mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-05 10:39:26 -05:00
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>
This commit is contained in:
1 parent
857b88a2c7
commit
bfdfefeb9e
40 files changed
+304
-44
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenNest.Clamps;
|
||||
using OpenNest.Collections;
|
||||
using OpenNest.CommonLines;
|
||||
@@ -45,6 +46,33 @@ namespace OpenNest
|
||||
|
||||
public string Customer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The job (or jobs) this nest cuts parts for, such as "4980-88R"; several are separated
|
||||
/// by commas ("4980-88R, 4981-02"). Setting it trims each number, drops empty ones and
|
||||
/// joins them with ", "; blank when the nest has none.
|
||||
/// </summary>
|
||||
public string JobNumber
|
||||
{
|
||||
get { return jobNumber; }
|
||||
set { jobNumber = NormalizeJobNumbers(value); }
|
||||
}
|
||||
|
||||
private string jobNumber = "";
|
||||
|
||||
/// <summary>
|
||||
/// <paramref name="text"/> as <see cref="JobNumber"/> stores it: each comma-separated
|
||||
/// number trimmed, empty ones dropped, joined with ", ".
|
||||
/// </summary>
|
||||
public static string NormalizeJobNumbers(string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
return "";
|
||||
var numbers = text.Split(',')
|
||||
.Select(n => n.Trim())
|
||||
.Where(n => n.Length > 0);
|
||||
return string.Join(", ", numbers);
|
||||
}
|
||||
|
||||
public string Notes { get; set; }
|
||||
|
||||
public string AssistGas { get; set; } = "";
|
||||
|
||||
Reference in new issue
Block a user