mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 18:48:11 +00:00
Enhance overview and train scheduling features
- Updated OverviewContractsTabPanel to include a new donut chart for freight type distribution. - Modified OverviewOperationsTabPanel to improve data visualization with additional charts and refactored data handling. - Introduced CreateScheduleWindowFields component for configuring booking windows in train scheduling. - Added new API endpoints for allocation candidates and booking allocation in trainScheduling.service. - Enhanced BookingRequestsPage to support allocation of paid bookings with a modal for selecting alternative dates. - Updated QUERY_KEYS and URLS constants to accommodate new operations and features. - Improved type definitions for overview and train scheduling to support new functionalities.
This commit is contained in:
@@ -43,8 +43,12 @@ export const overviewService = {
|
||||
return unwrap(response);
|
||||
},
|
||||
|
||||
getOperationsTab: async (): Promise<IOverviewOperationsTab> => {
|
||||
const response = await client.get<IOverviewOperationsTab>(O.OPERATIONS);
|
||||
getOperationsTab: async (
|
||||
range?: OverviewRange,
|
||||
): Promise<IOverviewOperationsTab> => {
|
||||
const response = await client.get<IOverviewOperationsTab>(O.OPERATIONS, {
|
||||
params: range ? { range } : undefined,
|
||||
});
|
||||
return unwrap(response);
|
||||
},
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { api as client } from "../auth/http";
|
||||
import { unwrap } from "@/utils/endpoint";
|
||||
import { URL_CONSTANTS } from "@/constants/URLS";
|
||||
import type {
|
||||
AllocationCandidates,
|
||||
BatchBoardFilters,
|
||||
BatchBoardListResponse,
|
||||
BatchBoardScheduleDetail,
|
||||
@@ -319,6 +320,25 @@ export const trainSchedulingService = {
|
||||
);
|
||||
},
|
||||
|
||||
getAllocationCandidates: async (
|
||||
bookingId: string,
|
||||
): Promise<AllocationCandidates> => {
|
||||
const response = await client.get<AllocationCandidates>(
|
||||
URL_CONSTANTS.TRAIN_SCHEDULING.ALLOCATION_CANDIDATES(bookingId),
|
||||
);
|
||||
return unwrap(response.data);
|
||||
},
|
||||
|
||||
allocatePaidBooking: async (
|
||||
bookingId: string,
|
||||
trainScheduleId: string,
|
||||
): Promise<void> => {
|
||||
await client.post(
|
||||
URL_CONSTANTS.TRAIN_SCHEDULING.ALLOCATE_BOOKING(bookingId),
|
||||
{ trainScheduleId },
|
||||
);
|
||||
},
|
||||
|
||||
getScheduleById: async (
|
||||
id: string,
|
||||
freightType?: FreightType,
|
||||
|
||||
Reference in New Issue
Block a user