using Chronos.Core.Model;
using Chronos.Data.Sync;
namespace Chronos.Data.Copies;
/// One difference of title, tags, rating, notes or settings between two copies (a JSON path, both values as shown).
public sealed record DetailLine(string Path, string? Here, string? There);
/// A project of one home, as the Projects part lists it.
public sealed record ProjectLine(Guid Id, string Name, bool IsMain, int Versions, Guid HeadId, string HeadHash, DateTimeOffset UpdatedAt);
///
/// Both homes' projects. MainSame: the two Main heads make the same choices; ThereKeepsProjects: the other home keeps
/// projects (a server without the projects capability keeps none).
///
public sealed record CopyProjectsView(IReadOnlyList Here, IReadOnlyList There, bool MainSame, bool ThereKeepsProjects);
/// Renders of each side, and those both hold (by render id, or by SHA-256 where both record one).
public sealed record CopyRendersView(int Here, int There, int Shared, long HereBytes, long ThereBytes);
///
/// The facts of one side: title, where it lies (archive or server name), photos, bytes, capture range, camera, hashed count,
/// origin, the servers the local copy is linked to, and whether it lies in a server's originals archive.
///
public sealed record CopyFacts(string Title, string Where, Guid? ArchiveId, int Photos, long Bytes, DateTime? First, DateTime? Last,
string? Camera, int Hashed, SequenceOrigin? Origin, IReadOnlyList Servers, bool InOriginalsArchive);
/// What the Compare dialog shows of a pair: both sides, the photos, the details line by line, projects, renders, and what can be done.
public sealed record CopyReview(FoundCopy Copy, CopyFacts Here, CopyFacts There, CopyComparisonResult Photos,
IReadOnlyList Details, CopyProjectsView Projects, CopyRendersView Renders, CopyCapabilities Can);
/// Whether Integrate (or Merge), Link only and Delete on server are possible, and why not (s).
public sealed record CopyCapabilities(bool Integrate, bool LinkOnly, bool DeleteThere, IReadOnlyList Blocks);
/// A row of Server › Matches: the pair with the facts of both sides (the other side's from the server listing or the other archive).
public sealed record FoundCopyView(FoundCopy Copy, CopyFacts Here, CopyFacts There);
///
/// The same time-lapse with workspace projects at two homes (a linked or integrated pair): the Edit picker marks each as the
/// other's twin. LocalHome names the local copy's archive; a project name is null when that home has no workspace project.
/// ServerName is the name shown for Server (the key itself when no name is known).
///
public sealed record CopyTwin(Guid CopyId, Guid LocalId, string LocalHome, string? LocalProject, string Server, Guid RemoteId, string? ServerProject,
string ServerName);