Files
OpenNest/OpenNest.Data/NestRecord.cs
T
ajandClaude Opus 5.5 bfdfefeb9e feat(data): store a nest's job number apart from the customer
Job numbers were going into Customer ("GM / 4980-88R"), which breaks
sorting, searching and grouping by customer. A nest now has its own
Job # field: one or several jobs separated by commas, normalized to
"a, b". It is saved in nest.json and the server (schema v21), edited
beside Customer in Edit Nest (WinForms and Avalonia), shown as a
sortable, searchable column in the Open list, and printed on the nest
report and in MCP output.

Deploy the server before the desktop: the open overlay takes the
server's job number, and an older server has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 10:21:04 -05:00

72 lines
2.4 KiB
C#

using OpenNest;
namespace OpenNest.Data;
/// <summary>
/// Server-side metadata for one saved nest. The .nest archive itself is stored
/// alongside; this record is what lists, filters and status tracking read.
/// Counts are captured by the client at save time.
/// </summary>
public sealed class NestRecord
{
public Guid Id { get; set; }
/// <summary>Server revision; zero means the server does not support history.</summary>
public int Revision { get; set; }
public bool Deleted { get; set; }
/// <summary>Selected historical revision promoted by an explicit Restore.</summary>
public int? RestoredFromRevision { get; set; }
public string Name { get; set; } = "";
public string Customer { get; set; } = "";
/// <summary>
/// The nest's job number or comma-separated job numbers (<see cref="Nest.JobNumber"/>);
/// blank when the nest has none or the server predates job numbers.
/// </summary>
public string JobNumber { get; set; } = "";
public DateTime DateCreated { get; set; }
public DateTime DateModified { get; set; }
public string Material { get; set; } = "";
/// <summary>Material grade; blank when none was chosen or the server predates grades.</summary>
public string MaterialGrade { get; set; } = "";
public double Thickness { get; set; }
/// <summary>
/// The shop's name for <see cref="Thickness"/>, such as "10 ga"; blank when the nest names
/// none or the server predates thickness names.
/// </summary>
public string ThicknessName { get; set; } = "";
/// <summary>
/// The nest's units, which <see cref="Thickness"/> is in. The server reads them from the
/// archive like the counts; inches when the archive has none or the server predates them.
/// </summary>
public Units Units { get; set; }
/// <summary>quote | toBeCut | hasBeenCut (camelCase on the wire, case-insensitive readers).</summary>
public NestStatus Status { get; set; } = NestStatus.Quote;
public int PlateCount { get; set; }
public int PartCount { get; set; }
public string Comments { get; set; } = "";
public string MadeBy { get; set; } = "";
/// <summary>Size of the stored .nest archive in bytes.</summary>
public long FileSize { get; set; }
/// <summary>When the server last stored the nest contents or metadata.</summary>
public DateTime SavedAt { get; set; }
}