mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 17:05:02 +00:00
fix schule issue and contianer type issue
This commit is contained in:
@@ -185,6 +185,7 @@ import { trainService, type Train } from "./trains.service";
|
||||
import {
|
||||
trainBuilderService,
|
||||
type AdjustConsistPayload,
|
||||
type AdjustConsistResult,
|
||||
type AvailableTrain,
|
||||
type BuildTrainPayload,
|
||||
type BuiltTrainListFilters,
|
||||
@@ -338,7 +339,7 @@ export const api = {
|
||||
|
||||
adjustConsist: endpoint<
|
||||
{ scheduleId: string; payload: AdjustConsistPayload },
|
||||
ScheduleConsist
|
||||
AdjustConsistResult
|
||||
>(
|
||||
"train-scheduling",
|
||||
"adjust-consist",
|
||||
|
||||
@@ -235,6 +235,18 @@ export interface ScheduleConsist {
|
||||
occurredAt: string;
|
||||
}>;
|
||||
editable: boolean;
|
||||
/**
|
||||
* Wagon-slot picture of the schedule: the consist IS the booking capacity
|
||||
* (weight/length only bind while building the consist), so the dialog can
|
||||
* project FULL / reopen / over-allocation live. Null on legacy schedules.
|
||||
*/
|
||||
scheduleCapacity: {
|
||||
maxWagons: number;
|
||||
allocatedWagons: number;
|
||||
remainingSlots: number;
|
||||
overAllocatedBy: number;
|
||||
bookingWindowStatus: string | null;
|
||||
} | null;
|
||||
}
|
||||
|
||||
export interface AdjustConsistPayload {
|
||||
@@ -242,6 +254,9 @@ export interface AdjustConsistPayload {
|
||||
removeWagonIds?: string[];
|
||||
}
|
||||
|
||||
/** Adjust response: fresh consist + schedule-impact warnings to surface. */
|
||||
export type AdjustConsistResult = ScheduleConsist & { warnings: string[] };
|
||||
|
||||
export const trainBuilderService = {
|
||||
list: (filters: BuiltTrainListFilters = {}) =>
|
||||
apiClient.get<BuiltTrainListResponse>(`${BASE}${toQuery(filters)}`),
|
||||
@@ -275,7 +290,7 @@ export const trainBuilderService = {
|
||||
apiClient.get<ScheduleConsist>(`/train-scheduling/schedules/${scheduleId}/consist`),
|
||||
/** Permanently trim/add wagons on the schedule's built train. */
|
||||
adjustConsist: (scheduleId: string, payload: AdjustConsistPayload) =>
|
||||
apiClient.post<ScheduleConsist>(
|
||||
apiClient.post<AdjustConsistResult>(
|
||||
`/train-scheduling/schedules/${scheduleId}/adjust-consist`,
|
||||
payload,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user