@burdenoff/microfe-movethewheels 2026.1012.1 → 2026.1013.1
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.
- package/dist/hooks/useContainerLifecycle.js +49 -42
- package/dist/hooks/useEpod.js +134 -70
- package/dist/hooks/useShipmentPermissions.js +28 -0
- package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +1 -1
- package/dist/movethewheels/hooks/useEpod.d.ts +1 -0
- package/dist/movethewheels/hooks/useShipmentPermissions.d.ts +9 -0
- package/dist/pages/ContainersPage.js +184 -168
- package/dist/pages/DeliveryCapturePage.js +87 -85
- package/dist/pages/FreeTimePage.js +205 -191
- package/package.json +4 -3
- package/src/movethewheels/hooks/useContainerLifecycle.ts +10 -6
- package/src/movethewheels/hooks/useEpod.ts +109 -33
- package/src/movethewheels/hooks/useShipmentPermissions.ts +38 -0
- package/src/movethewheels/pages/ContainersPage.tsx +198 -159
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +11 -8
- package/src/movethewheels/pages/FreeTimePage.tsx +55 -13
|
@@ -2,31 +2,33 @@ import { Clock as e } from "../node_modules/lucide-react/dist/esm/icons/clock.js
|
|
|
2
2
|
import { useMoveTheWheels as t } from "../providers/MoveTheWheelsProvider.js";
|
|
3
3
|
import { Button as n, Input as r } from "../components/ui.js";
|
|
4
4
|
import { PageLayout as i } from "../components/PageLayout.js";
|
|
5
|
-
import { useConditionAction as
|
|
6
|
-
import { ContainerEvidencePicker as
|
|
5
|
+
import { useConditionAction as ee, useConditionQuery as a } from "../hooks/useContainerCondition.js";
|
|
6
|
+
import { ContainerEvidencePicker as te } from "../components/ContainerEvidencePicker.js";
|
|
7
|
+
import { useShipmentPermissions as o } from "../hooks/useShipmentPermissions.js";
|
|
7
8
|
import { freeTimeIso as s } from "../utils/freeTimeDate.js";
|
|
8
|
-
import { FreeTimeAgreementForm as
|
|
9
|
-
import { DecideFreeExtensionDocument as
|
|
10
|
-
import { useState as
|
|
11
|
-
import { Fragment as
|
|
9
|
+
import { FreeTimeAgreementForm as ne } from "../components/FreeTimeAgreementForm.js";
|
|
10
|
+
import { DecideFreeExtensionDocument as re, FreeAgreementsDocument as ie, FreeClocksDocument as ae, FreeContainersDocument as oe, FreeCyclesDocument as se, FreeEventsDocument as ce, FreeExposureDocument as le, FreeExtensionsDocument as ue, OpenFreeClockDocument as de, RecordFreeAgreementDocument as fe, RequestFreeExtensionDocument as pe } from "../src/generated/free-time-operations.js";
|
|
11
|
+
import { useState as c } from "react";
|
|
12
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { PermissionProvider as f } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
14
|
//#region src/movethewheels/pages/FreeTimePage.tsx
|
|
13
15
|
var p = "space-y-4 rounded-xl border bg-bg-surface p-5", m = "mt-1 w-full rounded-md border bg-bg-surface p-2 text-sm", h = 25;
|
|
14
16
|
function g({ page: e, offset: t, setOffset: r, busy: i }) {
|
|
15
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ d("div", {
|
|
16
18
|
className: "flex flex-wrap items-center gap-2",
|
|
17
19
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ u(n, {
|
|
19
21
|
type: "button",
|
|
20
22
|
variant: "outline",
|
|
21
23
|
disabled: i || t === 0,
|
|
22
24
|
onClick: () => r(Math.max(0, t - h)),
|
|
23
25
|
children: "Previous"
|
|
24
26
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ u("span", {
|
|
26
28
|
className: "text-sm",
|
|
27
29
|
children: e ? `${e.total} records; page ${Math.floor(t / h) + 1}` : "Waiting for records"
|
|
28
30
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ u(n, {
|
|
30
32
|
type: "button",
|
|
31
33
|
variant: "outline",
|
|
32
34
|
disabled: i || !e?.hasMore || e.nextOffset == null || e.nextOffset > 1e4,
|
|
@@ -39,12 +41,12 @@ function g({ page: e, offset: t, setOffset: r, busy: i }) {
|
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
43
|
function _({ error: e, loading: t, children: n }) {
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
e && /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ d(l, { children: [
|
|
45
|
+
e && /* @__PURE__ */ u("p", {
|
|
44
46
|
role: "alert",
|
|
45
47
|
children: e
|
|
46
48
|
}),
|
|
47
|
-
t && /* @__PURE__ */
|
|
49
|
+
t && /* @__PURE__ */ u("p", {
|
|
48
50
|
role: "status",
|
|
49
51
|
children: "Loading records…"
|
|
50
52
|
}),
|
|
@@ -52,120 +54,127 @@ function _({ error: e, loading: t, children: n }) {
|
|
|
52
54
|
] });
|
|
53
55
|
}
|
|
54
56
|
function v() {
|
|
55
|
-
let { workspaceId: n, tenantId: r, currentUser:
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
let { workspaceId: n, tenantId: r, currentUser: ee, apiGatewayUrl: a } = t();
|
|
58
|
+
return /* @__PURE__ */ u(i, {
|
|
57
59
|
title: "Free time and extension decisions",
|
|
58
60
|
subtitle: "Separate sourced commercial obligations, actual events and recorded counterparty decisions.",
|
|
59
|
-
icon: /* @__PURE__ */
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
icon: /* @__PURE__ */ u(e, { "aria-hidden": "true" }),
|
|
62
|
+
children: /* @__PURE__ */ u(f, {
|
|
63
|
+
scopeId: n ?? null,
|
|
64
|
+
gateway: "workspace",
|
|
65
|
+
children: /* @__PURE__ */ u(y, {})
|
|
66
|
+
}, `${n}:${r}:${ee?.id}:${a}`)
|
|
61
67
|
});
|
|
62
68
|
}
|
|
63
69
|
function y() {
|
|
64
|
-
|
|
70
|
+
return /* @__PURE__ */ u(b, { access: o() });
|
|
71
|
+
}
|
|
72
|
+
function b({ access: e }) {
|
|
73
|
+
let [t, i] = c(""), [o, f] = c(""), [v, y] = c(""), [b, me] = c(0), [he, x] = c(0), [S, C] = c(0), [ge, w] = c(0), [_e, T] = c(0), [E, D] = c(0), [O, k] = c("open"), [ve, ye] = c("DEMURRAGE"), [A, j] = c(""), [M, be] = c((/* @__PURE__ */ new Date()).toISOString()), [xe, Se] = c(M), [N, P] = c(null), [F, I] = c([]), [L, R] = c(""), [z, Ce] = c("ACCEPTED"), B = ee(), V = a(oe, e.canRead ? { pagination: {
|
|
65
74
|
limit: h,
|
|
66
|
-
offset:
|
|
67
|
-
} }), H =
|
|
68
|
-
containerId:
|
|
75
|
+
offset: b
|
|
76
|
+
} } : null), H = a(se, e.canRead && t ? {
|
|
77
|
+
containerId: t,
|
|
69
78
|
pagination: {
|
|
70
79
|
limit: h,
|
|
71
|
-
offset:
|
|
80
|
+
offset: he
|
|
72
81
|
}
|
|
73
|
-
} : null), U =
|
|
74
|
-
cycleId:
|
|
82
|
+
} : null), U = a(ce, e.canRead && o ? {
|
|
83
|
+
cycleId: o,
|
|
75
84
|
pagination: {
|
|
76
85
|
limit: h,
|
|
77
|
-
offset:
|
|
86
|
+
offset: S
|
|
78
87
|
}
|
|
79
|
-
} : null, B.revision), W =
|
|
80
|
-
cycleId:
|
|
88
|
+
} : null, B.revision), W = a(ae, e.canRead && o ? {
|
|
89
|
+
cycleId: o,
|
|
81
90
|
pagination: {
|
|
82
91
|
limit: h,
|
|
83
92
|
offset: ge
|
|
84
93
|
}
|
|
85
|
-
} : null, B.revision), G =
|
|
86
|
-
clockId:
|
|
94
|
+
} : null, B.revision), G = a(ie, e.canRead && v ? {
|
|
95
|
+
clockId: v,
|
|
87
96
|
pagination: {
|
|
88
97
|
limit: h,
|
|
89
98
|
offset: _e
|
|
90
99
|
}
|
|
91
|
-
} : null, B.revision), K =
|
|
92
|
-
clockId:
|
|
100
|
+
} : null, B.revision), K = a(ie, e.canRead && v ? {
|
|
101
|
+
clockId: v,
|
|
93
102
|
pagination: {
|
|
94
103
|
limit: 1,
|
|
95
104
|
offset: 0
|
|
96
105
|
}
|
|
97
|
-
} : null, B.revision), q =
|
|
98
|
-
clockId:
|
|
106
|
+
} : null, B.revision), q = a(ue, e.canRead && v ? {
|
|
107
|
+
clockId: v,
|
|
99
108
|
pagination: {
|
|
100
109
|
limit: h,
|
|
101
|
-
offset:
|
|
110
|
+
offset: E
|
|
102
111
|
}
|
|
103
|
-
} : null, B.revision), J =
|
|
104
|
-
clockId:
|
|
105
|
-
asOf:
|
|
106
|
-
} : null, B.revision), Y = W.data?.mtwFreeTimeClockPage.items.find((e) => e.id ===
|
|
107
|
-
|
|
108
|
-
}, Q = J.data?.mtwFreeTimeExposure, $ = G.data?.mtwFreeTimeAgreementPage.items.find((e) => e.id === Q?.agreementId) ?? (X?.id === Q?.agreementId ? X : void 0),
|
|
112
|
+
} : null, B.revision), J = a(le, e.canRead && v ? {
|
|
113
|
+
clockId: v,
|
|
114
|
+
asOf: xe
|
|
115
|
+
} : null, B.revision), Y = W.data?.mtwFreeTimeClockPage.items.find((e) => e.id === v), X = K.data?.mtwFreeTimeAgreementPage.items[0], we = q.data?.mtwFreeTimeExtensionPage.items.filter((e) => !e.decision) ?? [], Z = () => {
|
|
116
|
+
y(""), T(0), D(0), R(""), I([]), k("open"), j(""), P(null), B.resetFeedback();
|
|
117
|
+
}, Q = J.data?.mtwFreeTimeExposure, $ = G.data?.mtwFreeTimeAgreementPage.items.find((e) => e.id === Q?.agreementId) ?? (X?.id === Q?.agreementId ? X : void 0), Te = () => {
|
|
109
118
|
if (!F.length) throw Error("Select exact decision/request evidence versions.");
|
|
110
119
|
return F.map(({ fileId: e, versionId: t }) => ({
|
|
111
120
|
fileId: e,
|
|
112
121
|
versionId: t
|
|
113
122
|
}));
|
|
114
123
|
};
|
|
115
|
-
return /* @__PURE__ */
|
|
124
|
+
return e.canRead ? /* @__PURE__ */ d("div", {
|
|
116
125
|
className: "space-y-6",
|
|
117
126
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ u("p", {
|
|
119
128
|
className: "rounded-lg border p-4 text-sm",
|
|
120
129
|
children: "These are estimates under recorded source terms. Separate storage, demurrage and detention may overlap commercially; they are not automatically merged or summed across currencies. An extension changes the clock only after external acceptance is recorded. This service does not negotiate or certify acceptance."
|
|
121
130
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ d("section", {
|
|
123
132
|
className: p,
|
|
124
133
|
"aria-label": "Container and commercial obligation",
|
|
125
134
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ d("label", {
|
|
127
136
|
className: "block",
|
|
128
|
-
children: ["Container", /* @__PURE__ */
|
|
137
|
+
children: ["Container", /* @__PURE__ */ d("select", {
|
|
129
138
|
className: m,
|
|
130
|
-
value:
|
|
139
|
+
value: t,
|
|
131
140
|
disabled: B.busy,
|
|
132
141
|
onChange: (e) => {
|
|
133
|
-
|
|
142
|
+
i(e.target.value), f(""), x(0), C(0), w(0), Z();
|
|
134
143
|
},
|
|
135
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ u("option", {
|
|
136
145
|
value: "",
|
|
137
146
|
children: "Choose container"
|
|
138
|
-
}), V.data?.mtwContainerPage.items.map((e) => /* @__PURE__ */
|
|
147
|
+
}), V.data?.mtwContainerPage.items.map((e) => /* @__PURE__ */ u("option", {
|
|
139
148
|
value: e.id,
|
|
140
149
|
children: e.containerNumber
|
|
141
150
|
}, e.id))]
|
|
142
151
|
})]
|
|
143
152
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ u(_, {
|
|
145
154
|
error: V.error,
|
|
146
155
|
loading: V.loading,
|
|
147
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ u(g, {
|
|
148
157
|
page: V.data?.mtwContainerPage,
|
|
149
|
-
offset:
|
|
158
|
+
offset: b,
|
|
150
159
|
busy: V.loading || B.busy,
|
|
151
160
|
setOffset: (e) => {
|
|
152
|
-
|
|
161
|
+
me(e), i(""), f(""), Z();
|
|
153
162
|
}
|
|
154
163
|
})
|
|
155
164
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ d("label", {
|
|
157
166
|
className: "block",
|
|
158
|
-
children: ["Usage cycle", /* @__PURE__ */
|
|
167
|
+
children: ["Usage cycle", /* @__PURE__ */ d("select", {
|
|
159
168
|
className: m,
|
|
160
|
-
value:
|
|
161
|
-
disabled: !
|
|
169
|
+
value: o,
|
|
170
|
+
disabled: !t || B.busy,
|
|
162
171
|
onChange: (e) => {
|
|
163
|
-
|
|
172
|
+
f(e.target.value), C(0), w(0), Z();
|
|
164
173
|
},
|
|
165
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ u("option", {
|
|
166
175
|
value: "",
|
|
167
176
|
children: "Choose cycle"
|
|
168
|
-
}), H.data?.mtwContainerCyclePage.items.map((e) => /* @__PURE__ */
|
|
177
|
+
}), H.data?.mtwContainerCyclePage.items.map((e) => /* @__PURE__ */ d("option", {
|
|
169
178
|
value: e.id,
|
|
170
179
|
children: [
|
|
171
180
|
e.bookingReference ?? e.id,
|
|
@@ -177,31 +186,31 @@ function y() {
|
|
|
177
186
|
}, e.id))]
|
|
178
187
|
})]
|
|
179
188
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ u(_, {
|
|
181
190
|
error: H.error,
|
|
182
191
|
loading: H.loading,
|
|
183
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ u(g, {
|
|
184
193
|
page: H.data?.mtwContainerCyclePage,
|
|
185
|
-
offset:
|
|
194
|
+
offset: he,
|
|
186
195
|
busy: H.loading || B.busy,
|
|
187
196
|
setOffset: (e) => {
|
|
188
|
-
|
|
197
|
+
x(e), f(""), Z();
|
|
189
198
|
}
|
|
190
199
|
})
|
|
191
200
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ d("label", {
|
|
193
202
|
className: "block",
|
|
194
|
-
children: ["Commercial obligation", /* @__PURE__ */
|
|
203
|
+
children: ["Commercial obligation", /* @__PURE__ */ d("select", {
|
|
195
204
|
className: m,
|
|
196
|
-
value:
|
|
197
|
-
disabled: !
|
|
205
|
+
value: v,
|
|
206
|
+
disabled: !o || B.busy,
|
|
198
207
|
onChange: (e) => {
|
|
199
|
-
|
|
208
|
+
y(e.target.value), T(0), D(0), R(""), I([]), k("correct"), P(null), B.resetFeedback();
|
|
200
209
|
},
|
|
201
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ u("option", {
|
|
202
211
|
value: "",
|
|
203
212
|
children: "New obligation / choose existing"
|
|
204
|
-
}), W.data?.mtwFreeTimeClockPage.items.map((e) => /* @__PURE__ */
|
|
213
|
+
}), W.data?.mtwFreeTimeClockPage.items.map((e) => /* @__PURE__ */ d("option", {
|
|
205
214
|
value: e.id,
|
|
206
215
|
children: [
|
|
207
216
|
e.chargeKind,
|
|
@@ -211,65 +220,65 @@ function y() {
|
|
|
211
220
|
}, e.id))]
|
|
212
221
|
})]
|
|
213
222
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ u(_, {
|
|
215
224
|
error: W.error,
|
|
216
225
|
loading: W.loading,
|
|
217
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ u(g, {
|
|
218
227
|
page: W.data?.mtwFreeTimeClockPage,
|
|
219
228
|
offset: ge,
|
|
220
229
|
busy: W.loading || B.busy,
|
|
221
230
|
setOffset: (e) => {
|
|
222
|
-
|
|
231
|
+
w(e), Z();
|
|
223
232
|
}
|
|
224
233
|
})
|
|
225
234
|
})
|
|
226
235
|
]
|
|
227
236
|
}),
|
|
228
|
-
|
|
237
|
+
v && /* @__PURE__ */ d("section", {
|
|
229
238
|
className: p,
|
|
230
239
|
"aria-label": "Recorded exposure",
|
|
231
240
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ u("h2", {
|
|
233
242
|
className: "text-lg font-semibold",
|
|
234
243
|
children: "Recorded exposure"
|
|
235
244
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ d("form", {
|
|
237
246
|
className: "flex flex-wrap items-end gap-3",
|
|
238
247
|
onSubmit: (e) => {
|
|
239
248
|
e.preventDefault();
|
|
240
249
|
try {
|
|
241
|
-
|
|
250
|
+
Se(s(M)), P(null);
|
|
242
251
|
} catch (e) {
|
|
243
252
|
P(e instanceof Error ? e.message : "Invalid evaluation time");
|
|
244
253
|
}
|
|
245
254
|
},
|
|
246
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ d("label", { children: ["Evaluate at time with timezone", /* @__PURE__ */ u(r, {
|
|
247
256
|
value: M,
|
|
248
|
-
onChange: (e) =>
|
|
257
|
+
onChange: (e) => be(e.target.value),
|
|
249
258
|
required: !0
|
|
250
|
-
})] }), /* @__PURE__ */
|
|
259
|
+
})] }), /* @__PURE__ */ u(n, {
|
|
251
260
|
type: "submit",
|
|
252
261
|
children: "Estimate exposure"
|
|
253
262
|
})]
|
|
254
263
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ u(_, {
|
|
256
265
|
error: J.error,
|
|
257
266
|
loading: J.loading,
|
|
258
|
-
children: Q && /* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
267
|
+
children: Q && /* @__PURE__ */ d(l, { children: [
|
|
268
|
+
/* @__PURE__ */ d("p", { children: [
|
|
260
269
|
"Evaluation agreement: ",
|
|
261
270
|
Q.agreementId ?? "Unknown",
|
|
262
271
|
".",
|
|
263
272
|
" ",
|
|
264
273
|
$ ? `${$.payer} → ${$.payee}. Source: ${$.sourceReference}. Timezone: ${$.terms?.timeZone ?? "Pricing terms unavailable"}.` : "See the matching history version for source and parties."
|
|
265
274
|
] }),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ u("p", { children: Q.status === "ESTIMATED" ? "Estimated under recorded terms" : `Cannot estimate: ${Q.reason ?? "Incomplete data"}` }),
|
|
276
|
+
/* @__PURE__ */ d("p", { children: [
|
|
268
277
|
"Exact deadline: ",
|
|
269
278
|
Q.freeUntil ?? "Unknown",
|
|
270
279
|
Q.localLastFreeDate ? `; local last-free date ${Q.localLastFreeDate}` : ""
|
|
271
280
|
] }),
|
|
272
|
-
Q.status === "ESTIMATED" && /* @__PURE__ */
|
|
281
|
+
Q.status === "ESTIMATED" && /* @__PURE__ */ d("p", { children: [
|
|
273
282
|
Q.chargedDays,
|
|
274
283
|
" charged dates;",
|
|
275
284
|
" ",
|
|
@@ -278,7 +287,7 @@ function y() {
|
|
|
278
287
|
Q.deadlineSource,
|
|
279
288
|
"."
|
|
280
289
|
] }),
|
|
281
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ u("p", {
|
|
282
291
|
className: "text-sm",
|
|
283
292
|
children: "The exact timestamp takes precedence over a date label. Recalculated using versions effective at evaluation time; this does not reconstruct what was known then. Prospective segmented tariffs are unsupported."
|
|
284
293
|
})
|
|
@@ -286,19 +295,19 @@ function y() {
|
|
|
286
295
|
})
|
|
287
296
|
]
|
|
288
297
|
}),
|
|
289
|
-
|
|
298
|
+
o && e.canUpdate && /* @__PURE__ */ d("section", {
|
|
290
299
|
className: p,
|
|
291
300
|
"aria-label": "Record contractual change",
|
|
292
301
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ u("h2", {
|
|
294
303
|
className: "text-lg font-semibold",
|
|
295
304
|
children: "Record contractual change"
|
|
296
305
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ d("label", {
|
|
298
307
|
className: "block",
|
|
299
|
-
children: ["Free-time action", /* @__PURE__ */
|
|
308
|
+
children: ["Free-time action", /* @__PURE__ */ d("select", {
|
|
300
309
|
className: m,
|
|
301
|
-
value:
|
|
310
|
+
value: O,
|
|
302
311
|
disabled: B.busy,
|
|
303
312
|
onChange: (e) => {
|
|
304
313
|
let t = [
|
|
@@ -307,24 +316,24 @@ function y() {
|
|
|
307
316
|
"request",
|
|
308
317
|
"decision"
|
|
309
318
|
].find((t) => t === e.target.value);
|
|
310
|
-
t && (
|
|
319
|
+
t && (k(t), B.resetFeedback(), R(""), I([]), P(null));
|
|
311
320
|
},
|
|
312
321
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ u("option", {
|
|
314
323
|
value: "open",
|
|
315
324
|
children: "Open a separate sourced obligation"
|
|
316
325
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ u("option", {
|
|
318
327
|
value: "correct",
|
|
319
328
|
disabled: !Y,
|
|
320
329
|
children: "Correct agreement / actual event binding"
|
|
321
330
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ u("option", {
|
|
323
332
|
value: "request",
|
|
324
333
|
disabled: !Y,
|
|
325
334
|
children: "Record extension request"
|
|
326
335
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ u("option", {
|
|
328
337
|
value: "decision",
|
|
329
338
|
disabled: !Y,
|
|
330
339
|
children: "Record external decision"
|
|
@@ -332,26 +341,26 @@ function y() {
|
|
|
332
341
|
]
|
|
333
342
|
})]
|
|
334
343
|
}),
|
|
335
|
-
(
|
|
336
|
-
|
|
344
|
+
(O === "open" || O === "correct") && /* @__PURE__ */ d(l, { children: [
|
|
345
|
+
O === "open" && /* @__PURE__ */ d("div", {
|
|
337
346
|
className: "grid gap-3 md:grid-cols-2",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ d("label", { children: ["Charge kind", /* @__PURE__ */ d("select", {
|
|
339
348
|
className: m,
|
|
340
|
-
value:
|
|
349
|
+
value: ve,
|
|
341
350
|
onChange: (e) => {
|
|
342
351
|
let t = [
|
|
343
352
|
"DEMURRAGE",
|
|
344
353
|
"DETENTION",
|
|
345
354
|
"TERMINAL_STORAGE"
|
|
346
355
|
].find((t) => t === e.target.value);
|
|
347
|
-
t &&
|
|
356
|
+
t && ye(t);
|
|
348
357
|
},
|
|
349
358
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ u("option", { children: "DEMURRAGE" }),
|
|
360
|
+
/* @__PURE__ */ u("option", { children: "DETENTION" }),
|
|
361
|
+
/* @__PURE__ */ u("option", { children: "TERMINAL_STORAGE" })
|
|
353
362
|
]
|
|
354
|
-
})] }), /* @__PURE__ */
|
|
363
|
+
})] }), /* @__PURE__ */ d("label", { children: ["Commercial obligation reference", /* @__PURE__ */ u(r, {
|
|
355
364
|
required: !0,
|
|
356
365
|
maxLength: 255,
|
|
357
366
|
value: A,
|
|
@@ -359,70 +368,72 @@ function y() {
|
|
|
359
368
|
placeholder: "Payee / terminal / booking / segment"
|
|
360
369
|
})] })]
|
|
361
370
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ u(_, {
|
|
363
372
|
error: U.error,
|
|
364
373
|
loading: U.loading,
|
|
365
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ u(g, {
|
|
366
375
|
page: U.data?.mtwContainerEventPage,
|
|
367
|
-
offset:
|
|
368
|
-
setOffset:
|
|
376
|
+
offset: S,
|
|
377
|
+
setOffset: C,
|
|
369
378
|
busy: U.loading || B.busy
|
|
370
379
|
})
|
|
371
380
|
}),
|
|
372
|
-
(
|
|
381
|
+
(O === "open" || X) && /* @__PURE__ */ u(ne, {
|
|
373
382
|
events: U.data?.mtwContainerEventPage.items ?? [],
|
|
374
|
-
initial:
|
|
375
|
-
busy: B.busy || U.loading ||
|
|
376
|
-
onSubmit: async (
|
|
377
|
-
if (
|
|
383
|
+
initial: O === "correct" ? X : void 0,
|
|
384
|
+
busy: B.busy || U.loading || O === "correct" && K.loading,
|
|
385
|
+
onSubmit: async (t) => {
|
|
386
|
+
if (!e.allows("update")) throw Error("Shipment update permission is required.");
|
|
387
|
+
if (O === "open") {
|
|
378
388
|
if (!A.trim()) throw Error("Enter a distinct commercial obligation reference.");
|
|
379
|
-
await B.run(
|
|
380
|
-
cycleId:
|
|
381
|
-
chargeKind:
|
|
389
|
+
await B.run(de, {
|
|
390
|
+
cycleId: o,
|
|
391
|
+
chargeKind: ve,
|
|
382
392
|
obligationReference: A,
|
|
383
|
-
agreement:
|
|
393
|
+
agreement: t
|
|
384
394
|
}, "Sourced clock opened.");
|
|
385
395
|
} else {
|
|
386
396
|
if (!Y || !X) throw Error("Reload the current obligation before correcting it.");
|
|
387
|
-
await B.run(
|
|
388
|
-
clockId:
|
|
397
|
+
await B.run(fe, {
|
|
398
|
+
clockId: v,
|
|
389
399
|
expectedVersion: Y.version,
|
|
390
|
-
agreement:
|
|
400
|
+
agreement: t
|
|
391
401
|
}, "New immutable agreement version recorded.");
|
|
392
402
|
}
|
|
393
403
|
}
|
|
394
|
-
}, `${
|
|
404
|
+
}, `${O}:${o}:${v}:${X?.id}`)
|
|
395
405
|
] }),
|
|
396
|
-
(
|
|
406
|
+
(O === "request" || O === "decision") && /* @__PURE__ */ d("form", {
|
|
397
407
|
className: "space-y-4",
|
|
398
|
-
onSubmit: async (
|
|
399
|
-
|
|
408
|
+
onSubmit: async (t) => {
|
|
409
|
+
t.preventDefault(), P(null);
|
|
400
410
|
try {
|
|
411
|
+
if (!e.allows("update")) throw Error("Shipment update permission is required.");
|
|
401
412
|
if (!Y || !X) throw Error("Reload the current obligation and agreement.");
|
|
402
|
-
let
|
|
403
|
-
if (
|
|
404
|
-
clockId:
|
|
413
|
+
let n = new FormData(t.currentTarget), r = (e) => String(n.get(e) ?? "").trim();
|
|
414
|
+
if (O === "request") await B.run(pe, {
|
|
415
|
+
clockId: v,
|
|
405
416
|
expectedVersion: Y.version,
|
|
406
417
|
baseAgreementId: X.id,
|
|
407
|
-
requestedFreeUntil: s(
|
|
408
|
-
requestedAt: s(
|
|
409
|
-
expiresAt: s(
|
|
410
|
-
reason:
|
|
411
|
-
evidence:
|
|
418
|
+
requestedFreeUntil: s(r("requestedDeadline")),
|
|
419
|
+
requestedAt: s(r("requestedAt")),
|
|
420
|
+
expiresAt: s(r("expiresAt")),
|
|
421
|
+
reason: r("reason"),
|
|
422
|
+
evidence: Te()
|
|
412
423
|
}, "Request recorded; current terms remain unchanged.");
|
|
413
424
|
else {
|
|
414
|
-
if (!
|
|
415
|
-
await B.run(
|
|
425
|
+
if (!we.some((e) => e.id === L)) throw Error("Choose an unanswered request.");
|
|
426
|
+
await B.run(re, {
|
|
416
427
|
extensionId: L,
|
|
417
428
|
expectedVersion: Y.version,
|
|
418
429
|
decision: z,
|
|
419
|
-
decidedAt: s(
|
|
420
|
-
effectiveAt: z === "ACCEPTED" ? s(
|
|
421
|
-
acceptedFreeUntil: z === "ACCEPTED" ? s(
|
|
422
|
-
counterparty:
|
|
423
|
-
sourceReference:
|
|
424
|
-
note:
|
|
425
|
-
evidence:
|
|
430
|
+
decidedAt: s(r("decidedAt")),
|
|
431
|
+
effectiveAt: z === "ACCEPTED" ? s(r("effectiveAt")) : null,
|
|
432
|
+
acceptedFreeUntil: z === "ACCEPTED" ? s(r("acceptedDeadline")) : null,
|
|
433
|
+
counterparty: r("counterparty"),
|
|
434
|
+
sourceReference: r("confirmation"),
|
|
435
|
+
note: r("note"),
|
|
436
|
+
evidence: Te()
|
|
426
437
|
}, "External decision recorded with immutable history.");
|
|
427
438
|
}
|
|
428
439
|
} catch (e) {
|
|
@@ -430,33 +441,33 @@ function y() {
|
|
|
430
441
|
}
|
|
431
442
|
},
|
|
432
443
|
children: [
|
|
433
|
-
|
|
444
|
+
O === "request" ? /* @__PURE__ */ d("div", {
|
|
434
445
|
className: "grid gap-3 md:grid-cols-2",
|
|
435
446
|
children: [[
|
|
436
447
|
["requestedDeadline", "Requested deadline with timezone"],
|
|
437
448
|
["requestedAt", "Actual request time with timezone"],
|
|
438
449
|
["expiresAt", "Request expiry with timezone"]
|
|
439
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
450
|
+
].map(([e, t]) => /* @__PURE__ */ d("label", { children: [t, /* @__PURE__ */ u(r, {
|
|
440
451
|
name: e,
|
|
441
452
|
required: !0,
|
|
442
453
|
placeholder: "2026-10-04T09:00:00+05:30"
|
|
443
|
-
})] }, e)), /* @__PURE__ */
|
|
454
|
+
})] }, e)), /* @__PURE__ */ d("label", { children: ["Request reason", /* @__PURE__ */ u(r, {
|
|
444
455
|
name: "reason",
|
|
445
456
|
required: !0,
|
|
446
457
|
maxLength: 2e3
|
|
447
458
|
})] })]
|
|
448
|
-
}) : /* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
459
|
+
}) : /* @__PURE__ */ d(l, { children: [
|
|
460
|
+
/* @__PURE__ */ d("label", {
|
|
450
461
|
className: "block",
|
|
451
|
-
children: ["Unanswered extension request", /* @__PURE__ */
|
|
462
|
+
children: ["Unanswered extension request", /* @__PURE__ */ d("select", {
|
|
452
463
|
className: m,
|
|
453
464
|
required: !0,
|
|
454
465
|
value: L,
|
|
455
466
|
onChange: (e) => R(e.target.value),
|
|
456
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ u("option", {
|
|
457
468
|
value: "",
|
|
458
469
|
children: "Choose request from this page"
|
|
459
|
-
}),
|
|
470
|
+
}), we.map((e) => /* @__PURE__ */ d("option", {
|
|
460
471
|
value: e.id,
|
|
461
472
|
children: [
|
|
462
473
|
e.requestedFreeUntil,
|
|
@@ -469,9 +480,9 @@ function y() {
|
|
|
469
480
|
}, e.id))]
|
|
470
481
|
})]
|
|
471
482
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ d("label", {
|
|
473
484
|
className: "block",
|
|
474
|
-
children: ["Recorded decision", /* @__PURE__ */
|
|
485
|
+
children: ["Recorded decision", /* @__PURE__ */ d("select", {
|
|
475
486
|
className: m,
|
|
476
487
|
value: z,
|
|
477
488
|
onChange: (e) => {
|
|
@@ -480,77 +491,77 @@ function y() {
|
|
|
480
491
|
"REJECTED",
|
|
481
492
|
"EXPIRED"
|
|
482
493
|
].find((t) => t === e.target.value);
|
|
483
|
-
t &&
|
|
494
|
+
t && Ce(t);
|
|
484
495
|
},
|
|
485
496
|
children: [
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ u("option", { children: "ACCEPTED" }),
|
|
498
|
+
/* @__PURE__ */ u("option", { children: "REJECTED" }),
|
|
499
|
+
/* @__PURE__ */ u("option", { children: "EXPIRED" })
|
|
489
500
|
]
|
|
490
501
|
})]
|
|
491
502
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ d("div", {
|
|
493
504
|
className: "grid gap-3 md:grid-cols-2",
|
|
494
505
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ d("label", { children: ["Actual decision time with timezone", /* @__PURE__ */ u(r, {
|
|
496
507
|
name: "decidedAt",
|
|
497
508
|
required: !0
|
|
498
509
|
})] }),
|
|
499
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ d("label", { children: ["Counterparty / expiry authority", /* @__PURE__ */ u(r, {
|
|
500
511
|
name: "counterparty",
|
|
501
512
|
required: !0,
|
|
502
513
|
maxLength: 255
|
|
503
514
|
})] }),
|
|
504
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ d("label", { children: ["External confirmation source reference", /* @__PURE__ */ u(r, {
|
|
505
516
|
name: "confirmation",
|
|
506
517
|
required: !0,
|
|
507
518
|
maxLength: 255
|
|
508
519
|
})] }),
|
|
509
|
-
z === "ACCEPTED" && /* @__PURE__ */
|
|
520
|
+
z === "ACCEPTED" && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("label", { children: ["Externally accepted deadline with timezone", /* @__PURE__ */ u(r, {
|
|
510
521
|
name: "acceptedDeadline",
|
|
511
522
|
required: !0
|
|
512
|
-
})] }), /* @__PURE__ */
|
|
523
|
+
})] }), /* @__PURE__ */ d("label", { children: ["Explicit effective time with timezone", /* @__PURE__ */ u(r, {
|
|
513
524
|
name: "effectiveAt",
|
|
514
525
|
required: !0
|
|
515
526
|
})] })] }),
|
|
516
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ d("label", { children: ["Decision note and applicability", /* @__PURE__ */ u(r, {
|
|
517
528
|
name: "note",
|
|
518
529
|
required: !0,
|
|
519
530
|
maxLength: 2e3
|
|
520
531
|
})] })
|
|
521
532
|
]
|
|
522
533
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ u("p", {
|
|
524
535
|
className: "text-sm",
|
|
525
536
|
children: "Requested and accepted deadlines can differ. Accepted extensions must move a known current cutoff later. Late decisions or a superseded base agreement require explicit reconciliation. Expiry never reverses an accepted agreement."
|
|
526
537
|
})
|
|
527
538
|
] }),
|
|
528
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ u(te, {
|
|
529
540
|
description: "Choose exact source versions. Integrity does not independently establish contractual terms or counterparty acceptance.",
|
|
530
541
|
value: F,
|
|
531
542
|
onChange: I
|
|
532
543
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ u(n, {
|
|
534
545
|
type: "submit",
|
|
535
546
|
disabled: B.busy || K.loading || !Y || !X,
|
|
536
|
-
children:
|
|
547
|
+
children: O === "request" ? "Record extension request" : "Record counterparty decision"
|
|
537
548
|
})
|
|
538
549
|
]
|
|
539
550
|
}),
|
|
540
|
-
(N || B.error) && /* @__PURE__ */
|
|
551
|
+
(N || B.error) && /* @__PURE__ */ u("p", {
|
|
541
552
|
role: "alert",
|
|
542
553
|
children: N ?? B.error
|
|
543
554
|
}),
|
|
544
|
-
B.notice && /* @__PURE__ */
|
|
555
|
+
B.notice && /* @__PURE__ */ u("p", {
|
|
545
556
|
role: "status",
|
|
546
557
|
children: B.notice
|
|
547
558
|
}),
|
|
548
|
-
B.hasPendingAttempt && /* @__PURE__ */
|
|
559
|
+
B.hasPendingAttempt && /* @__PURE__ */ d("div", {
|
|
549
560
|
className: "space-y-2",
|
|
550
|
-
children: [/* @__PURE__ */
|
|
561
|
+
children: [/* @__PURE__ */ u("p", {
|
|
551
562
|
className: "text-sm",
|
|
552
563
|
children: "A failed response may still mean the record was saved. Check history before discarding or repeating the action, especially after reopening this page."
|
|
553
|
-
}), /* @__PURE__ */
|
|
564
|
+
}), /* @__PURE__ */ u(n, {
|
|
554
565
|
type: "button",
|
|
555
566
|
variant: "outline",
|
|
556
567
|
disabled: B.busy,
|
|
@@ -560,19 +571,19 @@ function y() {
|
|
|
560
571
|
})
|
|
561
572
|
]
|
|
562
573
|
}),
|
|
563
|
-
|
|
574
|
+
v && /* @__PURE__ */ d("div", {
|
|
564
575
|
className: "grid gap-6 xl:grid-cols-2",
|
|
565
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ d("section", {
|
|
566
577
|
className: p,
|
|
567
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
568
579
|
className: "text-lg font-semibold",
|
|
569
580
|
children: "Agreement history"
|
|
570
|
-
}), /* @__PURE__ */
|
|
581
|
+
}), /* @__PURE__ */ d(_, {
|
|
571
582
|
error: G.error,
|
|
572
583
|
loading: G.loading,
|
|
573
|
-
children: [/* @__PURE__ */
|
|
584
|
+
children: [/* @__PURE__ */ u("ul", {
|
|
574
585
|
className: "space-y-3",
|
|
575
|
-
children: G.data?.mtwFreeTimeAgreementPage.items.map((e) => /* @__PURE__ */
|
|
586
|
+
children: G.data?.mtwFreeTimeAgreementPage.items.map((e) => /* @__PURE__ */ d("li", {
|
|
576
587
|
className: "break-words rounded-lg border p-3 text-sm",
|
|
577
588
|
children: [
|
|
578
589
|
"Version ",
|
|
@@ -596,7 +607,7 @@ function y() {
|
|
|
596
607
|
". Reason ",
|
|
597
608
|
e.changeReason,
|
|
598
609
|
".",
|
|
599
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ u("ul", { children: e.evidence.map((e) => /* @__PURE__ */ d("li", {
|
|
600
611
|
className: "break-all",
|
|
601
612
|
children: [
|
|
602
613
|
"Evidence version ",
|
|
@@ -607,24 +618,24 @@ function y() {
|
|
|
607
618
|
}, e.versionId)) })
|
|
608
619
|
]
|
|
609
620
|
}, e.id))
|
|
610
|
-
}), /* @__PURE__ */
|
|
621
|
+
}), /* @__PURE__ */ u(g, {
|
|
611
622
|
page: G.data?.mtwFreeTimeAgreementPage,
|
|
612
623
|
offset: _e,
|
|
613
|
-
setOffset:
|
|
624
|
+
setOffset: T,
|
|
614
625
|
busy: G.loading || B.busy
|
|
615
626
|
})]
|
|
616
627
|
})]
|
|
617
|
-
}), /* @__PURE__ */
|
|
628
|
+
}), /* @__PURE__ */ d("section", {
|
|
618
629
|
className: p,
|
|
619
|
-
children: [/* @__PURE__ */
|
|
630
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
620
631
|
className: "text-lg font-semibold",
|
|
621
632
|
children: "Extension decisions"
|
|
622
|
-
}), /* @__PURE__ */
|
|
633
|
+
}), /* @__PURE__ */ d(_, {
|
|
623
634
|
error: q.error,
|
|
624
635
|
loading: q.loading,
|
|
625
|
-
children: [/* @__PURE__ */
|
|
636
|
+
children: [/* @__PURE__ */ u("ul", {
|
|
626
637
|
className: "space-y-3",
|
|
627
|
-
children: q.data?.mtwFreeTimeExtensionPage.items.map((e) => /* @__PURE__ */
|
|
638
|
+
children: q.data?.mtwFreeTimeExtensionPage.items.map((e) => /* @__PURE__ */ d("li", {
|
|
628
639
|
className: "break-words rounded-lg border p-3 text-sm",
|
|
629
640
|
children: [
|
|
630
641
|
"Requested ",
|
|
@@ -639,18 +650,21 @@ function y() {
|
|
|
639
650
|
e.decision ? `${e.decision.decision}: ${e.decision.acceptedFreeUntil ?? "Terms unchanged"}; ${e.decision.counterparty}; ${e.decision.sourceReference}; ${e.decision.note}` : "REQUESTED — no terminal decision recorded."
|
|
640
651
|
]
|
|
641
652
|
}, e.id))
|
|
642
|
-
}), /* @__PURE__ */
|
|
653
|
+
}), /* @__PURE__ */ u(g, {
|
|
643
654
|
page: q.data?.mtwFreeTimeExtensionPage,
|
|
644
|
-
offset:
|
|
655
|
+
offset: E,
|
|
645
656
|
busy: q.loading || B.busy,
|
|
646
657
|
setOffset: (e) => {
|
|
647
|
-
|
|
658
|
+
D(e), R("");
|
|
648
659
|
}
|
|
649
660
|
})]
|
|
650
661
|
})]
|
|
651
662
|
})]
|
|
652
663
|
})
|
|
653
664
|
]
|
|
665
|
+
}) : /* @__PURE__ */ u("p", {
|
|
666
|
+
role: e.failed ? "alert" : "status",
|
|
667
|
+
children: e.loading ? "Checking shipment permissions…" : e.failed ? "Shipment permissions are unavailable. Reload to retry." : "Shipment read permission is required."
|
|
654
668
|
});
|
|
655
669
|
}
|
|
656
670
|
//#endregion
|