mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-27 06:01:06 -04:00
Releasing a drawing set makes one nest per material group, so a kit run spans several nests. The server now records which set revision was released, the multiplier and the nests it made, so a run can be tracked across its nests and a nest can say where it came from. The client uploads every nest first and posts the release last: a failure part-way leaves ordinary nests and no release, never a release pointing at missing nests. For the same reason a release is accepted for an older set revision or an archived set, since the nests already exist by then. The release id is client-allocated and a nest belongs to at most one release, so a retried post gets 409 with the release that already holds it. Releases are append-only and read joined to each nest's current metadata, so status and deletion are always current. The tables join schema v7, as the set tables have not shipped yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.4 KiB
C#
35 lines
1.4 KiB
C#
namespace OpenNest.Data;
|
|
|
|
/// <summary>
|
|
/// One release of a drawing set revision: the nests made from it, one per material group,
|
|
/// with every member quantity multiplied by <see cref="Multiplier"/>. Releases are
|
|
/// append-only; a mistaken one is undone by deleting its nests, which then read as deleted.
|
|
/// </summary>
|
|
public sealed class SetReleaseRecord
|
|
{
|
|
/// <summary>Allocated by the client, so an ambiguous post can be retried without a duplicate.</summary>
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>The set released. Taken from the route on post.</summary>
|
|
public Guid SetId { get; set; }
|
|
|
|
/// <summary>The exact set revision released; it need not be the current one.</summary>
|
|
public int SetRevision { get; set; }
|
|
|
|
/// <summary>The set's name at <see cref="SetRevision"/>. Server-joined; ignored on post.</summary>
|
|
public string SetName { get; set; } = "";
|
|
|
|
public int Multiplier { get; set; } = 1;
|
|
|
|
public string Notes { get; set; } = "";
|
|
|
|
/// <summary>When the server stored the release. Server-computed.</summary>
|
|
public DateTime ReleasedAt { get; set; }
|
|
|
|
/// <summary>Who released the set, as reported by the client.</summary>
|
|
public string ReleasedBy { get; set; } = "";
|
|
|
|
/// <summary>The nests created by the release, in the order posted.</summary>
|
|
public IReadOnlyList<SetReleaseNest> Nests { get; set; } = Array.Empty<SetReleaseNest>();
|
|
}
|