mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 05:30:55 +00:00
mile
This commit is contained in:
@@ -307,6 +307,16 @@ export class BillingService {
|
||||
});
|
||||
}
|
||||
|
||||
/** Invoices for a batch of source records (e.g. many last-mile legs), so a
|
||||
* list can show which records already have an invoice without N+1 queries. */
|
||||
findBySourceIds(source: string, sourceIds: string[]): Promise<Invoice[]> {
|
||||
if (!sourceIds.length) return Promise.resolve([]);
|
||||
return this.invoices.findAll({
|
||||
where: { source, sourceId: In(sourceIds) },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
}
|
||||
|
||||
/** Invoices for the signed-in customer; empty when they have no company. */
|
||||
async findForUser(
|
||||
userId: string,
|
||||
|
||||
Reference in New Issue
Block a user