mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-03 13:53:30 +00:00
27 lines
983 B
C#
27 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);
|
||
|
|
}
|
||
|
|
}
|