mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-05 07:12:06 +00:00
Clear leftover primary dispatch status on vendor patch so Completed is not blocked after a new company is chosen. Keep Jira keys out of source comments.
22 lines
691 B
TypeScript
22 lines
691 B
TypeScript
import type { WorkOrderBoardDetail } from "@/domain/work-orders/types/work-order-board-detail";
|
|
import type { WorkOrderDetail } from "@/domain/work-orders/types/work-order-detail";
|
|
|
|
/**
|
|
* Overlay authoritative closability fields from board detail onto a legacy GetById detail.
|
|
* Board `info.type`, `completion.docStatus`, and `media.length` are the SH-114 sources.
|
|
*/
|
|
export function enrichDetailClosabilityFromBoard(
|
|
detail: WorkOrderDetail,
|
|
board: WorkOrderBoardDetail | undefined,
|
|
): WorkOrderDetail {
|
|
if (!board) {
|
|
return detail;
|
|
}
|
|
|
|
return {
|
|
...detail,
|
|
type: board.info.type,
|
|
docStatus: board.completion.docStatus,
|
|
mediaCount: board.media.length,
|
|
};
|
|
}
|