diff --git a/apps/edr-freight-api/src/modules/first-mile/first-mile.service.ts b/apps/edr-freight-api/src/modules/first-mile/first-mile.service.ts index 73d98b8fe..a06f9eb87 100644 --- a/apps/edr-freight-api/src/modules/first-mile/first-mile.service.ts +++ b/apps/edr-freight-api/src/modules/first-mile/first-mile.service.ts @@ -225,6 +225,16 @@ export class FirstMileService { return updated; } + async updateStatus(id: string, status: FirstMileStatus): Promise { + const updated = await this.firstMileRepository.update(id, { status }); + + if (!updated) { + throw new NotFoundException(`First-mile record ${id} not found`); + } + + return updated; + } + private async notifyDriverAssignment(vehicleId: string, record: FirstMile): Promise { try { const vehicle = await this.vehiclesService.findById(vehicleId);