mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
feat: ui changes and pdf setup on the clients
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user