@feedmepos/mf-connect 0.1.98-beta.5 → 0.1.98-beta.50

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 (139) hide show
  1. package/dist/{App-D_4snNiy.js → App-XRTSw_F1.js} +812 -666
  2. package/dist/{AuditLogs-KQU1O9_9.js → AuditLogs-CgsvZ-7X.js} +12 -11
  3. package/dist/{Bin-gp_uuNrE.js → Bin-CDwE00an.js} +8 -8
  4. package/dist/{Broadcast-CbBaOlnn.js → Broadcast-BOh56jYG.js} +39 -36
  5. package/dist/CampaignAnalytic-DZkCSGRF.js +1826 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2bro245w.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DqYRlwCj.js} +7 -5
  7. package/dist/Card-DZ01wmGw.js +1060 -0
  8. package/dist/{Collections-CKeOHYZ4.js → Collections-CaIWOlsO.js} +14 -13
  9. package/dist/Credit-C8TM9q2f.js +286 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bh2O4xdy.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-1UH_Ie4E.js} +34 -30
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIdb46VQ.js → EffectSheet.vue_vue_type_style_index_0_lang-CVqMqYhi.js} +6 -6
  12. package/dist/{Experience-B-c5SMns.js → Experience-Cy0K8E9P.js} +112 -86
  13. package/dist/{FileSaver.min-DWnvGKCg.js → FileSaver.min-ClaVGDxU.js} +1 -1
  14. package/dist/Game-DxUNIK1H.js +356 -0
  15. package/dist/GiftCardSetup-DPuRb-29.js +662 -0
  16. package/dist/{Grab-BLC4GcgE.js → Grab-VSlV6K7E.js} +32 -31
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-l2CmQ0nR.js → ImageInput.vue_vue_type_script_setup_true_lang-BJQzLNY1.js} +1 -1
  18. package/dist/{Index-DmAG2skd.js → Index-D_xXXqKL.js} +10 -10
  19. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-UmynGH00.js → LocationPicker.vue_vue_type_script_setup_true_lang-BJl8_bKp.js} +1 -1
  20. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BThofu65.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BOaXZf3X.js} +1 -1
  21. package/dist/LoyaltyDashboard-CWPV6CHM.js +2218 -0
  22. package/dist/MainLayout-CeA24f8v.js +143 -0
  23. package/dist/{Marketing-DmY25Ri9.js → Marketing-Bw437-ze.js} +7 -6
  24. package/dist/{MarketingMaterialEdit-DP9pba44.js → MarketingMaterialEdit-x6JdhQDh.js} +15 -14
  25. package/dist/Member-zLjxWmJf.js +626 -0
  26. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DM9c_Ow1.js +1287 -0
  27. package/dist/MemberImportHistory-BvvIfn9o.js +187 -0
  28. package/dist/MemberList-DqqAduX1.js +336 -0
  29. package/dist/{MemberTransactions-XRvUfeFB.js → MemberTransactions-j4nWa843.js} +1 -1
  30. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-g7v3ZoUS.js → MessageInput.vue_vue_type_script_setup_true_lang-z9lYA425.js} +5434 -5279
  31. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  32. package/dist/Mission-CPXEtNBm.js +360 -0
  33. package/dist/Overview-Bel0iCe8.js +1316 -0
  34. package/dist/{Overview-DgmVlUVi.js → Overview-DySRWqyr.js} +21 -20
  35. package/dist/Point-ClovAwUI.js +288 -0
  36. package/dist/Promotion-BiiruWmm.js +423 -0
  37. package/dist/{Queue-DxtykwmI.js → Queue-DY9zRWWp.js} +13 -12
  38. package/dist/{Record-fLCi2Oyh.js → Record-BJ6M5bXk.js} +9 -9
  39. package/dist/Review-Cyi-vRyc.js +45 -0
  40. package/dist/ReviewFacebookCallback-CdSAfiJ7.js +238 -0
  41. package/dist/ReviewGoogleCallback-COen72wx.js +213 -0
  42. package/dist/{Reward-BbdiCAiO.js → Reward-B3--b_8h.js} +35 -35
  43. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Cfjtk46d.js → RewardGroup.vue_vue_type_script_setup_true_lang-DCmSt5io.js} +14 -13
  44. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CYEBeuQQ.js → RuleGroup.vue_vue_type_script_setup_true_lang-F2B47wb8.js} +17 -15
  45. package/dist/{Segment-EkGcR2jo.js → Segment-DydGccSi.js} +31 -29
  46. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DND48RGu.js → SelectItems.vue_vue_type_script_setup_true_lang-Bf_1Lw5R.js} +2 -2
  47. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-sbYDSAFK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BXrHY1DU.js} +37 -36
  48. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8RmLtRC.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DhitF847.js} +4 -4
  49. package/dist/{Setting-D3swsR6P.js → Setting-DgXgWy7W.js} +14 -14
  50. package/dist/{SettingAdvertisements-BjhTK11W.js → SettingAdvertisements-TMTfvGdU.js} +12 -12
  51. package/dist/Settings-b3K8fH29.js +230 -0
  52. package/dist/Store-jAGYe4R6.js +2615 -0
  53. package/dist/{StoreRewards-CyrWuwLi.js → StoreRewards-23IXon0V.js} +15 -15
  54. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BUTYIDGo.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BroaESpx.js} +400 -455
  55. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DJQ022R4.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-gnjnQhXP.js} +2 -2
  56. package/dist/{Tier-DrPqr8_e.js → Tier-B_ixl0ZY.js} +44 -41
  57. package/dist/{Title-CaZtz98p.js → Title-CUc90kzn.js} +49 -46
  58. package/dist/Transaction-BNVEjOC4.js +45 -0
  59. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BsBqk0Rs.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CkbKlnrt.js} +6 -6
  60. package/dist/{Voucher-BZcr4D0y.js → Voucher-eALK6zg9.js} +156 -133
  61. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DXQF3LZK.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CEsMYQ-L.js} +12 -12
  62. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DI-tCQeb.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEAJ5tb7.js} +2 -2
  63. package/dist/{app-B0vutEt5.js → app-I3z-EN92.js} +7269 -5971
  64. package/dist/app.js +1 -1
  65. package/dist/{business-IZLJeLD-.js → business-D_ksG_j8.js} +5 -5
  66. package/dist/campaign-BKIxUyuf.js +100 -0
  67. package/dist/{campaign-BPmgteCL.js → campaign-IZaOdcTr.js} +74 -96
  68. package/dist/{campaign.enum-BCdlLIt6.js → campaign.enum-k3u4N6yI.js} +1 -1
  69. package/dist/{campaign.fn-BIFWlQvS.js → campaign.fn-DeQTMPoH.js} +116 -116
  70. package/dist/{collectible.enum-CiuAWn6_.js → collectible.enum-CSQwvFfW.js} +1 -1
  71. package/dist/collection.fn-BtWAPYLz.js +26 -0
  72. package/dist/{duplicateCampaign-BouCkl9n.js → duplicateCampaign-BWdWO-Jv.js} +2 -2
  73. package/dist/{effect-Cov_Xrar.js → effect-BBSG58dq.js} +1 -1
  74. package/dist/{email-addresses-BiopO9xi.js → email-addresses-CJg5ttqC.js} +2 -2
  75. package/dist/{export-DAPTBdHb.js → export-BkjhRe8g.js} +3 -3
  76. package/dist/google-C3S8u0mT.js +4 -0
  77. package/dist/{helper-ClFo4nAk.js → helper-DsSVIIP1.js} +1 -1
  78. package/dist/index-38Rnr26K.js +53 -0
  79. package/dist/{index-N5t83KgP.js → index-BbBies0f.js} +1902 -2559
  80. package/dist/index-BmAoVlN8.js +151 -0
  81. package/dist/{index-BZvvCPbP.js → index-BsAuvfaE.js} +5 -4
  82. package/dist/{index-Kllafq_o.js → index-C-phzlda.js} +105 -123
  83. package/dist/{index-CD_3hR1g.js → index-C0qgi7n9.js} +1 -1
  84. package/dist/index-CPnv5m8Z.js +137 -0
  85. package/dist/{index-BeK9AXvx.js → index-CV1kOec1.js} +1 -1
  86. package/dist/{index-CmgQZKyo.js → index-Ckr8ODhI.js} +1 -1
  87. package/dist/{index-DTSGYksR.js → index-CtF4Z_fd.js} +281 -372
  88. package/dist/{index-k9DTOKkN.js → index-CtXqXihA.js} +4 -1
  89. package/dist/index-DCz9v1dd.js +51 -0
  90. package/dist/index-DdV1nasM.js +896 -0
  91. package/dist/index-ZPKkCZxS.js +72 -0
  92. package/dist/{index-k0hHOUBO.js → index-blX95L2R.js} +579 -571
  93. package/dist/{index-Bm5E2iD6.js → index-f0JDFqAr.js} +14 -14
  94. package/dist/{index-pKdJ8574.js → index-iagCxZ13.js} +5 -5
  95. package/dist/{index-C_AuIVay.js → index-wsdEChJx.js} +5 -5
  96. package/dist/{index.esm2017-ByFUnorr.js → index.esm2017-BMC-Q91P.js} +164 -164
  97. package/dist/{loading-t4ygCIAa.js → loading-3obmcgAf.js} +1 -1
  98. package/dist/{lodash-DwGVChOs.js → lodash-C69G7pFG.js} +1 -1
  99. package/dist/member-import-BxBe9NE7.js +187 -0
  100. package/dist/{membership-CMCTmRdh.js → membership-_XX1_j55.js} +3 -3
  101. package/dist/{money-MhQbdVIt.js → money-DZpYudCC.js} +1 -1
  102. package/dist/{number-klG94_wm.js → number-BbQQzzRA.js} +1 -1
  103. package/dist/objectid-kWi62XJQ.js +145 -0
  104. package/dist/{plugins-2py5EcqG.js → plugins-UfVjLlr4.js} +3 -3
  105. package/dist/remy-Qz_pNsUS.js +13 -0
  106. package/dist/{reward-CE9z-Us7.js → reward-1G2M5tgv.js} +1 -1
  107. package/dist/{rule-BKNHxNrQ.js → rule-DHHGjLt5.js} +3 -3
  108. package/dist/rule-builder-CgNmvg5o.js +126 -0
  109. package/dist/{template-C9yNa_0m.js → template-Ckva65hw.js} +6 -6
  110. package/dist/timezone-Ddve0ese.js +20 -0
  111. package/dist/transaction.fn-7n5XLxfA.js +64 -0
  112. package/dist/{trigger-Dk0tAyDv.js → trigger-F-XaDRpc.js} +14 -14
  113. package/dist/useMarketingMaterialActions-DIhnstdO.js +96 -0
  114. package/dist/{usePagination-cF1F_1NH.js → usePagination-C0TcC_Lo.js} +1 -1
  115. package/dist/{user-CNPPoxKh.js → user-DeuI7T2e.js} +1 -1
  116. package/dist/{vue-i18n-Bk_KpCO_.js → vue-i18n-DRrphfc1.js} +191 -191
  117. package/dist/{xlsx-D3muGzk7.js → xlsx-DaY_eyt1.js} +440 -440
  118. package/dist/{zod-D72USJGr.js → zod-BDdpK5Gp.js} +1 -1
  119. package/package.json +5 -3
  120. package/dist/Card-P7MqKEDT.js +0 -910
  121. package/dist/Credit-Dp5P2k79.js +0 -260
  122. package/dist/Game-CNSbh93g.js +0 -330
  123. package/dist/LoyaltyDashboard-Go9ClMrp.js +0 -1082
  124. package/dist/MainLayout-Dyw9Qqvh.js +0 -41
  125. package/dist/Member-DKXzaqlL.js +0 -280
  126. package/dist/MemberList-BJ5nI3Nz.js +0 -1601
  127. package/dist/Mission-BvHArY3W.js +0 -334
  128. package/dist/Point-BR0R03i6.js +0 -262
  129. package/dist/Promotion-DofFeR2N.js +0 -397
  130. package/dist/Review-7tFJOnrt.js +0 -1076
  131. package/dist/ReviewFacebookCallback-yl0w_vF9.js +0 -243
  132. package/dist/ReviewGoogleCallback-Dn_aF2ZD.js +0 -208
  133. package/dist/Store-U1jysb7b.js +0 -1996
  134. package/dist/Transaction-Bj6bSo8R.js +0 -39
  135. package/dist/campaign-Cxp-DOCG.js +0 -219
  136. package/dist/index-BQ8XZk2Y.js +0 -85
  137. package/dist/index-KmCk2ksK.js +0 -52
  138. package/dist/objectid-C4ak1ctJ.js +0 -145
  139. package/dist/useMarketingMaterialActions-BiXkdMcs.js +0 -107
