@argusoft/medplat-product-management 1.0.0 → 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.
Files changed (77) hide show
  1. package/dist/BrandsPage-CSA3meke.js +385 -0
  2. package/dist/BrandsPage-CSA3meke.js.map +1 -0
  3. package/dist/CategoriesPage-BrspzkJL.js +340 -0
  4. package/dist/CategoriesPage-BrspzkJL.js.map +1 -0
  5. package/dist/{DashboardPage-BNKUQj46.js → DashboardPage-CqaquOs2.js} +21 -22
  6. package/dist/{DashboardPage-BNKUQj46.js.map → DashboardPage-CqaquOs2.js.map} +1 -1
  7. package/dist/{FacilityPicker-Coi8I3yE.js → FacilityPicker-Dv_H95WW.js} +13 -13
  8. package/dist/{FacilityPicker-Coi8I3yE.js.map → FacilityPicker-Dv_H95WW.js.map} +1 -1
  9. package/dist/{InventoryPage-BR6jOzg2.js → InventoryPage-CPbzfDMR.js} +12 -12
  10. package/dist/{InventoryPage-BR6jOzg2.js.map → InventoryPage-CPbzfDMR.js.map} +1 -1
  11. package/dist/{MemberProfileCard-DbHZCS5n.js → MemberProfileCard-0vjO3Gzd.js} +2 -2
  12. package/dist/{MemberProfileCard-DbHZCS5n.js.map → MemberProfileCard-0vjO3Gzd.js.map} +1 -1
  13. package/dist/{PaymentCreatePage-Ci3ERnby.js → PaymentCreatePage-BYmDZAIB.js} +9 -10
  14. package/dist/{PaymentCreatePage-Ci3ERnby.js.map → PaymentCreatePage-BYmDZAIB.js.map} +1 -1
  15. package/dist/{PaymentsPage-sdg902zX.js → PaymentsPage-BXPvKon-.js} +16 -16
  16. package/dist/{PaymentsPage-sdg902zX.js.map → PaymentsPage-BXPvKon-.js.map} +1 -1
  17. package/dist/PickupCreatePage-CMGwoAXj.js +426 -0
  18. package/dist/PickupCreatePage-CMGwoAXj.js.map +1 -0
  19. package/dist/{PickupsPage-Ci2Ll0Kn.js → PickupsPage-D66_Wta4.js} +84 -39
  20. package/dist/PickupsPage-D66_Wta4.js.map +1 -0
  21. package/dist/PmTable-B9970kPY.js +375 -0
  22. package/dist/PmTable-B9970kPY.js.map +1 -0
  23. package/dist/{ProductEditPage-DL8gy85Y.js → ProductEditPage-B8qFTCW9.js} +226 -243
  24. package/dist/ProductEditPage-B8qFTCW9.js.map +1 -0
  25. package/dist/ProductsPage-C7_r9cKn.js +254 -0
  26. package/dist/ProductsPage-C7_r9cKn.js.map +1 -0
  27. package/dist/{PurchaseCreatePage-C3KMfBxJ.js → PurchaseCreatePage-CDfNDcKG.js} +150 -149
  28. package/dist/PurchaseCreatePage-CDfNDcKG.js.map +1 -0
  29. package/dist/{PurchaseRequestDetailPage-C0GYFJDl.js → PurchaseRequestDetailPage-C7aAwEqw.js} +15 -15
  30. package/dist/{PurchaseRequestDetailPage-C0GYFJDl.js.map → PurchaseRequestDetailPage-C7aAwEqw.js.map} +1 -1
  31. package/dist/{PurchaseRequestsPage-DvFH_tWe.js → PurchaseRequestsPage-BwCkbpaX.js} +14 -14
  32. package/dist/{PurchaseRequestsPage-DvFH_tWe.js.map → PurchaseRequestsPage-BwCkbpaX.js.map} +1 -1
  33. package/dist/{PurchasesPage-BCvLvSp4.js → PurchasesPage-CvaZouVy.js} +11 -12
  34. package/dist/{PurchasesPage-BCvLvSp4.js.map → PurchasesPage-CvaZouVy.js.map} +1 -1
  35. package/dist/{SaleCreatePage-DpkQMoTq.js → SaleCreatePage-DP1Qmltu.js} +30 -31
  36. package/dist/{SaleCreatePage-DpkQMoTq.js.map → SaleCreatePage-DP1Qmltu.js.map} +1 -1
  37. package/dist/{SalesPage-DUwgkEO-.js → SalesPage-CO3cdYX5.js} +18 -19
  38. package/dist/{SalesPage-DUwgkEO-.js.map → SalesPage-CO3cdYX5.js.map} +1 -1
  39. package/dist/{SettingsPage-CusC0jqJ.js → SettingsPage-DvVRwSFw.js} +104 -103
  40. package/dist/SettingsPage-DvVRwSFw.js.map +1 -0
  41. package/dist/StorageUnitsPage-B9Hr_RkW.js +470 -0
  42. package/dist/StorageUnitsPage-B9Hr_RkW.js.map +1 -0
  43. package/dist/{TransactionsPage-DDaK4VyY.js → TransactionsPage-HKIGwEZN.js} +127 -123
  44. package/dist/TransactionsPage-HKIGwEZN.js.map +1 -0
  45. package/dist/{TransferCreatePage-BxudLfhS.js → TransferCreatePage-DMuZqQ3c.js} +9 -9
  46. package/dist/{TransferCreatePage-BxudLfhS.js.map → TransferCreatePage-DMuZqQ3c.js.map} +1 -1
  47. package/dist/{TransfersPage-zgmt7teZ.js → TransfersPage-COIyouL4.js} +16 -16
  48. package/dist/{TransfersPage-zgmt7teZ.js.map → TransfersPage-COIyouL4.js.map} +1 -1
  49. package/dist/{VialsPage-CjqPfgpV.js → VialsPage-BNPUwGCU.js} +291 -224
  50. package/dist/VialsPage-BNPUwGCU.js.map +1 -0
  51. package/dist/{constants-BrA_hfAI.js → constants-5ZCZo-Zm.js} +5 -2
  52. package/dist/{constants-BrA_hfAI.js.map → constants-5ZCZo-Zm.js.map} +1 -1
  53. package/dist/{PmGuard-CjJBisaN.js → currency-ClRLIEg2.js} +186 -9
  54. package/dist/currency-ClRLIEg2.js.map +1 -0
  55. package/dist/index.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/BrandsPage-DCMCVvDY.js +0 -334
  58. package/dist/BrandsPage-DCMCVvDY.js.map +0 -1
  59. package/dist/CategoriesPage-BpRhwfrc.js +0 -284
  60. package/dist/CategoriesPage-BpRhwfrc.js.map +0 -1
  61. package/dist/PickupCreatePage-CieMsgWV.js +0 -310
  62. package/dist/PickupCreatePage-CieMsgWV.js.map +0 -1
  63. package/dist/PickupsPage-Ci2Ll0Kn.js.map +0 -1
  64. package/dist/PmGuard-CjJBisaN.js.map +0 -1
  65. package/dist/PmTable-BuXZQZCU.js +0 -302
  66. package/dist/PmTable-BuXZQZCU.js.map +0 -1
  67. package/dist/ProductEditPage-DL8gy85Y.js.map +0 -1
  68. package/dist/ProductsPage-BANTKxLb.js +0 -221
  69. package/dist/ProductsPage-BANTKxLb.js.map +0 -1
  70. package/dist/PurchaseCreatePage-C3KMfBxJ.js.map +0 -1
  71. package/dist/SettingsPage-CusC0jqJ.js.map +0 -1
  72. package/dist/StorageUnitsPage-BlC2AgrJ.js +0 -469
  73. package/dist/StorageUnitsPage-BlC2AgrJ.js.map +0 -1
  74. package/dist/TransactionsPage-DDaK4VyY.js.map +0 -1
  75. package/dist/VialsPage-CjqPfgpV.js.map +0 -1
  76. package/dist/currency-BDDCDgeE.js +0 -169
  77. package/dist/currency-BDDCDgeE.js.map +0 -1
