This commit is contained in:
natib21
2026-07-02 10:33:32 +00:00
parent 4e4d81479b
commit 4519a1d75d
2 changed files with 10 additions and 9 deletions

View File

@@ -210,10 +210,11 @@ export class FirstMileService {
firstMilePickupAddress?: string | null;
serviceType?: { includesFirstMile?: boolean | null } | null;
}): 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.firstMilePickupAddress?.trim() ||
booking.serviceType?.includesFirstMile);
return Boolean(
booking.tradeDirection === 'EXPORT' &&
(booking.firstMilePickupAddress?.trim() ||
booking.serviceType?.includesFirstMile),
);
}
async update(id: string, dto: UpdateFirstMileDto): Promise<FirstMile> {