@feedmepos/mf-connect 0.1.37-prod → 0.1.38-beta.10

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 (118) hide show
  1. package/dist/Analytic-BdyLURDk.js +761 -0
  2. package/dist/{App-Bpo0XZSs.js → App-BLV7hTax.js} +364 -352
  3. package/dist/AuditLogs-DbJczPj1.js +1887 -0
  4. package/dist/{Bin-ohZ2CZZR.js → Bin-BMEEisLw.js} +8 -8
  5. package/dist/{Broadcast-D5x0_-zC.js → Broadcast-kJ4PM-iv.js} +40 -40
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYb38NXA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dyy6Iknj.js} +18 -18
  7. package/dist/{Card-BM-Lrm5y.js → Card-SrRupWyd.js} +159 -159
  8. package/dist/{Collections-Cr4aoJer.js → Collections-CNoranW5.js} +136 -123
  9. package/dist/{Credit-DzDVFv4H.js → Credit-tW7knMvR.js} +74 -74
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bs8o9n1V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BplJqfmQ.js} +491 -488
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js → EffectSheet.vue_vue_type_style_index_0_lang-DKKptxcn.js} +91 -89
  13. package/dist/{Experience-CjaDdbvZ.js → Experience-DkZIYg_s.js} +41 -41
  14. package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
  15. package/dist/{Game-BuiTygow.js → Game-D3smlHJp.js} +31 -31
  16. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  17. package/dist/{Index-CQGzUU-w.js → Index-3Iep5Agi.js} +10 -10
  18. package/dist/Marketing-e3He2TRQ.js +20073 -0
  19. package/dist/Member-CdOzAmzY.js +279 -0
  20. package/dist/MemberList-DPNBniHV.js +1606 -0
  21. package/dist/MemberOverview-wL_ailso.js +58 -0
  22. package/dist/{MemberTransactions-DzG1fY0c.js → MemberTransactions-B4ROd3yQ.js} +1 -1
  23. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CF0IVI5X.js +60482 -0
  24. package/dist/{Mission-BtypT2uF.js → Mission-BRnOVwzw.js} +21 -21
  25. package/dist/{Overview-Be7bUtRO.js → Overview-DJ4ihjSG.js} +335 -335
  26. package/dist/{Point-Bw4lnLqp.js → Point-X2XbIe2Q.js} +41 -41
  27. package/dist/Promotion-B6FXsO-R.js +289 -0
  28. package/dist/{Queue-CpPEVgn8.js → Queue-kzL4GDld.js} +52 -52
  29. package/dist/{Record-DQq4P69i.js → Record-CbpzqZvu.js} +9 -9
  30. package/dist/{Reward-DJH0eM8u.js → Reward-CnLgcOl6.js} +173 -173
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_kw_PR0h.js → RewardGroup.vue_vue_type_script_setup_true_lang-CGzaVt3L.js} +11 -11
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BHSbFQ81.js +1751 -0
  33. package/dist/Segment-C9rvyN-t.js +882 -0
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js → SelectItems.vue_vue_type_script_setup_true_lang-Bq2TBHn4.js} +2 -2
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B60_8Toi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-9rmFSymz.js} +11 -11
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCaJ3xKT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-qAwMzxkn.js} +3 -3
  37. package/dist/Setting-CHWl3Rlt.js +1936 -0
  38. package/dist/{Store-H0UDQpln.js → Store-BEJYH91p.js} +211 -211
  39. package/dist/StoreRewards-C0LoDVM6.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Q7W66jrt.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-zupkP2uw.js} +1 -1
  42. package/dist/{Tier-CJufQcIz.js → Tier-8dGY0rNK.js} +106 -106
  43. package/dist/{Title-BBMgGUld.js → Title-BdgXkzgT.js} +133 -131
  44. package/dist/{Transaction-DsucPnfp.js → Transaction-BgFnK0ZU.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CwOcZEQX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-gMC5mLHh.js} +6 -6
  46. package/dist/{Voucher-BPvxKO_w.js → Voucher-B2ITqfZO.js} +153 -123
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BZ1uzuZz.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js → ZodTextField.vue_vue_type_script_setup_true_lang-C9svkJkQ.js} +1 -1
  49. package/dist/{app-D3MT1deX.js → app-BpNK9Shm.js} +164 -125
  50. package/dist/{app-Bo0JpadQ.js → app-kfprY-bq.js} +1 -1
  51. package/dist/app.js +4 -3
  52. package/dist/business-DKrvq1V9.js +79 -0
  53. package/dist/{campaign-j1c3ou7l.js → campaign-DmYOJ9S0.js} +5 -3
  54. package/dist/{campaign-Z3l7BoMg.js → campaign-sim1PpwX.js} +9 -9
  55. package/dist/{campaign.enum-CVXPc5Pd.js → campaign.enum-BD2rWUV4.js} +1 -1
  56. package/dist/campaign.fn-CBkNQbkW.js +758 -0
  57. package/dist/{collectible.enum-CDSikBAy.js → collectible.enum-SmUqreZO.js} +1 -1
  58. package/dist/{collection.fn-Bz38mGMa.js → collection.fn-kt3pF_1n.js} +2 -2
  59. package/dist/{dto-D648NN4s.js → dto-CgQvfjEp.js} +4 -4
  60. package/dist/{effect-DbMAmVSR.js → effect-Cof8Q_oG.js} +1 -1
  61. package/dist/{email-addresses-KOVDrRiK.js → email-addresses-Bq1gqAtY.js} +1 -1
  62. package/dist/{export-cTZf8Avd.js → export-CvhFTpK3.js} +3 -3
  63. package/dist/{helper-BYyfcLqw.js → helper-fHTdEmqM.js} +1 -1
  64. package/dist/index-B5526zoT.js +56 -0
  65. package/dist/index-BKs8ARn4.js +32260 -0
  66. package/dist/{index-DPBHiqsJ.js → index-BOxj8CUi.js} +11 -4
  67. package/dist/{index-nF9iYTlh.js → index-CA6LB3uR.js} +1 -1
  68. package/dist/{index-BrKXRxe_.js → index-CDPz2U9g.js} +1 -1
  69. package/dist/{index-CTPMbFf5.js → index-CNB0Lbxl.js} +10 -9
  70. package/dist/{index-E-0tTd0_.js → index-CYkHKi_f.js} +1 -1
  71. package/dist/{index-B3p0hmIV.js → index-ChdZIg_A.js} +1 -1
  72. package/dist/index-CsaQJMAR.js +66 -0
  73. package/dist/{index-BTb8I_eB.js → index-DBwa778L.js} +1 -1
  74. package/dist/{index-B4MqsaBz.js → index-DFZmjlFv.js} +3 -3
  75. package/dist/{index-BMl2KZts.js → index-DR0MjqoO.js} +11415 -10933
  76. package/dist/{index-BIaCtk8e.js → index-DasON_G8.js} +192 -79
  77. package/dist/index-ZoiSAZFK.js +31 -0
  78. package/dist/{index-CvoShC5J.js → index-meUmYtul.js} +536 -461
  79. package/dist/{index.esm2017-DFYwde30.js → index.esm2017-C7S5pHXF.js} +127 -127
  80. package/dist/{loading-vUArhX_O.js → loading-CWqSCt18.js} +1 -1
  81. package/dist/{membership-BHKv29yt.js → membership-DetnBa1q.js} +3 -3
  82. package/dist/{money-Bl3_QRkE.js → money-BkjOh2D6.js} +1 -1
  83. package/dist/{number-hh_S9w7k.js → number-DgbK531o.js} +1 -1
  84. package/dist/objectid-BQwSaw2U.js +145 -0
  85. package/dist/{plugins-CVes2wzE.js → plugins-OrApXSK1.js} +2 -2
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/{reward-ANZOdWzf.js → reward-KXD18Lzr.js} +1 -1
  88. package/dist/{rule-BvFk5bQg.js → rule-BnAvQkaq.js} +3 -3
  89. package/dist/{rule-builder-BSN777PN.js → rule-builder-fPUwOVc7.js} +17 -17
  90. package/dist/style.css +4 -1
  91. package/dist/{template-Dh9lDLs_.js → template-SbZEb9hY.js} +64 -64
  92. package/dist/{trigger-C7THbt7R.js → trigger-CnST_aOW.js} +7 -7
  93. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  94. package/dist/{user-DtNR9JY2.js → user-D2wQnmQQ.js} +1 -1
  95. package/dist/{vue-i18n-BWyHnm4m.js → vue-i18n-DiFFrwf8.js} +375 -375
  96. package/dist/{xlsx-7u9SB0oa.js → xlsx-B47YZ_wM.js} +226 -226
  97. package/package.json +9 -3
  98. package/dist/Analytic-CavR2bzs.js +0 -427
  99. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  100. package/dist/Marketing-BSspYuhg.js +0 -319
  101. package/dist/Member-B4S0UNGq.js +0 -287
  102. package/dist/MemberList-CfnUJ3mh.js +0 -1606
  103. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  104. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-hZUWLTWj.js +0 -455
  105. package/dist/Promotion-Bg6x0rAh.js +0 -255
  106. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CRGep1RK.js +0 -1641
  107. package/dist/Segment-BLB4VWNJ.js +0 -882
  108. package/dist/Setting-GRIUo7vg.js +0 -1932
  109. package/dist/StoreRewards--TNIFaCo.js +0 -423
  110. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfB8tA5l.js +0 -995
  111. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bg-9YqLP.js +0 -419
  112. package/dist/business-DMALI7ZO.js +0 -78
  113. package/dist/campaign.fn-rsRhHYZP.js +0 -758
  114. package/dist/index-BsCGyJMY.js +0 -29566
  115. package/dist/index-CuvNtC_M.js +0 -61
  116. package/dist/index-DFKmjCG1.js +0 -44
  117. package/dist/index-Dbd4WA4r.js +0 -61
  118. package/dist/objectid-CEyMlMge.js +0 -145
