@argusoft/medplat-product-management 1.0.1 → 1.0.2

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.
@@ -0,0 +1,426 @@
1
+ import { F as e, L as t, R as n, et as r, i, n as a, o, r as s } from "./currency-ClRLIEg2.js";
2
+ import { r as c } from "./PmTable-B9970kPY.js";
3
+ import { t as l } from "./format-UOyOu75i.js";
4
+ import { useMemo as u, useState as d } from "react";
5
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import { v4 as m } from "uuid";
7
+ import { Alert as h, Autocomplete as g, Box as _, Button as v, Card as y, CardContent as b, Chip as x, FormControl as ee, FormHelperText as te, Grid as S, InputLabel as ne, MenuItem as C, Select as re, Stack as w, TextField as T, Typography as E } from "@mui/material";
8
+ import { showToast as ie } from "@/common/toaster/toaster";
9
+ import { useNavigate as ae } from "react-router-dom";
10
+ import D from "@mui/icons-material/SaveRounded";
11
+ //#region src/views/PickupCreatePage.jsx
12
+ function O(e) {
13
+ return !(e.ownerType !== "FACILITY" || Number(e.qtyRemaining ?? 0) <= 0 || e.status === "EXPIRED" || e.status === "EXHAUSTED" || e.status === "QUARANTINED");
14
+ }
15
+ function k() {
16
+ let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
17
+ return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
18
+ }
19
+ function A() {
20
+ let A = ae(), [j, M] = d([]), [N, P] = d([]), [F, I] = d([]), [oe, se] = d(!0), [L, R] = d(!1), [z, B] = d(""), [V, H] = d({
21
+ id: m(),
22
+ personalBatchId: m(),
23
+ facilityId: "",
24
+ sourceBatchId: "",
25
+ pickedQty: 1,
26
+ notes: "",
27
+ sessionName: "",
28
+ sessionDescription: "",
29
+ sessionStartTime: k(),
30
+ sessionExpectedEndTime: "",
31
+ sessionSite: ""
32
+ });
33
+ i("update.manage.productManagement.pickup", () => {
34
+ async function r() {
35
+ try {
36
+ let [r, i, a] = await Promise.all([
37
+ t(),
38
+ e(),
39
+ n().catch(() => [])
40
+ ]);
41
+ M(r), P(i), I(a);
42
+ } catch (e) {
43
+ B(e?.response?.data?.message ?? e?.message ?? "Failed to load reference data");
44
+ } finally {
45
+ se(!1);
46
+ }
47
+ }
48
+ r();
49
+ }, []);
50
+ let U = F.length > 0, W = u(() => V.facilityId ? N.filter(O).filter((e) => e.ownerId === V.facilityId) : [], [N, V.facilityId]), G = u(() => N.find((e) => e.id === V.sourceBatchId) ?? null, [N, V.sourceBatchId]);
51
+ function K(e, t) {
52
+ H((n) => ({
53
+ ...n,
54
+ [e]: t
55
+ }));
56
+ }
57
+ function ce(e) {
58
+ H((t) => ({
59
+ ...t,
60
+ facilityId: e,
61
+ sourceBatchId: ""
62
+ }));
63
+ }
64
+ let q = Number(V.pickedQty), J = Number(G?.qtyRemaining ?? 0), Y = G ? !Number.isInteger(q) || q <= 0 ? "Enter a whole number greater than 0." : q > J ? `Only ${J} available in this batch.` : "" : "", X = V.sessionName.trim() ? "" : "Session name is required.", le = V.sessionStartTime ? new Date(V.sessionStartTime).getTime() : NaN, Z = V.sessionStartTime ? le < Date.now() - 300 * 1e3 ? "Start time cannot be in the past." : "" : "Start time is required.", Q = V.sessionExpectedEndTime ? V.sessionStartTime && V.sessionExpectedEndTime <= V.sessionStartTime ? "Expected end must be after the start time." : "" : "Expected end time is required.", $ = !!V.facilityId && !!V.sourceBatchId && !Y && !U && !X && !Z && !Q;
65
+ async function ue() {
66
+ if ($) {
67
+ R(!0), B("");
68
+ try {
69
+ let e = await r({
70
+ id: V.id,
71
+ personalBatchId: V.personalBatchId,
72
+ sourceBatchId: V.sourceBatchId,
73
+ pickedQty: q,
74
+ notes: V.notes || null,
75
+ sessionName: V.sessionName.trim(),
76
+ sessionDescription: V.sessionDescription.trim() || null,
77
+ sessionStartTime: V.sessionStartTime ? new Date(V.sessionStartTime).toISOString() : null,
78
+ sessionExpectedEndTime: V.sessionExpectedEndTime ? new Date(V.sessionExpectedEndTime).toISOString() : null,
79
+ sessionSite: V.sessionSite.trim() || null
80
+ });
81
+ ie({
82
+ message: `Picked up ${e.pickedQty} unit${e.pickedQty === 1 ? "" : "s"}.`,
83
+ type: "success"
84
+ }), A("/ui/medplat/manage/pm/pickups");
85
+ } catch (e) {
86
+ B(e?.response?.data?.message ?? e?.message ?? "Failed to record pickup");
87
+ } finally {
88
+ R(!1);
89
+ }
90
+ }
91
+ }
92
+ return /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(s, {}), /* @__PURE__ */ f(a, {
93
+ perm: "update.manage.productManagement.pickup",
94
+ title: "You don’t have permission to record pickups",
95
+ children: /* @__PURE__ */ p(o, {
96
+ title: "Record Pickup",
97
+ subtitle: "Check out stock from a facility for your field work. Record returns and wastage when you bring stock back.",
98
+ actions: /* @__PURE__ */ p(w, {
99
+ direction: "row",
100
+ spacing: 1,
101
+ children: [/* @__PURE__ */ f(v, {
102
+ variant: "outlined",
103
+ onClick: () => A("/ui/medplat/manage/pm/pickups"),
104
+ children: "Cancel"
105
+ }), /* @__PURE__ */ f(v, {
106
+ variant: "contained",
107
+ startIcon: /* @__PURE__ */ f(D, {}),
108
+ disabled: !$ || L,
109
+ onClick: () => void ue(),
110
+ children: L ? "Recording…" : "Record Pickup"
111
+ })]
112
+ }),
113
+ children: [
114
+ z ? /* @__PURE__ */ f(h, {
115
+ severity: "error",
116
+ sx: { mb: 2 },
117
+ children: z
118
+ }) : null,
119
+ U ? /* @__PURE__ */ p(h, {
120
+ severity: "warning",
121
+ sx: { mb: 2 },
122
+ action: /* @__PURE__ */ f(v, {
123
+ color: "inherit",
124
+ size: "small",
125
+ onClick: () => A("/ui/medplat/manage/pm/pickups"),
126
+ children: "Go to Pickups"
127
+ }),
128
+ children: [
129
+ "You already have ",
130
+ /* @__PURE__ */ f("strong", { children: F.length }),
131
+ " open outreach session",
132
+ F.length === 1 ? "" : "s",
133
+ ". End the active session",
134
+ F.length === 1 ? "" : "s",
135
+ " before starting a new pickup, or use ",
136
+ /* @__PURE__ */ f("strong", { children: "Top Up" }),
137
+ " on the Pickups page to add more stock to an active session."
138
+ ]
139
+ }) : null,
140
+ /* @__PURE__ */ f(y, {
141
+ sx: {
142
+ borderRadius: 4,
143
+ mb: 2,
144
+ border: "1px solid",
145
+ borderColor: "divider",
146
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
147
+ },
148
+ children: /* @__PURE__ */ p(b, {
149
+ sx: { p: 2.5 },
150
+ children: [/* @__PURE__ */ f(c, {
151
+ eyebrow: "Step 1",
152
+ title: "Source",
153
+ hint: "Select a facility and then the batch to pick up.",
154
+ sx: { mb: 2 }
155
+ }), /* @__PURE__ */ p(S, {
156
+ container: !0,
157
+ spacing: 2,
158
+ children: [/* @__PURE__ */ f(S, {
159
+ item: !0,
160
+ xs: 12,
161
+ md: 5,
162
+ children: /* @__PURE__ */ f(g, {
163
+ size: "small",
164
+ options: j,
165
+ getOptionLabel: (e) => e?.name ?? "",
166
+ isOptionEqualToValue: (e, t) => e?.id === t?.id,
167
+ value: j.find((e) => e.id === V.facilityId) ?? null,
168
+ onChange: (e, t) => ce(t?.id ?? ""),
169
+ loading: oe,
170
+ renderInput: (e) => /* @__PURE__ */ f(T, {
171
+ ...e,
172
+ required: !0,
173
+ label: "Source Facility",
174
+ placeholder: "Pick a facility you're assigned to"
175
+ })
176
+ })
177
+ }), /* @__PURE__ */ f(S, {
178
+ item: !0,
179
+ xs: 12,
180
+ md: 7,
181
+ children: /* @__PURE__ */ p(ee, {
182
+ required: !0,
183
+ fullWidth: !0,
184
+ size: "small",
185
+ disabled: !V.facilityId,
186
+ children: [
187
+ /* @__PURE__ */ f(ne, { children: "Source Batch" }),
188
+ /* @__PURE__ */ f(re, {
189
+ label: "Source Batch",
190
+ value: V.sourceBatchId,
191
+ onChange: (e) => K("sourceBatchId", e.target.value),
192
+ children: W.length === 0 ? /* @__PURE__ */ f(C, {
193
+ disabled: !0,
194
+ value: "",
195
+ children: /* @__PURE__ */ f("em", { children: "No pickable stock in this facility" })
196
+ }) : W.map((e) => /* @__PURE__ */ p(C, {
197
+ value: e.id,
198
+ children: [
199
+ /* @__PURE__ */ f(_, {
200
+ component: "span",
201
+ sx: {
202
+ fontWeight: 700,
203
+ mr: 1
204
+ },
205
+ children: e.productName
206
+ }),
207
+ /* @__PURE__ */ p(E, {
208
+ variant: "caption",
209
+ color: "text.secondary",
210
+ sx: { mr: 1 },
211
+ children: ["qty ", e.qtyRemaining]
212
+ }),
213
+ e.lotNumber ? /* @__PURE__ */ f(E, {
214
+ variant: "caption",
215
+ sx: {
216
+ fontFamily: "monospace",
217
+ mr: 1
218
+ },
219
+ children: e.lotNumber
220
+ }) : null,
221
+ e.expiryDate ? /* @__PURE__ */ p(E, {
222
+ variant: "caption",
223
+ color: "text.secondary",
224
+ children: ["exp ", l(e.expiryDate)]
225
+ }) : null
226
+ ]
227
+ }, e.id))
228
+ }),
229
+ /* @__PURE__ */ f(te, { children: V.facilityId ? W.length === 0 ? "This facility has no in-stock batches you can pick up right now." : "Active facility batches only — quarantined / expired / exhausted stock is hidden." : "Pick a facility first." })
230
+ ]
231
+ })
232
+ })]
233
+ })]
234
+ })
235
+ }),
236
+ /* @__PURE__ */ f(y, {
237
+ sx: {
238
+ borderRadius: 4,
239
+ mb: 2,
240
+ border: "1px solid",
241
+ borderColor: "divider",
242
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
243
+ },
244
+ children: /* @__PURE__ */ p(b, {
245
+ sx: { p: 2.5 },
246
+ children: [/* @__PURE__ */ f(c, {
247
+ eyebrow: "Session",
248
+ title: "Outreach session details",
249
+ hint: "Records the purpose, timing and location of this outreach session. Shown when administering from this stock.",
250
+ sx: { mb: 2 }
251
+ }), /* @__PURE__ */ p(S, {
252
+ container: !0,
253
+ spacing: 2,
254
+ children: [
255
+ /* @__PURE__ */ f(S, {
256
+ item: !0,
257
+ xs: 12,
258
+ md: 6,
259
+ children: /* @__PURE__ */ f(T, {
260
+ required: !0,
261
+ fullWidth: !0,
262
+ size: "small",
263
+ label: "Session name",
264
+ inputProps: { maxLength: 150 },
265
+ value: V.sessionName,
266
+ onChange: (e) => K("sessionName", e.target.value),
267
+ error: !!X && V.sessionName !== "",
268
+ helperText: V.sessionName === "" ? "e.g. Anganwadi camp – Ward 4" : X
269
+ })
270
+ }),
271
+ /* @__PURE__ */ f(S, {
272
+ item: !0,
273
+ xs: 12,
274
+ md: 6,
275
+ children: /* @__PURE__ */ f(T, {
276
+ fullWidth: !0,
277
+ size: "small",
278
+ label: "Session site (optional)",
279
+ placeholder: "Location / site reference",
280
+ inputProps: { maxLength: 200 },
281
+ value: V.sessionSite,
282
+ onChange: (e) => K("sessionSite", e.target.value)
283
+ })
284
+ }),
285
+ /* @__PURE__ */ f(S, {
286
+ item: !0,
287
+ xs: 12,
288
+ md: 6,
289
+ children: /* @__PURE__ */ f(T, {
290
+ required: !0,
291
+ fullWidth: !0,
292
+ size: "small",
293
+ type: "datetime-local",
294
+ label: "Start time",
295
+ InputLabelProps: { shrink: !0 },
296
+ inputProps: { min: k() },
297
+ value: V.sessionStartTime,
298
+ onChange: (e) => K("sessionStartTime", e.target.value),
299
+ error: !!Z,
300
+ helperText: Z || "Cannot be in the past. (5 minutes buffer allowed)"
301
+ })
302
+ }),
303
+ /* @__PURE__ */ f(S, {
304
+ item: !0,
305
+ xs: 12,
306
+ md: 6,
307
+ children: /* @__PURE__ */ f(T, {
308
+ required: !0,
309
+ fullWidth: !0,
310
+ size: "small",
311
+ type: "datetime-local",
312
+ label: "Expected end",
313
+ InputLabelProps: { shrink: !0 },
314
+ inputProps: { min: V.sessionStartTime || void 0 },
315
+ value: V.sessionExpectedEndTime,
316
+ onChange: (e) => K("sessionExpectedEndTime", e.target.value),
317
+ error: !!Q,
318
+ helperText: Q || "When the session is expected to end."
319
+ })
320
+ }),
321
+ /* @__PURE__ */ f(S, {
322
+ item: !0,
323
+ xs: 12,
324
+ children: /* @__PURE__ */ f(T, {
325
+ fullWidth: !0,
326
+ size: "small",
327
+ multiline: !0,
328
+ minRows: 2,
329
+ label: "Purpose / description (optional)",
330
+ value: V.sessionDescription,
331
+ onChange: (e) => K("sessionDescription", e.target.value)
332
+ })
333
+ })
334
+ ]
335
+ })]
336
+ })
337
+ }),
338
+ G ? /* @__PURE__ */ f(y, {
339
+ sx: {
340
+ borderRadius: 4,
341
+ mb: 2,
342
+ border: "1px solid",
343
+ borderColor: "divider",
344
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
345
+ },
346
+ children: /* @__PURE__ */ p(b, {
347
+ sx: { p: 2.5 },
348
+ children: [
349
+ /* @__PURE__ */ f(c, {
350
+ eyebrow: "Step 2",
351
+ title: "Quantity",
352
+ hint: `Available: ${J}. You can pick up to this amount.`,
353
+ sx: { mb: 2 }
354
+ }),
355
+ /* @__PURE__ */ p(S, {
356
+ container: !0,
357
+ spacing: 2,
358
+ children: [/* @__PURE__ */ f(S, {
359
+ item: !0,
360
+ xs: 12,
361
+ md: 4,
362
+ children: /* @__PURE__ */ f(T, {
363
+ required: !0,
364
+ fullWidth: !0,
365
+ size: "small",
366
+ type: "number",
367
+ label: "Pick Quantity",
368
+ inputProps: {
369
+ min: 1,
370
+ max: J
371
+ },
372
+ value: V.pickedQty,
373
+ onChange: (e) => K("pickedQty", e.target.value),
374
+ error: !!Y,
375
+ helperText: Y || `Out of ${J} available`
376
+ })
377
+ }), /* @__PURE__ */ f(S, {
378
+ item: !0,
379
+ xs: 12,
380
+ md: 8,
381
+ children: /* @__PURE__ */ f(T, {
382
+ fullWidth: !0,
383
+ size: "small",
384
+ label: "Notes (optional)",
385
+ placeholder: "Anything worth recording about this pickup",
386
+ value: V.notes,
387
+ onChange: (e) => K("notes", e.target.value)
388
+ })
389
+ })]
390
+ }),
391
+ /* @__PURE__ */ p(w, {
392
+ direction: "row",
393
+ spacing: 1,
394
+ sx: { mt: 2 },
395
+ flexWrap: "wrap",
396
+ useFlexGap: !0,
397
+ children: [
398
+ /* @__PURE__ */ f(x, {
399
+ size: "small",
400
+ label: `Product · ${G.productName}`
401
+ }),
402
+ G.lotNumber ? /* @__PURE__ */ f(x, {
403
+ size: "small",
404
+ label: `Lot · ${G.lotNumber}`
405
+ }) : null,
406
+ G.expiryDate ? /* @__PURE__ */ f(x, {
407
+ size: "small",
408
+ label: `Expiry · ${l(G.expiryDate)}`
409
+ }) : null,
410
+ G.storageUnitName ? /* @__PURE__ */ f(x, {
411
+ size: "small",
412
+ label: `From · ${G.storageUnitName}`
413
+ }) : null
414
+ ]
415
+ })
416
+ ]
417
+ })
418
+ }) : null
419
+ ]
420
+ })
421
+ })] });
422
+ }
423
+ //#endregion
424
+ export { A as default };
425
+
426
+ //# sourceMappingURL=PickupCreatePage-CMGwoAXj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickupCreatePage-CMGwoAXj.js","names":[],"sources":["../src/views/PickupCreatePage.jsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { v4 as uuidv4 } from 'uuid';\nimport {\n Alert,\n Autocomplete,\n Box,\n Button,\n Card,\n CardContent,\n Chip,\n FormControl,\n FormHelperText,\n Grid,\n InputLabel,\n MenuItem,\n Select,\n Stack,\n TextField,\n Typography,\n} from '@mui/material';\nimport SaveRoundedIcon from '@mui/icons-material/SaveRounded';\nimport { showToast } from '@/common/toaster/toaster';\nimport PmPageShell from '@pm/components/PmPageShell';\nimport PmNav from '@pm/components/PmNav';\nimport PmGuard from '@pm/components/PmGuard';\nimport { usePermissionedEffect } from '@pm/utils/permissions';\nimport { PmFormSection } from '@pm/components/PmTable';\nimport {\n listBatches,\n listFacilities,\n listMyOpenPickups,\n recordPickup,\n} from '@pm/services/pmApi';\nimport { formatDate } from '@pm/utils/format';\n\n// Only facility-owned, in-stock, non-quarantined, non-terminal batches are\n// candidates for pickup. The backend enforces the same rules; filtering here\n// keeps the dropdown free of unactionable rows.\nfunction isPickable(batch) {\n if (batch.ownerType !== 'FACILITY') return false;\n if (Number(batch.qtyRemaining ?? 0) <= 0) return false;\n if (batch.status === 'EXPIRED' || batch.status === 'EXHAUSTED' || batch.status === 'QUARANTINED') return false;\n return true;\n}\n\n// Current local time as a value for <input type=\"datetime-local\"> (YYYY-MM-DDTHH:mm).\nfunction nowLocalInput() {\n const d = new Date();\n const pad = (n) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n}\n\nexport default function PickupCreatePage() {\n const navigate = useNavigate();\n const [facilities, setFacilities] = useState([]);\n const [batches, setBatches] = useState([]);\n // OPEN pickups already on this user — one-session-per-user rule means\n // any open session blocks a new pickup. The user has to end the session\n // or top it up instead.\n const [openSessions, setOpenSessions] = useState([]);\n const [loading, setLoading] = useState(true);\n const [submitting, setSubmitting] = useState(false);\n const [error, setError] = useState('');\n const [form, setForm] = useState({\n id: uuidv4(),\n personalBatchId: uuidv4(),\n facilityId: '',\n sourceBatchId: '',\n pickedQty: 1,\n notes: '',\n // Outreach session metadata.\n sessionName: '',\n sessionDescription: '',\n sessionStartTime: nowLocalInput(),\n sessionExpectedEndTime: '',\n sessionSite: '',\n });\n\n usePermissionedEffect('update.manage.productManagement.pickup', () => {\n async function load() {\n try {\n const [f, b, open] = await Promise.all([\n listFacilities(),\n listBatches(),\n listMyOpenPickups().catch(() => []),\n ]);\n setFacilities(f);\n setBatches(b);\n setOpenSessions(open);\n } catch (err) {\n setError(err?.response?.data?.message ?? err?.message ?? 'Failed to load reference data');\n } finally {\n setLoading(false);\n }\n }\n void load();\n }, []);\n\n const hasOpenSession = openSessions.length > 0;\n\n // Batches limited to the picked facility (when one is selected). Reset\n // when the facility changes so the user can't carry over a stale batch.\n const eligibleBatches = useMemo(() => {\n if (!form.facilityId) return [];\n return batches.filter(isPickable).filter((b) => b.ownerId === form.facilityId);\n }, [batches, form.facilityId]);\n\n const selectedBatch = useMemo(\n () => batches.find((b) => b.id === form.sourceBatchId) ?? null,\n [batches, form.sourceBatchId],\n );\n\n function patch(k, v) {\n setForm((f) => ({ ...f, [k]: v }));\n }\n\n function patchFacility(id) {\n setForm((f) => ({ ...f, facilityId: id, sourceBatchId: '' }));\n }\n\n const qty = Number(form.pickedQty);\n const remaining = Number(selectedBatch?.qtyRemaining ?? 0);\n const qtyError = !selectedBatch\n ? ''\n : !Number.isInteger(qty) || qty <= 0\n ? 'Enter a whole number greater than 0.'\n : qty > remaining\n ? `Only ${remaining} available in this batch.`\n : '';\n const sessionNameError = form.sessionName.trim() ? '' : 'Session name is required.';\n // Start time can't be in the past. A small grace (5 min) tolerates the lag\n // between the prefilled \"now\" and submission; the backend re-checks against\n // server time so a tampered client clock can't bypass it.\n const startMs = form.sessionStartTime ? new Date(form.sessionStartTime).getTime() : NaN;\n const sessionStartError = !form.sessionStartTime\n ? 'Start time is required.'\n : startMs < Date.now() - 5 * 60 * 1000\n ? 'Start time cannot be in the past.'\n : '';\n // End time is required and must be after the start.\n const sessionEndError = !form.sessionExpectedEndTime\n ? 'Expected end time is required.'\n : (form.sessionStartTime && form.sessionExpectedEndTime <= form.sessionStartTime)\n ? 'Expected end must be after the start time.'\n : '';\n const formIsValid = !!form.facilityId && !!form.sourceBatchId && !qtyError && !hasOpenSession\n && !sessionNameError && !sessionStartError && !sessionEndError;\n\n async function save() {\n if (!formIsValid) return;\n setSubmitting(true);\n setError('');\n try {\n const created = await recordPickup({\n id: form.id,\n personalBatchId: form.personalBatchId,\n sourceBatchId: form.sourceBatchId,\n pickedQty: qty,\n notes: form.notes || null,\n sessionName: form.sessionName.trim(),\n sessionDescription: form.sessionDescription.trim() || null,\n sessionStartTime: form.sessionStartTime ? new Date(form.sessionStartTime).toISOString() : null,\n sessionExpectedEndTime: form.sessionExpectedEndTime ? new Date(form.sessionExpectedEndTime).toISOString() : null,\n sessionSite: form.sessionSite.trim() || null,\n });\n showToast({ message: `Picked up ${created.pickedQty} unit${created.pickedQty === 1 ? '' : 's'}.`, type: 'success' });\n navigate('/ui/medplat/manage/pm/pickups');\n } catch (err) {\n setError(err?.response?.data?.message ?? err?.message ?? 'Failed to record pickup');\n } finally {\n setSubmitting(false);\n }\n }\n\n return (\n <Box>\n <PmNav />\n <PmGuard perm={'update.manage.productManagement.pickup'} title=\"You don’t have permission to record pickups\">\n <PmPageShell\n title=\"Record Pickup\"\n subtitle=\"Check out stock from a facility for your field work. Record returns and wastage when you bring stock back.\"\n actions={\n <Stack direction=\"row\" spacing={1}>\n <Button variant=\"outlined\" onClick={() => navigate('/ui/medplat/manage/pm/pickups')}>Cancel</Button>\n <Button variant=\"contained\" startIcon={<SaveRoundedIcon />}\n disabled={!formIsValid || submitting}\n onClick={() => void save()}>\n {submitting ? 'Recording…' : 'Record Pickup'}\n </Button>\n </Stack>\n }\n >\n {error ? <Alert severity=\"error\" sx={{ mb: 2 }}>{error}</Alert> : null}\n\n {hasOpenSession ? (\n <Alert\n severity=\"warning\"\n sx={{ mb: 2 }}\n action={\n <Button color=\"inherit\" size=\"small\"\n onClick={() => navigate('/ui/medplat/manage/pm/pickups')}>\n Go to Pickups\n </Button>\n }\n >\n You already have <strong>{openSessions.length}</strong> open outreach session{openSessions.length === 1 ? '' : 's'}.\n End the active session{openSessions.length === 1 ? '' : 's'} before starting a new pickup,\n or use <strong>Top Up</strong> on the Pickups page to add more stock to an active session.\n </Alert>\n ) : null}\n\n <Card sx={{ borderRadius: 4, mb: 2, border: '1px solid', borderColor: 'divider', boxShadow: '0 12px 32px rgba(15, 23, 42, 0.045)' }}>\n <CardContent sx={{ p: 2.5 }}>\n <PmFormSection\n eyebrow=\"Step 1\"\n title=\"Source\"\n hint=\"Select a facility and then the batch to pick up.\"\n sx={{ mb: 2 }}\n />\n <Grid container spacing={2}>\n <Grid item xs={12} md={5}>\n <Autocomplete\n size=\"small\"\n options={facilities}\n getOptionLabel={(f) => f?.name ?? ''}\n isOptionEqualToValue={(a, b) => a?.id === b?.id}\n value={facilities.find((f) => f.id === form.facilityId) ?? null}\n onChange={(_, next) => patchFacility(next?.id ?? '')}\n loading={loading}\n renderInput={(params) => (\n <TextField {...params} required label=\"Source Facility\" placeholder=\"Pick a facility you're assigned to\" />\n )}\n />\n </Grid>\n <Grid item xs={12} md={7}>\n <FormControl required fullWidth size=\"small\" disabled={!form.facilityId}>\n <InputLabel>Source Batch</InputLabel>\n <Select\n label=\"Source Batch\"\n value={form.sourceBatchId}\n onChange={(e) => patch('sourceBatchId', e.target.value)}\n >\n {eligibleBatches.length === 0 ? (\n <MenuItem disabled value=\"\">\n <em>No pickable stock in this facility</em>\n </MenuItem>\n ) : (\n eligibleBatches.map((b) => (\n <MenuItem key={b.id} value={b.id}>\n <Box component=\"span\" sx={{ fontWeight: 700, mr: 1 }}>{b.productName}</Box>\n <Typography variant=\"caption\" color=\"text.secondary\" sx={{ mr: 1 }}>\n qty {b.qtyRemaining}\n </Typography>\n {b.lotNumber ? (\n <Typography variant=\"caption\" sx={{ fontFamily: 'monospace', mr: 1 }}>\n {b.lotNumber}\n </Typography>\n ) : null}\n {b.expiryDate ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n exp {formatDate(b.expiryDate)}\n </Typography>\n ) : null}\n </MenuItem>\n ))\n )}\n </Select>\n <FormHelperText>\n {!form.facilityId\n ? 'Pick a facility first.'\n : eligibleBatches.length === 0\n ? 'This facility has no in-stock batches you can pick up right now.'\n : 'Active facility batches only — quarantined / expired / exhausted stock is hidden.'}\n </FormHelperText>\n </FormControl>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n\n <Card sx={{ borderRadius: 4, mb: 2, border: '1px solid', borderColor: 'divider', boxShadow: '0 12px 32px rgba(15, 23, 42, 0.045)' }}>\n <CardContent sx={{ p: 2.5 }}>\n <PmFormSection\n eyebrow=\"Session\"\n title=\"Outreach session details\"\n hint=\"Records the purpose, timing and location of this outreach session. Shown when administering from this stock.\"\n sx={{ mb: 2 }}\n />\n <Grid container spacing={2}>\n <Grid item xs={12} md={6}>\n <TextField\n required fullWidth size=\"small\"\n label=\"Session name\"\n inputProps={{ maxLength: 150 }}\n value={form.sessionName}\n onChange={(e) => patch('sessionName', e.target.value)}\n error={!!sessionNameError && form.sessionName !== ''}\n helperText={form.sessionName === '' ? 'e.g. Anganwadi camp – Ward 4' : sessionNameError}\n />\n </Grid>\n <Grid item xs={12} md={6}>\n <TextField\n fullWidth size=\"small\"\n label=\"Session site (optional)\"\n placeholder=\"Location / site reference\"\n inputProps={{ maxLength: 200 }}\n value={form.sessionSite}\n onChange={(e) => patch('sessionSite', e.target.value)}\n />\n </Grid>\n <Grid item xs={12} md={6}>\n <TextField\n required\n fullWidth size=\"small\" type=\"datetime-local\"\n label=\"Start time\"\n InputLabelProps={{ shrink: true }}\n inputProps={{ min: nowLocalInput() }}\n value={form.sessionStartTime}\n onChange={(e) => patch('sessionStartTime', e.target.value)}\n error={!!sessionStartError}\n helperText={sessionStartError || 'Cannot be in the past. (5 minutes buffer allowed)'}\n />\n </Grid>\n <Grid item xs={12} md={6}>\n <TextField\n required\n fullWidth size=\"small\" type=\"datetime-local\"\n label=\"Expected end\"\n InputLabelProps={{ shrink: true }}\n inputProps={{ min: form.sessionStartTime || undefined }}\n value={form.sessionExpectedEndTime}\n onChange={(e) => patch('sessionExpectedEndTime', e.target.value)}\n error={!!sessionEndError}\n helperText={sessionEndError || 'When the session is expected to end.'}\n />\n </Grid>\n <Grid item xs={12}>\n <TextField\n fullWidth size=\"small\" multiline minRows={2}\n label=\"Purpose / description (optional)\"\n value={form.sessionDescription}\n onChange={(e) => patch('sessionDescription', e.target.value)}\n />\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n\n {selectedBatch ? (\n <Card sx={{ borderRadius: 4, mb: 2, border: '1px solid', borderColor: 'divider', boxShadow: '0 12px 32px rgba(15, 23, 42, 0.045)' }}>\n <CardContent sx={{ p: 2.5 }}>\n <PmFormSection\n eyebrow=\"Step 2\"\n title=\"Quantity\"\n hint={`Available: ${remaining}. You can pick up to this amount.`}\n sx={{ mb: 2 }}\n />\n <Grid container spacing={2}>\n <Grid item xs={12} md={4}>\n <TextField\n required fullWidth size=\"small\" type=\"number\"\n label=\"Pick Quantity\"\n inputProps={{ min: 1, max: remaining }}\n value={form.pickedQty}\n onChange={(e) => patch('pickedQty', e.target.value)}\n error={!!qtyError}\n helperText={qtyError || `Out of ${remaining} available`}\n />\n </Grid>\n <Grid item xs={12} md={8}>\n <TextField\n fullWidth size=\"small\"\n label=\"Notes (optional)\"\n placeholder=\"Anything worth recording about this pickup\"\n value={form.notes}\n onChange={(e) => patch('notes', e.target.value)}\n />\n </Grid>\n </Grid>\n <Stack direction=\"row\" spacing={1} sx={{ mt: 2 }} flexWrap=\"wrap\" useFlexGap>\n <Chip size=\"small\" label={`Product · ${selectedBatch.productName}`} />\n {selectedBatch.lotNumber ? <Chip size=\"small\" label={`Lot · ${selectedBatch.lotNumber}`} /> : null}\n {selectedBatch.expiryDate ? <Chip size=\"small\" label={`Expiry · ${formatDate(selectedBatch.expiryDate)}`} /> : null}\n {selectedBatch.storageUnitName ? <Chip size=\"small\" label={`From · ${selectedBatch.storageUnitName}`} /> : null}\n </Stack>\n </CardContent>\n </Card>\n ) : null}\n </PmPageShell>\n </PmGuard>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;AAuCA,SAAS,EAAW,GAAO;CAIzB,OADA,EAFI,EAAM,cAAc,cACpB,OAAO,EAAM,gBAAgB,CAAC,KAAK,KACnC,EAAM,WAAW,aAAa,EAAM,WAAW,eAAe,EAAM,WAAW;AAErF;AAGA,SAAS,IAAgB;CACvB,IAAM,oBAAI,IAAI,KAAK,GACb,KAAO,MAAM,OAAO,CAAC,EAAE,SAAS,GAAG,GAAG;CAC5C,OAAO,GAAG,EAAE,YAAY,EAAE,GAAG,EAAI,EAAE,SAAS,IAAI,CAAC,EAAE,GAAG,EAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAI,EAAE,SAAS,CAAC,EAAE,G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