feat: ui changes and pdf setup on the clients

This commit is contained in:
Nathnael
2026-07-01 06:56:58 +00:00
parent 94982d3c5a
commit e5aab84f51
16 changed files with 857 additions and 354 deletions

View File

@@ -29,12 +29,39 @@ export const invoicesService = {
return data.data ?? data;
},
/** The customer's invoices for one source record (e.g. a booking). */
listForSource: async (
source: string,
sourceId: string,
): Promise<PortalInvoice[]> => {
const { data } = await client.get(B.MY_INVOICES, {
params: { source, sourceId },
});
return data.data ?? data;
},
/** One of the customer's invoices, with its line items. */
get: async (id: string): Promise<PortalInvoiceDetail> => {
const { data } = await client.get(B.MY_INVOICE_BY_ID(id));
return data.data ?? data;
},
/** The sealed invoice PDF for one of the customer's invoices. */
downloadDocument: async (id: string): Promise<Blob> => {
const { data } = await client.get(B.MY_INVOICE_DOCUMENT(id), {
responseType: "blob",
});
return data;
},
/** The sealed payment-receipt PDF (available once paid). */
downloadReceipt: async (id: string): Promise<Blob> => {
const { data } = await client.get(B.MY_INVOICE_RECEIPT(id), {
responseType: "blob",
});
return data;
},
/** Initiate gateway payment for an open invoice; returns the client action. */
pay: async (
id: string,