@@ -1,15 +1,16 @@
1
- import { S as e, a as t, c as n, k as ee, n as r, r as te, st as ne, t as i, w as a, x as o } from "./PmGuard-CjJBisaN.js";
2
- import { c as s, g as re, h as ie, m as c, p as ae, r as l, s as oe, t as se } from "./validation-Ba7puFIO.js";
3
- import { t as ce } from "./useFieldErrors-hDG8ox_x.js";
4
- import { i as le, l as ue, u as de } from "./constants-BrA_hfAI.js";
5
- import { useEffect as u, useMemo as d, useState as f } from "react";
6
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
7
- import { Alert as h, Box as fe, Button as g, Card as _, CardContent as v, Checkbox as y, Divider as b, FormControl as x, FormControlLabel as S, FormHelperText as C, Grid as w, InputLabel as T, MenuItem as E, Select as D, Stack as O, TextField as k, Typography as A } from "@mui/material";
8
- import { showToast as j } from "@/common/toaster/toaster";
9
- import { useNavigate as M, useParams as N } from "react-router-dom";
10
- import P from "@mui/icons-material/SaveRounded";
1
+ import { A as e, C as t, S as n, T as ee, ct as r, i, l as a, n as o, o as s, r as c } from "./currency-ClRLIEg2.js";
2
+ import { n as l, o as u } from "./PmTable-B9970kPY.js";
3
+ import { c as te, g as ne, h as re, m as d, p as ie, r as f, s as ae, t as oe } from "./validation-Ba7puFIO.js";
4
+ import { t as p } from "./useFieldErrors-hDG8ox_x.js";
5
+ import { i as m, l as h, u as g } from "./constants-5ZCZo-Zm.js";
6
+ import { useEffect as se, useMemo as _, useState as v } from "react";
7
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
8
+ import { Alert as x, Box as ce, Button as S, Card as C, CardContent as w, Checkbox as T, Divider as E, FormControlLabel as D, Grid as O, Stack as k, TextField as A, Typography as j } from "@mui/material";
9
+ import { showToast as le } from "@/common/toaster/toaster";
10
+ import { useNavigate as ue, useParams as M } from "react-router-dom";
11
+ import N from "@mui/icons-material/SaveRounded";
11
12
  //#region src/views/ProductEditPage.jsx
