diff --git a/src/Titano.Data/Archive/IArchiveIngest.cs b/src/Titano.Data/Archive/IArchiveIngest.cs new file mode 100644 index 00000000..63c53889 --- /dev/null +++ b/src/Titano.Data/Archive/IArchiveIngest.cs @@ -0,0 +1,30 @@ +namespace Titano.Data.Archive; + +/// +/// 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 , or selects the target: +/// an existing sequence, a new one with that title, or the sequence grouped automatically by session. +/// +public sealed record IngestRequest( + Guid ArchiveId, + Guid? SequenceId, + string? NewSequenceTitle, + string? SessionKey, + string StagedPath, + string OriginalFileName, + long Size, + string Sha256, + DateTime? ClientCapturedAt, + Guid? UserId); + +/// The committed frame; when the sequence already held a frame with that SHA-256. +public sealed record IngestResult(Guid SequenceId, Guid FrameId, int Index, string RelativePath, bool Duplicate); + +/// +/// Commits staged files into the archive layout (originals folder, naming templates, sequence.json written +/// atomically) and the index. Used by the server's upload completion and by the client's card import. +/// +public interface IArchiveIngest +{ + Task CommitAsync(IngestRequest request, CancellationToken cancellationToken = default); +}