mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 06:03:12 +00:00
A work order whose uplifts were all cancelled, withdrawn, expired or revoked no longer matches the advanced-search Has uplift filter, and the board Uplift column no longer reports it as having an uplift or shows the dead one as its primary status. One shared live-status list backs both queries. Explicit cancelled/revoked sub-filter values still find those work orders.
26 lines
983 B
C#
26 lines
983 B
C#
namespace SeaHaven.DataServices.Helpers
|
|
{
|
|
/// <summary>
|
|
/// Which stored uplift statuses still count as a live uplift on a work order.
|
|
/// Cancelled (legacy "Cancelled", "Withdrawn", "Expired") and revoked uplifts do not;
|
|
/// pending, approved, auto-approved and rejected ones do. The advanced-search
|
|
/// "Has uplift" filter and the board Uplift column both use this, so they cannot drift.
|
|
/// </summary>
|
|
public static class LiveUpliftStatus
|
|
{
|
|
/// <summary>
|
|
/// Stored statuses that are not live. Kept as an array so EF translates
|
|
/// <c>NonLive.Contains(u.Status)</c> inside query predicates.
|
|
/// </summary>
|
|
public static readonly string[] NonLive =
|
|
{
|
|
"Withdrawn",
|
|
"Cancelled",
|
|
"Expired",
|
|
"Revoked",
|
|
};
|
|
|
|
public static bool IsLive(string? status) =>
|
|
status == null || !NonLive.Contains(status, StringComparer.Ordinal);
|
|
}
|
|
}
|