chore: fix the invoice event

This commit is contained in:
Nathnael
2026-07-02 12:35:43 +00:00
parent 03740ee719
commit 787da1ccc0
2 changed files with 15 additions and 2 deletions

View File

@@ -691,7 +691,13 @@ export class BillingService {
status: invoice.status,
paymentId: invoice.paymentId ?? null,
};
this.events.emit(`${invoice.source}.invoice.${event}`, payload);
this.events
.emitAsync(`${invoice.source}.invoice.${event}`, payload)
.catch((err) =>
this.logger.error(
`Listener for ${invoice.source}.invoice.${event} (invoice ${invoice.id}) failed: ${err instanceof Error ? err.message : String(err)}`,
),
);
}
// ── Payment reconciliation (by source) ───────────────────────────────────────