sgerp-frontend-lib 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/constants/timezones.d.ts +23 -0
  2. package/dist/constants/timezones.d.ts.map +1 -0
  3. package/dist/constants/timezones.js +107 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -0
  7. package/dist/locales/locale-server.d.ts +1 -1
  8. package/dist/locales/locale-server.d.ts.map +1 -1
  9. package/dist/locales/locale-server.js +5 -0
  10. package/dist/locales/locale.d.ts +1 -1
  11. package/dist/locales/locale.d.ts.map +1 -1
  12. package/dist/locales/locale.js +6 -2
  13. package/dist/locales/locale_en.d.ts.map +1 -1
  14. package/dist/locales/locale_en.js +77 -1
  15. package/dist/locales/locale_id.d.ts +2 -0
  16. package/dist/locales/locale_id.d.ts.map +1 -0
  17. package/dist/locales/locale_id.js +2473 -0
  18. package/dist/locales/locale_ja.d.ts.map +1 -1
  19. package/dist/locales/locale_ja.js +76 -1
  20. package/dist/locales/locale_ms.d.ts.map +1 -1
  21. package/dist/locales/locale_ms.js +60 -1
  22. package/dist/locales/locale_tl.d.ts +2 -0
  23. package/dist/locales/locale_tl.d.ts.map +1 -0
  24. package/dist/locales/locale_tl.js +1122 -0
  25. package/dist/markdown.d.ts +33 -0
  26. package/dist/markdown.d.ts.map +1 -0
  27. package/dist/markdown.js +117 -0
  28. package/dist/sgerp/collection.d.ts.map +1 -1
  29. package/dist/sgerp/collection.js +18 -4
  30. package/dist/sgerp/domains.d.ts +16 -2
  31. package/dist/sgerp/domains.d.ts.map +1 -1
  32. package/dist/sgerp/domains.js +47 -1
  33. package/dist/sgerp/hooks/use-selection-state.d.ts +37 -0
  34. package/dist/sgerp/hooks/use-selection-state.d.ts.map +1 -0
  35. package/dist/sgerp/hooks/use-selection-state.js +121 -0
  36. package/dist/sgerp/hooks/use-simulation-data.d.ts +105 -0
  37. package/dist/sgerp/hooks/use-simulation-data.d.ts.map +1 -0
  38. package/dist/sgerp/hooks/use-simulation-data.js +146 -0
  39. package/dist/sgerp/hooks/use-simulation-state.d.ts +80 -0
  40. package/dist/sgerp/hooks/use-simulation-state.d.ts.map +1 -0
  41. package/dist/sgerp/hooks/use-simulation-state.js +161 -0
  42. package/dist/sgerp/index.d.ts +24 -2
  43. package/dist/sgerp/index.d.ts.map +1 -1
  44. package/dist/sgerp/index.js +62 -2
  45. package/dist/sgerp/simulation-logic/fetchUtils.d.ts.map +1 -1
  46. package/dist/sgerp/simulation-logic/fetchUtils.js +2 -0
  47. package/dist/sgerp/simulation-logic/index.d.ts +3 -1
  48. package/dist/sgerp/simulation-logic/index.d.ts.map +1 -1
  49. package/dist/sgerp/simulation-logic/index.js +10 -1
  50. package/dist/sgerp/simulation-logic/liveUpdates.d.ts +102 -0
  51. package/dist/sgerp/simulation-logic/liveUpdates.d.ts.map +1 -0
  52. package/dist/sgerp/simulation-logic/liveUpdates.js +87 -0
  53. package/dist/sgerp/simulation-logic/prepareSimulationData.d.ts +36 -0
  54. package/dist/sgerp/simulation-logic/prepareSimulationData.d.ts.map +1 -0
  55. package/dist/sgerp/simulation-logic/prepareSimulationData.js +34 -0
  56. package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts +7 -1
  57. package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts.map +1 -1
  58. package/dist/sgerp/simulation-logic/routeCalculationUtils.js +81 -0
  59. package/dist/utils/countries.d.ts +15 -0
  60. package/dist/utils/countries.d.ts.map +1 -0
  61. package/dist/utils/countries.js +112 -0
  62. package/dist/utils.d.ts +3 -0
  63. package/dist/utils.d.ts.map +1 -0
  64. package/dist/utils.js +8 -0
  65. package/dist/vrptoolbox/collection.d.ts +16 -0
  66. package/dist/vrptoolbox/collection.d.ts.map +1 -0
  67. package/dist/vrptoolbox/collection.js +62 -0
  68. package/dist/vrptoolbox/index.d.ts +6 -0
  69. package/dist/vrptoolbox/index.d.ts.map +1 -0
  70. package/dist/vrptoolbox/index.js +8 -0
  71. package/dist/vrptoolbox/types/job.d.ts +46 -0
  72. package/dist/vrptoolbox/types/job.d.ts.map +1 -0
  73. package/dist/vrptoolbox/types/job.js +5 -0
  74. package/package.json +7 -4
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSimulationData = useSimulationData;
4
+ const react_1 = require("react");
5
+ const fetchUtils_1 = require("../simulation-logic/fetchUtils");
6
+ const referenceUtils_1 = require("../simulation-logic/referenceUtils");
7
+ const routeUtils_1 = require("../utils/routeUtils");
8
+ const use_live_updates_1 = require("./use-live-updates");
9
+ /**
10
+ * React hook for fetching and managing simulation data
11
+ * Encapsulates the full data loading pipeline: fetch, attach references, generate routes
12
+ *
13
+ * @param api - SGERP client instance
14
+ * @param simulationId - Simulation ID to fetch data for
15
+ * @param simulation - Optional simulation object (for fetching main geofence)
16
+ * @param options - Hook options
17
+ * @returns Simulation data state and control functions
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * function SimulationPage({ simulationId }) {
22
+ * const api = useSGERP();
23
+ * const simulation = useCollection(api?.collections.simulation ?? null)
24
+ * ?.find(s => s.id === simulationId);
25
+ *
26
+ * // Basic usage - fetches data once
27
+ * const {
28
+ * vehicles,
29
+ * bookings,
30
+ * nodes,
31
+ * vehicleRoutes,
32
+ * vehicleData,
33
+ * loading,
34
+ * error,
35
+ * refetch
36
+ * } = useSimulationData(api, simulationId, simulation);
37
+ *
38
+ * // With live updates - automatically refreshes every 5 seconds
39
+ * const data = useSimulationData(api, simulationId, simulation, {
40
+ * enableLiveUpdates: true,
41
+ * liveUpdateInterval: 5000,
42
+ * onLiveUpdate: () => console.log('Data updated!')
43
+ * });
44
+ *
45
+ * if (loading) return <Spinner />;
46
+ * if (error) return <Error message={error.message} />;
47
+ *
48
+ * // All data is already processed - routes generated, references attached
49
+ * return <SimulationView vehicles={vehicles} bookings={bookings} routes={vehicleRoutes} />;
50
+ * }
51
+ * ```
52
+ */
53
+ function useSimulationData(api, simulationId, simulation = null, options = {}) {
54
+ var _a, _b, _c;
55
+ const { enabled = true, enableLiveUpdates = false, liveUpdateInterval = 5000, onSuccess, onError, onLiveUpdate } = options;
56
+ const [state, setState] = (0, react_1.useState)({
57
+ vehicles: [],
58
+ bookings: [],
59
+ nodes: [],
60
+ drivers: [],
61
+ geofences: [],
62
+ mainGeofence: null,
63
+ vehicleRoutes: new Map(),
64
+ vehicleData: new Map(),
65
+ loading: false,
66
+ error: null
67
+ });
68
+ const fetchData = (0, react_1.useCallback)(async () => {
69
+ if (!api || !simulationId) {
70
+ return;
71
+ }
72
+ setState(prev => (Object.assign(Object.assign({}, prev), { loading: true, error: null })));
73
+ try {
74
+ // Step 1: Fetch all data
75
+ const { vehicles, bookings, nodes, drivers, geofences, mainGeofence } = await (0, fetchUtils_1.fetchSimulationData)(api, simulationId, simulation);
76
+ // Step 2: Attach references between models
77
+ const { vehicleData } = (0, referenceUtils_1.attachReferences)(bookings, vehicles, nodes);
78
+ // Step 3: Generate vehicle routes from nodes
79
+ const vehicleIds = vehicles.map(v => v.id);
80
+ const vehicleRoutes = (0, routeUtils_1.createVehicleRoutesFromNodes)(nodes, vehicleIds);
81
+ const result = {
82
+ vehicles,
83
+ bookings,
84
+ nodes,
85
+ drivers,
86
+ geofences,
87
+ mainGeofence,
88
+ vehicleRoutes,
89
+ vehicleData
90
+ };
91
+ setState(Object.assign(Object.assign({}, result), { loading: false, error: null }));
92
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(result);
93
+ }
94
+ catch (error) {
95
+ const err = error instanceof Error ? error : new Error(String(error));
96
+ setState(prev => (Object.assign(Object.assign({}, prev), { loading: false, error: err })));
97
+ onError === null || onError === void 0 ? void 0 : onError(err);
98
+ }
99
+ }, [api, simulationId, simulation, onSuccess, onError]);
100
+ (0, react_1.useEffect)(() => {
101
+ if (enabled && api && simulationId) {
102
+ fetchData();
103
+ }
104
+ }, [enabled, api, simulationId, fetchData]);
105
+ // Set up live updates for vehicles, bookings, and nodes
106
+ const handleLiveUpdate = (0, react_1.useCallback)(() => {
107
+ if (!api || !simulationId)
108
+ return;
109
+ // Get updated data from collections (already fetched by useLiveUpdates)
110
+ const updatedVehicles = api.collections.vehicle.models;
111
+ const updatedBookings = api.collections.booking.models;
112
+ const updatedNodes = api.collections.node.models;
113
+ // Re-attach references to update denormalized fields
114
+ const { vehicleData } = (0, referenceUtils_1.attachReferences)(updatedBookings, updatedVehicles, updatedNodes);
115
+ // Regenerate routes from updated nodes
116
+ const vehicleIds = updatedVehicles.map(v => v.id);
117
+ const vehicleRoutes = (0, routeUtils_1.createVehicleRoutesFromNodes)(updatedNodes, vehicleIds);
118
+ // Update state with processed data
119
+ setState(prev => (Object.assign(Object.assign({}, prev), { vehicles: updatedVehicles, bookings: updatedBookings, nodes: updatedNodes, vehicleRoutes,
120
+ vehicleData })));
121
+ onLiveUpdate === null || onLiveUpdate === void 0 ? void 0 : onLiveUpdate();
122
+ }, [api, simulationId, onLiveUpdate]);
123
+ // Use live updates for each collection
124
+ (0, use_live_updates_1.useLiveUpdates)((_a = api === null || api === void 0 ? void 0 : api.collections.vehicle) !== null && _a !== void 0 ? _a : null, {
125
+ enabled: enableLiveUpdates && !!simulationId,
126
+ params: { simulation_id: simulationId },
127
+ interval: liveUpdateInterval,
128
+ onUpdate: handleLiveUpdate
129
+ });
130
+ (0, use_live_updates_1.useLiveUpdates)((_b = api === null || api === void 0 ? void 0 : api.collections.booking) !== null && _b !== void 0 ? _b : null, {
131
+ enabled: enableLiveUpdates && !!simulationId,
132
+ params: {
133
+ booking_type: 'customer',
134
+ simulation_id: simulationId
135
+ },
136
+ interval: liveUpdateInterval,
137
+ onUpdate: handleLiveUpdate
138
+ });
139
+ (0, use_live_updates_1.useLiveUpdates)((_c = api === null || api === void 0 ? void 0 : api.collections.node) !== null && _c !== void 0 ? _c : null, {
140
+ enabled: enableLiveUpdates && !!simulationId,
141
+ params: { simulation_id: simulationId },
142
+ interval: liveUpdateInterval,
143
+ onUpdate: handleLiveUpdate
144
+ });
145
+ return Object.assign(Object.assign({}, state), { refetch: fetchData });
146
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Hook for managing simulation page state and derived calculations
3
+ * Extracts business logic from simulation-detail-page component
4
+ */
5
+ import type { Booking } from '../types/simulation/booking';
6
+ import type { Vehicle } from '../types/simulation/vehicle';
7
+ /**
8
+ * Booking state distribution counts
9
+ */
10
+ export interface StateDistribution {
11
+ unassigned: number;
12
+ calculating: number;
13
+ assigned: number;
14
+ rejected_by_system: number;
15
+ sent_offer: number;
16
+ enroute: number;
17
+ completed: number;
18
+ cancelled_by_user: number;
19
+ cancelled_in_calc: number;
20
+ fail_to_board: number;
21
+ fail_to_deliver: number;
22
+ }
23
+ /**
24
+ * Per-vehicle booking statistics
25
+ */
26
+ export interface VehicleStats {
27
+ [vehicleId: number]: {
28
+ total: number;
29
+ completed: number;
30
+ assigned: number;
31
+ enroute: number;
32
+ };
33
+ }
34
+ /**
35
+ * JIT shift statistics
36
+ */
37
+ export interface ShiftStats {
38
+ [shiftId: string]: {
39
+ bookings: number;
40
+ vehiclesAllocated: number;
41
+ vehiclesAssigned: number;
42
+ };
43
+ }
44
+ /**
45
+ * Calculate booking state distribution
46
+ */
47
+ export declare function calculateStateDistribution(bookings: Booking[]): StateDistribution;
48
+ /**
49
+ * Calculate per-vehicle booking statistics
50
+ */
51
+ export declare function calculateVehicleStats(bookings: Booking[]): VehicleStats;
52
+ /**
53
+ * Calculate JIT shift statistics
54
+ */
55
+ export declare function calculateShiftStats(bookings: Booking[], shifts: Array<{
56
+ id: number | string;
57
+ shift_id?: string;
58
+ }>): ShiftStats;
59
+ /**
60
+ * Filter bookings by state
61
+ */
62
+ export declare function filterBookingsByState(bookings: Booking[], stateFilters: string[]): Booking[];
63
+ /**
64
+ * Hook for simulation state calculations
65
+ * Provides memoized state distribution, vehicle stats, and filtered bookings
66
+ */
67
+ export declare function useSimulationState(bookings: Booking[], vehicles: Vehicle[], stateFilters?: string[], shifts?: Array<{
68
+ id: number | string;
69
+ shift_id?: string;
70
+ }>): {
71
+ stateDistribution: StateDistribution;
72
+ vehicleStats: VehicleStats;
73
+ shiftStats: ShiftStats;
74
+ filteredBookings: Booking[];
75
+ autoplanStats: {
76
+ unassignedCount: number;
77
+ vehicleCount: number;
78
+ };
79
+ };
80
+ //# sourceMappingURL=use-simulation-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-simulation-state.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/hooks/use-simulation-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,OAAO,EAAE,MAAM,GAAG;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,iBAAiB,CA6BjF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,YAAY,CA2BvE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EAAE,EACnB,MAAM,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACxD,UAAU,CA0CZ;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,EAAE,EACnB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,EAAE,CAcX;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,OAAO,EAAE,EACnB,YAAY,GAAE,MAAM,EAAO,EAC3B,MAAM,GAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAM;;;;;;;;;EA4C/D"}
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ /**
3
+ * Hook for managing simulation page state and derived calculations
4
+ * Extracts business logic from simulation-detail-page component
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.calculateStateDistribution = calculateStateDistribution;
8
+ exports.calculateVehicleStats = calculateVehicleStats;
9
+ exports.calculateShiftStats = calculateShiftStats;
10
+ exports.filterBookingsByState = filterBookingsByState;
11
+ exports.useSimulationState = useSimulationState;
12
+ const react_1 = require("react");
13
+ const booking_1 = require("../types/simulation/booking");
14
+ /**
15
+ * Calculate booking state distribution
16
+ */
17
+ function calculateStateDistribution(bookings) {
18
+ const distribution = {
19
+ unassigned: 0,
20
+ calculating: 0,
21
+ assigned: 0,
22
+ rejected_by_system: 0,
23
+ sent_offer: 0,
24
+ enroute: 0,
25
+ completed: 0,
26
+ cancelled_by_user: 0,
27
+ cancelled_in_calc: 0,
28
+ fail_to_board: 0,
29
+ fail_to_deliver: 0,
30
+ };
31
+ bookings.forEach((booking) => {
32
+ const state = booking.state;
33
+ // Combine unassigned states (not in calculation)
34
+ if ([booking_1.BookingState.NEW, booking_1.BookingState.PREPARED].includes(state)) {
35
+ distribution.unassigned++;
36
+ }
37
+ else if ([booking_1.BookingState.QUEUED, booking_1.BookingState.CALCULATION].includes(state)) {
38
+ distribution.calculating++;
39
+ }
40
+ else if (state && state in distribution) {
41
+ distribution[state]++;
42
+ }
43
+ });
44
+ return distribution;
45
+ }
46
+ /**
47
+ * Calculate per-vehicle booking statistics
48
+ */
49
+ function calculateVehicleStats(bookings) {
50
+ const stats = {};
51
+ bookings.forEach((booking) => {
52
+ if (!booking.vehicle_id)
53
+ return;
54
+ if (!stats[booking.vehicle_id]) {
55
+ stats[booking.vehicle_id] = {
56
+ total: 0,
57
+ completed: 0,
58
+ assigned: 0,
59
+ enroute: 0,
60
+ };
61
+ }
62
+ stats[booking.vehicle_id].total++;
63
+ if (booking.state === booking_1.BookingState.COMPLETED) {
64
+ stats[booking.vehicle_id].completed++;
65
+ }
66
+ else if (booking.state === booking_1.BookingState.ASSIGNED) {
67
+ stats[booking.vehicle_id].assigned++;
68
+ }
69
+ else if (booking.state === booking_1.BookingState.ENROUTE) {
70
+ stats[booking.vehicle_id].enroute++;
71
+ }
72
+ });
73
+ return stats;
74
+ }
75
+ /**
76
+ * Calculate JIT shift statistics
77
+ */
78
+ function calculateShiftStats(bookings, shifts) {
79
+ const stats = {};
80
+ // Group bookings by shift
81
+ const bookingsByShift = new Map();
82
+ bookings.forEach((booking) => {
83
+ const shiftId = booking.shift_id;
84
+ if (!shiftId)
85
+ return;
86
+ if (!bookingsByShift.has(shiftId)) {
87
+ bookingsByShift.set(shiftId, []);
88
+ }
89
+ bookingsByShift.get(shiftId).push(booking);
90
+ });
91
+ // Calculate stats for each shift
92
+ shifts.forEach((shift) => {
93
+ const shiftId = shift.shift_id || String(shift.id);
94
+ const shiftBookings = bookingsByShift.get(shiftId) || [];
95
+ const vehicleIds = new Set();
96
+ const assignedVehicleIds = new Set();
97
+ shiftBookings.forEach((booking) => {
98
+ if (booking.vehicle_id) {
99
+ vehicleIds.add(booking.vehicle_id);
100
+ if (booking.state === 'assigned' || booking.state === 'enroute' || booking.state === 'completed') {
101
+ assignedVehicleIds.add(booking.vehicle_id);
102
+ }
103
+ }
104
+ });
105
+ const bookingCount = shiftBookings.length;
106
+ stats[shiftId] = {
107
+ bookings: bookingCount,
108
+ vehiclesAllocated: vehicleIds.size,
109
+ vehiclesAssigned: assignedVehicleIds.size,
110
+ };
111
+ });
112
+ return stats;
113
+ }
114
+ /**
115
+ * Filter bookings by state
116
+ */
117
+ function filterBookingsByState(bookings, stateFilters) {
118
+ if (stateFilters.length === 0)
119
+ return bookings;
120
+ return bookings.filter((booking) => {
121
+ // Handle "unassigned" as a combined filter (NEW, PREPARED only - not calculating states)
122
+ if (stateFilters.includes('unassigned')) {
123
+ return [booking_1.BookingState.NEW, booking_1.BookingState.PREPARED].includes(booking.state);
124
+ }
125
+ // Handle "calculating" as a combined filter (QUEUED, CALCULATION)
126
+ if (stateFilters.includes('calculating')) {
127
+ return [booking_1.BookingState.QUEUED, booking_1.BookingState.CALCULATION].includes(booking.state);
128
+ }
129
+ return stateFilters.includes(booking.state);
130
+ });
131
+ }
132
+ /**
133
+ * Hook for simulation state calculations
134
+ * Provides memoized state distribution, vehicle stats, and filtered bookings
135
+ */
136
+ function useSimulationState(bookings, vehicles, stateFilters = [], shifts = []) {
137
+ // Calculate booking state distribution
138
+ const stateDistribution = (0, react_1.useMemo)(() => calculateStateDistribution(bookings), [bookings]);
139
+ // Calculate per-vehicle statistics
140
+ const vehicleStats = (0, react_1.useMemo)(() => calculateVehicleStats(bookings), [bookings]);
141
+ // Calculate JIT shift statistics
142
+ const shiftStats = (0, react_1.useMemo)(() => calculateShiftStats(bookings, shifts), [bookings, shifts]);
143
+ // Filter bookings by selected states
144
+ const filteredBookings = (0, react_1.useMemo)(() => filterBookingsByState(bookings, stateFilters), [bookings, stateFilters]);
145
+ // Calculate autoplan statistics
146
+ const autoplanStats = (0, react_1.useMemo)(() => {
147
+ const unassignedCount = stateDistribution.unassigned || 0;
148
+ const totalVehicleCount = vehicles.length;
149
+ return {
150
+ unassignedCount,
151
+ vehicleCount: totalVehicleCount,
152
+ };
153
+ }, [stateDistribution, vehicles]);
154
+ return {
155
+ stateDistribution,
156
+ vehicleStats,
157
+ shiftStats,
158
+ filteredBookings,
159
+ autoplanStats,
160
+ };
161
+ }
@@ -31,6 +31,12 @@ export { BuildingCollection } from './collections/masstransit/building';
31
31
  export { TransitStopSetCollection } from './collections/masstransit/transitstopset';
32
32
  export { useCollection, useSGERP } from './hooks/use-collection';
33
33
  export { useLiveUpdates } from './hooks/use-live-updates';
34
+ export { useSimulationData } from './hooks/use-simulation-data';
35
+ export type { SimulationDataState, UseSimulationDataOptions } from './hooks/use-simulation-data';
36
+ export { useSimulationState, calculateStateDistribution, calculateVehicleStats, calculateShiftStats, filterBookingsByState } from './hooks/use-simulation-state';
37
+ export type { StateDistribution, VehicleStats, ShiftStats } from './hooks/use-simulation-state';
38
+ export { useSelectionState, useRecentChanges } from './hooks/use-selection-state';
39
+ export type { SelectionState } from './hooks/use-selection-state';
34
40
  export { SGERPProvider, useSGERPContext } from './context/sgerp-context';
35
41
  export type { SGERPProviderProps } from './context/sgerp-context';
36
42
  export * from './constants/scheduling-enums';
@@ -45,6 +51,7 @@ export type { ProjectMember, } from './types/sharing/project-member';
45
51
  export type { Organization, } from './types/sharing/organization';
46
52
  export type { OrganizationProject, } from './types/sharing/organization-project';
47
53
  export type { Pricing, PricingExtension, PricingDemandAdditionalPrice, PricingRule, PricingRules, PricingRoundingStrategy, PricingTerms, PricingTicketItem, PricingTicketSection, PricingDiscount, PricingPaymentMethod, PricingOptions, } from './types/sharing/pricing';
54
+ export type { PricingCostRequest, PricingCostResponse, PricingCostTicket, } from './types/simulation/pricing';
48
55
  export type { Passenger, } from './types/transportation/passenger';
49
56
  export { PassengerGender } from './types/transportation/passenger';
50
57
  export type { Ticket, } from './types/transportation/ticket';
@@ -70,6 +77,9 @@ export type { MapboxToken, } from './types/simulation/mapboxtoken';
70
77
  export type { RoutingEngineSettings, } from './types/simulation/routing-engine-settings';
71
78
  export { routingProfileToEngineSettings, } from './types/simulation/routing-engine-settings';
72
79
  export type { CalculationParams, } from './types/simulation/calculation-params';
80
+ export type { LogisticsApiSettings, } from './types/simulation/logistics-api-settings';
81
+ export { getDefaultLogisticsApiSettings, } from './types/simulation/logistics-api-settings';
82
+ export type { RouteCostModification, RouteCostModificationSetting, RouteCostModificationPolylinearSetting, RouteCostModificationPenalty, RouteCostModificationRelation, } from './types/simulation/route-cost-modification';
73
83
  export type { VehicleUploadModel, VehicleUploadPayload, VehicleUploadResult, VehicleUploadResultVehicle, VehicleUploadCreatedNode, VehicleUploadOverlap, VehiclesInvalidUploadInfo, BulkTaskMessage, BulkTaskPayloadType, BulkTaskResultType, } from './types/bulkoperations';
74
84
  export { VehicleStatus, VehicleUseOption, VehicleExportAttemptStatus, createVehicleUploadTask, } from './types/bulkoperations';
75
85
  export type { VehicleStatusValue, VehicleUseOptionValue, VehicleExportAttemptStatusValue, } from './types/bulkoperations';
@@ -81,10 +91,22 @@ export type { MapLayerConfig, MapStateConfig, } from './types/map';
81
91
  export { OperationsLocationMapState, OperationsLocationByProjectMapState, } from './map-states/operations-location-state';
82
92
  export { RoutingEngine, Step, Leg, Route, airLeg, } from './routing';
83
93
  export { getHSLToRGB, getColorFromAgentId, normalizeVehicleColor, getContrastTextColor, } from './utils/color';
84
- export { generateWaypointRouteFromNodes, createVehicleRoutesFromNodes } from './utils/routeUtils';
85
- export type { RouteNode, Waypoint as RouteWaypoint, VehicleRouteData as RouteVehicleRouteData } from './utils/routeUtils';
94
+ export { generateWaypointRouteFromNodes, createVehicleRoutesFromNodes, validatePickupDropoffConstraint } from './utils/routeUtils';
95
+ export type { RouteNode, Waypoint, Waypoint as RouteWaypoint, VehicleRouteData, VehicleRouteData as RouteVehicleRouteData } from './utils/routeUtils';
96
+ export { buildBookingPayload } from './utils/bookingPayload';
97
+ export type { BookingPayloadInput } from './utils/bookingPayload';
98
+ export { fetchVehicles, fetchBookings, fetchNodes, fetchDrivers, fetchDriversByProject, fetchOperationsLocationsByProject, fetchSimulationData, createIndexMaps, attachReferences, calculateBoundingBoxCenter, vehicleComplexRearrange, buildVehicleRouteMap, shiftNodeTimestamps, shiftWaypointTimestamps, calculateVehicleRoute, hasRouteChanged, recalculateVehicleRoute, processUnassignResponse, LIVE_UPDATE_INTERVALS, PROCESSOR_LIVE_UPDATE_PARAMS, getVehicleLiveUpdateConfig, getBookingLiveUpdateConfig, getNodeLiveUpdateConfig, getProcessorLiveUpdateConfig, triggerAllSimulationUpdates, } from './simulation-logic';
99
+ export type { VehicleComplexRearrangeRequest, ManualEditResponse, ManualEditError, VehicleRouteMap, UnassignResponse, ProcessUnassignResult, SimulationLiveUpdatesConfig, SimulationLiveUpdateTriggers, } from './simulation-logic';
86
100
  export { localize, getLocale, setLocale } from '../locales/locale';
87
101
  export type { Language } from '../locales/locale';
88
102
  export { useLocalization } from '../locales/useLocalization';
89
103
  export { ConnectionManager } from '../connection-manager';
104
+ export type { StoredConnection } from '../connection-manager';
105
+ export { getTimezoneOptions } from '../constants/timezones';
106
+ export { COUNTRIES, POPULAR_COUNTRIES, getLocalizedCountryName } from '../utils/countries';
107
+ export { cn } from '../utils';
108
+ export { SGERP_DOMAINS, DEFAULT_SERVERS, BACKEND_DETECTION_RULES, detectBackendFromUrl } from './domains';
109
+ export type { BackendEnvironment, OSRMBackend } from './domains';
110
+ export { FIRST_SOLUTION_STRATEGIES } from './constants/solver-strategies';
111
+ export type { FirstSolutionStrategy } from './constants/solver-strategies';
90
112
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../sgerplib/sgerp/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAA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BAAoB,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC1G,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.routingProfileToEngineSettings = exports.getRoutingEngineLabel = exports.RoutingEngineName = exports.NodeType = exports.BookingState = exports.TransactionCurrency = exports.TransactionProvider = exports.TransactionType = exports.TransactionStatus = exports.PassengerGender = exports.isValidEnumValue = exports.getEnumValues = exports.getEnumLabel = exports.getEnumOptions = exports.useSGERPContext = exports.SGERPProvider = exports.useLiveUpdates = exports.useSGERP = exports.useCollection = exports.TransitStopSetCollection = exports.BuildingCollection = exports.TransitStopCollection = exports.SMSScheduledCollection = exports.MapboxTokenCollection = exports.GeofenceCollection = exports.RoutingProfileCollection = exports.OperationsLocationGroupCollection = exports.OperationsLocationCollection = exports.SimulationProcessorCollection = exports.DatasetCollection = exports.NodeCollection = exports.BookingCollection = exports.VehicleTypeCollection = exports.VehicleCollection = exports.DriverCollection = exports.SimulationCollection = exports.UserCollection = exports.TransactionCollection = exports.TicketCollection = exports.PassengerCollection = exports.PricingCollection = exports.OrganizationProjectCollection = exports.OrganizationCollection = exports.ProjectMemberCollection = exports.ProjectCollection = exports.Collection = exports.APIError = exports.APIClient = exports.SGERPClient = exports.initializeSGERP = void 0;
18
- exports.ConnectionManager = exports.useLocalization = exports.setLocale = exports.getLocale = exports.localize = exports.createVehicleRoutesFromNodes = exports.generateWaypointRouteFromNodes = exports.getContrastTextColor = exports.normalizeVehicleColor = exports.getColorFromAgentId = exports.getHSLToRGB = exports.airLeg = exports.Route = exports.Leg = exports.Step = exports.RoutingEngine = exports.OperationsLocationByProjectMapState = exports.OperationsLocationMapState = exports.createVehicleUploadTask = exports.VehicleExportAttemptStatus = exports.VehicleUseOption = exports.VehicleStatus = void 0;
17
+ exports.TransactionStatus = exports.PassengerGender = exports.isValidEnumValue = exports.getEnumValues = exports.getEnumLabel = exports.getEnumOptions = exports.useSGERPContext = exports.SGERPProvider = exports.useRecentChanges = exports.useSelectionState = exports.filterBookingsByState = exports.calculateShiftStats = exports.calculateVehicleStats = exports.calculateStateDistribution = exports.useSimulationState = exports.useSimulationData = exports.useLiveUpdates = exports.useSGERP = exports.useCollection = exports.TransitStopSetCollection = exports.BuildingCollection = exports.TransitStopCollection = exports.SMSScheduledCollection = exports.MapboxTokenCollection = exports.GeofenceCollection = exports.RoutingProfileCollection = exports.OperationsLocationGroupCollection = exports.OperationsLocationCollection = exports.SimulationProcessorCollection = exports.DatasetCollection = exports.NodeCollection = exports.BookingCollection = exports.VehicleTypeCollection = exports.VehicleCollection = exports.DriverCollection = exports.SimulationCollection = exports.UserCollection = exports.TransactionCollection = exports.TicketCollection = exports.PassengerCollection = exports.PricingCollection = exports.OrganizationProjectCollection = exports.OrganizationCollection = exports.ProjectMemberCollection = exports.ProjectCollection = exports.Collection = exports.APIError = exports.APIClient = exports.SGERPClient = exports.initializeSGERP = void 0;
18
+ exports.getBookingLiveUpdateConfig = exports.getVehicleLiveUpdateConfig = exports.PROCESSOR_LIVE_UPDATE_PARAMS = exports.LIVE_UPDATE_INTERVALS = exports.processUnassignResponse = exports.recalculateVehicleRoute = exports.hasRouteChanged = exports.calculateVehicleRoute = exports.shiftWaypointTimestamps = exports.shiftNodeTimestamps = exports.buildVehicleRouteMap = exports.vehicleComplexRearrange = exports.calculateBoundingBoxCenter = exports.attachReferences = exports.createIndexMaps = exports.fetchSimulationData = exports.fetchOperationsLocationsByProject = exports.fetchDriversByProject = exports.fetchDrivers = exports.fetchNodes = exports.fetchBookings = exports.fetchVehicles = exports.buildBookingPayload = exports.validatePickupDropoffConstraint = exports.createVehicleRoutesFromNodes = exports.generateWaypointRouteFromNodes = exports.getContrastTextColor = exports.normalizeVehicleColor = exports.getColorFromAgentId = exports.getHSLToRGB = exports.airLeg = exports.Route = exports.Leg = exports.Step = exports.RoutingEngine = exports.OperationsLocationByProjectMapState = exports.OperationsLocationMapState = exports.createVehicleUploadTask = exports.VehicleExportAttemptStatus = exports.VehicleUseOption = exports.VehicleStatus = exports.getDefaultLogisticsApiSettings = exports.routingProfileToEngineSettings = exports.getRoutingEngineLabel = exports.RoutingEngineName = exports.NodeType = exports.BookingState = exports.TransactionCurrency = exports.TransactionProvider = exports.TransactionType = void 0;
19
+ exports.FIRST_SOLUTION_STRATEGIES = exports.detectBackendFromUrl = exports.BACKEND_DETECTION_RULES = exports.DEFAULT_SERVERS = exports.SGERP_DOMAINS = exports.cn = exports.getLocalizedCountryName = exports.POPULAR_COUNTRIES = exports.COUNTRIES = exports.getTimezoneOptions = exports.ConnectionManager = exports.useLocalization = exports.setLocale = exports.getLocale = exports.localize = exports.triggerAllSimulationUpdates = exports.getProcessorLiveUpdateConfig = exports.getNodeLiveUpdateConfig = void 0;
19
20
  // Main Client
20
21
  var client_1 = require("./client");
21
22
  Object.defineProperty(exports, "initializeSGERP", { enumerable: true, get: function () { return client_1.initializeSGERP; } });
@@ -85,6 +86,17 @@ Object.defineProperty(exports, "useCollection", { enumerable: true, get: functio
85
86
  Object.defineProperty(exports, "useSGERP", { enumerable: true, get: function () { return use_collection_1.useSGERP; } });
86
87
  var use_live_updates_1 = require("./hooks/use-live-updates");
87
88
  Object.defineProperty(exports, "useLiveUpdates", { enumerable: true, get: function () { return use_live_updates_1.useLiveUpdates; } });
89
+ var use_simulation_data_1 = require("./hooks/use-simulation-data");
90
+ Object.defineProperty(exports, "useSimulationData", { enumerable: true, get: function () { return use_simulation_data_1.useSimulationData; } });
91
+ var use_simulation_state_1 = require("./hooks/use-simulation-state");
92
+ Object.defineProperty(exports, "useSimulationState", { enumerable: true, get: function () { return use_simulation_state_1.useSimulationState; } });
93
+ Object.defineProperty(exports, "calculateStateDistribution", { enumerable: true, get: function () { return use_simulation_state_1.calculateStateDistribution; } });
94
+ Object.defineProperty(exports, "calculateVehicleStats", { enumerable: true, get: function () { return use_simulation_state_1.calculateVehicleStats; } });
95
+ Object.defineProperty(exports, "calculateShiftStats", { enumerable: true, get: function () { return use_simulation_state_1.calculateShiftStats; } });
96
+ Object.defineProperty(exports, "filterBookingsByState", { enumerable: true, get: function () { return use_simulation_state_1.filterBookingsByState; } });
97
+ var use_selection_state_1 = require("./hooks/use-selection-state");
98
+ Object.defineProperty(exports, "useSelectionState", { enumerable: true, get: function () { return use_selection_state_1.useSelectionState; } });
99
+ Object.defineProperty(exports, "useRecentChanges", { enumerable: true, get: function () { return use_selection_state_1.useRecentChanges; } });
88
100
  // React Context
89
101
  var sgerp_context_1 = require("./context/sgerp-context");
90
102
  Object.defineProperty(exports, "SGERPProvider", { enumerable: true, get: function () { return sgerp_context_1.SGERPProvider; } });
@@ -116,6 +128,8 @@ Object.defineProperty(exports, "RoutingEngineName", { enumerable: true, get: fun
116
128
  Object.defineProperty(exports, "getRoutingEngineLabel", { enumerable: true, get: function () { return routingprofile_2.getRoutingEngineLabel; } });
117
129
  var routing_engine_settings_1 = require("./types/simulation/routing-engine-settings");
118
130
  Object.defineProperty(exports, "routingProfileToEngineSettings", { enumerable: true, get: function () { return routing_engine_settings_1.routingProfileToEngineSettings; } });
131
+ var logistics_api_settings_1 = require("./types/simulation/logistics-api-settings");
132
+ Object.defineProperty(exports, "getDefaultLogisticsApiSettings", { enumerable: true, get: function () { return logistics_api_settings_1.getDefaultLogisticsApiSettings; } });
119
133
  var bulkoperations_1 = require("./types/bulkoperations");
120
134
  Object.defineProperty(exports, "VehicleStatus", { enumerable: true, get: function () { return bulkoperations_1.VehicleStatus; } });
121
135
  Object.defineProperty(exports, "VehicleUseOption", { enumerable: true, get: function () { return bulkoperations_1.VehicleUseOption; } });
@@ -141,6 +155,36 @@ Object.defineProperty(exports, "getContrastTextColor", { enumerable: true, get:
141
155
  var routeUtils_1 = require("./utils/routeUtils");
142
156
  Object.defineProperty(exports, "generateWaypointRouteFromNodes", { enumerable: true, get: function () { return routeUtils_1.generateWaypointRouteFromNodes; } });
143
157
  Object.defineProperty(exports, "createVehicleRoutesFromNodes", { enumerable: true, get: function () { return routeUtils_1.createVehicleRoutesFromNodes; } });
158
+ Object.defineProperty(exports, "validatePickupDropoffConstraint", { enumerable: true, get: function () { return routeUtils_1.validatePickupDropoffConstraint; } });
159
+ var bookingPayload_1 = require("./utils/bookingPayload");
160
+ Object.defineProperty(exports, "buildBookingPayload", { enumerable: true, get: function () { return bookingPayload_1.buildBookingPayload; } });
161
+ // Simulation Logic Utilities
162
+ var simulation_logic_1 = require("./simulation-logic");
163
+ Object.defineProperty(exports, "fetchVehicles", { enumerable: true, get: function () { return simulation_logic_1.fetchVehicles; } });
164
+ Object.defineProperty(exports, "fetchBookings", { enumerable: true, get: function () { return simulation_logic_1.fetchBookings; } });
165
+ Object.defineProperty(exports, "fetchNodes", { enumerable: true, get: function () { return simulation_logic_1.fetchNodes; } });
166
+ Object.defineProperty(exports, "fetchDrivers", { enumerable: true, get: function () { return simulation_logic_1.fetchDrivers; } });
167
+ Object.defineProperty(exports, "fetchDriversByProject", { enumerable: true, get: function () { return simulation_logic_1.fetchDriversByProject; } });
168
+ Object.defineProperty(exports, "fetchOperationsLocationsByProject", { enumerable: true, get: function () { return simulation_logic_1.fetchOperationsLocationsByProject; } });
169
+ Object.defineProperty(exports, "fetchSimulationData", { enumerable: true, get: function () { return simulation_logic_1.fetchSimulationData; } });
170
+ Object.defineProperty(exports, "createIndexMaps", { enumerable: true, get: function () { return simulation_logic_1.createIndexMaps; } });
171
+ Object.defineProperty(exports, "attachReferences", { enumerable: true, get: function () { return simulation_logic_1.attachReferences; } });
172
+ Object.defineProperty(exports, "calculateBoundingBoxCenter", { enumerable: true, get: function () { return simulation_logic_1.calculateBoundingBoxCenter; } });
173
+ Object.defineProperty(exports, "vehicleComplexRearrange", { enumerable: true, get: function () { return simulation_logic_1.vehicleComplexRearrange; } });
174
+ Object.defineProperty(exports, "buildVehicleRouteMap", { enumerable: true, get: function () { return simulation_logic_1.buildVehicleRouteMap; } });
175
+ Object.defineProperty(exports, "shiftNodeTimestamps", { enumerable: true, get: function () { return simulation_logic_1.shiftNodeTimestamps; } });
176
+ Object.defineProperty(exports, "shiftWaypointTimestamps", { enumerable: true, get: function () { return simulation_logic_1.shiftWaypointTimestamps; } });
177
+ Object.defineProperty(exports, "calculateVehicleRoute", { enumerable: true, get: function () { return simulation_logic_1.calculateVehicleRoute; } });
178
+ Object.defineProperty(exports, "hasRouteChanged", { enumerable: true, get: function () { return simulation_logic_1.hasRouteChanged; } });
179
+ Object.defineProperty(exports, "recalculateVehicleRoute", { enumerable: true, get: function () { return simulation_logic_1.recalculateVehicleRoute; } });
180
+ Object.defineProperty(exports, "processUnassignResponse", { enumerable: true, get: function () { return simulation_logic_1.processUnassignResponse; } });
181
+ Object.defineProperty(exports, "LIVE_UPDATE_INTERVALS", { enumerable: true, get: function () { return simulation_logic_1.LIVE_UPDATE_INTERVALS; } });
182
+ Object.defineProperty(exports, "PROCESSOR_LIVE_UPDATE_PARAMS", { enumerable: true, get: function () { return simulation_logic_1.PROCESSOR_LIVE_UPDATE_PARAMS; } });
183
+ Object.defineProperty(exports, "getVehicleLiveUpdateConfig", { enumerable: true, get: function () { return simulation_logic_1.getVehicleLiveUpdateConfig; } });
184
+ Object.defineProperty(exports, "getBookingLiveUpdateConfig", { enumerable: true, get: function () { return simulation_logic_1.getBookingLiveUpdateConfig; } });
185
+ Object.defineProperty(exports, "getNodeLiveUpdateConfig", { enumerable: true, get: function () { return simulation_logic_1.getNodeLiveUpdateConfig; } });
186
+ Object.defineProperty(exports, "getProcessorLiveUpdateConfig", { enumerable: true, get: function () { return simulation_logic_1.getProcessorLiveUpdateConfig; } });
187
+ Object.defineProperty(exports, "triggerAllSimulationUpdates", { enumerable: true, get: function () { return simulation_logic_1.triggerAllSimulationUpdates; } });
144
188
  // Localization
145
189
  var locale_1 = require("../locales/locale");
146
190
  Object.defineProperty(exports, "localize", { enumerable: true, get: function () { return locale_1.localize; } });
@@ -151,3 +195,19 @@ Object.defineProperty(exports, "useLocalization", { enumerable: true, get: funct
151
195
  // Connection Manager
152
196
  var connection_manager_1 = require("../connection-manager");
153
197
  Object.defineProperty(exports, "ConnectionManager", { enumerable: true, get: function () { return connection_manager_1.ConnectionManager; } });
198
+ // Constants & Utils
199
+ var timezones_1 = require("../constants/timezones");
200
+ Object.defineProperty(exports, "getTimezoneOptions", { enumerable: true, get: function () { return timezones_1.getTimezoneOptions; } });
201
+ var countries_1 = require("../utils/countries");
202
+ Object.defineProperty(exports, "COUNTRIES", { enumerable: true, get: function () { return countries_1.COUNTRIES; } });
203
+ Object.defineProperty(exports, "POPULAR_COUNTRIES", { enumerable: true, get: function () { return countries_1.POPULAR_COUNTRIES; } });
204
+ Object.defineProperty(exports, "getLocalizedCountryName", { enumerable: true, get: function () { return countries_1.getLocalizedCountryName; } });
205
+ var utils_1 = require("../utils");
206
+ Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return utils_1.cn; } });
207
+ var domains_1 = require("./domains");
208
+ Object.defineProperty(exports, "SGERP_DOMAINS", { enumerable: true, get: function () { return domains_1.SGERP_DOMAINS; } });
209
+ Object.defineProperty(exports, "DEFAULT_SERVERS", { enumerable: true, get: function () { return domains_1.DEFAULT_SERVERS; } });
210
+ Object.defineProperty(exports, "BACKEND_DETECTION_RULES", { enumerable: true, get: function () { return domains_1.BACKEND_DETECTION_RULES; } });
211
+ Object.defineProperty(exports, "detectBackendFromUrl", { enumerable: true, get: function () { return domains_1.detectBackendFromUrl; } });
212
+ var solver_strategies_1 = require("./constants/solver-strategies");
213
+ Object.defineProperty(exports, "FIRST_SOLUTION_STRATEGIES", { enumerable: true, get: function () { return solver_strategies_1.FIRST_SOLUTION_STRATEGIES; } });
@@ -1 +1 @@
1
- {"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAIjF;;;GAGG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,WAAW,EAChB,YAAY,EAAE,MAAM,GAAG,MAAM,GAC5B,O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;;GAIG;AACH,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,MAAM,GAAG,MAAM,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAW/B;AAgCD;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAC7B,OAAO,CAAC,QAAQ,EAAE,CAAC,CA4CrB;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,WAAW,EAChB,UAAU,EAAE,UAAU,GAAG,IAAI,GAC5B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA0B1B;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,WAAW,EAChB,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,UAAU,GAAE,UAAU,GAAG,IAAW;;;;;;;GA8BrC"}
@@ -10,6 +10,7 @@ exports.fetchGeofences = fetchGeofences;
10
10
  exports.fetchSimulationGeofence = fetchSimulationGeofence;
11
11
  exports.fetchSimulationData = fetchSimulationData;
12
12
  const client_1 = require("../api/client");
13
+ const referenceUtils_1 = require("./referenceUtils");
13
14
  /**
14
15
  * Fetch vehicles for a simulation
15
16
  * Uses fetchAll() to get all vehicles regardless of count
@@ -215,6 +216,7 @@ async function fetchSimulationData(api, simulationId, simulation = null) {
215
216
  fetchGeofences(api, vehicles, simulationId),
216
217
  fetchSimulationGeofence(api, simulation)
217
218
  ]);
219
+ (0, referenceUtils_1.attachReferences)(bookings, vehicles, nodes);
218
220
  return {
219
221
  vehicles,
220
222
  bookings,
@@ -8,7 +8,9 @@ export { calculateBoundingBoxCenter } from './mapUtils';
8
8
  export { vehicleComplexRearrange, buildVehicleRouteMap } from './manualEditUtils';
9
9
  export type { VehicleComplexRearrangeRequest, ManualEditResponse, ManualEditError, VehicleRouteMap } from './manualEditUtils';
10
10
  export { shiftNodeTimestamps, shiftWaypointTimestamps } from './timeShiftUtils';
11
- export { calculateVehicleRoute, hasRouteChanged } from './routeCalculationUtils';
11
+ export { calculateVehicleRoute, hasRouteChanged, recalculateVehicleRoute } from './routeCalculationUtils';
12
12
  export { processUnassignResponse } from './optimisticUpdateUtils';
13
13
  export type { UnassignResponse, ProcessUnassignResult } from './optimisticUpdateUtils';
14
+ export { LIVE_UPDATE_INTERVALS, PROCESSOR_LIVE_UPDATE_PARAMS, getVehicleLiveUpdateConfig, getBookingLiveUpdateConfig, getNodeLiveUpdateConfig, getProcessorLiveUpdateConfig, triggerAllSimulationUpdates } from './liveUpdates';
15
+ export type { SimulationLiveUpdatesConfig, SimulationLiveUpdateTriggers } from './liveUpdates';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,iCAAiC,EACjC,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,8BAA8B,EAC9B,kBAAkB,EAClB,eAAe,EACf,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,iCAAiC,EACjC,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,8BAA8B,EAC9B,kBAAkB,EAClB,eAAe,EACf,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,eAAe,CAAC"}