feat(data): archive ingest contract shared by server uploads and card import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 10:44:34 +00:00
1 parent 3223c8af39
commit ece7f1add0
1 file changed
+30
+30
View File
@@ -0,0 +1,30 @@
namespace Titano.Data.Archive;
/// <summary>
/// A verified file waiting in a staging folder on the archive volume, ready to become a frame (BRIEF §4.3, §14.4).
/// Exactly one of <see cref="SequenceId"/>, <see cref="NewSequenceTitle"/> or <see cref="SessionKey"/> selects the target:
/// an existing sequence, a new one with that title, or the sequence grouped automatically by session.
/// </summary>
public sealed record IngestRequest(
Guid ArchiveId,
Guid? SequenceId,
string? NewSequenceTitle,
string? SessionKey,
string StagedPath,
string OriginalFileName,
long Size,
string Sha256,
DateTime? ClientCapturedAt,
Guid? UserId);
/// <summary>The committed frame; <see cref="Duplicate"/> when the sequence already held a frame with that SHA-256.</summary>
public sealed record IngestResult(Guid SequenceId, Guid FrameId, int Index, string RelativePath, bool Duplicate);
/// <summary>
/// Commits staged files into the archive layout (originals folder, naming templates, <c>sequence.json</c> written
/// atomically) and the index. Used by the server's upload completion and by the client's card import.
/// </summary>
public interface IArchiveIngest
{
Task<IngestResult> CommitAsync(IngestRequest request, CancellationToken cancellationToken = default);
}