@@ -1,995 +0,0 @@
1
- import { defineComponent as H, mergeModels as ee, useModel as fe, computed as U, onMounted as ae, watch as Q, resolveComponent as A, openBlock as F, createBlock as q, withCtx as W, createVNode as D, unref as l, ref as O, h as n, isRef as ge, createElementVNode as x, createElementBlock as V, Fragment as X, renderList as te, toDisplayString as L, createTextVNode as he, resolveDynamicComponent as ye, onBeforeMount as ve } from "vue";
2
- import { components as S, useDialog as _e } from "@feedmepos/ui-library";
3
- import { r as oe } from "./index-CvoShC5J.js";
4
- import "./index-BsCGyJMY.js";
5
- import { s as be } from "./index-Dbd4WA4r.js";
6
- import { h } from "./moment-BWErdI6_.js";
7
- import { _ as j } from "./FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js";
8
- import { s as K } from "./index-CuvNtC_M.js";
9
- import { f as J } from "./number-hh_S9w7k.js";
10
- import { u as ne } from "./business-DMALI7ZO.js";
11
- import { u as re, _ as le } from "./usePagination-JoYaROkV.js";
12
- import { a as Z, c as Se, p as xe } from "./plugins-CVes2wzE.js";
13
- import { g as se } from "./user-DtNR9JY2.js";
14
- import { B as ie, e as ce } from "./export-cTZf8Avd.js";
15
- import { u as ue } from "./campaign-j1c3ou7l.js";
16
- import "./index-BTb8I_eB.js";
17
- import "./index-CTPMbFf5.js";
18
- import "./index-BIaCtk8e.js";
19
- import "./index-BrKXRxe_.js";
20
- import "./index-B4MqsaBz.js";
21
- import { u as we } from "./vue-i18n-BWyHnm4m.js";
22
- import { o as P } from "./objectId-dwaoBfJX.js";
23
- import { useRouter as De } from "vue-router";
24
- import { t as G } from "./index-DFKmjCG1.js";
25
- import { R as z } from "./app-D3MT1deX.js";
26
- import { u as Re } from "./loading-vUArhX_O.js";
27
- import { useCoreStore as Te } from "@feedmepos/mf-common";
28
- import { m as Ce } from "./index-DPBHiqsJ.js";
29
- function Ie(u) {
30
- let f = "";
31
- switch (u) {
32
- case "PORTAL":
33
- f = "ADMIN";
34
- break;
35
- case "BENEFIT":
36
- f = "MEMBERSHIP";
37
- break;
38
- case "ORDER":
39
- f = "ORDER";
40
- break;
41
- case "BILL":
42
- f = "SPENDING";
43
- break;
44
- case "CASHBACK":
45
- f = "CASHBACK";
46
- break;
47
- case "CYCLE":
48
- f = "EXPIRED";
49
- break;
50
- case "COUNTER_CONSUME":
51
- f = "COUNTER REDEEM";
52
- break;
53
- default:
54
- f = u;
55
- break;
56
- }
57
- return f;
58
- }
59
- function Fe(u) {
60
- var f, _, c, m, b, T;
61
- switch ((f = u == null ? void 0 : u.pf_collectible) == null ? void 0 : f.type) {
62
- case "VOUCHER":
63
- return `${(_ = u.pf_collectible) == null ? void 0 : _.type} (${(c = u.pf_collectible) == null ? void 0 : c.name})`;
64
- case "TITLE":
65
- return `${(m = u.pf_collectible) == null ? void 0 : m.type} (${(b = u.pf_collectible) == null ? void 0 : b.name})`;
66
- case "POINT":
67
- return "Experience";
68
- case "COIN":
69
- return "Point";
70
- default:
71
- return be((T = u == null ? void 0 : u.pf_collectible) == null ? void 0 : T.type);
72
- }
73
- }
74
- function Ee(u) {
75
- switch (u) {
76
- case "ONLINE":
77
- return "Online";
78
- case "COIN":
79
- return "Point";
80
- default:
81
- return u;
82
- }
83
- }
84
- const E = {
85
- getReason: Ie,
86
- formattedType: Fe,
87
- formattedPaymentType: Ee
88
- }, k = "YYYY-MM-DD", de = /* @__PURE__ */ H({
89
- __name: "DateRangeChip",
90
- props: /* @__PURE__ */ ee({
91
- modelValue: {
92
- type: Object,
93
- required: !0
94
- }
95
- }, {
96
- dateRange: {
97
- type: Object,
98
- default: () => ({
99
- startDate: h().subtract(7, "day").format(k),
100
- endDate: h().endOf("day").format(k)
101
- })
102
- },
103
- dateRangeModifiers: {}
104
- }),
105
- emits: /* @__PURE__ */ ee(["update:model-value"], ["update:dateRange"]),
106
- setup(u, { emit: f }) {
107
- const _ = u, c = f, m = fe(u, "dateRange"), b = U(() => m.value ? `${T.value.startDate ?? "Start"} - ${T.value.endDate ?? "End"}` : "No dates selected."), T = U(() => ({
108
- startDate: m.value.startDate ? h(m.value.startDate).format(k) : void 0,
109
- endDate: m.value.endDate ? h(m.value.endDate).format(k) : void 0
110
- }));
111
- return ae(() => {
112
- m.value = {
113
- startDate: _.modelValue.startDate ? h(_.modelValue.startDate).format(k) : void 0,
114
- endDate: _.modelValue.endDate ? h(_.modelValue.endDate).format(k) : void 0
115
- };
116
- }), Q(
117
- () => m.value,
118
- () => {
119
- c("update:model-value", T.value);
120
- }
121
- ), (d, R) => {
122
- const N = A("FmChip"), p = A("FmDateRangePicker");
123
- return F(), q(p, {
124
- modelValue: m.value,
125
- "onUpdate:modelValue": R[0] || (R[0] = (o) => m.value = o),
126
- "show-predefined-range": ""
127
- }, {
128
- "trigger-button": W(() => [
129
- D(N, {
130
- label: l(b),
131
- icon: "calendar_month",
132
- "right-icon": "keyboard_arrow_down",
133
- class: "text-fm-color-neutral-gray-400 cursor-pointer"
134
- }, null, 8, ["label"])
135
- ]),
136
- _: 1
137
- }, 8, ["modelValue"]);
138
- };
139
- }
140
- });
141
- class Ae extends ie {
142
- }
143
- const Ne = { class: "space-y-24 pr-12" }, Oe = { class: "w-full space-y-16" }, Me = { class: "fm-typo-en-body-lg-600" }, ke = ["onClick"], Ve = /* @__PURE__ */ x("hr", { class: "mt-3" }, null, -1), Pe = { class: "fm-typo-en-body-lg-600" }, Ye = ["onClick"], Ue = /* @__PURE__ */ x("hr", { class: "mt-3" }, null, -1), $e = { class: "flex items-center gap-8" }, Be = /* @__PURE__ */ H({
144
- __name: "TransactionDetailSheet",
145
- setup(u, { expose: f }) {
146
- we();
147
- const _ = O(!1), c = O(), m = ue(), b = ne();
148
- function T(p, o) {
149
- _.value = p, c.value = o ?? null;
150
- }
151
- const d = U(() => {
152
- var p, o;
153
- return J(
154
- ((o = c.value) == null ? void 0 : o.expiryAmount.reduce(
155
- (e, s) => e + s.amount,
156
- ((p = c.value) == null ? void 0 : p.amount) ?? 0
157
- )) ?? 0,
158
- 2
159
- );
160
- }), R = U(() => {
161
- var p, o, e, s, r;
162
- return c.value ? [
163
- {
164
- label: "Transaction ID",
165
- value: (p = c.value) == null ? void 0 : p._id
166
- },
167
- {
168
- label: "Date/Time",
169
- value: h(P(c.value._id.toString())).format(
170
- "D MMM YYYY, hh:mmA"
171
- )
172
- },
173
- {
174
- label: "Amount",
175
- component: () => n(
176
- "span",
177
- {
178
- class: [
179
- "pr-2",
180
- +d.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
181
- ]
182
- },
183
- d.value
184
- )
185
- },
186
- {
187
- label: "Type",
188
- value: E.formattedType(c.value)
189
- },
190
- {
191
- label: "Source",
192
- value: K(E.getReason(c.value.source))
193
- },
194
- {
195
- label: "User",
196
- value: (e = (o = c.value) == null ? void 0 : o.pf_user) == null ? void 0 : e.name
197
- },
198
- {
199
- label: "Phone Number",
200
- value: (r = (s = c.value) == null ? void 0 : s.pf_user) == null ? void 0 : r.phoneNumber
201
- }
202
- ] : [];
203
- }), N = U(() => {
204
- var s, r, w, g;
205
- if (!c.value) return [];
206
- const p = [], o = (s = c.value) == null ? void 0 : s.metadata, e = c.value;
207
- if (o != null && o.campaign) {
208
- const C = m.campaigns.all.find(
209
- (M) => M._id === (o == null ? void 0 : o.campaign)
210
- );
211
- if (!C) return;
212
- p.push({
213
- label: "Campaign",
214
- value: C.name
215
- });
216
- }
217
- return o != null && o.remark && p.push({
218
- label: "Remark",
219
- value: o.remark
220
- }), (r = c.value) != null && r.ref.startsWith("bill_") && p.push({
221
- label: "Bill Number",
222
- value: (w = c.value) == null ? void 0 : w.ref,
223
- copy: () => {
224
- var C;
225
- return Z((C = c.value) == null ? void 0 : C.ref);
226
- }
227
- }), o != null && o.location && p.push({
228
- label: "Location",
229
- value: (g = b.locations.find(
230
- (C) => C._id.toString() === (o == null ? void 0 : o.location)
231
- )) == null ? void 0 : g.name
232
- }), e.source === oe.enum.STORE && p.push({
233
- label: "Store Transaction",
234
- value: e.ref
235
- }), o != null && o.originTransaction && p.push({
236
- label: "Parent Transaction",
237
- value: o.originTransaction
238
- }), o != null && o.referral_count && p.push({
239
- label: "Referral Count",
240
- value: o.referral_count
241
- }), e.refunded && p.push({
242
- label: "Refunded From",
243
- value: e.refundedFrom
244
- }), p;
245
- });
246
- return f({
247
- showSheet: T
248
- }), (p, o) => {
249
- const e = A("FmButton"), s = A("FmSideSheet");
250
- return F(), q(s, {
251
- "max-width": 560,
252
- modelValue: l(_),
253
- "onUpdate:modelValue": o[1] || (o[1] = (r) => ge(_) ? _.value = r : null),
254
- header: "Transaction Details"
255
- }, {
256
- "side-sheet-footer": W(() => [
257
- x("div", $e, [
258
- D(e, {
259
- label: "Close",
260
- onClick: o[0] || (o[0] = (r) => T(!1)),
261
- variant: "tertiary"
262
- })
263
- ])
264
- ]),
265
- default: W(() => [
266
- x("div", Ne, [
267
- x("div", Oe, [
268
- (F(!0), V(X, null, te(l(R), (r) => (F(), V("div", {
269
- key: r.label,
270
- class: "flex flex-col gap-4"
271
- }, [
272
- x("div", Me, L(r.label), 1),
273
- x("div", {
274
- class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
275
- onClick: r.copy
276
- }, [
277
- he(L(r.accessorFn ? r.accessorFn() : r.value) + " ", 1),
278
- (F(), q(ye(r.component)))
279
- ], 8, ke),
280
- Ve
281
- ]))), 128)),
282
- (F(!0), V(X, null, te(l(N), (r) => (F(), V("div", {
283
- key: r.label,
284
- class: "flex flex-col gap-4"
285
- }, [
286
- x("div", Pe, L(r.label), 1),
287
- x("div", {
288
- class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
289
- onClick: r.copy
290
- }, L(r.accessorFn ? r.accessorFn() : r.value), 9, Ye),
291
- Ue
292
- ]))), 128))
293
- ])
294
- ])
295
- ]),
296
- _: 1
297
- }, 8, ["modelValue"]);
298
- };
299
- }
300
- }), Le = { class: "hidden xs:flex items-center justify-end" }, ze = { class: "flex items-center justify-between" }, Ke = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, Ge = { class: "xs:hidden" }, Dt = /* @__PURE__ */ H({
301
- __name: "CollectionTransactions",
302
- props: {
303
- user: {
304
- type: String
305
- }
306
- },
307
- setup(u) {
308
- const f = ne(), _ = ue(), c = De(), m = u, b = O(!1), T = [
309
- {
310
- header: "Transaction ID",
311
- accessorKey: "_id",
312
- meta: {
313
- maxWidth: "100px"
314
- },
315
- cell(a) {
316
- return n("div", { class: "flex items-center" }, [
317
- n(S.FmIcon, {
318
- name: "content_copy",
319
- outline: !0,
320
- size: "sm",
321
- class: "cursor-pointer mr-4",
322
- onClick: (t) => {
323
- t.preventDefault(), t.stopPropagation(), Z(a.row.original._id.toString());
324
- }
325
- }),
326
- n(
327
- "div",
328
- { class: "pr-2 text-ellipsis overflow-hidden" },
329
- a.row.original._id.toString()
330
- )
331
- ]);
332
- },
333
- enableSorting: !1
334
- },
335
- {
336
- header: "Created at",
337
- accessorKey: "_id",
338
- accessorFn: (a) => h(P(a._id.toString())),
339
- cell: (a) => h(P(a.row.original._id.toString())).format(
340
- "D MMM YYYY, hh:mmA"
341
- ),
342
- enableSorting: !0
343
- },
344
- {
345
- header: "Amount",
346
- // accessorKey: 'totalAmount',
347
- enableSorting: !1,
348
- cell(a) {
349
- var v, i, I, Y;
350
- const t = J(
351
- a.row.original.expiryAmount.reduce(
352
- ($, B) => $ + B.amount,
353
- a.row.original.amount ?? 0
354
- ),
355
- 2
356
- ), y = (i = (v = a.row.original.expiryAmount) == null ? void 0 : v[0]) != null && i.expiredAt ? h((Y = (I = a.row.original.expiryAmount) == null ? void 0 : I[0]) == null ? void 0 : Y.expiredAt).format(
357
- "D MMM YYYY"
358
- ) : "";
359
- return n("div", { class: "flex items-center" }, [
360
- n(
361
- "div",
362
- {
363
- class: [
364
- "pr-2",
365
- +t > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
366
- ]
367
- },
368
- t
369
- ),
370
- n("div", { class: "flex items-center" }, [
371
- a.row.original.expiryAmount.length > 0 ? n(
372
- S.FmTooltip,
373
- {
374
- content: `Expired on ${y}`
375
- },
376
- [
377
- n(S.FmIcon, {
378
- name: "info",
379
- outline: !0,
380
- size: "sm"
381
- })
382
- ]
383
- ) : n("div")
384
- ])
385
- ]);
386
- }
387
- },
388
- {
389
- header: "Type",
390
- accessorKey: "pf_collectible.type",
391
- accessorFn: (a) => E.formattedType(a),
392
- meta: {
393
- maxWidth: "200px"
394
- },
395
- cell(a) {
396
- const t = E.formattedType(a.row.original);
397
- return n("div", { class: "flex items-center" }, [
398
- n("div", { class: "truncate text-ellipsis" }, t),
399
- t.length > 20 ? n(
400
- S.FmTooltip,
401
- {
402
- content: t
403
- },
404
- [
405
- n(S.FmIcon, {
406
- name: "info",
407
- color: "primary",
408
- outline: !0,
409
- size: "sm"
410
- })
411
- ]
412
- ) : null
413
- ]);
414
- }
415
- },
416
- {
417
- header: "Source",
418
- accessorKey: "source",
419
- cell(a) {
420
- var t;
421
- return n("div", { class: "flex items-center gap-4" }, [
422
- n(
423
- "div",
424
- { class: "truncate text-ellipsis" },
425
- K(E.getReason(a.row.original.source))
426
- ),
427
- ...(t = a.row.original.metadata) != null && t.campaign ? [
428
- n(
429
- S.FmTooltip,
430
- {
431
- get content() {
432
- var y;
433
- return (y = _.campaigns.all.find(
434
- (v) => {
435
- var i;
436
- return v._id === ((i = a.row.original.metadata) == null ? void 0 : i.campaign);
437
- }
438
- )) == null ? void 0 : y.name;
439
- }
440
- },
441
- [
442
- n(S.FmIcon, {
443
- name: "info",
444
- color: "primary",
445
- size: "sm",
446
- onClick: async (y) => {
447
- y.preventDefault(), y.stopPropagation();
448
- const v = _.campaigns.all.find(
449
- (i) => {
450
- var I;
451
- return i._id === ((I = a.row.original.metadata) == null ? void 0 : I.campaign);
452
- }
453
- );
454
- if (v)
455
- switch (v.type) {
456
- case "VOUCHER":
457
- case "PROMOTION":
458
- case "BROADCAST":
459
- await c.push({
460
- name: z[`$connect-CAMPAIGN_${v.type}`]
461
- });
462
- break;
463
- case "GAME":
464
- case "CREDIT":
465
- case "MISSION":
466
- await c.push({
467
- name: z[`$connect-PROGRAM_${v.type}`]
468
- });
469
- break;
470
- case "POINT":
471
- await c.push({
472
- name: z["$connect-PROGRAM_EXPERIENCE"]
473
- });
474
- break;
475
- case "COIN":
476
- await c.push({
477
- name: z["$connect-PROGRAM_POINT"]
478
- });
479
- break;
480
- }
481
- }
482
- })
483
- ]
484
- )
485
- ] : []
486
- ]);
487
- }
488
- },
489
- {
490
- header: "User",
491
- accessorKey: "pf_user.name",
492
- cell(a) {
493
- return se(a.row.original.pf_user);
494
- }
495
- },
496
- {
497
- header: "Phone No.",
498
- accessorKey: "pf_user.phoneNumber",
499
- accessorFn: (a) => {
500
- var t;
501
- return ((t = a == null ? void 0 : a.pf_user) == null ? void 0 : t.phoneNumber) || "";
502
- }
503
- },
504
- {
505
- accessorFn: (a) => a.ref,
506
- header: "References",
507
- accessorKey: "ref",
508
- cell(a) {
509
- var t, y;
510
- return n("div", { class: "flex items-center justify-between gap-4" }, [
511
- n("div", { class: "flex items-center" }, [
512
- (t = a.row.original.metadata) != null && t.remark ? n(
513
- S.FmTooltip,
514
- {
515
- content: (y = a.row.original.metadata) == null ? void 0 : y.remark
516
- },
517
- [
518
- n(S.FmIcon, {
519
- name: "info",
520
- class: "pl-2",
521
- outline: !0,
522
- size: "sm"
523
- })
524
- ]
525
- ) : n("div")
526
- ]),
527
- n("div", { class: "flex-1" }, a.row.original.ref)
528
- ]);
529
- }
530
- }
531
- ], d = O({
532
- search: "",
533
- "pf_collectible.type": [],
534
- "metadata.location": [],
535
- dateRange: {
536
- startDate: h().subtract(7, "day").toISOString(),
537
- endDate: h().endOf("day").toISOString()
538
- },
539
- source: []
540
- }), { tableMeta: R, rowData: N, onSort: p, debouncedFetchData: o, onSearch: e } = re(async (a) => {
541
- const t = {
542
- ...d.value,
543
- user: m.user,
544
- dateRange: {
545
- start: new Date(d.value.dateRange.startDate).toISOString(),
546
- end: new Date(d.value.dateRange.endDate).toISOString()
547
- }
548
- }, y = await G.readAll(a, t);
549
- return {
550
- resources: y.resources.map((v) => {
551
- const i = s.value.find((I) => I._id === v.ref);
552
- return { ...v, ref: (i == null ? void 0 : i.seqNumber) || v.ref };
553
- }),
554
- meta: y.meta
555
- };
556
- }), s = O([]), r = oe.options.map((a) => ({ label: K(E.getReason(a)), value: a })), w = f.locations.map((a) => ({ label: a.name, value: a._id }));
557
- Q(
558
- d,
559
- () => {
560
- o();
561
- },
562
- { deep: !0 }
563
- );
564
- async function g() {
565
- try {
566
- b.value = !0;
567
- const a = {
568
- ...d.value,
569
- user: m.user,
570
- dateRange: {
571
- start: new Date(d.value.dateRange.startDate).toISOString(),
572
- end: new Date(d.value.dateRange.endDate).toISOString()
573
- }
574
- };
575
- await ce({
576
- exporter: new Ae(),
577
- readFunction: (t) => G.readAll(t, a),
578
- transformRecord: (t) => {
579
- var y, v, i, I, Y, $, B;
580
- return {
581
- TransactionID: t._id,
582
- CreatedAt: h(P(t._id.toString())).format(
583
- "D MMM YYYY, hh:mmA"
584
- ),
585
- Amount: J(
586
- t.expiryAmount.reduce(
587
- (me, pe) => me + pe.amount,
588
- t.amount ?? 0
589
- ),
590
- 2
591
- ),
592
- ExpiredAt: (v = (y = t.expiryAmount) == null ? void 0 : y[0]) != null && v.expiredAt ? h((I = (i = t.expiryAmount) == null ? void 0 : i[0]) == null ? void 0 : I.expiredAt).format("D MMM YYYY") : "",
593
- Type: E.formattedType(t),
594
- Source: K(E.getReason(t.source)),
595
- User: ((Y = t.pf_user) == null ? void 0 : Y.name) || "",
596
- "Phone No.": (($ = t.pf_user) == null ? void 0 : $.phoneNumber) || "",
597
- References: t.ref,
598
- Remark: ((B = t.metadata) == null ? void 0 : B.remark) || ""
599
- };
600
- },
601
- filename: "transactions"
602
- });
603
- } catch (a) {
604
- console.error(a);
605
- } finally {
606
- b.value = !1;
607
- }
608
- }
609
- const C = O(null);
610
- function M(a) {
611
- var t;
612
- console.log(a), (t = C.value) == null || t.showSheet(!0, a.original);
613
- }
614
- return ve(async () => {
615
- await f.readLocations(), await _.read(), await o();
616
- }), (a, t) => {
617
- const y = A("FmSearch"), v = A("FmButton");
618
- return F(), V(X, null, [
619
- x("div", null, [
620
- x("div", Le, [
621
- D(y, {
622
- class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
623
- modelValue: l(d).search,
624
- "onUpdate:modelValue": t[0] || (t[0] = (i) => l(d).search = i),
625
- placeholder: "Search",
626
- collapsible: ""
627
- }, null, 8, ["modelValue"]),
628
- D(v, {
629
- icon: "ios_share",
630
- variant: "tertiary",
631
- onClick: g
632
- })
633
- ]),
634
- x("div", ze, [
635
- x("div", Ke, [
636
- D(j, {
637
- class: "cursor-pointer text-fm-color-neutral-gray-400",
638
- "right-icon": "keyboard_arrow_down",
639
- modelValue: l(d)["metadata.location"],
640
- "onUpdate:modelValue": t[1] || (t[1] = (i) => l(d)["metadata.location"] = i),
641
- icon: "storefront",
642
- "show-item-label": !0,
643
- items: l(w)
644
- }, null, 8, ["modelValue", "items"]),
645
- D(j, {
646
- class: "cursor-pointer text-fm-color-neutral-gray-400",
647
- "right-icon": "keyboard_arrow_down",
648
- modelValue: l(d)["pf_collectible.type"],
649
- "onUpdate:modelValue": t[2] || (t[2] = (i) => l(d)["pf_collectible.type"] = i),
650
- label: "Type: ",
651
- "show-item-label": !0,
652
- items: [
653
- { label: "Point", value: "COIN" },
654
- { label: "Credit", value: "CREDIT" },
655
- { label: "Voucher", value: "VOUCHER" },
656
- { label: "Experience", value: "POINT" },
657
- { label: "Tier", value: "TIER" },
658
- { label: "Title", value: "TITLE" },
659
- { label: "Game", value: "GAME" },
660
- { label: "Stamp", value: "STAMP" }
661
- ]
662
- }, null, 8, ["modelValue"]),
663
- D(j, {
664
- class: "cursor-pointer text-fm-color-neutral-gray-400",
665
- "right-icon": "keyboard_arrow_down",
666
- modelValue: l(d).source,
667
- "onUpdate:modelValue": t[3] || (t[3] = (i) => l(d).source = i),
668
- label: "Source: ",
669
- "show-item-label": !0,
670
- items: l(r)
671
- }, null, 8, ["modelValue", "items"]),
672
- D(de, {
673
- "model-value": {
674
- startDate: l(d).dateRange.startDate,
675
- endDate: l(d).dateRange.endDate
676
- },
677
- "onUpdate:modelValue": t[4] || (t[4] = (i) => l(d).dateRange = {
678
- startDate: l(h)(i.startDate).startOf("d").toISOString(),
679
- endDate: l(h)(i.endDate).endOf("d").toISOString()
680
- })
681
- }, null, 8, ["model-value"])
682
- ]),
683
- D(y, {
684
- class: "xs:hidden",
685
- modelValue: l(d).search,
686
- "onUpdate:modelValue": t[5] || (t[5] = (i) => l(d).search = i),
687
- placeholder: "Search",
688
- collapsible: ""
689
- }, null, 8, ["modelValue"]),
690
- x("div", Ge, [
691
- D(v, {
692
- icon: "ios_share",
693
- variant: "tertiary",
694
- onClick: g
695
- })
696
- ])
697
- ]),
698
- D(le, {
699
- loading: l(R).isLoading,
700
- "row-data": l(N),
701
- "row-count": l(R).totalRows,
702
- "column-defs": T.filter(
703
- (i) => !m.user || i.header !== "User" && i.header !== "Phone No."
704
- ),
705
- "page-count": l(R).pageCount,
706
- "page-index": l(R).pageIndex,
707
- "page-size": l(R).pageSize,
708
- "shrink-at": !1,
709
- onSortChange: l(p),
710
- onPageChange: t[6] || (t[6] = (i) => l(o)({
711
- pageSize: i.pageSize,
712
- pageIndex: i.pageIndex
713
- })),
714
- onRowClick: M
715
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
716
- ]),
717
- D(Be, {
718
- ref_key: "transactionDetailSheet",
719
- ref: C
720
- }, null, 512)
721
- ], 64);
722
- };
723
- }
724
- });
725
- class He extends ie {
726
- }
727
- const je = { class: "flex items-center justify-between" }, qe = { class: "flex gap-8 items-center" }, We = { class: "flex gap-8 items-center xs:hidden" }, Rt = /* @__PURE__ */ H({
728
- __name: "StoreTransactions",
729
- props: {
730
- user: {
731
- type: String
732
- }
733
- },
734
- setup(u) {
735
- const f = u, { minor: _ } = Re;
736
- _e();
737
- const c = [
738
- {
739
- header: "Transaction ID",
740
- meta: {
741
- maxWidth: "150px"
742
- },
743
- cell(e) {
744
- return n("div", { class: "flex items-center" }, [
745
- n(S.FmIcon, {
746
- name: "content_copy",
747
- outline: !0,
748
- size: "sm",
749
- class: "cursor-pointer mr-4 shrink-0",
750
- onClick: (s) => {
751
- s.preventDefault(), s.stopPropagation(), Z(e.row.original._id.toString());
752
- }
753
- }),
754
- n("div", { class: "truncate" }, e.row.original._id.toString())
755
- ]);
756
- }
757
- },
758
- {
759
- header: "Created at",
760
- accessorFn: (e) => h(P(e._id.toString())).format("D MMM YYYY, hh:mmA"),
761
- enableSorting: !0
762
- },
763
- {
764
- header: "Bundle",
765
- accessorFn: (e) => e.bundle.name
766
- },
767
- {
768
- header: "Location",
769
- accessorFn: (e) => e.location ? e.pf_location.name : "Online Store"
770
- },
771
- {
772
- header: "Payment Type",
773
- accessorFn: (e) => {
774
- var s;
775
- return ((s = e.paymentType) == null ? void 0 : s.type) ?? "N/A";
776
- },
777
- cell(e) {
778
- var s, r;
779
- return n("div", { class: "flex items-center gap-4" }, [
780
- n("div", { class: "flex items-center" }, [
781
- ((s = e.row.original.paymentType) == null ? void 0 : s.type) == "ONLINE" && e.row.original.paymentType.extra ? n(
782
- S.FmTooltip,
783
- {
784
- content: e.row.original.paymentType.extra
785
- },
786
- [
787
- n(S.FmIcon, {
788
- name: "info",
789
- outline: !0,
790
- size: "sm"
791
- })
792
- ]
793
- ) : n("div")
794
- ]),
795
- n(
796
- "div",
797
- { class: "flex-1" },
798
- ((r = e.row.original.paymentType) == null ? void 0 : r.type) ?? "N/A"
799
- )
800
- ]);
801
- }
802
- },
803
- {
804
- header: "User",
805
- cell: (e) => se(e.row.original.pf_member)
806
- },
807
- {
808
- header: "Phone No.",
809
- accessorFn: (e) => e.pf_member.phoneNumber
810
- },
811
- {
812
- header: "Status",
813
- // accessorFn: (u) => u.status,
814
- cell(e) {
815
- var s, r, w, g;
816
- return n("div", { class: "flex items-center" }, [
817
- n("div", Se.title(e.row.original.status)),
818
- n("div", { class: "flex items-center" }, [
819
- (r = (s = e.row.original) == null ? void 0 : s.refund) != null && r.reason ? n(
820
- S.FmTooltip,
821
- {
822
- content: (g = (w = e.row.original) == null ? void 0 : w.refund) == null ? void 0 : g.reason
823
- },
824
- [
825
- n(S.FmIcon, {
826
- name: "info",
827
- color: "primary",
828
- outline: !0,
829
- size: "sm",
830
- class: "pl-2"
831
- })
832
- ]
833
- ) : n("div")
834
- ])
835
- ]);
836
- }
837
- },
838
- {
839
- header: "Source",
840
- accessorFn: (e) => e.source
841
- },
842
- {
843
- header: "Ref",
844
- accessorFn: (e) => e.ref
845
- },
846
- {
847
- id: "action",
848
- cell(e) {
849
- const s = e.row.original, r = s.status === "COMPLETED" && !s.refund && s.source == "ADMIN";
850
- return r ? n(
851
- S.FmMenu,
852
- {
853
- placement: "bottom-end",
854
- onClick: (w) => {
855
- w.stopPropagation();
856
- }
857
- },
858
- {
859
- "menu-button": () => n(S.FmButton, {
860
- icon: "settings",
861
- variant: "tertiary",
862
- if: r
863
- }),
864
- default: () => [
865
- n(S.FmMenuItem, {
866
- label: "Refund",
867
- sublabel: "Refund this transaction",
868
- onClick: async (w) => {
869
- w.stopPropagation(), await p(s);
870
- }
871
- })
872
- ]
873
- }
874
- ) : n("div");
875
- }
876
- }
877
- ], m = O({
878
- searchValue: "",
879
- dateRange: {
880
- startDate: h().subtract(7, "day").toISOString(),
881
- endDate: h().toISOString()
882
- }
883
- }), { tableMeta: b, rowData: T, onSort: d, debouncedFetchData: R, onSearch: N } = re(async (e) => {
884
- const s = {
885
- ...m.value.dateRange,
886
- user: f.user
887
- };
888
- return await G.readStoreTransactions(e, s);
889
- });
890
- async function p(e) {
891
- await xe.confirm(
892
- "Are you sure you want to refund this transaction?",
893
- "Refund Store Transaction",
894
- "Confirm",
895
- "Cancel"
896
- ) && await _(
897
- async () => {
898
- var r;
899
- await Ce.refundStoreTransaction({
900
- id: e._id,
901
- reason: `ADMIN:${(r = Te().sessionUser) == null ? void 0 : r.name}`
902
- }), await R();
903
- },
904
- {
905
- message: "Refunding transaction...",
906
- successMessage: "Transaction refunded successfully"
907
- }
908
- );
909
- }
910
- Q(
911
- m,
912
- () => {
913
- R();
914
- },
915
- { deep: !0 }
916
- ), ae(async () => {
917
- await R();
918
- });
919
- const o = async () => ce({
920
- exporter: new He(),
921
- readFunction: (e) => G.readStoreTransactions(e, {
922
- ...m.value.dateRange,
923
- user: f.user
924
- }),
925
- transformRecord: (e) => {
926
- var s, r, w, g, C, M;
927
- return {
928
- TransactionId: ((s = e._id) == null ? void 0 : s.toString()) || "",
929
- CreatedAt: h(P(e._id.toString())).format(
930
- "DD/MM/YYYY HH:mm:ss"
931
- ),
932
- Bundle: e.bundle.name || "",
933
- Location: e.location ? e.pf_location.name : "Online Store",
934
- PaymentType: ((r = e.paymentType) == null ? void 0 : r.type) || "N/A",
935
- PaymentExtra: ((w = e.paymentType) == null ? void 0 : w.extra) || "",
936
- User: ((g = e.pf_member) == null ? void 0 : g.name) || "",
937
- PhoneNumber: ((C = e.pf_member) == null ? void 0 : C.phoneNumber) || "",
938
- Status: e.status || "",
939
- RefundReason: ((M = e == null ? void 0 : e.refund) == null ? void 0 : M.reason) || ""
940
- };
941
- },
942
- filename: "store-transactions"
943
- });
944
- return (e, s) => {
945
- const r = A("FmSearch"), w = A("FmButton");
946
- return F(), V("div", null, [
947
- x("div", je, [
948
- x("div", qe, [
949
- D(de, {
950
- modelValue: l(m).dateRange,
951
- "onUpdate:modelValue": s[0] || (s[0] = (g) => l(m).dateRange = g)
952
- }, null, 8, ["modelValue"])
953
- ]),
954
- x("div", We, [
955
- D(r, {
956
- modelValue: l(b).searchValue,
957
- "onUpdate:modelValue": [
958
- s[1] || (s[1] = (g) => l(b).searchValue = g),
959
- l(N)
960
- ],
961
- placeholder: "Search",
962
- collapsible: ""
963
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
964
- D(w, {
965
- icon: "ios_share",
966
- variant: "tertiary",
967
- onClick: o
968
- })
969
- ])
970
- ]),
971
- D(le, {
972
- loading: l(b).isLoading,
973
- "row-data": l(T),
974
- "row-count": l(b).totalRows,
975
- "column-defs": c.filter(
976
- (g) => !f.user || g.header !== "User" && g.header !== "Phone No."
977
- ),
978
- "page-count": l(b).pageCount,
979
- "page-index": l(b).pageIndex,
980
- "page-size": l(b).pageSize,
981
- "shrink-at": !1,
982
- onSortChange: l(d),
983
- onPageChange: s[2] || (s[2] = (g) => l(R)({
984
- pageSize: g.pageSize,
985
- pageIndex: g.pageIndex
986
- }))
987
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
988
- ]);
989
- };
990
- }
991
- });
992
- export {
993
- Dt as _,
994
- Rt as a
995
- };