@feedmepos/mf-connect 0.0.24-prod → 0.0.26-prod

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 (62) hide show
  1. package/dist/{Analytic-CHsctJL0.js → Analytic-BwBhJ7bl.js} +8 -8
  2. package/dist/{App-BSiHlz5h.js → App-CA0Bo7YB.js} +5 -5
  3. package/dist/{Broadcast-CL9Sa0bc.js → Broadcast-B7Vr0vR9.js} +7 -7
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C2krWgqp.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DHe7YrHv.js} +8 -8
  5. package/dist/{Card-CqTzwiBp.js → Card-CMtk619g.js} +52 -52
  6. package/dist/{Collections-9OXjYxFu.js → Collections-CoqcbHXm.js} +5 -5
  7. package/dist/{Credit-BDm7vWU6.js → Credit-DO5d0Ia5.js} +7 -7
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B7qqPxFM.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-wjcSfHZH.js} +20 -20
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DItx2Ubv.js → EffectSheet.vue_vue_type_style_index_0_lang-nOplo491.js} +5 -5
  10. package/dist/{Experience-DTWow5NR.js → Experience-0UrzWEqm.js} +7 -7
  11. package/dist/{Game-BkYVDXqA.js → Game-D8Mu-QrE.js} +7 -7
  12. package/dist/{Marketing-sDN1f-Rb.js → Marketing-CR39uxLG.js} +4 -4
  13. package/dist/{Member-CIzs5lmW.js → Member-BZc2vm9K.js} +3 -3
  14. package/dist/{MemberList-CdTv3lWA.js → MemberList-B82Z9gw6.js} +12 -12
  15. package/dist/{MemberTransactions-CBoHXPr7.js → MemberTransactions-D930e4BY.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CSwRL1kp.js → MessageInput.vue_vue_type_script_setup_true_lang-tJa9UGBw.js} +2 -2
  17. package/dist/{Mission-DdHOGOjC.js → Mission-BF7HKRi8.js} +7 -7
  18. package/dist/{Point-Bc4su8pQ.js → Point-B0NCGElf.js} +7 -7
  19. package/dist/{Promotion-Dhl69yfs.js → Promotion-BmQnf0S_.js} +8 -8
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CPHiByal.js → RuleGroup.vue_vue_type_script_setup_true_lang-DLk3mfqC.js} +14 -14
  21. package/dist/{Segment-D95w0dZl.js → Segment-e6COr7ja.js} +7 -7
  22. package/dist/{Setting-C3ia_BMY.js → Setting-AIeGOPa5.js} +7 -7
  23. package/dist/{Store-ziVgZZSh.js → Store-BuMv-LTP.js} +342 -335
  24. package/dist/{StoreRewards-CJBlOtGb.js → StoreRewards-ZneBcoft.js} +10 -10
  25. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-oTTUzRap.js +818 -0
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C-5z47S1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BxIB_0F7.js} +1 -1
  27. package/dist/{Tier-BKBlLV7D.js → Tier-COOABCAS.js} +13 -13
  28. package/dist/{Title-COWE-LXc.js → Title-C3SBQRLi.js} +13 -13
  29. package/dist/{Transaction-BKU5hTvU.js → Transaction-D2mzi_Jl.js} +1 -1
  30. package/dist/{Voucher-DGLn6y-b.js → Voucher-CTzZO62k.js} +10 -10
  31. package/dist/{app-BQpZdCao.js → app-BdK2GXbi.js} +24 -24
  32. package/dist/{app-CKg8FD6W.js → app-DnQYkIC1.js} +1 -1
  33. package/dist/app.js +1 -1
  34. package/dist/{business-DGCDUsna.js → business-DOjJsL7e.js} +1 -1
  35. package/dist/{campaign-DFzcetIZ.js → campaign-BfMIUjwj.js} +2 -2
  36. package/dist/{dto-BOsVyHhB.js → dto-CVcS74Vc.js} +37 -37
  37. package/dist/{effect-DAgCe9mB.js → effect-BoRL9Psq.js} +1 -1
  38. package/dist/{export-BArwqiqn.js → export-BF80KJle.js} +3 -3
  39. package/dist/{helper-CjcpPq85.js → helper-nDRCuCMN.js} +1 -1
  40. package/dist/{index-E9DFEkCN.js → index-B4sdSZlj.js} +1 -1
  41. package/dist/{index-DUmYKFqp.js → index-BLMsRNp3.js} +3 -3
  42. package/dist/{index-DarpjYwN.js → index-Bmre6Xyp.js} +5 -5
  43. package/dist/{index-D61l3xYo.js → index-BoPQzRxs.js} +2 -2
  44. package/dist/{index-CBYeGg9d.js → index-BqxhzaPB.js} +1 -1
  45. package/dist/{index-CksikPRJ.js → index-C3Ue1uba.js} +3 -3
  46. package/dist/{index-BtSUMNhN.js → index-D7SjamN8.js} +1 -1
  47. package/dist/{index-DQNrbgQh.js → index-DNcU_RF1.js} +1 -1
  48. package/dist/{index-BLUNODxz.js → index-DTolyILx.js} +1 -1
  49. package/dist/{index-D9aWLz3L.js → index-F2VnwXeh.js} +1 -1
  50. package/dist/{index-Dl6Tmuvm.js → index-KXzxwHB2.js} +5 -5
  51. package/dist/{index-Cr7N263J.js → index-MP-346gd.js} +2 -2
  52. package/dist/{index.esm2017-CK_DN0pS.js → index.esm2017-EdeAmUeI.js} +1 -1
  53. package/dist/{loading-CrTiMhEE.js → loading-CmOFZn8N.js} +4 -4
  54. package/dist/{membership-BTYMMItR.js → membership-BVO31tOv.js} +3 -3
  55. package/dist/{money-DPJgDQxk.js → money-B5Qx7zIa.js} +1 -1
  56. package/dist/{number-DRvZfW5z.js → number-DSC_WHKN.js} +1 -1
  57. package/dist/{rule-DBp5EC2a.js → rule-B7oRK5yD.js} +2 -2
  58. package/dist/{rule-builder-B7-hVixK.js → rule-builder-DdebV2-2.js} +1 -1
  59. package/dist/{template-D9IbwHGS.js → template-C9fzQdej.js} +3 -3
  60. package/dist/{xlsx-BUPLRzvR.js → xlsx-Cv4wYDm9.js} +1 -1
  61. package/package.json +1 -1
  62. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DNIqB0jd.js +0 -795
