namespace Titano.Protocol;
/// Sequence summary for lists (BRIEF §12.2 card data).
public sealed record SequenceDto(
Guid Id,
string? Title,
string DisplayTitle,
string Folder,
string? CameraMake,
string? CameraModel,
string? Lens,
DateTime? FirstCapture,
DateTime? LastCapture,
int FrameCount,
double? MedianInterval,
long TotalBytes,
long Status,
int RenderedCount,
Guid? HeroFrameId,
IReadOnlyList Tags,
int Rating,
string? Notes,
int SettingsVersion,
int FramesVersion,
int WarningCount,
Guid? OwnerUserId,
DateTimeOffset UpdatedAt);
/// A page of results with an opaque keyset cursor; null cursor = last page.
public sealed record Page(IReadOnlyList Items, string? NextCursor, long? Total);
/// POST /api/v1/sequences.
public sealed record CreateSequenceRequest(string? Title, string? CameraHint);
/// PATCH /api/v1/sequences/{id}. enables conflict detection (409).
public sealed record UpdateSequenceRequest(
string? Title,
IReadOnlyList? Tags,
int? Rating,
string? Notes,
string? SettingsJson,
int? ExpectedSettingsVersion);
public sealed record FrameDto(
Guid Id,
Guid SequenceId,
int Index,
string FileName,
long Size,
string? Sha256,
DateTime? CapturedAt,
int? UtcOffsetMinutes,
double? ExposureTime,
double? FNumber,
int? Iso,
double? FocalLength,
int Orientation,
int Width,
int Height,
string Format,
long Flags);
/// GET /api/v1/sequences/{id}/manifest: what a client needs to diff a sequence (BRIEF §14.5).
public sealed record SequenceManifest(
Guid SequenceId,
int FramesVersion,
int SettingsVersion,
string? SettingsJson,
IReadOnlyList Tags,
IReadOnlyList Frames,
IReadOnlyList Renders);
public sealed record ManifestFrame(Guid Id, int Index, string FileName, long Size, string Sha256, bool HasProxy, bool HasThumb);
public sealed record RenderDto(
Guid Id,
string PresetName,
string? Codec,
int Width,
int Height,
double Fps,
double DurationSeconds,
long Bytes,
DateTimeOffset Created,
string? ProducedBy);
/// Aggregates for the archive dashboard and the admin panel.
public sealed record ArchiveStatsDto(
long Sequences,
long Photos,
long Bytes,
long FreeBytes,
long CapacityBytes,
int Cameras,
int? FirstYear,
int? LastYear,
IReadOnlyList ByYear,
IReadOnlyList ByMonth,
IReadOnlyList ByCamera,
IReadOnlyList ByFormat,
int SequencesWithoutProxies,
int UnverifiedSequences);
public sealed record KeyValueCount(string Key, long Count, long Bytes);
/// GET /api/v1/sequences/{id}/stats: frame totals by format and flagged frames.
public sealed record SequenceStatsDto(
Guid SequenceId,
int FrameCount,
long TotalBytes,
DateTime? FirstCapture,
DateTime? LastCapture,
double? MedianInterval,
IReadOnlyList ByFormat,
long MissingFrames,
long CorruptFrames,
long DuplicateFrames,
long ExcludedFrames);
///
/// DELETE /api/v1/sequences/{id}: what the delete does (with ?dryRun=true) or did. The folder is moved
/// to inside the archive, never erased.
///
public sealed record SequenceDeletePlan(Guid SequenceId, string? Folder, string? TrashFolder, int FrameCount, long TotalBytes, int RenderCount, bool DryRun);
/// GET/PUT /api/v1/archive/settings (admin). The root path comes from the server configuration.
public sealed record ArchiveSettingsDto(Guid Id, string Name, string RootPath, string FolderTemplate, string FileTemplate, int ProxyLongEdge);