Train scheduling API,Routes and UI

This commit is contained in:
hagiye
2026-06-08 16:31:28 +03:00
parent 3d1f972e52
commit 7facbeda22
38 changed files with 1993 additions and 696 deletions

View File

@@ -5,6 +5,9 @@ import { URL_CONSTANTS } from '@/constants/URLS';
export type LocomotiveType = 'DIESEL' | 'ELECTRIC';
export type LocomotiveStatus =
| 'AVAILABLE'
| 'UNAVAILABLE'
| 'IMPORT_READY'
| 'EXPORT_READY'
| 'MAINTENANCE'
| 'ASSIGNED'
| 'OUT_OF_SERVICE';

View File

@@ -70,6 +70,14 @@ export const trainSchedulingService = {
return unwrap(response.data);
},
publishSchedule: async (id: string): Promise<TrainScheduleDetail> => {
const response = await client.post<TrainScheduleDetail>(
URL_CONSTANTS.TRAIN_SCHEDULING.PUBLISH_SCHEDULE(id),
{},
);
return unwrap(response.data);
},
getAvailableLocomotives: async (): Promise<LocomotiveRecord[]> => {
const response = await client.get<LocomotiveRecord[]>(URL_CONSTANTS.LOCOMOTIVES.BASE, {
params: { status: 'AVAILABLE' },

View File

@@ -6,6 +6,19 @@ export interface Wagon {
wagonTypeId: string;
trainId: string | null;
sequenceNumber: number | null;
currentLocationYardId: string | null;
currentLocationYard?: {
id: string;
code: string;
label: string;
country?: string;
} | null;
wagonType?: {
id: string;
code: string;
name: string;
supportedLoadTypes?: string[];
} | null;
tareWeight: number;
maxPayloadWeight: number;
status: string;