49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
import type { WorkOrderCompletionInput, WorkOrderInput, WorkOrderMaterialIssueInput, WorkOrderStatus } from "@mrp/shared";
|
|
|
|
export const workOrderStatusOptions: Array<{ value: WorkOrderStatus; label: string }> = [
|
|
{ value: "DRAFT", label: "Draft" },
|
|
{ value: "RELEASED", label: "Released" },
|
|
{ value: "IN_PROGRESS", label: "In Progress" },
|
|
{ value: "ON_HOLD", label: "On Hold" },
|
|
{ value: "COMPLETE", label: "Complete" },
|
|
{ value: "CANCELLED", label: "Cancelled" },
|
|
];
|
|
|
|
export const workOrderStatusFilters: Array<{ value: "ALL" | WorkOrderStatus; label: string }> = [
|
|
{ value: "ALL", label: "All statuses" },
|
|
...workOrderStatusOptions,
|
|
];
|
|
|
|
export const workOrderStatusPalette: Record<WorkOrderStatus, string> = {
|
|
DRAFT: "border border-slate-400/30 bg-slate-500/12 text-slate-700 dark:text-slate-300",
|
|
RELEASED: "border border-sky-400/30 bg-sky-500/12 text-sky-700 dark:text-sky-300",
|
|
IN_PROGRESS: "border border-emerald-400/30 bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
|
|
ON_HOLD: "border border-amber-400/30 bg-amber-500/12 text-amber-700 dark:text-amber-300",
|
|
COMPLETE: "border border-brand/30 bg-brand/10 text-brand",
|
|
CANCELLED: "border border-rose-400/30 bg-rose-500/12 text-rose-700 dark:text-rose-300",
|
|
};
|
|
|
|
export const emptyWorkOrderInput: WorkOrderInput = {
|
|
itemId: "",
|
|
projectId: null,
|
|
status: "DRAFT",
|
|
quantity: 1,
|
|
warehouseId: "",
|
|
locationId: "",
|
|
dueDate: null,
|
|
notes: "",
|
|
};
|
|
|
|
export const emptyMaterialIssueInput: WorkOrderMaterialIssueInput = {
|
|
componentItemId: "",
|
|
warehouseId: "",
|
|
locationId: "",
|
|
quantity: 1,
|
|
notes: "",
|
|
};
|
|
|
|
export const emptyCompletionInput: WorkOrderCompletionInput = {
|
|
quantity: 1,
|
|
notes: "",
|
|
};
|