@@ -1,795 +0,0 @@
1
- import { defineComponent as P, ref as k, computed as $, onMounted as z, resolveComponent as x, openBlock as R, createBlock as E, unref as n, withCtx as N, createVNode as g, normalizeClass as U, createCommentVNode as re, createElementVNode as I, toDisplayString as q, createElementBlock as L, Fragment as le, renderList as se, mergeModels as K, useModel as ie, watch as j, onBeforeMount as ce, h as c } from "vue";
2
- import { components as S } from "@feedmepos/ui-library";
3
- import { d as ue } from "./index-Cr7N263J.js";
4
- import { a as X } from "./loading-CrTiMhEE.js";
5
- import { s as de } from "./index-Dbd4WA4r.js";
6
- import { h as b } from "./moment-BWErdI6_.js";
7
- import { s as Y } from "./index-CuvNtC_M.js";
8
- import { f as H } from "./number-DRvZfW5z.js";
9
- import { u as me } from "./business-DGCDUsna.js";
10
- import { u as J, _ as Q } from "./usePagination-JoYaROkV.js";
11
- import { g as Z } from "./user-Bm4KttFq.js";
12
- import { B as ee, a as te } from "./export-BArwqiqn.js";
13
- import { o as A } from "./objectId-dwaoBfJX.js";
14
- import { g as G, a as pe, S as fe, b as ge } from "./index-CksikPRJ.js";
15
- function ye(r) {
16
- let s = "";
17
- switch (r) {
18
- case "PORTAL":
19
- s = "ADMIN";
20
- break;
21
- case "BENEFIT":
22
- s = "MEMBERSHIP";
23
- break;
24
- case "ORDER":
25
- s = "ORDER";
26
- break;
27
- case "BILL":
28
- s = "SPENDING";
29
- break;
30
- case "CASHBACK":
31
- s = "CASHBACK";
32
- break;
33
- case "CYCLE":
34
- s = "EXPIRED";
35
- break;
36
- case "COUNTER_CONSUME":
37
- s = "COUNTER REDEEM";
38
- break;
39
- default:
40
- s = r;
41
- break;
42
- }
43
- return s;
44
- }
45
- function be(r) {
46
- var s, l, p, d, o, y;
47
- switch ((s = r == null ? void 0 : r.pf_collectible) == null ? void 0 : s.type) {
48
- case "VOUCHER":
49
- return `${(l = r.pf_collectible) == null ? void 0 : l.type} (${(p = r.pf_collectible) == null ? void 0 : p.name})`;
50
- case "TITLE":
51
- return `${(d = r.pf_collectible) == null ? void 0 : d.type} (${(o = r.pf_collectible) == null ? void 0 : o.name})`;
52
- case "POINT":
53
- return "Experience";
54
- case "COIN":
55
- return "Point";
56
- default:
57
- return de((y = r == null ? void 0 : r.pf_collectible) == null ? void 0 : y.type);
58
- }
59
- }
60
- function he(r) {
61
- switch (r) {
62
- case "ONLINE":
63
- return "Online";
64
- case "COIN":
65
- return "Point";
66
- default:
67
- return r;
68
- }
69
- }
70
- const T = {
71
- getReason: ye,
72
- formattedType: be,
73
- formattedPaymentType: he
74
- }, ve = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, B = /* @__PURE__ */ P({
75
- __name: "FilterChip",
76
- props: {
77
- modelValue: {
78
- type: Array,
79
- required: !1
80
- },
81
- label: {
82
- type: String,
83
- required: !1,
84
- default: ""
85
- },
86
- showItemLabel: {
87
- type: Boolean,
88
- default: !1
89
- },
90
- placement: {
91
- type: String,
92
- required: !1,
93
- default: "bottom-end"
94
- },
95
- class: {
96
- type: String,
97
- required: !1
98
- },
99
- disabled: {
100
- type: Boolean,
101
- required: !1
102
- },
103
- items: {
104
- type: Array,
105
- required: !0
106
- },
107
- icon: {
108
- type: String,
109
- required: !1
110
- }
111
- },
112
- emits: ["update:model-value"],
113
- setup(r, { emit: s }) {
114
- const l = r, p = s, d = k(!1), o = k({}), y = $(() => {
115
- if (!o.value || Object.keys(o.value).length == l.items.length)
116
- return "All";
117
- {
118
- const m = Object.keys(o.value).length;
119
- return `${m > 0 ? m : "None"} selected`;
120
- }
121
- });
122
- function D(m) {
123
- o.value[m] ? delete o.value[m] : o.value[m] = !0, p("update:model-value", Object.keys(o.value));
124
- }
125
- function C() {
126
- Object.keys(o.value).length > 0 ? o.value = {} : o.value = l.items.reduce((m, t) => (m[t.value] = !0, m), {}), p("update:model-value", Object.keys(o.value));
127
- }
128
- return z(() => {
129
- o.value = l.modelValue.reduce(
130
- (m, t) => (m[t] = !0, m),
131
- {}
132
- ), l.modelValue.length == 0;
133
- }), (m, t) => {
134
- const u = x("FmIcon"), _ = x("FmChip"), w = x("FmMenuItem"), f = x("FmMenu");
135
- return R(), E(f, {
136
- placement: r.placement || "bottom-end",
137
- disabled: r.disabled == !0,
138
- "model-value": n(d),
139
- onMenuChanged: t[0] || (t[0] = (e) => d.value = e),
140
- "close-on-click": !1
141
- }, {
142
- "menu-button": N(() => [
143
- g(_, {
144
- label: r.label,
145
- class: U(l.class || "text-fm-color-neutral-gray-400 cursor-pointer")
146
- }, {
147
- default: N(() => [
148
- l.icon ? (R(), E(u, {
149
- key: 0,
150
- name: l.icon,
151
- class: U(l.class),
152
- outline: "",
153
- size: "sm"
154
- }, null, 8, ["name", "class"])) : re("", !0),
155
- I("div", ve, q(l.label) + " " + q(r.showItemLabel ? n(y) : ""), 1),
156
- g(u, {
157
- name: n(d) ? "keyboard_arrow_up" : "keyboard_arrow_down",
158
- class: U(l.class),
159
- outline: "",
160
- size: "sm"
161
- }, null, 8, ["name", "class"])
162
- ]),
163
- _: 1
164
- }, 8, ["label", "class"])
165
- ]),
166
- default: N(() => [
167
- g(w, {
168
- "model-value": Object.keys(n(o)).length === l.items.length,
169
- label: "All",
170
- "has-checkbox": !0,
171
- indeterminate: !0,
172
- onClick: C
173
- }, null, 8, ["model-value"]),
174
- (R(!0), L(le, null, se(l.items ?? [], (e) => (R(), E(w, {
175
- key: e.value,
176
- value: e.value,
177
- label: e.label,
178
- "has-checkbox": !0,
179
- "model-value": n(o)[e.value],
180
- "onUpdate:modelValue": (a) => D(e.value)
181
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
182
- ]),
183
- _: 1
184
- }, 8, ["placement", "disabled", "model-value"]);
185
- };
186
- }
187
- }), O = "YYYY-MM-DD", ae = /* @__PURE__ */ P({
188
- __name: "DateRangeChip",
189
- props: /* @__PURE__ */ K({
190
- modelValue: {
191
- type: Object,
192
- required: !0
193
- }
194
- }, {
195
- dateRange: {
196
- type: Object,
197
- default: () => ({
198
- startDate: b().subtract(7, "day").format(O),
199
- endDate: b().endOf("day").format(O)
200
- })
201
- },
202
- dateRangeModifiers: {}
203
- }),
204
- emits: /* @__PURE__ */ K(["update:model-value"], ["update:dateRange"]),
205
- setup(r, { emit: s }) {
206
- const l = r, p = s, d = ie(r, "dateRange"), o = $(() => d.value ? `${y.value.startDate ?? "Start"} - ${y.value.endDate ?? "End"}` : "No dates selected."), y = $(() => ({
207
- startDate: d.value.startDate ? b(d.value.startDate).format(O) : void 0,
208
- endDate: d.value.endDate ? b(d.value.endDate).format(O) : void 0
209
- }));
210
- return z(() => {
211
- d.value = l.modelValue;
212
- }), j(
213
- () => d.value,
214
- () => {
215
- p("update:model-value", y.value);
216
- }
217
- ), (D, C) => {
218
- const m = x("FmChip"), t = x("FmDateRangePicker");
219
- return R(), E(t, {
220
- modelValue: d.value,
221
- "onUpdate:modelValue": C[0] || (C[0] = (u) => d.value = u),
222
- "show-predefined-range": ""
223
- }, {
224
- "trigger-button": N(() => [
225
- g(m, {
226
- label: n(o),
227
- icon: "calendar_month",
228
- "right-icon": "keyboard_arrow_down",
229
- class: "text-fm-color-neutral-gray-400 cursor-pointer"
230
- }, null, 8, ["label"])
231
- ]),
232
- _: 1
233
- }, 8, ["modelValue"]);
234
- };
235
- }
236
- });
237
- class _e extends ee {
238
- }
239
- const W = () => {
240
- const r = fe.getBusinessId();
241
- if (!r) throw new Error("Invalid business ID");
242
- return ge(`businesses/${r}/transactions`, {
243
- noIdRequired: !0
244
- });
245
- }, M = {
246
- async readAll(r, s) {
247
- const l = G(
248
- await W().get("", {
249
- params: { ...r, ...s }
250
- })
251
- );
252
- return {
253
- meta: l.meta,
254
- resources: l.resources
255
- };
256
- },
257
- async readStoreTransactions(r, s) {
258
- const l = G(
259
- await W().get("/store", {
260
- params: { ...r, ...s }
261
- })
262
- );
263
- return {
264
- meta: l.meta,
265
- resources: l.resources
266
- };
267
- },
268
- async readBills(r, s, l) {
269
- return (await pe("").get(`/restaurants/${r}/receipt?start=${s}&end=${l}`)).data;
270
- }
271
- }, Se = { class: "hidden xs:flex items-center justify-end" }, xe = { class: "flex items-center justify-between" }, we = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, De = { class: "xs:hidden" }, Le = /* @__PURE__ */ P({
272
- __name: "CollectionTransactions",
273
- props: {
274
- user: {
275
- type: String
276
- }
277
- },
278
- setup(r) {
279
- const s = me(), l = r, p = k(!1), d = [
280
- {
281
- header: "Transaction ID",
282
- accessorKey: "_id",
283
- meta: {
284
- maxWidth: "100px"
285
- },
286
- cell(e) {
287
- return c("div", { class: "flex items-center" }, [
288
- c(S.FmIcon, {
289
- name: "content_copy",
290
- outline: !0,
291
- size: "sm",
292
- class: "cursor-pointer mr-4",
293
- onClick: (a) => {
294
- a.preventDefault(), a.stopPropagation(), X(e.row.original._id.toString());
295
- }
296
- }),
297
- c(
298
- "div",
299
- { class: "pr-2 text-ellipsis overflow-hidden" },
300
- e.row.original._id.toString()
301
- )
302
- ]);
303
- },
304
- enableSorting: !1
305
- },
306
- {
307
- header: "Created at",
308
- accessorKey: "_id",
309
- accessorFn: (e) => b(A(e._id.toString())).format("D MMM YYYY, hh:mmA"),
310
- enableSorting: !0
311
- },
312
- {
313
- header: "Amount",
314
- // accessorKey: 'totalAmount',
315
- enableSorting: !1,
316
- cell(e) {
317
- var v, i, F, V;
318
- const a = H(
319
- e.row.original.expiryAmount.reduce(
320
- (ne, oe) => ne + oe.amount,
321
- e.row.original.amount ?? 0
322
- ),
323
- 2
324
- ), h = (i = (v = e.row.original.expiryAmount) == null ? void 0 : v[0]) != null && i.expiredAt ? b((V = (F = e.row.original.expiryAmount) == null ? void 0 : F[0]) == null ? void 0 : V.expiredAt).format(
325
- "D MMM YYYY"
326
- ) : "";
327
- return c("div", { class: "flex items-center" }, [
328
- c(
329
- "div",
330
- {
331
- class: [
332
- "pr-2",
333
- +a > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
334
- ]
335
- },
336
- a
337
- ),
338
- c("div", { class: "flex items-center" }, [
339
- e.row.original.expiryAmount.length > 0 ? c(
340
- S.FmTooltip,
341
- {
342
- content: `Expired on ${h}`
343
- },
344
- [
345
- c(S.FmIcon, {
346
- name: "info",
347
- outline: !0,
348
- size: "sm"
349
- })
350
- ]
351
- ) : c("div")
352
- ])
353
- ]);
354
- }
355
- },
356
- {
357
- header: "Type",
358
- accessorKey: "pf_collectible.type",
359
- accessorFn: (e) => T.formattedType(e),
360
- meta: {
361
- maxWidth: "200px"
362
- },
363
- cell(e) {
364
- const a = T.formattedType(e.row.original);
365
- return c("div", { class: "flex items-center" }, [
366
- c("div", { class: "truncate text-ellipsis" }, a),
367
- a.length > 20 ? c(
368
- S.FmTooltip,
369
- {
370
- content: a
371
- },
372
- [
373
- c(S.FmIcon, {
374
- name: "info",
375
- outline: !0,
376
- size: "sm"
377
- })
378
- ]
379
- ) : null
380
- ]);
381
- }
382
- },
383
- {
384
- header: "Source",
385
- accessorKey: "source",
386
- accessorFn: (e) => Y(T.getReason(e.source))
387
- },
388
- {
389
- header: "User",
390
- accessorKey: "pf_user.name",
391
- cell(e) {
392
- return Z(e.row.original.pf_user);
393
- }
394
- },
395
- {
396
- header: "Phone No.",
397
- accessorKey: "pf_user.phoneNumber",
398
- accessorFn: (e) => {
399
- var a;
400
- return ((a = e == null ? void 0 : e.pf_user) == null ? void 0 : a.phoneNumber) || "";
401
- }
402
- },
403
- {
404
- accessorFn: (e) => e.ref,
405
- header: "References",
406
- accessorKey: "ref",
407
- cell(e) {
408
- var a, h;
409
- return c("div", { class: "flex items-center justify-between gap-4" }, [
410
- c("div", { class: "flex items-center" }, [
411
- (a = e.row.original.metadata) != null && a.remark ? c(
412
- S.FmTooltip,
413
- {
414
- content: (h = e.row.original.metadata) == null ? void 0 : h.remark
415
- },
416
- [
417
- c(S.FmIcon, {
418
- name: "info",
419
- outline: !0,
420
- size: "sm"
421
- })
422
- ]
423
- ) : c("div")
424
- ]),
425
- c("div", { class: "flex-1" }, e.row.original.ref)
426
- ]);
427
- }
428
- }
429
- ], o = k({
430
- search: "",
431
- "pf_collectible.type": [],
432
- "metadata.location": [],
433
- dateRange: {
434
- startDate: b().subtract(7, "day").toISOString(),
435
- endDate: b().endOf("day").toISOString()
436
- },
437
- source: []
438
- }), { tableMeta: y, rowData: D, onSort: C, debouncedFetchData: m, onSearch: t } = J(async (e) => {
439
- const a = {
440
- ...o.value,
441
- user: l.user,
442
- dateRange: {
443
- start: new Date(o.value.dateRange.startDate).toISOString(),
444
- end: new Date(o.value.dateRange.endDate).toISOString()
445
- }
446
- }, h = await M.readAll(e, a);
447
- return {
448
- resources: h.resources.map((v) => {
449
- const i = u.value.find((F) => F._id === v.ref);
450
- return { ...v, ref: (i == null ? void 0 : i.seqNumber) || v.ref };
451
- }),
452
- meta: h.meta
453
- };
454
- }), u = k([]), _ = ue.options.map((e) => ({ label: Y(T.getReason(e)), value: e })), w = s.locations.map((e) => ({ label: e.name, value: e._id }));
455
- j(
456
- o,
457
- () => {
458
- m();
459
- },
460
- { deep: !0 }
461
- );
462
- async function f() {
463
- try {
464
- p.value = !0;
465
- const e = {
466
- ...o.value,
467
- user: l.user,
468
- dateRange: {
469
- start: new Date(o.value.dateRange.startDate).toISOString(),
470
- end: new Date(o.value.dateRange.endDate).toISOString()
471
- }
472
- };
473
- await te({
474
- exporter: new _e(),
475
- readFunction: (a) => M.readAll(a, e),
476
- transformRecord: (a) => {
477
- var h, v, i;
478
- return {
479
- TransactionID: a._id,
480
- CreatedAt: b(A(a._id.toString())).format(
481
- "D MMM YYYY, hh:mmA"
482
- ),
483
- Amount: H(
484
- a.expiryAmount.reduce(
485
- (F, V) => F + V.amount,
486
- a.amount ?? 0
487
- ),
488
- 2
489
- ),
490
- Type: T.formattedType(a),
491
- Source: Y(T.getReason(a.source)),
492
- User: ((h = a.pf_user) == null ? void 0 : h.name) || "",
493
- "Phone No.": ((v = a.pf_user) == null ? void 0 : v.phoneNumber) || "",
494
- References: a.ref,
495
- Remark: ((i = a.metadata) == null ? void 0 : i.remark) || ""
496
- };
497
- },
498
- filename: "transactions"
499
- });
500
- } catch (e) {
501
- console.error(e);
502
- } finally {
503
- p.value = !1;
504
- }
505
- }
506
- return ce(async () => {
507
- await s.readLocations(), await m();
508
- }), (e, a) => {
509
- const h = x("FmSearch"), v = x("FmButton");
510
- return R(), L("div", null, [
511
- I("div", Se, [
512
- g(h, {
513
- class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
514
- modelValue: n(o).search,
515
- "onUpdate:modelValue": a[0] || (a[0] = (i) => n(o).search = i),
516
- placeholder: "Search",
517
- collapsible: ""
518
- }, null, 8, ["modelValue"]),
519
- g(v, {
520
- icon: "ios_share",
521
- variant: "tertiary",
522
- onClick: f
523
- })
524
- ]),
525
- I("div", xe, [
526
- I("div", we, [
527
- g(B, {
528
- class: "cursor-pointer text-fm-color-neutral-gray-400",
529
- "right-icon": "keyboard_arrow_down",
530
- modelValue: n(o)["metadata.location"],
531
- "onUpdate:modelValue": a[1] || (a[1] = (i) => n(o)["metadata.location"] = i),
532
- icon: "storefront",
533
- "show-item-label": !0,
534
- items: n(w)
535
- }, null, 8, ["modelValue", "items"]),
536
- g(B, {
537
- class: "cursor-pointer text-fm-color-neutral-gray-400",
538
- "right-icon": "keyboard_arrow_down",
539
- modelValue: n(o)["pf_collectible.type"],
540
- "onUpdate:modelValue": a[2] || (a[2] = (i) => n(o)["pf_collectible.type"] = i),
541
- label: "Type: ",
542
- "show-item-label": !0,
543
- items: [
544
- { label: "Point", value: "COIN" },
545
- { label: "Credit", value: "CREDIT" },
546
- { label: "Voucher", value: "VOUCHER" },
547
- { label: "Experience", value: "POINT" },
548
- { label: "Tier", value: "TIER" },
549
- { label: "Title", value: "TITLE" },
550
- { label: "Game", value: "GAME" },
551
- { label: "Stamp", value: "STAMP" }
552
- ]
553
- }, null, 8, ["modelValue"]),
554
- g(B, {
555
- class: "cursor-pointer text-fm-color-neutral-gray-400",
556
- "right-icon": "keyboard_arrow_down",
557
- modelValue: n(o).source,
558
- "onUpdate:modelValue": a[3] || (a[3] = (i) => n(o).source = i),
559
- label: "Source: ",
560
- "show-item-label": !0,
561
- items: n(_)
562
- }, null, 8, ["modelValue", "items"]),
563
- g(ae, {
564
- "model-value": {
565
- startDate: n(o).dateRange.startDate,
566
- endDate: n(o).dateRange.endDate
567
- },
568
- "onUpdate:modelValue": a[4] || (a[4] = (i) => n(o).dateRange = {
569
- startDate: n(b)(i.startDate).startOf("d").toISOString(),
570
- endDate: n(b)(i.endDate).endOf("d").toISOString()
571
- })
572
- }, null, 8, ["model-value"])
573
- ]),
574
- g(h, {
575
- class: "xs:hidden",
576
- modelValue: n(o).search,
577
- "onUpdate:modelValue": a[5] || (a[5] = (i) => n(o).search = i),
578
- placeholder: "Search",
579
- collapsible: ""
580
- }, null, 8, ["modelValue"]),
581
- I("div", De, [
582
- g(v, {
583
- icon: "ios_share",
584
- variant: "tertiary",
585
- onClick: f
586
- })
587
- ])
588
- ]),
589
- g(Q, {
590
- loading: n(y).isLoading,
591
- "row-data": n(D),
592
- "row-count": n(y).totalRows,
593
- "column-defs": d.filter(
594
- (i) => !l.user || i.header !== "User" && i.header !== "Phone No."
595
- ),
596
- "page-count": n(y).pageCount,
597
- "page-index": n(y).pageIndex,
598
- "page-size": n(y).pageSize,
599
- "shrink-at": !1,
600
- onSortChange: n(C),
601
- onPageChange: a[6] || (a[6] = (i) => n(m)({
602
- pageSize: i.pageSize,
603
- pageIndex: i.pageIndex
604
- }))
605
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
606
- ]);
607
- };
608
- }
609
- });
610
- class Ce extends ee {
611
- }
612
- const Ie = { class: "flex items-center justify-between" }, Re = { class: "flex gap-8 items-center" }, Fe = { class: "flex gap-8 items-center xs:hidden" }, je = /* @__PURE__ */ P({
613
- __name: "StoreTransactions",
614
- props: {
615
- user: {
616
- type: String
617
- }
618
- },
619
- setup(r) {
620
- const s = r, l = [
621
- {
622
- header: "Transaction ID",
623
- meta: {
624
- maxWidth: "150px"
625
- },
626
- cell(t) {
627
- return c("div", { class: "flex items-center" }, [
628
- c(S.FmIcon, {
629
- name: "content_copy",
630
- outline: !0,
631
- size: "sm",
632
- class: "cursor-pointer mr-4 shrink-0",
633
- onClick: (u) => {
634
- u.preventDefault(), u.stopPropagation(), X(t.row.original._id.toString());
635
- }
636
- }),
637
- c("div", { class: "truncate" }, t.row.original._id.toString())
638
- ]);
639
- }
640
- },
641
- {
642
- header: "Created at",
643
- accessorFn: (t) => b(A(t._id.toString())).format("D MMM YYYY, hh:mmA"),
644
- enableSorting: !0
645
- },
646
- {
647
- header: "Bundle",
648
- accessorFn: (t) => t.bundle.name
649
- },
650
- {
651
- header: "Location",
652
- accessorFn: (t) => t.location ? t.pf_location.name : "Online Store"
653
- },
654
- {
655
- header: "Payment Type",
656
- accessorFn: (t) => {
657
- var u;
658
- return ((u = t.paymentType) == null ? void 0 : u.type) ?? "N/A";
659
- },
660
- cell(t) {
661
- var u, _;
662
- return c("div", { class: "flex items-center gap-4" }, [
663
- c("div", { class: "flex items-center" }, [
664
- ((u = t.row.original.paymentType) == null ? void 0 : u.type) == "ONLINE" && t.row.original.paymentType.extra ? c(
665
- S.FmTooltip,
666
- {
667
- content: t.row.original.paymentType.extra
668
- },
669
- [
670
- c(S.FmIcon, {
671
- name: "info",
672
- outline: !0,
673
- size: "sm"
674
- })
675
- ]
676
- ) : c("div")
677
- ]),
678
- c(
679
- "div",
680
- { class: "flex-1" },
681
- ((_ = t.row.original.paymentType) == null ? void 0 : _.type) ?? "N/A"
682
- )
683
- ]);
684
- }
685
- },
686
- {
687
- header: "User",
688
- cell: (t) => Z(t.row.original.pf_member)
689
- },
690
- {
691
- header: "Phone No.",
692
- accessorFn: (t) => t.pf_member.phoneNumber
693
- },
694
- {
695
- header: "Status",
696
- accessorFn: (t) => t.status
697
- }
698
- ], p = k({
699
- searchValue: "",
700
- dateRange: {
701
- startDate: b().subtract(7, "day").toISOString(),
702
- endDate: b().toISOString()
703
- }
704
- }), { tableMeta: d, rowData: o, onSort: y, debouncedFetchData: D, onSearch: C } = J(async (t) => {
705
- const u = {
706
- ...p.value.dateRange,
707
- user: s.user
708
- };
709
- return await M.readStoreTransactions(t, u);
710
- });
711
- j(
712
- p,
713
- () => {
714
- D();
715
- },
716
- { deep: !0 }
717
- ), z(async () => {
718
- await D();
719
- });
720
- const m = async () => te({
721
- exporter: new Ce(),
722
- readFunction: (t) => M.readStoreTransactions(t, {
723
- ...p.value.dateRange,
724
- user: s.user
725
- }),
726
- transformRecord: (t) => {
727
- var u, _, w, f, e;
728
- return {
729
- TransactionId: ((u = t._id) == null ? void 0 : u.toString()) || "",
730
- CreatedAt: b(A(t._id.toString())).format(
731
- "DD/MM/YYYY HH:mm:ss"
732
- ),
733
- Bundle: t.bundle.name || "",
734
- Location: t.location ? t.pf_location.name : "Online Store",
735
- PaymentType: ((_ = t.paymentType) == null ? void 0 : _.type) || "N/A",
736
- PaymentExtra: ((w = t.paymentType) == null ? void 0 : w.extra) || "",
737
- User: ((f = t.pf_member) == null ? void 0 : f.name) || "",
738
- PhoneNumber: ((e = t.pf_member) == null ? void 0 : e.phoneNumber) || "",
739
- Status: t.status || ""
740
- };
741
- },
742
- filename: "store-transactions"
743
- });
744
- return (t, u) => {
745
- const _ = x("FmSearch"), w = x("FmButton");
746
- return R(), L("div", null, [
747
- I("div", Ie, [
748
- I("div", Re, [
749
- g(ae, {
750
- modelValue: n(p).dateRange,
751
- "onUpdate:modelValue": u[0] || (u[0] = (f) => n(p).dateRange = f)
752
- }, null, 8, ["modelValue"])
753
- ]),
754
- I("div", Fe, [
755
- g(_, {
756
- modelValue: n(d).searchValue,
757
- "onUpdate:modelValue": [
758
- u[1] || (u[1] = (f) => n(d).searchValue = f),
759
- n(C)
760
- ],
761
- placeholder: "Search",
762
- collapsible: ""
763
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
764
- g(w, {
765
- icon: "ios_share",
766
- variant: "tertiary",
767
- onClick: m
768
- })
769
- ])
770
- ]),
771
- g(Q, {
772
- loading: n(d).isLoading,
773
- "row-data": n(o),
774
- "row-count": n(d).totalRows,
775
- "column-defs": l.filter(
776
- (f) => !s.user || f.header !== "User" && f.header !== "Phone No."
777
- ),
778
- "page-count": n(d).pageCount,
779
- "page-index": n(d).pageIndex,
780
- "page-size": n(d).pageSize,
781
- "shrink-at": !1,
782
- onSortChange: n(y),
783
- onPageChange: u[2] || (u[2] = (f) => n(D)({
784
- pageSize: f.pageSize,
785
- pageIndex: f.pageIndex
786
- }))
787
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
788
- ]);
789
- };
790
- }
791
- });
792
- export {
793
- Le as _,
794
- je as a
795
- };