@feedmepos/mf-order-setting 0.0.99 → 0.0.100

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 (46) hide show
  1. package/dist/{DisplaySystemView-Brrexhuz.js → DisplaySystemView-bnG_JNDd.js} +4 -4
  2. package/dist/{FoodCourtInvitationsView-wmZ1J7dm.js → FoodCourtInvitationsView-DbuetF4z.js} +5 -5
  3. package/dist/{FoodCourtOrderSettingsView-CNZs4q-x.js → FoodCourtOrderSettingsView-BXgApCVG.js} +1 -1
  4. package/dist/{FoodCourtOrdersView-DMvZ_Z_C.js → FoodCourtOrdersView-K0iC1arR.js} +4 -4
  5. package/dist/FoodCourtStallsView-DijfdyBw.js +668 -0
  6. package/dist/{FoodCourtStatusView-YdiL94wn.js → FoodCourtStatusView-DTriHcSD.js} +2 -2
  7. package/dist/{KioskDevicesView-DsXy1LWl.js → KioskDevicesView-d2SWWkhC.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-Byoci4Fo.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-DA6c96uZ.js} +5 -5
  9. package/dist/{KioskSettingView-DqUpOq_Y.js → KioskSettingView-I7Hgzrvr.js} +3 -3
  10. package/dist/{KioskView-CdRnNSU0.js → KioskView-B_lLNsaU.js} +6 -6
  11. package/dist/{OrderSettingsView-CjXph68w.js → OrderSettingsView-8OS93YGL.js} +10 -10
  12. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-BG71fNkx.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-K0oCZMt8.js} +1 -1
  13. package/dist/{app-moKDIx07.js → app-qdN8kXAM.js} +43 -27
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-DQqlQ2dX.js → dayjs.min-C-IKwmsU.js} +1 -1
  16. package/dist/{featureFlag-qLUdllY9.js → featureFlag-z_-AhzUC.js} +1 -1
  17. package/dist/food-court-member-joC8tmsI.js +234 -0
  18. package/dist/frontend/mf-order/src/api/food-court/index.d.ts +24 -4
  19. package/dist/frontend/mf-order/src/api/food-court/invitation.d.ts +3 -1
  20. package/dist/frontend/mf-order/src/app.d.ts +16 -0
  21. package/dist/frontend/mf-order/src/main.d.ts +16 -0
  22. package/dist/frontend/mf-order/src/views/food-court/food-court-member.d.ts +29 -14
  23. package/dist/frontend/mf-order/src/views/food-court/stalls/EditStallSheet.vue.d.ts +7 -3
  24. package/dist/frontend/mf-order/src/views/food-court/stalls/GenerateJoinCodeSheet.vue.d.ts +2 -2
  25. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  26. package/dist/{index-D5T7zJ3M.js → index-BK-RT8YN.js} +1 -1
  27. package/dist/{index-BthRwhFh.js → index-BxK-mqfV.js} +1 -1
  28. package/dist/{index-Dy5GRKwA.js → index-DeUtM1Z8.js} +2 -2
  29. package/dist/{index-C44A5dgm.js → index-DfsaaxdM.js} +1 -1
  30. package/dist/{index-BDgJZqqD.js → index-DjtNAyFp.js} +4 -4
  31. package/dist/{index-By3yKf-8.js → index-WSlqpTW2.js} +55 -42
  32. package/dist/{order.dto-DvP9y_72.js → order.dto-BTF8MlM5.js} +2 -2
  33. package/package.json +1 -1
  34. package/src/api/food-court/index.ts +36 -4
  35. package/src/api/food-court/invitation.ts +3 -0
  36. package/src/locales/en-US.json +8 -4
  37. package/src/locales/ja-JP.json +8 -4
  38. package/src/locales/th-TH.json +8 -4
  39. package/src/locales/zh-CN.json +8 -4
  40. package/src/views/food-court/FoodCourtStallsView.vue +43 -10
  41. package/src/views/food-court/food-court-member.spec.ts +139 -13
  42. package/src/views/food-court/food-court-member.ts +99 -30
  43. package/src/views/food-court/stalls/EditStallSheet.vue +41 -20
  44. package/src/views/food-court/stalls/GenerateJoinCodeSheet.vue +6 -6
  45. package/dist/FoodCourtStallsView-B3egjtKo.js +0 -635
  46. package/dist/food-court-member-CfV5vmHz.js +0 -216
