31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
|
|
import type { PurchaseOrderInput, PurchaseOrderStatus } from "@mrp/shared";
|
||
|
|
|
||
|
|
export const purchaseStatusOptions: Array<{ value: PurchaseOrderStatus; label: string }> = [
|
||
|
|
{ value: "DRAFT", label: "Draft" },
|
||
|
|
{ value: "ISSUED", label: "Issued" },
|
||
|
|
{ value: "APPROVED", label: "Approved" },
|
||
|
|
{ value: "CLOSED", label: "Closed" },
|
||
|
|
];
|
||
|
|
|
||
|
|
export const purchaseStatusFilters: Array<{ value: "ALL" | PurchaseOrderStatus; label: string }> = [
|
||
|
|
{ value: "ALL", label: "All statuses" },
|
||
|
|
...purchaseStatusOptions,
|
||
|
|
];
|
||
|
|
|
||
|
|
export const purchaseStatusPalette: Record<PurchaseOrderStatus, string> = {
|
||
|
|
DRAFT: "border border-sky-400/30 bg-sky-500/12 text-sky-700 dark:text-sky-300",
|
||
|
|
ISSUED: "border border-amber-400/30 bg-amber-500/12 text-amber-700 dark:text-amber-300",
|
||
|
|
APPROVED: "border border-emerald-400/30 bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
|
||
|
|
CLOSED: "border border-slate-400/30 bg-slate-500/12 text-slate-700 dark:text-slate-300",
|
||
|
|
};
|
||
|
|
|
||
|
|
export const emptyPurchaseOrderInput: PurchaseOrderInput = {
|
||
|
|
vendorId: "",
|
||
|
|
status: "DRAFT",
|
||
|
|
issueDate: new Date().toISOString(),
|
||
|
|
taxPercent: 0,
|
||
|
|
freightAmount: 0,
|
||
|
|
notes: "",
|
||
|
|
lines: [],
|
||
|
|
};
|