mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
Merge pull request #319 from Tria-plc/freight/feature/vehicle_2
Freight/feature/vehicle 2
This commit is contained in:
@@ -225,6 +225,16 @@ export class FirstMileService {
|
|||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateStatus(id: string, status: FirstMileStatus): Promise<FirstMile> {
|
||||||
|
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<void> {
|
private async notifyDriverAssignment(vehicleId: string, record: FirstMile): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const vehicle = await this.vehiclesService.findById(vehicleId);
|
const vehicle = await this.vehiclesService.findById(vehicleId);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ type StatusFilter = "ALL" | FirstMileApiStatus | AssignmentStatus;
|
|||||||
|
|
||||||
const FILTER_OPTIONS: { value: StatusFilter; label: string }[] = [
|
const FILTER_OPTIONS: { value: StatusFilter; label: string }[] = [
|
||||||
{ value: "ALL", label: "All" },
|
{ value: "ALL", label: "All" },
|
||||||
...FIRST_MILE_STATUSES.map((s) => ({ value: s as StatusFilter, label: STATUS_META[s].label })),
|
...FIRST_MILE_STATUSES.filter((s) => s !== "PAYMENT_PENDING").map((s) => ({ value: s as StatusFilter, label: STATUS_META[s].label })),
|
||||||
{ value: "ASSIGNED", label: "Assigned" },
|
{ value: "ASSIGNED", label: "Assigned" },
|
||||||
{ value: "UNASSIGNED", label: "Unassigned" },
|
{ value: "UNASSIGNED", label: "Unassigned" },
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user