This commit is contained in:
hagiye
2026-06-25 11:00:40 +03:00
parent 503878110f
commit f4a90755c2
42 changed files with 2100 additions and 98 deletions

View File

@@ -749,12 +749,12 @@ export const api = {
() => ["warehouse-fee-rules"],
),
feePreview: endpoint<{ inventoryId: string }, FeePreview[]>(
feePreview: endpoint<{ inventoryId: string; billingCurrency?: 'ETB' | 'USD' }, FeePreview[]>(
"warehouse-inventory",
"fee-preview",
({ inventoryId }) =>
warehouseService.feePreview(inventoryId).then((r) => r.data),
({ inventoryId }) => ["warehouse-inventory", inventoryId, "fee-preview"],
({ inventoryId, billingCurrency }) =>
warehouseService.feePreview(inventoryId, billingCurrency).then((r) => r.data),
({ inventoryId, billingCurrency }) => ["warehouse-inventory", inventoryId, "fee-preview", billingCurrency ?? 'USD'],
),
invoices: endpoint<{ filter?: WarehouseInvoiceFilter }, WarehouseFeeInvoice[]>(
@@ -1045,14 +1045,14 @@ export const api = {
// ── Invoices ───────────────────────────────────────────────────────────
generateInvoice: endpoint<
{ inventoryId: string; confirmZero?: boolean },
{ inventoryId: string; confirmZero?: boolean; billingCurrency?: 'ETB' | 'USD' },
WarehouseFeeInvoice
>(
"warehouse-fee-invoices",
"generate",
({ inventoryId, confirmZero }) =>
({ inventoryId, confirmZero, billingCurrency }) =>
warehouseService
.generateInvoice(inventoryId, confirmZero)
.generateInvoice(inventoryId, confirmZero, billingCurrency)
.then((r) => r.data),
undefined,
() => [["warehouse-fee-invoices"], ["warehouse-inventory"]],
@@ -1980,4 +1980,4 @@ export const api = {
({ range }) => overviewService.getDashboard(range),
),
},
};
};