@@ -0,0 +1,187 @@
1
+ import { defineComponent as F, ref as I, watch as v, onBeforeMount as D, openBlock as C, createElementBlock as M, createElementVNode as N, createVNode as u, unref as t, h as i } from "vue";
2
+ import { a as R } from "./index-BsAuvfaE.js";
3
+ import { u as k, _ as L } from "./usePagination-C0TcC_Lo.js";
4
+ import { _ as O } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
5
+ import { c as l } from "./string-Gcy5IM_H.js";
6
+ import "./index-Ckr8ODhI.js";
7
+ import { useSnackbar as P, components as c } from "@feedmepos/ui-library";
8
+ import { useCoreStore as T } from "@feedmepos/mf-common";
9
+ import { F as U } from "./member-import-BxBe9NE7.js";
10
+ import { F as g } from "./FileSaver.min-ClaVGDxU.js";
11
+ import { h as m } from "./moment-D7p2TMB-.js";
12
+ import { useRouter as V } from "vue-router";
13
+ import { m as d } from "./index-CPnv5m8Z.js";
14
+ import { R as B } from "./app-I3z-EN92.js";
15
+ const $ = { class: "flex flex-col gap-16" }, Y = { class: "flex items-center" }, re = /* @__PURE__ */ F({
16
+ __name: "MemberImportHistory",
17
+ setup(z) {
18
+ const w = V(), b = T(), S = P(), n = I({ status: [] });
19
+ function _(e) {
20
+ return e === "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : ["INVALID", "STOPPED"].includes(e) ? "text-fm-color-typo-error bg-fm-color-system-error-100" : ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
21
+ e
22
+ ) ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-info bg-fm-color-system-info-100";
23
+ }
24
+ function p(e) {
25
+ return m(e.originalFileExpiresAt).isAfter(m());
26
+ }
27
+ function f(e, o = !1) {
28
+ S.open({
29
+ type: "error",
30
+ message: o && e instanceof R && e.status === 410 ? "Original file has expired or is unavailable." : "Unable to download the import file. Please try again."
31
+ });
32
+ }
33
+ async function y(e) {
34
+ try {
35
+ g.saveAs(
36
+ await d.downloadOriginalImportFile(e._id.toString()),
37
+ e.file.originalName
38
+ );
39
+ } catch (o) {
40
+ f(o, !0);
41
+ }
42
+ }
43
+ async function h(e) {
44
+ try {
45
+ g.saveAs(
46
+ await d.downloadImportResult(e._id.toString()),
47
+ `member-import-${e._id}.csv`
48
+ );
49
+ } catch (o) {
50
+ f(o);
51
+ }
52
+ }
53
+ const x = [
54
+ {
55
+ header: "File",
56
+ accessorFn: (e) => e.file.originalName,
57
+ enableSorting: !1
58
+ },
59
+ {
60
+ header: "Import ID",
61
+ accessorFn: (e) => e._id.toString(),
62
+ enableSorting: !1
63
+ },
64
+ {
65
+ header: "Mode",
66
+ accessorFn: (e) => l.title(e.options.mode),
67
+ enableSorting: !1
68
+ },
69
+ {
70
+ header: "Status",
71
+ cell(e) {
72
+ const o = e.row.original.status;
73
+ return i(c.FmChip, {
74
+ label: l.title(o),
75
+ compact: !0,
76
+ class: _(o)
77
+ });
78
+ },
79
+ enableSorting: !1
80
+ },
81
+ {
82
+ header: "Rows",
83
+ accessorFn: (e) => `${e.summary.completed}/${e.summary.total} completed · ${e.summary.failed} failed`,
84
+ enableSorting: !1
85
+ },
86
+ {
87
+ header: "Created / completed",
88
+ accessorFn: (e) => [e.createdAt, e.completedAt].filter(Boolean).map((o) => m(o).format("D MMM YYYY, hh:mmA")).join(" / "),
89
+ enableSorting: !1
90
+ },
91
+ {
92
+ header: "Error",
93
+ cell(e) {
94
+ return i(
95
+ "div",
96
+ {
97
+ class: "max-w-[240px] truncate",
98
+ title: e.row.original.error ?? void 0
99
+ },
100
+ e.row.original.error || "-"
101
+ );
102
+ },
103
+ enableSorting: !1
104
+ },
105
+ {
106
+ header: "Actions",
107
+ cell(e) {
108
+ const o = e.row.original;
109
+ return i("div", { class: "flex gap-4" }, [
110
+ i(c.FmButton, {
111
+ icon: "download",
112
+ variant: "tertiary",
113
+ disabled: !p(o),
114
+ "aria-label": "Download original file",
115
+ title: p(o) ? "Download original file" : "Original file has expired",
116
+ onClick: (a) => {
117
+ a.stopPropagation(), y(o);
118
+ }
119
+ }),
120
+ i(c.FmButton, {
121
+ icon: "description",
122
+ variant: "tertiary",
123
+ disabled: o.summary.total === 0,
124
+ "aria-label": "Download result CSV",
125
+ title: "Download result CSV",
126
+ onClick: (a) => {
127
+ a.stopPropagation(), h(o);
128
+ }
129
+ })
130
+ ]);
131
+ },
132
+ enableSorting: !1
133
+ }
134
+ ], A = U.options.map((e) => ({
135
+ label: l.title(e),
136
+ value: e
137
+ })), { tableMeta: r, rowData: E, debouncedFetchData: s } = k(
138
+ (e) => d.readImportHistory(e, n.value.status),
139
+ { key: "createdAt", descending: !0 }
140
+ );
141
+ return v(
142
+ n,
143
+ () => {
144
+ s();
145
+ },
146
+ { deep: !0 }
147
+ ), D(async () => {
148
+ var e, o;
149
+ if (!((o = (e = b.sessionUser.value) == null ? void 0 : e.role) != null && o.isAdmin)) {
150
+ await w.replace({
151
+ name: B["$connect-LOYALTY_MEMBER_LIST"]
152
+ });
153
+ return;
154
+ }
155
+ await s();
156
+ }), (e, o) => (C(), M("div", $, [
157
+ N("div", Y, [
158
+ u(O, {
159
+ modelValue: t(n).status,
160
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => t(n).status = a),
161
+ class: "cursor-pointer text-fm-color-neutral-gray-400",
162
+ "right-icon": "keyboard_arrow_down",
163
+ label: "Status: ",
164
+ "show-item-label": !0,
165
+ items: t(A)
166
+ }, null, 8, ["modelValue", "items"])
167
+ ]),
168
+ u(L, {
169
+ loading: t(r).isLoading,
170
+ "row-data": t(E),
171
+ "row-count": t(r).totalRows,
172
+ "column-defs": x,
173
+ "page-count": t(r).pageCount,
174
+ "page-index": t(r).pageIndex,
175
+ "page-size": t(r).pageSize,
176
+ "shrink-at": !1,
177
+ onPageChange: o[1] || (o[1] = (a) => t(s)({
178
+ pageSize: a.pageSize,
179
+ pageIndex: a.pageIndex
180
+ }))
181
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size"])
182
+ ]));
183
+ }
184
+ });
185
+ export {
186
+ re as default
187
+ };
@@ -0,0 +1,336 @@
1
+ import { defineComponent as xe, ref as E, computed as ve, onMounted as Me, resolveComponent as I, openBlock as ne, createElementBlock as Ne, createElementVNode as Fe, createVNode as y, unref as s, withDirectives as Ee, vShow as Ie, createBlock as De, createCommentVNode as Ve, h as d } from "vue";
2
+ import { h } from "./moment-D7p2TMB-.js";
3
+ import { components as S } from "@feedmepos/ui-library";
4
+ import { e as ke, M as Be } from "./email-addresses-CJg5ttqC.js";
5
+ import { w as Pe } from "./xlsx-DaY_eyt1.js";
6
+ import "./index-Ckr8ODhI.js";
7
+ import "./index-wsdEChJx.js";
8
+ import { u as Re } from "./membership-_XX1_j55.js";
9
+ import { u as Ye, _ as Ae } from "./MemberDetailSheet.vue_vue_type_script_setup_true_lang-DM9c_Ow1.js";
10
+ import { f as x } from "./number-BbQQzzRA.js";
11
+ import { u as Le } from "./loading-3obmcgAf.js";
12
+ import { t as Oe } from "./money-DZpYudCC.js";
13
+ import { u as ze } from "./business-D_ksG_j8.js";
14
+ import { u as Ke, _ as Ue } from "./usePagination-C0TcC_Lo.js";
15
+ import { g as $e, a as je, b as qe } from "./user-DeuI7T2e.js";
16
+ import { useRouter as Je } from "vue-router";
17
+ import { m as D } from "./index-CPnv5m8Z.js";
18
+ import { R as Ge } from "./app-I3z-EN92.js";
19
+ import { o as se } from "./objectId-dwaoBfJX.js";
20
+ const He = { class: "flex items-center justify-end" }, bt = /* @__PURE__ */ xe({
21
+ __name: "MemberList",
22
+ setup(Qe) {
23
+ const re = Ye(), u = Re(), v = ze(), { minor: ie } = Le, le = Je(), ce = [
24
+ {
25
+ header: "Name",
26
+ enableSorting: !0,
27
+ accessorKey: "name",
28
+ cell(a) {
29
+ return $e(a.row.original);
30
+ }
31
+ },
32
+ {
33
+ header: "Phone",
34
+ enableSorting: !0,
35
+ accessorKey: "phoneNumber"
36
+ },
37
+ {
38
+ accessorFn: (a) => h(se(a._id.toString())).format("D MMM YYYY"),
39
+ header: "Customer Since",
40
+ accessorKey: "_id",
41
+ id: "_id"
42
+ },
43
+ {
44
+ accessorKey: "collection_TIER_0_balance",
45
+ header: "Tier",
46
+ enableSorting: !0,
47
+ cell(a) {
48
+ return je(
49
+ a.row.original,
50
+ u.sortedTiers
51
+ );
52
+ }
53
+ },
54
+ {
55
+ header: "Title",
56
+ enableSorting: !1,
57
+ cell(a) {
58
+ return qe(
59
+ a.row.original,
60
+ u.sortedTitles
61
+ );
62
+ }
63
+ },
64
+ {
65
+ accessorKey: "collection_CREDIT_0_balance",
66
+ accessorFn: (a) => {
67
+ var t, o, n;
68
+ return x(((n = (o = (t = a.collection) == null ? void 0 : t.CREDIT) == null ? void 0 : o[0]) == null ? void 0 : n.balance) ?? 0, 2);
69
+ },
70
+ header: "Credit(s)",
71
+ enableSorting: !0
72
+ },
73
+ {
74
+ accessorKey: "collection_POINT_0_balance",
75
+ accessorFn: (a) => {
76
+ var t, o, n;
77
+ return x(((n = (o = (t = a.collection) == null ? void 0 : t.POINT) == null ? void 0 : o[0]) == null ? void 0 : n.balance) ?? 0, 2);
78
+ },
79
+ header: "Experience(s)",
80
+ enableSorting: !0
81
+ },
82
+ {
83
+ accessorKey: "collection_COIN_0_balance",
84
+ accessorFn: (a) => {
85
+ var t, o, n;
86
+ return x(((n = (o = (t = a.collection) == null ? void 0 : t.COIN) == null ? void 0 : o[0]) == null ? void 0 : n.balance) ?? 0, 2);
87
+ },
88
+ header: "Point(s)",
89
+ enableSorting: !0
90
+ },
91
+ {
92
+ accessorFn: (a) => {
93
+ var t;
94
+ return ((t = a.stats) == null ? void 0 : t.visitCount) ?? 0;
95
+ },
96
+ header: "Total visit",
97
+ accessorKey: "stats.visitCount",
98
+ id: "stats.visitCount"
99
+ },
100
+ {
101
+ accessorFn: (a) => {
102
+ var t;
103
+ return (t = a.stats) == null ? void 0 : t.lastVisit;
104
+ },
105
+ sortingFn: (a, t) => {
106
+ var o, n;
107
+ return new Date((o = a.original.stats) == null ? void 0 : o.lastVisit).getTime() - new Date((n = t.original.stats) == null ? void 0 : n.lastVisit).getTime();
108
+ },
109
+ id: "stats.lastVisit",
110
+ header: "Last visit",
111
+ cell(a) {
112
+ var t, o;
113
+ return d("div", { class: "flex items-center justify-end gap-4" }, [
114
+ d(
115
+ "span",
116
+ (t = a.row.original.stats) != null && t.lastVisit ? h((o = a.row.original.stats) == null ? void 0 : o.lastVisit).fromNow() : "NA"
117
+ ),
118
+ d(
119
+ S.FmTooltip,
120
+ {
121
+ content: h(a.row.original.stats.lastVisit).format(
122
+ "D MMM YYYY - hh:mmA"
123
+ )
124
+ },
125
+ [d(S.FmIcon, { name: "info", outline: !0, size: "sm" })]
126
+ )
127
+ ]);
128
+ }
129
+ },
130
+ {
131
+ id: "actions",
132
+ cell(a) {
133
+ return d(
134
+ S.FmMenu,
135
+ {
136
+ placement: "bottom-end",
137
+ onClick: (t) => {
138
+ t.stopPropagation();
139
+ }
140
+ },
141
+ {
142
+ "menu-button": () => d(S.FmButton, { icon: "more_vert", variant: "tertiary" }),
143
+ default: () => [
144
+ d(S.FmMenuItem, {
145
+ label: "Transaction details",
146
+ onClick: async (t) => {
147
+ t.stopPropagation(), await be(a.row.original._id);
148
+ }
149
+ })
150
+ ]
151
+ }
152
+ );
153
+ }
154
+ }
155
+ ], { tableMeta: l, rowData: de, onSort: ue, debouncedFetchData: M, onSearch: me } = Ke(D.read), V = E(), _ = E(!1), m = E(), pe = ve(() => v.locations.map((a) => ({
156
+ label: a.name,
157
+ value: a._id
158
+ })));
159
+ async function fe() {
160
+ m.value = await D.readById(
161
+ m.value._id.toString()
162
+ ), _.value = !0;
163
+ }
164
+ async function ge() {
165
+ await M(), _.value = !1;
166
+ }
167
+ async function be(a) {
168
+ await le.push({
169
+ name: Ge["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
170
+ params: { id: a }
171
+ });
172
+ }
173
+ const N = {
174
+ sortBy: "_id",
175
+ descending: !1,
176
+ rowsPerPage: 1e3
177
+ };
178
+ function F(a) {
179
+ const t = h(a);
180
+ return t.isValid() ? t.format("DD/MM/YYYY") : "";
181
+ }
182
+ async function he() {
183
+ const a = new Be(), t = N.rowsPerPage;
184
+ await ie(
185
+ async () => {
186
+ var T, i, p, k, B, P, R, Y, A, L, O, z, K, U, $, j, q, J, G, H, Q, W, X, Z, ee;
187
+ let o, n = !0;
188
+ for (; n; ) {
189
+ const C = await D.readCursor({
190
+ limit: t,
191
+ sortBy: N.sortBy,
192
+ descending: N.descending,
193
+ ...o ? { cursor: o } : {}
194
+ });
195
+ if (!C.resources.length)
196
+ break;
197
+ for (const e of C.resources) {
198
+ const Se = (T = ke.parseOneAddress(
199
+ e == null ? void 0 : e.email
200
+ )) != null && T.domain.includes("feedmepos.com") ? void 0 : e.email, _e = (p = ((i = e == null ? void 0 : e.collection) == null ? void 0 : i.TITLE) || []) == null ? void 0 : p.reduce(
201
+ (r, c) => {
202
+ var g, b;
203
+ const f = (b = (g = u.sortedTitles) == null ? void 0 : g.find(
204
+ (w) => w._id === c.collectible
205
+ )) == null ? void 0 : b.name;
206
+ return !f || c.balance <= 0 || r.push(f), r;
207
+ },
208
+ []
209
+ ), Te = (u.sortedTitles || []).reduce(
210
+ (r, c) => {
211
+ var g, b, w, oe;
212
+ const f = (oe = (w = (b = (((g = e == null ? void 0 : e.collection) == null ? void 0 : g.TITLE) || []).find(
213
+ (ye) => ye.collectible === c._id
214
+ )) == null ? void 0 : b.expiryBalance) == null ? void 0 : w[0]) == null ? void 0 : oe.expiredAt;
215
+ return r[c.name] = f ? h(f).format("DD/MM/YYYY") : "", r;
216
+ },
217
+ {}
218
+ ), Ce = ((P = (B = (k = e.collection) == null ? void 0 : k.CREDIT) == null ? void 0 : B.at(0)) == null ? void 0 : P.balance) || 0, te = ((L = (A = (Y = (R = e.collection) == null ? void 0 : R.CREDIT) == null ? void 0 : Y.at(0)) == null ? void 0 : A.expiryBalance) == null ? void 0 : L.reduce(
219
+ (r, c) => r + c.amount,
220
+ 0
221
+ )) || 0, ae = x(Ce, 2), we = {
222
+ ID: e._id.toString(),
223
+ Name: ((O = e.name) == null ? void 0 : O.trim()) || "",
224
+ Phone: ((z = e == null ? void 0 : e.phoneNumber) == null ? void 0 : z.trim()) || "",
225
+ Email: Se || "",
226
+ Gender: e.gender || "",
227
+ CardNo: e.cardNo || "",
228
+ Birthday: e != null && e.birthday ? F(e == null ? void 0 : e.birthday) : "",
229
+ Credit: (Number(ae) - Number(te)).toFixed(2),
230
+ FreeCredit: Number(te.toFixed(2)),
231
+ TotalCredit: Number(ae),
232
+ Exp: e != null && e.collection ? (($ = (U = (K = e.collection) == null ? void 0 : K.POINT) == null ? void 0 : U.at(0)) == null ? void 0 : $.balance) ?? 0 : 0,
233
+ Point: e != null && e.collection ? ((J = (q = (j = e.collection) == null ? void 0 : j.COIN) == null ? void 0 : q.at(0)) == null ? void 0 : J.balance) ?? 0 : 0,
234
+ Tier: e != null && e.collection ? ((Q = (H = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : H.at(0)) == null ? void 0 : Q.balance) ?? 0 : 0,
235
+ Titles: _e.join(","),
236
+ ...Te,
237
+ TotalTransaction: e.stats.visitCount,
238
+ AvgSpent: Oe(Number(e.stats.avgBillSize || 0)).toFormat(
239
+ !1
240
+ ),
241
+ TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
242
+ LastVisit: F(e.stats.lastVisit),
243
+ Feedback: ((W = e.stats) == null ? void 0 : W.feedbackCount) || 0,
244
+ LastSeasonTierEarned: ((X = e.stats) == null ? void 0 : X.lastSeasonTierEarned) || 0,
245
+ LastSeasonPointEarned: ((Z = e.stats) == null ? void 0 : Z.lastSeasonPointEarned) || 0,
246
+ JoinedAt: F(e.joinAt || se(e._id)),
247
+ JoinedAtLocation: e.location && ((ee = pe.value.find((r) => r.value == e.location)) == null ? void 0 : ee.label) || "-",
248
+ VisitFrequency: `${Number(
249
+ Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
250
+ )}`
251
+ };
252
+ a.addRecord(we);
253
+ }
254
+ o = C.meta.nextCursor ?? void 0, n = C.meta.hasNext && !!o;
255
+ }
256
+ await Pe(
257
+ a.buildExcel(),
258
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
259
+ {
260
+ bookType: "xlsx",
261
+ bookSST: !1,
262
+ type: "array"
263
+ }
264
+ );
265
+ },
266
+ {
267
+ message: "Exporting member...",
268
+ successMessage: "Member exported successfully"
269
+ }
270
+ );
271
+ }
272
+ return Me(async () => {
273
+ await u.readMembership(), await v.readLocations(), await re.read(), await v.readLocations(), await M();
274
+ }), (a, t) => {
275
+ const o = I("FmSearch"), n = I("FmButton"), T = I("FmSnackbar");
276
+ return ne(), Ne("div", null, [
277
+ Fe("div", He, [
278
+ y(o, {
279
+ class: "mt-4",
280
+ modelValue: s(l).searchValue,
281
+ "onUpdate:modelValue": [
282
+ t[0] || (t[0] = (i) => s(l).searchValue = i),
283
+ s(me)
284
+ ],
285
+ placeholder: "Search",
286
+ collapsible: ""
287
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
288
+ y(n, {
289
+ icon: "ios_share",
290
+ variant: "tertiary",
291
+ onClick: he
292
+ })
293
+ ]),
294
+ Ee(y(T, {
295
+ "z-index": 0,
296
+ class: "!max-w-full my-16",
297
+ title: "Info",
298
+ description: "Current list is not up to date, please refresh table for latest data.",
299
+ variant: "info",
300
+ dismissable: "",
301
+ onOnDismiss: t[1] || (t[1] = (i) => _.value = !1),
302
+ action: "Refresh",
303
+ onOnAction: ge
304
+ }, null, 512), [
305
+ [Ie, s(_)]
306
+ ]),
307
+ y(Ue, {
308
+ loading: s(l).isLoading,
309
+ "row-data": s(de),
310
+ "row-count": s(l).totalRows,
311
+ "column-defs": ce,
312
+ "shrink-at": !1,
313
+ "page-count": s(l).pageCount,
314
+ "page-index": s(l).pageIndex,
315
+ "page-size": s(l).pageSize,
316
+ onSortChange: s(ue),
317
+ onPageChange: t[2] || (t[2] = (i) => s(M)({ pageSize: i.pageSize, pageIndex: i.pageIndex })),
318
+ onRowClick: t[3] || (t[3] = (i) => {
319
+ var p;
320
+ m.value = i.original, (p = s(V)) == null || p.showSheet();
321
+ })
322
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
323
+ s(m) ? (ne(), De(Ae, {
324
+ key: 0,
325
+ ref_key: "sheetRef",
326
+ ref: V,
327
+ member: s(m),
328
+ "onUpdate:member": fe
329
+ }, null, 8, ["member"])) : Ve("", !0)
330
+ ]);
331
+ };
332
+ }
333
+ });
334
+ export {
335
+ bt as default
336
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, ref as p, resolveComponent as _, openBlock as a, createElementBlock as f, createVNode as v, unref as o, createBlock as u, createCommentVNode as b } from "vue";
2
- import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BUTYIDGo.js";
2
+ import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BroaESpx.js";
3
3
  import { useRouter as y } from "vue-router";
4
4
  const C = { class: "flex flex-col gap-y-32 pb-24" }, F = /* @__PURE__ */ d({
5
5
  __name: "MemberTransactions",