mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-06 06:31:56 +00:00
78 lines
1.7 KiB
TypeScript
78 lines
1.7 KiB
TypeScript
|
|
export type MockVendor = {
|
||
|
|
id: string;
|
||
|
|
name: string;
|
||
|
|
};
|
||
|
|
|
||
|
|
export type MockInvoice = {
|
||
|
|
id: string;
|
||
|
|
invoiceNumber: string;
|
||
|
|
vendorId: string;
|
||
|
|
vendorName: string;
|
||
|
|
amountDue: number;
|
||
|
|
dueDate: string;
|
||
|
|
payDate: string | null;
|
||
|
|
status: "pending_approval" | "approved" | "scheduled" | "paid";
|
||
|
|
paymentMethod: "check" | "ach";
|
||
|
|
};
|
||
|
|
|
||
|
|
export const mockVendors: MockVendor[] = [
|
||
|
|
{ id: "vendor-1", name: "Acme Supplies Co" },
|
||
|
|
{ id: "vendor-2", name: "Harbor Maintenance LLC" },
|
||
|
|
{ id: "vendor-3", name: "Northwind Utilities" },
|
||
|
|
];
|
||
|
|
|
||
|
|
export const mockInvoices: MockInvoice[] = [
|
||
|
|
{
|
||
|
|
id: "inv-1",
|
||
|
|
invoiceNumber: "INV-1001",
|
||
|
|
vendorId: "vendor-1",
|
||
|
|
vendorName: "Acme Supplies Co",
|
||
|
|
amountDue: 1250.5,
|
||
|
|
dueDate: "2026-08-20",
|
||
|
|
payDate: "2026-08-15",
|
||
|
|
status: "approved",
|
||
|
|
paymentMethod: "check",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: "inv-2",
|
||
|
|
invoiceNumber: "INV-1002",
|
||
|
|
vendorId: "vendor-2",
|
||
|
|
vendorName: "Harbor Maintenance LLC",
|
||
|
|
amountDue: 4800,
|
||
|
|
dueDate: "2026-08-25",
|
||
|
|
payDate: null,
|
||
|
|
status: "pending_approval",
|
||
|
|
paymentMethod: "ach",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: "inv-3",
|
||
|
|
invoiceNumber: "INV-1003",
|
||
|
|
vendorId: "vendor-3",
|
||
|
|
vendorName: "Northwind Utilities",
|
||
|
|
amountDue: 312.75,
|
||
|
|
dueDate: "2026-08-12",
|
||
|
|
payDate: "2026-08-10",
|
||
|
|
status: "approved",
|
||
|
|
paymentMethod: "check",
|
||
|
|
},
|
||
|
|
];
|
||
|
|
|
||
|
|
/** Mocks are the default data path until the API is wired. */
|
||
|
|
export function areMocksEnabled(): boolean {
|
||
|
|
return import.meta.env.VITE_USE_MOCKS !== "false";
|
||
|
|
}
|
||
|
|
|
||
|
|
export function getMockInvoices(): MockInvoice[] {
|
||
|
|
if (!areMocksEnabled()) {
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return mockInvoices;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function getMockVendors(): MockVendor[] {
|
||
|
|
if (!areMocksEnabled()) {
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return mockVendors;
|
||
|
|
}
|