@@ -1,216 +0,0 @@
1
- function N(t) {
2
- switch (t.status) {
3
- case "ACTIVE":
4
- return t.visible === !1 ? "INACTIVE" : "ACTIVE";
5
- case "INVITED":
6
- return "INVITED";
7
- case "DECLINED":
8
- return "DECLINED";
9
- default:
10
- return null;
11
- }
12
- }
13
- function C(t) {
14
- switch (t) {
15
- case "PENDING":
16
- return "PENDING_APPROVAL";
17
- case "OPEN":
18
- return "CODE_ISSUED";
19
- default:
20
- return null;
21
- }
22
- }
23
- function I(t) {
24
- var n, s;
25
- const o = [];
26
- for (const { member: e, restaurant: a } of t) {
27
- const r = N(e);
28
- r && o.push({
29
- kind: "member",
30
- key: `member:${e._id}`,
31
- memberId: e._id,
32
- restaurantId: e.restaurantId,
33
- restaurantName: (a == null ? void 0 : a.name) || null,
34
- status: e.status,
35
- listStatus: r,
36
- unitNo: ((n = e.stall) == null ? void 0 : n.unitNo) ?? null,
37
- displayName: ((s = e.stall) == null ? void 0 : s.displayName) ?? null
38
- });
39
- }
40
- return o;
41
- }
42
- function f(t) {
43
- var n, s;
44
- const o = [];
45
- for (const { joinCode: e, restaurant: a } of t) {
46
- const r = C(e.status);
47
- r && o.push({
48
- kind: "joinCode",
49
- key: `joinCode:${e._id}`,
50
- joinCodeId: e._id,
51
- status: e.status === "PENDING" ? "PENDING" : "OPEN",
52
- listStatus: r,
53
- restaurantId: e.restaurantId ?? (a == null ? void 0 : a._id) ?? null,
54
- restaurantName: (a == null ? void 0 : a.name) || null,
55
- businessName: (a == null ? void 0 : a.businessName) || null,
56
- unitNo: ((n = e.stall) == null ? void 0 : n.unitNo) ?? null,
57
- displayName: ((s = e.stall) == null ? void 0 : s.displayName) ?? null,
58
- expiresAt: e.expiresAt
59
- });
60
- }
61
- return [
62
- ...o.filter((e) => e.status === "PENDING"),
63
- ...o.filter((e) => e.status === "OPEN")
64
- ];
65
- }
66
- function v(t, o = []) {
67
- return [...f(o), ...I(t)];
68
- }
69
- const O = {
70
- ACTIVE: { variant: "success", labelKey: "order.foodCourt.stalls.statusActive" },
71
- INACTIVE: { variant: "neutral", labelKey: "order.foodCourt.stalls.statusInactive" },
72
- INVITED: { variant: "neutral", labelKey: "order.foodCourt.stalls.statusInvited" },
73
- DECLINED: { variant: "critical", labelKey: "order.foodCourt.stalls.statusDeclined" },
74
- PENDING_APPROVAL: {
75
- variant: "warning",
76
- labelKey: "order.foodCourt.stalls.statusPendingApproval"
77
- },
78
- CODE_ISSUED: { variant: "info", labelKey: "order.foodCourt.stalls.statusCodeIssued" }
79
- };
80
- function S(t) {
81
- return t.displayName || t.restaurantName || t.restaurantId || "";
82
- }
83
- function L(t) {
84
- const o = t.restaurantName || t.restaurantId || "";
85
- return t.businessName && t.businessName !== o ? `${o} (${t.businessName})` : o;
86
- }
87
- const y = {
88
- ACTIVE: ["edit", "deactivate", "remove"],
89
- INACTIVE: ["edit", "activate", "remove"],
90
- INVITED: ["edit", "cancelInvite"],
91
- DECLINED: [],
92
- PENDING_APPROVAL: ["approve", "decline"],
93
- CODE_ISSUED: ["cancelCode"]
94
- }, p = {
95
- edit: "order.edit",
96
- deactivate: "order.foodCourt.stalls.actionDeactivate",
97
- activate: "order.foodCourt.stalls.actionActivate",
98
- remove: "order.foodCourt.stalls.actionRemove",
99
- cancelInvite: "order.foodCourt.stalls.actionCancelInvite",
100
- approve: "order.foodCourt.stalls.actionApprove",
101
- decline: "order.foodCourt.stalls.actionDecline",
102
- cancelCode: "order.foodCourt.stalls.actionCancelCode"
103
- }, D = "ABCDEFGHJKMNPQRSTUVWXYZ23456789", u = 10;
104
- function E(t) {
105
- return (t ?? "").toUpperCase().replace(/[\s-]/g, "");
106
- }
107
- function b(t) {
108
- const o = E(t);
109
- return o.length === u && [...o].every((n) => D.includes(n));
110
- }
111
- function m(t) {
112
- const o = E(t);
113
- if (o.length !== u) return o;
114
- const n = u / 2;
115
- return `${o.slice(0, n)}-${o.slice(n)}`;
116
- }
117
- const l = { min: 1, max: 50 };
118
- function P(t) {
119
- return typeof t != "number" || Number.isNaN(t) ? l.min : Math.min(l.max, Math.max(l.min, Math.trunc(t)));
120
- }
121
- function j(t) {
122
- return t.map((o) => m(o)).filter(Boolean).join(`
123
- `);
124
- }
125
- const d = {
126
- JOIN_CODE_INVALID: "order.foodCourt.joinErrors.invalid",
127
- JOIN_CODE_EXPIRED: "order.foodCourt.joinErrors.expired",
128
- JOIN_CODE_USED: "order.foodCourt.joinErrors.used",
129
- TOO_MANY_ATTEMPTS: "order.foodCourt.joinErrors.tooManyAttempts",
130
- MEMBER_EXISTS: "order.foodCourt.joinErrors.memberExists",
131
- JOIN_REQUEST_EXISTS: "order.foodCourt.joinErrors.requestExists",
132
- RESTAURANT_NOT_MANAGEABLE: "order.foodCourt.joinErrors.notManageable"
133
- };
134
- function R(t) {
135
- const o = typeof t == "object" && t !== null ? t.code : void 0;
136
- return typeof o == "string" && Object.prototype.hasOwnProperty.call(d, o) ? d[o] : null;
137
- }
138
- function V(t) {
139
- return typeof t == "object" && t !== null && t.code === "RESTAURANT_NOT_FOUND";
140
- }
141
- const A = {
142
- INVITED: "INVITED",
143
- ACTIVE: "JOINED",
144
- DECLINED: "DECLINED",
145
- REVOKED: "CANCELLED",
146
- REMOVED: "LEFT"
147
- };
148
- function T(t) {
149
- const o = [t == null ? void 0 : t.line1, t == null ? void 0 : t.city, t == null ? void 0 : t.state].map((n) => (n ?? "").trim()).filter(Boolean);
150
- return o.length ? o.reduce((n, s) => `${n}${n.endsWith(",") ? " " : ", "}${s}`) : null;
151
- }
152
- function M(t) {
153
- const o = t.map(({ foodCourtId: s, profile: e, member: a }) => {
154
- var r, c;
155
- return {
156
- foodCourtId: s,
157
- memberId: a._id,
158
- courtName: (e == null ? void 0 : e.name) || null,
159
- courtAddress: T(e == null ? void 0 : e.address),
160
- status: A[a.status] ?? "CANCELLED",
161
- unitNo: ((r = a.stall) == null ? void 0 : r.unitNo) ?? null,
162
- displayName: ((c = a.stall) == null ? void 0 : c.displayName) ?? null,
163
- joinedAt: a.joinedAt ?? null,
164
- since: a.joinedAt ?? a.invitedAt ?? null
165
- };
166
- }), n = (s) => s.since && Date.parse(s.since) || 0;
167
- return o.sort((s, e) => n(e) - n(s));
168
- }
169
- const J = {
170
- JOINED: { variant: "success", labelKey: "order.foodCourt.invitations.statusJoined" },
171
- INVITED: { variant: "neutral", labelKey: "order.foodCourt.invitations.statusInvited" },
172
- DECLINED: { variant: "critical", labelKey: "order.foodCourt.invitations.statusDeclined" },
173
- CANCELLED: { variant: "neutral", labelKey: "order.foodCourt.invitations.statusCancelled" },
174
- LEFT: { variant: "neutral", labelKey: "order.foodCourt.invitations.statusLeft" }
175
- }, K = 60;
176
- function i(t) {
177
- const o = (t ?? "").trim();
178
- return o || null;
179
- }
180
- function _(t, o) {
181
- const n = i(t);
182
- return n === i(o) ? null : n;
183
- }
184
- function h(t, o, n) {
185
- return { unitNo: i(t), displayName: _(o, n) };
186
- }
187
- function U(t, o) {
188
- const n = { unitNo: i(t), displayName: i(o) };
189
- return n.unitNo || n.displayName ? n : null;
190
- }
191
- function g(t) {
192
- return t instanceof Error && t.message ? t.message : String(t);
193
- }
194
- export {
195
- l as J,
196
- J as M,
197
- y as S,
198
- p as a,
199
- K as b,
200
- P as c,
201
- U as d,
202
- g as e,
203
- m as f,
204
- S as g,
205
- O as h,
206
- T as i,
207
- j,
208
- b as k,
209
- R as l,
210
- M as m,
211
- E as n,
212
- V as o,
213
- L as r,
214
- h as s,
215
- v as t
216
- };