fix(work-orders): narrow vendor patch type for inline drafts

Vendor assignment patch must not carry table-row status, which blocked tsc
because Canceled is not a draft status.
This commit is contained in:
Arthur Bassi 2026-08-20 14:29:57 -03:00
parent 4c9f8b7d81
commit 493104c56d

View file

@ -1,4 +1,4 @@
import type { WorkOrderTablePatch } from "@/domain/work-orders/types/work-order-table-row";
import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
export type VendorAssignmentFields = {
vendorId: string;
@ -7,7 +7,12 @@ export type VendorAssignmentFields = {
techPhone: string;
};
export function toVendorTablePatch(fields: VendorAssignmentFields): WorkOrderTablePatch {
export type VendorTablePatch = Pick<
WorkOrderTableRow,
"vendorId" | "company" | "tech" | "techPhone" | "primaryDispatchStatus"
>;
export function toVendorTablePatch(fields: VendorAssignmentFields): VendorTablePatch {
return {
vendorId: fields.vendorId,
company: fields.company,