12
- var F = {
13
+ var P = {
13
14
  vaccineCode: "",
14
15
  vialVolumeMl: "",
15
16
  adultDoseMl: "",
@@ -23,75 +24,82 @@ var F = {
23
24
  storageTempMaxCelsius: "",
24
25
  comments: ""
25
26
  };
26
- function I() {
27
- let { productId: I } = N(), L = M(), [R, z] = f(!0), [B, V] = f(""), [H, pe] = f([]), [me, he] = f([]), [U, ge] = f([]), W = ce(), G = n()?.manageSales !== !1, [K, q] = f({
28
- id: I,
27
+ function F() {
28
+ let { productId: F } = M(), I = ue(), [L, R] = v(!0), [z, B] = v(""), [V, H] = v(!1), [U, de] = v([]), [fe, pe] = v([]), [me, he] = v([]), W = p(), G = a()?.manageSales !== !1, [K, q] = v({
29
+ id: F,
29
30
  name: "",
30
31
  categoryId: "",
31
32
  brandId: "",
32
33
  description: "",
33
34
  unit: "",
35
+ unitOther: "",
34
36
  hasExpiry: !0,
35
37
  needsStorageUnit: !1,
36
38
  notForSale: !1,
37
39
  isActive: !0,
38
40
  imageUuids: [],
39
41
  vaccineConfig: null
40
- }), J = d(() => H.find((e) => e.id === K.categoryId), [H, K.categoryId]), Y = J?.code?.toUpperCase() === ue;
41
- te("update.manage.productManagement.product", () => {
42
- async function t() {
43
- z(!0);
42
+ }), J = _(() => U.find((e) => e.id === K.categoryId), [U, K.categoryId]), Y = J?.code?.toUpperCase() === h;
43
+ i("update.manage.productManagement.product", () => {
44
+ async function r() {
45
+ R(!0);
44
46
  try {
45
- let [t, n, r] = await Promise.all([
46
- e(),
47
- o(),
48
- a().catch(() => [])
47
+ let [r, i, a] = await Promise.all([
48
+ t(),
49
+ n(),
50
+ ee().catch(() => [])
49
51
  ]);
50
- pe(t), he(n), ge(r);
52
+ de(r), pe(i), he(a);
51
53
  try {
52
- let e = await ee(I);
53
- q({
54
- id: e.id,
55
- name: e.name ?? "",
56
- categoryId: e.categoryId ?? "",
57
- brandId: e.brandId ?? "",
58
- description: e.description ?? "",
59
- unit: e.unit ?? "PIECE",
60
- hasExpiry: e.hasExpiry ?? !1,
61
- needsStorageUnit: e.needsStorageUnit ?? !1,
62
- notForSale: e.notForSale ?? !1,
63
- isActive: e.isActive ?? !0,
64
- imageUuids: e.imageUuids ?? [],
65
- vaccineConfig: e.vaccineConfig ? {
66
- vaccineCode: e.vaccineConfig.vaccineCode ?? "",
67
- vialVolumeMl: e.vaccineConfig.vialVolumeMl ?? "",
68
- adultDoseMl: e.vaccineConfig.adultDoseMl ?? "",
69
- childDoseMl: e.vaccineConfig.childDoseMl ?? "",
70
- openVialValidityHours: e.vaccineConfig.openVialValidityHours ?? 6,
71
- maxConcurrentOpenVials: e.vaccineConfig.maxConcurrentOpenVials ?? 2,
72
- requiresReconstitution: e.vaccineConfig.requiresReconstitution ?? !1,
73
- reconstitutedValidityHours: e.vaccineConfig.reconstitutedValidityHours ?? "",
74
- route: e.vaccineConfig.route ?? "",
75
- storageTempMinCelsius: e.vaccineConfig.storageTempMinCelsius ?? "",
76
- storageTempMaxCelsius: e.vaccineConfig.storageTempMaxCelsius ?? "",
77
- comments: e.vaccineConfig.comments ?? ""
54
+ let t = await e(F);
55
+ H(!1), q({
56
+ id: t.id,
57
+ name: t.name ?? "",
58
+ categoryId: t.categoryId ?? "",
59
+ brandId: t.brandId ?? "",
60
+ description: t.description ?? "",
61
+ unit: t.unit ?? "PIECE",
62
+ unitOther: t.unitOther ?? "",
63
+ hasExpiry: t.hasExpiry ?? !1,
64
+ needsStorageUnit: t.needsStorageUnit ?? !1,
65
+ notForSale: t.notForSale ?? !1,
66
+ isActive: t.isActive ?? !0,
67
+ imageUuids: t.imageUuids ?? [],
68
+ vaccineConfig: t.vaccineConfig ? {
69
+ vaccineCode: t.vaccineConfig.vaccineCode ?? "",
70
+ vialVolumeMl: t.vaccineConfig.vialVolumeMl ?? "",
71
+ adultDoseMl: t.vaccineConfig.adultDoseMl ?? "",
72
+ childDoseMl: t.vaccineConfig.childDoseMl ?? "",
73
+ openVialValidityHours: t.vaccineConfig.openVialValidityHours ?? 6,
74
+ maxConcurrentOpenVials: t.vaccineConfig.maxConcurrentOpenVials ?? 2,
75
+ requiresReconstitution: t.vaccineConfig.requiresReconstitution ?? !1,
76
+ reconstitutedValidityHours: t.vaccineConfig.reconstitutedValidityHours ?? "",
77
+ route: t.vaccineConfig.route ?? "",
78
+ storageTempMinCelsius: t.vaccineConfig.storageTempMinCelsius ?? "",
79
+ storageTempMaxCelsius: t.vaccineConfig.storageTempMaxCelsius ?? "",
80
+ comments: t.vaccineConfig.comments ?? ""
78
81
  } : null
79
82
  });
80
- } catch {}
83
+ } catch {
84
+ H(!0);
85
+ }
81
86
  } catch (e) {
82
- V(e?.response?.data?.message ?? e?.message ?? "Failed to load product");
87
+ B(e?.response?.data?.message ?? e?.message ?? "Failed to load product");
83
88
  } finally {
84
- z(!1);
89
+ R(!1);
85
90
  }
86
91
  }
87
- t();
88
- }, [I]), u(() => {
89
- Y && q((e) => ({
92
+ r();
93
+ }, [F]), se(() => {
94
+ q(Y ? (e) => ({
90
95
  ...e,
91
96
  unit: "VIAL",
92
97
  needsStorageUnit: !0,
93
- vaccineConfig: e.vaccineConfig ?? { ...F }
94
- }));
98
+ vaccineConfig: e.vaccineConfig ?? { ...P }
99
+ }) : (e) => e.vaccineConfig ? {
100
+ ...e,
101
+ vaccineConfig: null
102
+ } : e);
95
103
  }, [Y]);
96
104
  function X(e, t) {
97
105
  q((n) => ({
@@ -103,47 +111,49 @@ function I() {
103
111
  q((n) => ({
104
112
  ...n,
105
113
  vaccineConfig: {
106
- ...n.vaccineConfig ?? F,
114
+ ...n.vaccineConfig ?? P,
107
115
  [e]: t
108
116
  }
109
117
  }));
110
118
  }
111
- let Q = d(() => {
119
+ let Q = _(() => {
112
120
  let e = {
113
- name: c(K.name, "Product name"),
114
- categoryId: c(K.categoryId, "Category"),
115
- brandId: c(K.brandId, "Brand"),
116
- unit: c(K.unit, "Unit")
121
+ name: d(K.name, "Product name"),
122
+ categoryId: d(K.categoryId, "Category"),
123
+ brandId: d(K.brandId, "Brand"),
124
+ unit: d(K.unit, "Unit"),
125
+ unitOther: K.unit === "OTHER" ? d(K.unitOther, "Custom unit") : ""
117
126
  };
118
127
  if (Y && K.vaccineConfig) {
119
- let t = K.vaccineConfig, n = ie(t.storageTempMinCelsius, t.storageTempMaxCelsius);
128
+ let t = K.vaccineConfig, n = re(t.storageTempMinCelsius, t.storageTempMaxCelsius);
120
129
  Object.assign(e, {
121
- vaccineCode: c(t.vaccineCode, "Vaccine"),
122
- vialVolumeMl: re(t.vialVolumeMl),
123
- adultDoseMl: l(t.adultDoseMl, "Adult dose", t.vialVolumeMl),
124
- childDoseMl: l(t.childDoseMl, "Child dose", t.vialVolumeMl),
125
- openVialValidityHours: s(t.openVialValidityHours),
126
- maxConcurrentOpenVials: oe(t.maxConcurrentOpenVials),
127
- reconstitutedValidityHours: ae(t.reconstitutedValidityHours, t.requiresReconstitution),
130
+ vaccineCode: d(t.vaccineCode, "Vaccine"),
131
+ vialVolumeMl: ne(t.vialVolumeMl),
132
+ adultDoseMl: f(t.adultDoseMl, "Adult dose", t.vialVolumeMl),
133
+ childDoseMl: f(t.childDoseMl, "Child dose", t.vialVolumeMl),
134
+ openVialValidityHours: te(t.openVialValidityHours),
135
+ maxConcurrentOpenVials: ae(t.maxConcurrentOpenVials),
136
+ reconstitutedValidityHours: ie(t.reconstitutedValidityHours, t.requiresReconstitution),
128
137
  storageTempMinCelsius: n.min,
129
138
  storageTempMaxCelsius: n.max
130
139
  }), !t.adultDoseMl && !t.childDoseMl && (e.adultDoseMl = e.adultDoseMl || "Provide at least one dose (adult or child)", e.childDoseMl = e.childDoseMl || "Provide at least one dose (adult or child)");
131
140
  }
132
141
  return e;
133
- }, [K, Y]), $ = se(Q);
134
- async function _e() {
142
+ }, [K, Y]), $ = oe(Q);
143
+ async function ge() {
135
144
  if (!$) {
136
- W.markAllTouched(), V("Please fix the highlighted fields and try again.");
145
+ W.markAllTouched(), B("Please fix the highlighted fields and try again.");
137
146
  return;
138
147
  }
139
148
  try {
140
- await ne({
149
+ await r({
141
150
  id: K.id,
142
151
  name: K.name.trim(),
143
152
  categoryId: K.categoryId,
144
153
  brandId: K.brandId,
145
154
  description: K.description || null,
146
155
  unit: K.unit,
156
+ unitOther: K.unit === "OTHER" && K.unitOther?.trim() || null,
147
157
  hasExpiry: !!K.hasExpiry,
148
158
  needsStorageUnit: !!K.needsStorageUnit,
149
159
  notForSale: G ? !!K.notForSale : !1,
@@ -163,165 +173,163 @@ function I() {
163
173
  storageTempMaxCelsius: K.vaccineConfig.storageTempMaxCelsius === "" ? null : Number(K.vaccineConfig.storageTempMaxCelsius),
164
174
  comments: K.vaccineConfig.comments || null
165
175
  } : null
166
- }), j({
176
+ }), le({
167
177
  message: "Product saved.",
168
178
  type: "success"
169
- }), L("/ui/medplat/manage/pm/products");
179
+ }), I("/ui/medplat/manage/pm/products");
170
180
  } catch (e) {
171
- V(e?.response?.data?.message ?? e?.message ?? "Failed to save product");
181
+ B(e?.response?.data?.message ?? e?.message ?? "Failed to save product");
172
182
  }
173
183
  }
174
- return /* @__PURE__ */ m(fe, { children: [/* @__PURE__ */ p(r, {}), /* @__PURE__ */ p(i, {
184
+ return /* @__PURE__ */ b(ce, { children: [/* @__PURE__ */ y(c, {}), /* @__PURE__ */ y(o, {
175
185
  perm: "update.manage.productManagement.product",
176
186
  title: "You don’t have permission to create or edit products",
177
- children: /* @__PURE__ */ m(t, {
178
- title: K.id ? "Edit Product" : "New Product",
187
+ children: /* @__PURE__ */ b(s, {
188
+ title: V ? "Add Product" : "Edit Product",
179
189
  subtitle: `Category: ${J?.code ?? "—"}`,
180
- chips: Y ? ["Vaccine"] : ["Generic"],
181
- actions: /* @__PURE__ */ m(O, {
190
+ actions: /* @__PURE__ */ b(k, {
182
191
  direction: "row",
183
192
  spacing: 1,
184
- children: [/* @__PURE__ */ p(g, {
193
+ children: [/* @__PURE__ */ y(S, {
185
194
  variant: "outlined",
186
- onClick: () => L("/ui/medplat/manage/pm/products"),
195
+ onClick: () => I("/ui/medplat/manage/pm/products"),
187
196
  children: "Cancel"
188
- }), /* @__PURE__ */ p(g, {
197
+ }), /* @__PURE__ */ y(S, {
189
198
  variant: "contained",
190
- startIcon: /* @__PURE__ */ p(P, {}),
199
+ startIcon: /* @__PURE__ */ y(N, {}),
191
200
  disabled: !$,
192
- onClick: () => void _e(),
201
+ onClick: () => void ge(),
193
202
  children: "Save"
194
203
  })]
195
204
  }),
196
205
  children: [
197
- R ? /* @__PURE__ */ p(h, {
206
+ L ? /* @__PURE__ */ y(x, {
198
207
  severity: "info",
199
208
  children: "Loading…"
200
209
  }) : null,
201
- B ? /* @__PURE__ */ p(h, {
210
+ z ? /* @__PURE__ */ y(x, {
202
211
  severity: "error",
203
212
  sx: { mb: 2 },
204
- children: B
213
+ children: z
205
214
  }) : null,
206
- /* @__PURE__ */ p(_, {
215
+ /* @__PURE__ */ y(C, {
207
216
  sx: {
208
217
  borderRadius: 4,
209
218
  mb: 2
210
219
  },
211
- children: /* @__PURE__ */ m(v, { children: [/* @__PURE__ */ p(A, {
220
+ children: /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(j, {
212
221
  variant: "h6",
213
222
  sx: {
214
223
  fontWeight: 800,
215
224
  mb: 2
216
225
  },
217
226
  children: "Basic Details"
218
- }), /* @__PURE__ */ m(w, {
227
+ }), /* @__PURE__ */ b(O, {
219
228
  container: !0,
220
229
  spacing: 2,
221
230
  children: [
222
- /* @__PURE__ */ p(w, {
231
+ /* @__PURE__ */ y(O, {
223
232
  item: !0,
224
233
  xs: 12,
225
234
  md: 6,
226
- children: /* @__PURE__ */ p(k, {
235
+ children: /* @__PURE__ */ y(A, {
227
236
  required: !0,
228
237
  fullWidth: !0,
229
238
  size: "small",
230
239
  label: "Product Name",
231
240
  value: K.name,
241
+ inputProps: { maxLength: 255 },
232
242
  onChange: (e) => X("name", e.target.value),
233
243
  onBlur: W.onBlur("name"),
234
244
  error: W.show("name") && !!Q.name,
235
- helperText: W.show("name") ? Q.name : ""
245
+ FormHelperTextProps: { component: "div" },
246
+ helperText: /* @__PURE__ */ y(l, {
247
+ message: W.show("name") ? Q.name : "",
248
+ value: K.name,
249
+ max: 255
250
+ })
236
251
  })
237
252
  }),
238
- /* @__PURE__ */ p(w, {
253
+ /* @__PURE__ */ y(O, {
239
254
  item: !0,
240
255
  xs: 12,
241
256
  md: 3,
242
- children: /* @__PURE__ */ m(x, {
257
+ children: /* @__PURE__ */ y(u, {
258
+ label: "Category",
243
259
  required: !0,
244
- fullWidth: !0,
245
- size: "small",
260
+ value: K.categoryId,
261
+ onChange: (e) => X("categoryId", e),
262
+ onBlur: W.onBlur("categoryId"),
246
263
  error: W.show("categoryId") && !!Q.categoryId,
247
- children: [
248
- /* @__PURE__ */ p(T, { children: "Category" }),
249
- /* @__PURE__ */ p(D, {
250
- label: "Category",
251
- value: K.categoryId,
252
- onChange: (e) => X("categoryId", e.target.value),
253
- onBlur: W.onBlur("categoryId"),
254
- children: H.map((e) => /* @__PURE__ */ m(E, {
255
- value: e.id,
256
- children: [
257
- e.name,
258
- " (",
259
- e.code,
260
- ")"
261
- ]
262
- }, e.id))
263
- }),
264
- W.show("categoryId") && Q.categoryId ? /* @__PURE__ */ p(C, { children: Q.categoryId }) : null
265
- ]
264
+ helperText: W.show("categoryId") ? Q.categoryId : "",
265
+ options: U.map((e) => ({
266
+ value: e.id,
267
+ label: `${e.name} (${e.code})`
268
+ }))
266
269
  })
267
270
  }),
268
- /* @__PURE__ */ p(w, {
271
+ /* @__PURE__ */ y(O, {
269
272
  item: !0,
270
273
  xs: 12,
271
274
  md: 3,
272
- children: /* @__PURE__ */ m(x, {
275
+ children: /* @__PURE__ */ y(u, {
276
+ label: "Brand",
273
277
  required: !0,
274
- fullWidth: !0,
275
- size: "small",
278
+ value: K.brandId,
279
+ onChange: (e) => X("brandId", e),
280
+ onBlur: W.onBlur("brandId"),
276
281
  error: W.show("brandId") && !!Q.brandId,
277
- children: [
278
- /* @__PURE__ */ p(T, { children: "Brand" }),
279
- /* @__PURE__ */ p(D, {
280
- label: "Brand",
281
- value: K.brandId,
282
- onChange: (e) => X("brandId", e.target.value),
283
- onBlur: W.onBlur("brandId"),
284
- children: me.map((e) => /* @__PURE__ */ p(E, {
285
- value: e.id,
286
- children: e.name
287
- }, e.id))
288
- }),
289
- W.show("brandId") && Q.brandId ? /* @__PURE__ */ p(C, { children: Q.brandId }) : null
290
- ]
282
+ helperText: W.show("brandId") ? Q.brandId : "",
283
+ options: fe.map((e) => ({
284
+ value: e.id,
285
+ label: e.name
286
+ }))
291
287
  })
292
288
  }),
293
- /* @__PURE__ */ p(w, {
289
+ /* @__PURE__ */ y(O, {
294
290
  item: !0,
295
291
  xs: 12,
296
292
  md: 3,
297
- children: /* @__PURE__ */ m(x, {
293
+ children: /* @__PURE__ */ y(u, {
294
+ label: "Unit",
298
295
  required: !0,
299
- fullWidth: !0,
300
- size: "small",
301
296
  disabled: Y,
297
+ value: K.unit,
298
+ onChange: (e) => X("unit", e),
299
+ onBlur: W.onBlur("unit"),
302
300
  error: W.show("unit") && !!Q.unit,
303
- children: [
304
- /* @__PURE__ */ p(T, { children: "Unit" }),
305
- /* @__PURE__ */ p(D, {
306
- label: "Unit",
307
- value: K.unit,
308
- onChange: (e) => X("unit", e.target.value),
309
- onBlur: W.onBlur("unit"),
310
- children: le.map((e) => /* @__PURE__ */ p(E, {
311
- value: e.value,
312
- children: e.label
313
- }, e.value))
314
- }),
315
- /* @__PURE__ */ p(C, { children: W.show("unit") && Q.unit ? Q.unit : Y ? "Vaccines must use VIAL" : "" })
316
- ]
301
+ helperText: W.show("unit") && Q.unit ? Q.unit : Y ? "Vaccines must use VIAL" : "",
302
+ options: m
317
303
  })
318
304
  }),
319
- /* @__PURE__ */ p(w, {
305
+ K.unit === "OTHER" ? /* @__PURE__ */ y(O, {
306
+ item: !0,
307
+ xs: 12,
308
+ md: 3,
309
+ children: /* @__PURE__ */ y(A, {
310
+ required: !0,
311
+ fullWidth: !0,
312
+ size: "small",
313
+ label: "Custom unit name",
314
+ value: K.unitOther,
315
+ inputProps: { maxLength: 50 },
316
+ onChange: (e) => X("unitOther", e.target.value),
317
+ onBlur: W.onBlur("unitOther"),
318
+ error: W.show("unitOther") && !!Q.unitOther,
319
+ FormHelperTextProps: { component: "div" },
320
+ helperText: /* @__PURE__ */ y(l, {
321
+ message: W.show("unitOther") && Q.unitOther ? Q.unitOther : "e.g. Strip, Ampoule, Sachet",
322
+ value: K.unitOther,
323
+ max: 50
324
+ })
325
+ })
326
+ }) : null,
327
+ /* @__PURE__ */ y(O, {
320
328
  item: !0,
321
329
  xs: 6,
322
330
  md: 3,
323
- children: /* @__PURE__ */ p(S, {
324
- control: /* @__PURE__ */ p(y, {
331
+ children: /* @__PURE__ */ y(D, {
332
+ control: /* @__PURE__ */ y(T, {
325
333
  checked: !!K.hasExpiry,
326
334
  disabled: Y,
327
335
  onChange: (e) => X("hasExpiry", e.target.checked)
@@ -329,12 +337,12 @@ function I() {
329
337
  label: Y ? "Has expiry (vaccine)" : "Has expiry"
330
338
  })
331
339
  }),
332
- /* @__PURE__ */ p(w, {
340
+ /* @__PURE__ */ y(O, {
333
341
  item: !0,
334
342
  xs: 6,
335
343
  md: 3,
336
- children: /* @__PURE__ */ p(S, {
337
- control: /* @__PURE__ */ p(y, {
344
+ children: /* @__PURE__ */ y(D, {
345
+ control: /* @__PURE__ */ y(T, {
338
346
  checked: !!K.needsStorageUnit,
339
347
  disabled: Y,
340
348
  onChange: (e) => X("needsStorageUnit", e.target.checked)
@@ -342,34 +350,34 @@ function I() {
342
350
  label: Y ? "Needs storage unit (vaccine)" : "Needs storage unit"
343
351
  })
344
352
  }),
345
- G ? /* @__PURE__ */ p(w, {
353
+ G ? /* @__PURE__ */ y(O, {
346
354
  item: !0,
347
355
  xs: 6,
348
356
  md: 3,
349
- children: /* @__PURE__ */ p(S, {
350
- control: /* @__PURE__ */ p(y, {
357
+ children: /* @__PURE__ */ y(D, {
358
+ control: /* @__PURE__ */ y(T, {
351
359
  checked: !!K.notForSale,
352
360
  onChange: (e) => X("notForSale", e.target.checked)
353
361
  }),
354
362
  label: "Not for sale"
355
363
  })
356
364
  }) : null,
357
- /* @__PURE__ */ p(w, {
365
+ /* @__PURE__ */ y(O, {
358
366
  item: !0,
359
367
  xs: 6,
360
368
  md: 3,
361
- children: /* @__PURE__ */ p(S, {
362
- control: /* @__PURE__ */ p(y, {
369
+ children: /* @__PURE__ */ y(D, {
370
+ control: /* @__PURE__ */ y(T, {
363
371
  checked: !!K.isActive,
364
372
  onChange: (e) => X("isActive", e.target.checked)
365
373
  }),
366
374
  label: "Active"
367
375
  })
368
376
  }),
369
- /* @__PURE__ */ p(w, {
377
+ /* @__PURE__ */ y(O, {
370
378
  item: !0,
371
379
  xs: 12,
372
- children: /* @__PURE__ */ p(k, {
380
+ children: /* @__PURE__ */ y(A, {
373
381
  fullWidth: !0,
374
382
  size: "small",
375
383
  multiline: !0,
@@ -382,68 +390,53 @@ function I() {
382
390
  ]
383
391
  })] })
384
392
  }),
385
- Y ? /* @__PURE__ */ p(_, {
393
+ Y ? /* @__PURE__ */ y(C, {
386
394
  sx: { borderRadius: 4 },
387
- children: /* @__PURE__ */ m(v, { children: [
388
- /* @__PURE__ */ m(O, {
395
+ children: /* @__PURE__ */ b(w, { children: [
396
+ /* @__PURE__ */ b(k, {
389
397
  direction: "row",
390
398
  justifyContent: "space-between",
391
399
  alignItems: "center",
392
400
  sx: { mb: 2 },
393
- children: [/* @__PURE__ */ p(A, {
401
+ children: [/* @__PURE__ */ y(j, {
394
402
  variant: "h6",
395
403
  sx: { fontWeight: 800 },
396
404
  children: "Vaccine Configuration"
397
- }), /* @__PURE__ */ p(A, {
405
+ }), /* @__PURE__ */ y(j, {
398
406
  variant: "caption",
399
407
  color: "text.secondary",
400
408
  children: "Required for vaccine products. Controls vial size, dosing, and shelf life rules."
401
409
  })]
402
410
  }),
403
- /* @__PURE__ */ p(b, { sx: { mb: 2 } }),
404
- /* @__PURE__ */ m(w, {
411
+ /* @__PURE__ */ y(E, { sx: { mb: 2 } }),
412
+ /* @__PURE__ */ b(O, {
405
413
  container: !0,
406
414
  spacing: 2,
407
415
  children: [
408
- /* @__PURE__ */ p(w, {
416
+ /* @__PURE__ */ y(O, {
409
417
  item: !0,
410
418
  xs: 12,
411
419
  md: 3,
412
- children: /* @__PURE__ */ m(x, {
420
+ children: /* @__PURE__ */ y(u, {
421
+ label: "Vaccine",
413
422
  required: !0,
414
- fullWidth: !0,
415
- size: "small",
423
+ value: K.vaccineConfig?.vaccineCode || "",
424
+ onChange: (e) => Z("vaccineCode", e),
425
+ onBlur: W.onBlur("vaccineCode"),
416
426
  error: W.show("vaccineCode") && !!Q.vaccineCode,
417
- children: [
418
- /* @__PURE__ */ p(T, { children: "Vaccine" }),
419
- /* @__PURE__ */ m(D, {
420
- label: "Vaccine",
421
- value: K.vaccineConfig?.vaccineCode || "",
422
- onChange: (e) => Z("vaccineCode", e.target.value),
423
- onBlur: W.onBlur("vaccineCode"),
424
- children: [U.length === 0 ? /* @__PURE__ */ p(E, {
425
- value: "",
426
- disabled: !0,
427
- children: /* @__PURE__ */ p("em", { children: "No vaccines configured in immunization master" })
428
- }) : null, U.map((e) => /* @__PURE__ */ m(E, {
429
- value: e.vaccineCode,
430
- children: [
431
- e.vaccineName,
432
- " (",
433
- e.vaccineCode,
434
- ")"
435
- ]
436
- }, e.id))]
437
- }),
438
- /* @__PURE__ */ p(C, { children: W.show("vaccineCode") && Q.vaccineCode ? Q.vaccineCode : "Sourced from medplat_immunization_master" })
439
- ]
427
+ helperText: W.show("vaccineCode") && Q.vaccineCode ? Q.vaccineCode : "Sourced from medplat_immunization_master",
428
+ noOptionsText: "No vaccines configured in immunization master",
429
+ options: me.map((e) => ({
430
+ value: e.vaccineCode,
431
+ label: `${e.vaccineName} (${e.vaccineCode})`
432
+ }))
440
433
  })
441
434
  }),
442
- /* @__PURE__ */ p(w, {
435
+ /* @__PURE__ */ y(O, {
443
436
  item: !0,
444
437
  xs: 12,
445
438
  md: 3,
446
- children: /* @__PURE__ */ p(k, {
439
+ children: /* @__PURE__ */ y(A, {
447
440
  required: !0,
448
441
  fullWidth: !0,
449
442
  size: "small",
@@ -460,11 +453,11 @@ function I() {
460
453
  helperText: W.show("vialVolumeMl") ? Q.vialVolumeMl : ""
461
454
  })
462
455
  }),
463
- /* @__PURE__ */ p(w, {
456
+ /* @__PURE__ */ y(O, {
464
457
  item: !0,
465
458
  xs: 12,
466
459
  md: 3,
467
- children: /* @__PURE__ */ p(k, {
460
+ children: /* @__PURE__ */ y(A, {
468
461
  fullWidth: !0,
469
462
  size: "small",
470
463
  type: "number",
@@ -480,11 +473,11 @@ function I() {
480
473
  helperText: W.show("adultDoseMl") ? Q.adultDoseMl : ""
481
474
  })
482
475
  }),
483
- /* @__PURE__ */ p(w, {
476
+ /* @__PURE__ */ y(O, {
484
477
  item: !0,
485
478
  xs: 12,
486
479
  md: 3,
487
- children: /* @__PURE__ */ p(k, {
480
+ children: /* @__PURE__ */ y(A, {
488
481
  fullWidth: !0,
489
482
  size: "small",
490
483
  type: "number",
@@ -500,11 +493,11 @@ function I() {
500
493
  helperText: W.show("childDoseMl") ? Q.childDoseMl : ""
501
494
  })
502
495
  }),
503
- /* @__PURE__ */ p(w, {
496
+ /* @__PURE__ */ y(O, {
504
497
  item: !0,
505
498
  xs: 12,
506
499
  md: 3,
507
- children: /* @__PURE__ */ p(k, {
500
+ children: /* @__PURE__ */ y(A, {
508
501
  required: !0,
509
502
  fullWidth: !0,
510
503
  size: "small",
@@ -521,11 +514,11 @@ function I() {
521
514
  helperText: W.show("openVialValidityHours") && Q.openVialValidityHours ? Q.openVialValidityHours : "0 = single-use; max 720 (~30 days)"
522
515
  })
523
516
  }),
524
- /* @__PURE__ */ p(w, {
517
+ /* @__PURE__ */ y(O, {
525
518
  item: !0,
526
519
  xs: 12,
527
520
  md: 3,
528
- children: /* @__PURE__ */ p(k, {
521
+ children: /* @__PURE__ */ y(A, {
529
522
  required: !0,
530
523
  fullWidth: !0,
531
524
  size: "small",
@@ -542,23 +535,23 @@ function I() {
542
535
  helperText: W.show("maxConcurrentOpenVials") ? Q.maxConcurrentOpenVials : ""
543
536
  })
544
537
  }),
545
- /* @__PURE__ */ p(w, {
538
+ /* @__PURE__ */ y(O, {
546
539
  item: !0,
547
540
  xs: 12,
548
541
  md: 3,
549
- children: /* @__PURE__ */ p(S, {
550
- control: /* @__PURE__ */ p(y, {
542
+ children: /* @__PURE__ */ y(D, {
543
+ control: /* @__PURE__ */ y(T, {
551
544
  checked: !!K.vaccineConfig?.requiresReconstitution,
552
545
  onChange: (e) => Z("requiresReconstitution", e.target.checked)
553
546
  }),
554
547
  label: "Requires reconstitution"
555
548
  })
556
549
  }),
557
- /* @__PURE__ */ p(w, {
550
+ /* @__PURE__ */ y(O, {
558
551
  item: !0,
559
552
  xs: 12,
560
553
  md: 3,
561
- children: /* @__PURE__ */ p(k, {
554
+ children: /* @__PURE__ */ y(A, {
562
555
  fullWidth: !0,
563
556
  size: "small",
564
557
  type: "number",
@@ -576,32 +569,22 @@ function I() {
576
569
  helperText: W.show("reconstitutedValidityHours") ? Q.reconstitutedValidityHours : ""
577
570
  })
578
571
  }),
579
- /* @__PURE__ */ p(w, {
572
+ /* @__PURE__ */ y(O, {
580
573
  item: !0,
581
574
  xs: 12,
582
575
  md: 3,
583
- children: /* @__PURE__ */ m(x, {
584
- fullWidth: !0,
585
- size: "small",
586
- children: [/* @__PURE__ */ p(T, { children: "Route of Administration" }), /* @__PURE__ */ m(D, {
587
- label: "Route of Administration",
588
- value: K.vaccineConfig?.route || "",
589
- onChange: (e) => Z("route", e.target.value),
590
- children: [/* @__PURE__ */ p(E, {
591
- value: "",
592
- children: /* @__PURE__ */ p("em", { children: "—" })
593
- }), de.map((e) => /* @__PURE__ */ p(E, {
594
- value: e.value,
595
- children: e.label
596
- }, e.value))]
597
- })]
576
+ children: /* @__PURE__ */ y(u, {
577
+ label: "Route of Administration",
578
+ value: K.vaccineConfig?.route || "",
579
+ onChange: (e) => Z("route", e),
580
+ options: g
598
581
  })
599
582
  }),
600
- /* @__PURE__ */ p(w, {
583
+ /* @__PURE__ */ y(O, {
601
584
  item: !0,
602
585
  xs: 12,
603
586
  md: 3,
604
- children: /* @__PURE__ */ p(k, {
587
+ children: /* @__PURE__ */ y(A, {
605
588
  fullWidth: !0,
606
589
  size: "small",
607
590
  type: "number",
@@ -618,11 +601,11 @@ function I() {
618
601
  helperText: W.show("storageTempMinCelsius") && Q.storageTempMinCelsius ? Q.storageTempMinCelsius : "Allowed range: −90°C to +30°C"
619
602
  })
620
603
  }),
621
- /* @__PURE__ */ p(w, {
604
+ /* @__PURE__ */ y(O, {
622
605
  item: !0,
623
606
  xs: 12,
624
607
  md: 3,
625
- children: /* @__PURE__ */ p(k, {
608
+ children: /* @__PURE__ */ y(A, {
626
609
  fullWidth: !0,
627
610
  size: "small",
628
611
  type: "number",
@@ -639,10 +622,10 @@ function I() {
639
622
  helperText: W.show("storageTempMaxCelsius") && Q.storageTempMaxCelsius ? Q.storageTempMaxCelsius : "Allowed range: −90°C to +30°C"
640
623
  })
641
624
  }),
642
- /* @__PURE__ */ p(w, {
625
+ /* @__PURE__ */ y(O, {
643
626
  item: !0,
644
627
  xs: 12,
645
- children: /* @__PURE__ */ p(k, {
628
+ children: /* @__PURE__ */ y(A, {
646
629
  fullWidth: !0,
647
630
  size: "small",
648
631
  multiline: !0,
@@ -661,6 +644,6 @@ function I() {
661
644
  })] });
662
645
  }
663
646
  //#endregion
664
- export { I as default };
647
+ export { F as default };
665
648
 
666
- //# sourceMappingURL=ProductEditPage-DL8gy85Y.js.map
649
+ //# sourceMappingURL=ProductEditPage-B8qFTCW9.js.map