mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 05:58:18 +00:00
fix
This commit is contained in:
@@ -43,7 +43,7 @@ export class FirstMileService {
|
||||
private readonly vehiclesService: VehiclesService,
|
||||
private readonly driversService: DriversService,
|
||||
private readonly smsClient: SmsClientService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Look up a booking by its human-readable reference and confirm it has been
|
||||
@@ -95,7 +95,7 @@ export class FirstMileService {
|
||||
if (booking.paymentStatus !== 'PAID') {
|
||||
throw new BadRequestException(`Booking ${label} is not paid`);
|
||||
}
|
||||
|
||||
console.log("-------------------", booking)
|
||||
if (!this.bookingRequestsFirstMile(booking)) {
|
||||
throw new BadRequestException(`Booking ${label} does not require a first mile`);
|
||||
}
|
||||
@@ -212,11 +212,8 @@ export class FirstMileService {
|
||||
}): boolean {
|
||||
// Export bookings always need a first mile (pickup → origin yard); the
|
||||
// pickup address is captured at assignment time, not required upfront.
|
||||
return Boolean(
|
||||
booking.tradeDirection === 'EXPORT' ||
|
||||
booking.firstMilePickupAddress?.trim() ||
|
||||
booking.serviceType?.includesFirstMile,
|
||||
);
|
||||
return Boolean(booking.firstMilePickupAddress?.trim() ||
|
||||
booking.serviceType?.includesFirstMile);
|
||||
}
|
||||
|
||||
async update(id: string, dto: UpdateFirstMileDto): Promise<FirstMile> {
|
||||
|
||||
Reference in New Issue
Block a user