Adding all the tests and fixes to the passengers app

This commit is contained in:
Muluhabt
2026-07-21 13:45:49 +03:00
parent 8ce2d2d874
commit f2ae9c883f
3316 changed files with 15548 additions and 37 deletions

View File

@@ -140,10 +140,14 @@ export class CurrencyService {
});
if (!exchangeRate) {
this.logger.warn(
`No exchange rate found for ${fromCurrency} to ${toCurrency}, using 1.0`,
// H-2: fail closed. Never price at parity (1.0) when a required rate is absent — a silent 1.0
// substitution underprices international fares ~100×. Reject the quote/booking instead.
this.logger.error(
`No exchange rate configured for ${fromCurrency}->${toCurrency}; refusing to price at parity`,
);
throw new BadRequestException(
`No exchange rate configured for ${fromCurrency}->${toCurrency}`,
);
return 1.0;
}
const ageMs = Date.now() - exchangeRate.effectiveDate.getTime();