namespace OpenNest
{
///
/// Shop-floor workflow state of a saved nest, persisted as a string in
/// nest.json so unknown future values can fall back safely.
///
///
/// New values go at the end: the nest server still accepts integer statuses from
/// existing callers, so existing values must keep their numbers. Lists shown to the
/// operator use , not declaration order.
///
public enum NestStatus
{
Quote,
ToBeCut,
HasBeenCut,
///
/// Created but not yet ready to quote or cut, such as a nest released from a
/// drawing set before it has been nested and checked. Comes before Quote.
///
Draft,
}
public static class NestStatuses
{
/// Every status in the order a nest moves through them.
public static readonly NestStatus[] WorkflowOrder =
{
NestStatus.Draft,
NestStatus.Quote,
NestStatus.ToBeCut,
NestStatus.HasBeenCut,
};
/// The name shown to the operator, such as "To Be Cut".
public static string DisplayName(NestStatus status) => status switch
{
NestStatus.Draft => "Draft",
NestStatus.Quote => "Quote",
NestStatus.ToBeCut => "To Be Cut",
NestStatus.HasBeenCut => "Has Been Cut",
_ => status.ToString(),
};
}
}