mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-06 01:52:04 +00:00
* fix(work-orders): allow blank WO number in wizard create path
[recover] remove malicious eslint payload (was d0d08508)
* fix(work-orders): emit severity before type in board scalar PATCH ops
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(work-orders): drop vendor collateral from SH-192 lane
* fix(work-orders): add severity to unscheduled highlight fixture after dev merge
* refactor(work-orders): extract inline type/severity cell under function line cap
* fix(work-orders): add severity to comp-doc and media fixtures after dev merge
PR #45 introduced completion-doc, media and table-mutation fixtures that predate the required severity field, so the integrated head failed tsc. Fill severity on those row builders (null for PM, SEV 1 for the Emergency fixture) and type the mutation BASE_ROW instead of asserting it.
* test(work-orders): align merge fixes with severity field and WO# placeholder
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Arthur Bassi <bassi-arthurr@users.noreply.github.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
60 lines
1.4 KiB
TypeScript
60 lines
1.4 KiB
TypeScript
import type { WorkOrderBoardCreatePayload } from "@/domain/work-orders/types/work-order-board";
|
|
import type { WorkOrderWizardDraft } from "@/domain/work-orders/types/work-order-wizard";
|
|
|
|
function trimOrUndefined(value: string | undefined): string | undefined {
|
|
const trimmed = value?.trim();
|
|
|
|
return trimmed ? trimmed : undefined;
|
|
}
|
|
|
|
/** Mutates `payload` with primary service, service notes, POC, tech phone, and vendor notes. */
|
|
export function assignWizardServicePocFields(
|
|
payload: WorkOrderBoardCreatePayload,
|
|
draft: WorkOrderWizardDraft,
|
|
): void {
|
|
const primaryService = trimOrUndefined(draft.pm);
|
|
|
|
if (primaryService) {
|
|
payload.primaryService = primaryService;
|
|
}
|
|
|
|
const serviceNotes = trimOrUndefined(draft.pmNote);
|
|
|
|
if (serviceNotes) {
|
|
payload.serviceNotes = serviceNotes;
|
|
}
|
|
|
|
const pocName = trimOrUndefined(draft.pocName);
|
|
|
|
if (pocName) {
|
|
payload.pocName = pocName;
|
|
}
|
|
|
|
const pocPhone = trimOrUndefined(draft.pocPhone);
|
|
|
|
if (pocPhone) {
|
|
payload.pocPhone = pocPhone;
|
|
}
|
|
|
|
const pocNotes = trimOrUndefined(draft.pocNotes);
|
|
|
|
if (pocNotes) {
|
|
payload.pocNotes = pocNotes;
|
|
}
|
|
|
|
const techPhone = trimOrUndefined(draft.techPhone);
|
|
|
|
if (techPhone) {
|
|
payload.techPhone = techPhone;
|
|
}
|
|
|
|
const vendorNotes = trimOrUndefined(draft.vendorNotes);
|
|
|
|
if (vendorNotes) {
|
|
payload.vendorNotes = vendorNotes;
|
|
}
|
|
|
|
if (draft.severity != null) {
|
|
payload.severity = draft.severity;
|
|
}
|
|
}
|