mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 04:08:11 +00:00
trains, wagons,containers and cargoes schema and API
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { apiClient } from '@/lib/axios';
|
||||
|
||||
export interface Container {
|
||||
id: string;
|
||||
containerNumber: string;
|
||||
containerTypeId: string;
|
||||
wagonId: string | null;
|
||||
position: number | null;
|
||||
tareWeight: number;
|
||||
maxGrossWeight: number;
|
||||
sealNumber?: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export const containerService = {
|
||||
getAll: () => apiClient.get<Container[]>('/containers'),
|
||||
getByWagon: (wagonId: string) => apiClient.get<Container[]>(`/containers?wagonId=${wagonId}`),
|
||||
assignToWagon: (containerId: string, wagonId: string, position?: number) =>
|
||||
apiClient.post(`/containers/${containerId}/assign-wagon`, { wagonId, position }),
|
||||
unassign: (containerId: string) => apiClient.post(`/containers/${containerId}/unassign-wagon`),
|
||||
};
|
||||
Reference in New Issue
Block a user