mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 13:38:20 +00:00
feat: add toggle to DJF
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import type { Freight } from '@edr/types';
|
||||
|
||||
import { ManualPaymentSettingsService } from '../payment-settings/manual-payment-settings.service';
|
||||
import { YardScopeService } from '../rule-engine/services/yard-scope.service';
|
||||
import { BookingRequestRepository } from './booking-request.repository';
|
||||
import { ContractsService } from './contracts.service';
|
||||
@@ -30,6 +31,7 @@ export class BookingRequestService {
|
||||
private readonly contractBookingService: ContractBookingService,
|
||||
private readonly notifier: ContractNotifierService,
|
||||
private readonly yardScope: YardScopeService,
|
||||
private readonly paymentSettings: ManualPaymentSettingsService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -101,6 +103,17 @@ export class BookingRequestService {
|
||||
}
|
||||
}
|
||||
}
|
||||
// The currency picker hides a switched-off currency, but a stale tab must
|
||||
// not be able to raise a shipment nobody can pay for.
|
||||
if (
|
||||
dto.paymentCurrency &&
|
||||
!(await this.paymentSettings.isCurrencyOffered(dto.paymentCurrency))
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
`${dto.paymentCurrency.toUpperCase()} is not accepted as a billing currency right now. Pick another currency.`,
|
||||
);
|
||||
}
|
||||
|
||||
await this.contractBookingService.assertRequestWithinCapacity(contract, {
|
||||
containers: dto.containers,
|
||||
bulk: dto.bulk,
|
||||
|
||||
Reference in New Issue
Block a user