mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
refactor(payment): centralize invoice processing with detailed tracking and configurable logging
This commit is contained in:
@@ -1069,6 +1069,7 @@ export class BookingBatchService implements OnModuleInit {
|
||||
Freight.InvoiceSource.Booking,
|
||||
booking.id,
|
||||
deadline,
|
||||
"PREPAID",
|
||||
);
|
||||
await this.notifier.payNow(booking, deadline);
|
||||
}
|
||||
@@ -1120,7 +1121,7 @@ export class BookingBatchService implements OnModuleInit {
|
||||
// Pay window closed before settlement → expire the booking's open invoice too
|
||||
// (emits `booking.invoice.expired`). Domain owns the reaction; billing stays
|
||||
// source-agnostic.
|
||||
await this.billing.expirePayable(Freight.InvoiceSource.Booking, booking.id);
|
||||
await this.billing.expirePayable(Freight.InvoiceSource.Booking, booking.id, "PREPAID");
|
||||
this.notifier.expired(booking);
|
||||
}
|
||||
|
||||
@@ -1167,6 +1168,7 @@ export class BookingBatchService implements OnModuleInit {
|
||||
await this.billing.expirePayable(
|
||||
Freight.InvoiceSource.Booking,
|
||||
victim.id,
|
||||
"PREPAID",
|
||||
manager,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user