mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
fix(work-orders): emit severity before type in board scalar PATCH ops
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
48702c3fc4
commit
202a3387ff
1 changed files with 6 additions and 5 deletions
|
|
@ -22,6 +22,12 @@ type ScalarBoardOpRule = {
|
|||
/** One row per scalar patch field, in emission order. */
|
||||
const SCALAR_BOARD_OP_RULES: ScalarBoardOpRule[] = [
|
||||
{ key: "woNumber", field: "woNumber", toValue: (value) => value as string },
|
||||
// Severity before type so Emergency/Reactive never land without required severity.
|
||||
{
|
||||
key: "severity",
|
||||
field: "severity",
|
||||
toValue: (value) => (value == null ? "" : String(value)),
|
||||
},
|
||||
{ key: "type", field: "workOrderType", toValue: (value) => value as string },
|
||||
{ key: "site", field: "siteCode", toValue: (value) => value as string },
|
||||
{ key: "status", field: "lifecycleStatus", toValue: (value) => value as string },
|
||||
|
|
@ -34,11 +40,6 @@ const SCALAR_BOARD_OP_RULES: ScalarBoardOpRule[] = [
|
|||
{ key: "extraServices", field: "extraServices", toValue: (value) => JSON.stringify(value) },
|
||||
{ key: "serviceNotes", field: "serviceNotes", toValue: (value) => value as string },
|
||||
{ key: "flagColor", field: "flagColor", toValue: (value) => (value as string | null) ?? "" },
|
||||
{
|
||||
key: "severity",
|
||||
field: "severity",
|
||||
toValue: (value) => (value == null ? "" : String(value)),
|
||||
},
|
||||
];
|
||||
|
||||
export function expandScalarBoardOps(patch: WorkOrderTablePatch): BoardFieldOp[] {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue