@feedmepos/mf-connect 0.1.111-prod → 0.1.113-beta.3

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 (162) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-D3pYl3WL.js → App-YfpYV7C0.js} +738 -689
  3. package/dist/AuditLogs-kD0_HO_p.js +2016 -0
  4. package/dist/{Bin-DOZqpbYH.js → Bin-Dr-Xp3pn.js} +8 -8
  5. package/dist/Broadcast-CEbHu2xA.js +306 -0
  6. package/dist/{CampaignAnalytic-cFKvCgxX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +49 -32
  8. package/dist/Card-BUnwg0eM.js +1086 -0
  9. package/dist/{Collections-9QK5hbLo.js → Collections-CKyBkKq2.js} +197 -185
  10. package/dist/{Credit-8Ouy4O9a.js → Credit-CJOXWLV1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
  14. package/dist/{Experience-DMh4hR1S.js → Experience-C_Am5CTY.js} +32 -31
  15. package/dist/{FileSaver.min-Bx9mdUgJ.js → FileSaver.min-CueAGbjq.js} +1 -1
  16. package/dist/{Game-CL0TZvg1.js → Game-B6GO_LVU.js} +19 -18
  17. package/dist/GiftCardSetup-CVLDDpI2.js +748 -0
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
  19. package/dist/{Goals-Dz5Vp-lj.js → Goals-BX-sMV2V.js} +4 -4
  20. package/dist/Grab-Bh335Srh.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
  22. package/dist/{Index-kH8aAegB.js → Index-CyXRbwcm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-BBxEoWol.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
  26. package/dist/MainLayout-KbKkpX5n.js +4 -0
  27. package/dist/{MainLayout-2BLwDyHQ.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
  28. package/dist/{Marketing-C4OnSV-c.js → Marketing-DQT1MWQg.js} +4 -4
  29. package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
  30. package/dist/{Member-CT9WwxP0.js → Member-DwDUCzlv.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -49
  32. package/dist/{MemberImportHistory-B__BFID7.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
  33. package/dist/{MemberList-DgLI4wty.js → MemberList-DFieV7Qk.js} +103 -105
  34. package/dist/{MemberTransactions-UFx_DZYe.js → MemberTransactions-BPOXyAuC.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4821 -4690
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
  37. package/dist/{Mission-CawzGzDu.js → Mission-nErb05Es.js} +22 -21
  38. package/dist/{Overview-D19oSo24.js → Overview-7G31a7B-.js} +58 -56
  39. package/dist/{Overview-CAtTlEVa.js → Overview-DuJr_hAg.js} +145 -144
  40. package/dist/{Point-BPAGmKAj.js → Point-PWDLemD4.js} +22 -21
  41. package/dist/{Promotion-B0Uf9vjL.js → Promotion-N80Tj8M6.js} +137 -131
  42. package/dist/{Queue-CJEAFss_.js → Queue-M7ZpgiMT.js} +49 -47
  43. package/dist/{Record-s6hSQG2P.js → Record-NhxrdvWv.js} +9 -9
  44. package/dist/{Review-DhNCbAOm.js → Review-DiAaAzIG.js} +2 -2
  45. package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
  46. package/dist/{ReviewGoogleCallback-D8ENWii2.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
  47. package/dist/{Reward-BT00QsXL.js → Reward-yTaOqOT8.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +26 -24
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
  50. package/dist/{Segment-BuGhX9zg.js → Segment-DE9Bcd6R.js} +287 -287
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +37 -35
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
  53. package/dist/Setting-C0JAxIRT.js +574 -0
  54. package/dist/{SettingAdvertisements-aqFErKAr.js → SettingAdvertisements-DxueyKU8.js} +12 -12
  55. package/dist/Settings-Cs46AcxZ.js +286 -0
  56. package/dist/Store-DqQae9nE.js +2629 -0
  57. package/dist/{StoreRewards-D2pTL2oA.js → StoreRewards-JxSUsOzJ.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
  60. package/dist/{Tier-OyE8oH2r.js → Tier-DWhgWush.js} +2576 -686
  61. package/dist/{Title-DAl7CKL_.js → Title-DUNeMdz8.js} +104 -101
  62. package/dist/Transaction-DAv-LVhC.js +45 -0
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
  64. package/dist/{Voucher-D2QGWSxs.js → Voucher-uLTq9RSK.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
  66. package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
  68. package/dist/WhatsappBot-DB4NRZMd.js +589 -0
  69. package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
  70. package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
  71. package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
  72. package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
  73. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
  74. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
  75. package/dist/{app-QxosLNkH.js → app-Devzv4gO.js} +12854 -9732
  76. package/dist/app.js +4 -3
  77. package/dist/base.export-CCSMkvAm.js +75 -0
  78. package/dist/browser-BSAOEeIM.js +1478 -0
  79. package/dist/{business-CbqG6NXr.js → business-BjAmUqNA.js} +1 -1
  80. package/dist/campaign-C5c47GqT.js +400 -0
  81. package/dist/{campaign-Rj7oDBnN.js → campaign-CTe-T5Gd.js} +31 -25
  82. package/dist/{campaign.enum-B7vdNYKd.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  83. package/dist/campaign.fn-DxAO8A5b.js +776 -0
  84. package/dist/{collectible.enum-BsQseg7-.js → collectible.enum-Liy2wH3s.js} +1 -1
  85. package/dist/{collection.fn-EbUIyB1X.js → collection.fn-C9l-OtNt.js} +2 -2
  86. package/dist/currency-mwm4AWXK.js +7 -0
  87. package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
  88. package/dist/{effect-B_91OlcX.js → effect-D8ba9z0K.js} +1 -1
  89. package/dist/{email-addresses-DXnYZG-e.js → email-addresses-BR5J6_Jz.js} +2 -2
  90. package/dist/feature-flag-C-5NdFW8.js +868 -0
  91. package/dist/feature-flag-CNcU4_3r.js +50 -0
  92. package/dist/google-BQK68wbe.js +5 -0
  93. package/dist/{helper-_uhiXya1.js → helper-D9cEaMIv.js} +1 -1
  94. package/dist/index-0H82-X0n.js +80 -0
  95. package/dist/{index-Cp7oHMm3.js → index-B1jP-_Z_.js} +691 -229
  96. package/dist/{index-BZ2b0Pk6.js → index-B7HH6vKF.js} +8 -7
  97. package/dist/{index-tbo0pMIu.js → index-BFaZp6Et.js} +29 -15
  98. package/dist/index-B_gzo75q.js +53 -0
  99. package/dist/{index-DlQJZNwD.js → index-BfoDdVQS.js} +22 -6
  100. package/dist/{index-CDm0BWa3.js → index-BvY2hQac.js} +1 -1
  101. package/dist/index-Byg4ztr-.js +902 -0
  102. package/dist/{index-BWgc2-Qz.js → index-CZfqqrVu.js} +4 -3
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-xuFTeVrb.js → index-CmzjBrHR.js} +11 -9
  105. package/dist/{index-BBihP1s2.js → index-Ct6YjTIW.js} +2 -2
  106. package/dist/{index-Df4l6y-S.js → index-D34iYRdc.js} +1900 -2121
  107. package/dist/{index-DuhRCI0L.js → index-D4k1G2oE.js} +4 -4
  108. package/dist/{index-uuNGb1nv.js → index-DnepoNWn.js} +8028 -10766
  109. package/dist/index-Drmh0FT-.js +14571 -0
  110. package/dist/{index-DlGnYR5y.js → index-DtcUCknS.js} +2700 -2613
  111. package/dist/{index-C_1iqF1Q.js → index-DwTBiVts.js} +1 -1
  112. package/dist/{index-CWUmrVo_.js → index-OvnHt5x5.js} +800 -793
  113. package/dist/index-RwNlbTO8.js +115 -0
  114. package/dist/{index-CzYxnDWP.js → index-VqAbYyHH.js} +11 -6
  115. package/dist/{index-DzBzClHP.js → index-yGSko6Eq.js} +1 -1
  116. package/dist/{index.esm2017-B72iWwk_.js → index.esm2017-DLb2VyCT.js} +156 -156
  117. package/dist/{loading-rIhCiB_S.js → loading-CUNk5u1d.js} +1 -1
  118. package/dist/{lodash-B6fOjfjd.js → lodash-BJXravls.js} +1 -1
  119. package/dist/{member-import-CbHn7zss.js → member-import-DjYoddBi.js} +6 -5
  120. package/dist/{membership-DkJN7jyQ.js → membership-ByJUFP8f.js} +3 -3
  121. package/dist/{money-ChbDx6Nq.js → money-Bf2IEMJJ.js} +1 -1
  122. package/dist/{number-9TEd27Ku.js → number-CRBHrRUL.js} +1 -1
  123. package/dist/objectid-58gyOvdR.js +145 -0
  124. package/dist/{onboarding-BN3MKVRs.js → onboarding-CQ3lw7eY.js} +25 -25
  125. package/dist/{onboardingSetup-D9xhdgS3.js → onboardingSetup-CsdZKGFk.js} +2 -2
  126. package/dist/{plugins-CCibSJZa.js → plugins-iTZLbJGy.js} +3 -3
  127. package/dist/{MarketingMaterialEdit-DFhpsI2-.js → remy-icon-BhUGu2NI.js} +2 -1031
  128. package/dist/{reward-DjasF-NL.js → reward-DTN6JpEd.js} +1 -1
  129. package/dist/{rule-DqeChj0e.js → rule-BYACNQOL.js} +572 -492
  130. package/dist/style.css +1 -1
  131. package/dist/template--Vr0PCjB.js +188 -0
  132. package/dist/{timezone-D0nC1LDx.js → timezone-DwzjOED-.js} +1 -1
  133. package/dist/{transaction.fn-BkF4Ad2z.js → transaction.fn-DapYe3n7.js} +2 -2
  134. package/dist/{trigger-CxpXoQJO.js → trigger-D8r76yb0.js} +18 -18
  135. package/dist/{useMarketingMaterialActions-p0-fyMkm.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
  136. package/dist/{usePagination-CrC-1v4L.js → usePagination-BRcQJkO1.js} +1 -1
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
  138. package/dist/{user-CrylHgF1.js → user-vBZFKqXQ.js} +1 -1
  139. package/dist/vue-i18n-Cw6fF11e.js +2365 -0
  140. package/dist/{xlsx-CJNYF7-l.js → xlsx-Muy_Rjhk.js} +440 -440
  141. package/dist/{zod-Dzn9S95S.js → zod-CCPTOeUz.js} +1 -1
  142. package/package.json +12 -3
  143. package/dist/Broadcast-DZ4SP99P.js +0 -271
  144. package/dist/Card-B5ni027Q.js +0 -911
  145. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js +0 -2430
  146. package/dist/ReviewFacebookCallback-DeZqcpJo.js +0 -238
  147. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js +0 -1882
  148. package/dist/Setting-BOWPp05N.js +0 -2036
  149. package/dist/Settings-DekXvE-R.js +0 -179
  150. package/dist/Store-DpVlMuau.js +0 -1998
  151. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js +0 -1009
  152. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js +0 -142
  153. package/dist/Transaction-mvKzTgLx.js +0 -39
  154. package/dist/campaign-Co4Lq-Wz.js +0 -228
  155. package/dist/campaign.fn-DolD3lYJ.js +0 -776
  156. package/dist/export-D0hWZSfH.js +0 -97
  157. package/dist/google-C3S8u0mT.js +0 -4
  158. package/dist/index-aCuOvuEC.js +0 -45
  159. package/dist/objectid-CGol1NeA.js +0 -145
  160. package/dist/rule-builder-DT854ycI.js +0 -102
  161. package/dist/template-BeCVA0-N.js +0 -236
  162. package/dist/vue-i18n-BjtkXdmG.js +0 -2365
@@ -1,1009 +0,0 @@
1
- import { ref as M, defineComponent as J, computed as W, h as l, resolveComponent as Y, openBlock as P, createBlock as te, unref as s, isRef as ve, withCtx as oe, createElementVNode as x, createVNode as C, createElementBlock as O, Fragment as Q, renderList as ne, toDisplayString as K, createTextVNode as xe, resolveDynamicComponent as Se, watch as re, onBeforeMount as be, onMounted as _e } from "vue";
2
- import { components as v, useDialog as we } from "@feedmepos/ui-library";
3
- import { s as se } from "./index-Df4l6y-S.js";
4
- import "./index-uuNGb1nv.js";
5
- import { T as A } from "./transaction.fn-BkF4Ad2z.js";
6
- import { h as T } from "./moment-D7p2TMB-.js";
7
- import { _ as H } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
8
- import { _ as le } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js";
9
- import { s as j } from "./index-CuvNtC_M.js";
10
- import { f as X } from "./number-9TEd27Ku.js";
11
- import { u as ie } from "./business-CbqG6NXr.js";
12
- import { _ as ce, u as Ce } from "./usePagination-CrC-1v4L.js";
13
- import { c as Z, p as Te } from "./plugins-CCibSJZa.js";
14
- import { g as ue } from "./user-CrylHgF1.js";
15
- import { B as me, e as Re } from "./export-D0hWZSfH.js";
16
- import { u as de } from "./campaign-Rj7oDBnN.js";
17
- import "./index-CDm0BWa3.js";
18
- import "./index-DlGnYR5y.js";
19
- import "./index-Cp7oHMm3.js";
20
- import "./index-BZ2b0Pk6.js";
21
- import "./index-BWgc2-Qz.js";
22
- import { u as pe } from "./vue-i18n-BjtkXdmG.js";
23
- import { o as z } from "./objectId-dwaoBfJX.js";
24
- import { u as fe } from "./loading-rIhCiB_S.js";
25
- import { w as Ie } from "./xlsx-CJNYF7-l.js";
26
- import { useRouter as Fe } from "vue-router";
27
- import { t as q } from "./index-tbo0pMIu.js";
28
- import { R as G } from "./app-QxosLNkH.js";
29
- import { useCoreStore as De } from "@feedmepos/mf-common";
30
- import { c as Ne } from "./string-Gcy5IM_H.js";
31
- import { m as Ae } from "./index-DlQJZNwD.js";
32
- const Me = (_) => {
33
- if (_.startsWith("_") || _.includes("."))
34
- return _;
35
- for (const w of ["pf_user_", "pf_collectible_"])
36
- if (_.startsWith(w))
37
- return `${w.slice(0, -1)}.${_.slice(w.length).replace(new RegExp("_", "g"), ".")}`;
38
- return _.replace(new RegExp("_", "g"), ".");
39
- };
40
- function Ee(_, w = { key: "_id", descending: !0 }) {
41
- const c = M({
42
- pageCount: 1,
43
- searchValue: "",
44
- pageIndex: 0,
45
- totalRows: 0,
46
- isLoading: !1,
47
- pageSize: 10,
48
- hasNext: !1
49
- }), u = M(w), S = M([]), h = M([void 0]);
50
- function I() {
51
- h.value = [void 0], c.value.pageIndex = 0, c.value.pageCount = 1, c.value.hasNext = !1;
52
- }
53
- const E = async (t = {}) => {
54
- const o = t.pageSize ?? c.value.pageSize, y = o !== c.value.pageSize;
55
- y && I();
56
- const p = y ? 0 : Math.max(t.pageIndex ?? c.value.pageIndex, 0), f = p === 0 || !!h.value[p] ? p : c.value.pageIndex, V = h.value[f];
57
- c.value.isLoading = !0, c.value.pageSize = o, S.value = [];
58
- try {
59
- const N = await _({
60
- limit: o,
61
- sortBy: u.value.key,
62
- descending: u.value.descending,
63
- search: c.value.searchValue,
64
- ...V ? { cursor: V } : {}
65
- });
66
- S.value = N.resources, c.value.pageIndex = f, c.value.totalRows = N.resources.length, c.value.hasNext = N.meta.hasNext, c.value.pageCount = f + (N.meta.hasNext ? 2 : 1), N.meta.nextCursor ? h.value[f + 1] = N.meta.nextCursor : h.value.splice(f + 1);
67
- } catch (N) {
68
- console.error("Error fetching data:", N), c.value.hasNext = !1;
69
- } finally {
70
- c.value.isLoading = !1;
71
- }
72
- };
73
- let R, d;
74
- const m = (t) => (R && clearTimeout(R), d && d(), new Promise((o) => {
75
- d = o, R = setTimeout(async () => {
76
- R = void 0, d = void 0, await E(t), o();
77
- }, 200);
78
- }));
79
- return {
80
- tableMeta: c,
81
- rowData: S,
82
- sortBy: u,
83
- pageCursors: h,
84
- resetCursorState: I,
85
- fetchData: E,
86
- debouncedFetchData: m,
87
- onSort: async (t) => {
88
- t.length ? u.value = {
89
- key: Me(t[0].id),
90
- descending: t[0].desc
91
- } : u.value = w, I(), await m({
92
- pageIndex: 0,
93
- pageSize: c.value.pageSize
94
- });
95
- },
96
- onSearch: () => (I(), m({
97
- pageIndex: 0,
98
- pageSize: c.value.pageSize
99
- }))
100
- };
101
- }
102
- class ke extends me {
103
- }
104
- const Pe = { class: "space-y-24 pr-12" }, Ve = { class: "w-full space-y-16" }, Oe = { class: "fm-typo-en-body-lg-600" }, ze = ["onClick"], Ye = { class: "fm-typo-en-body-lg-600" }, Ue = ["onClick"], $e = { class: "flex items-center gap-8" }, Be = /* @__PURE__ */ J({
105
- __name: "TransactionDetailSheet",
106
- setup(_, { expose: w }) {
107
- pe();
108
- const c = M(!1), u = M(), S = de(), h = ie();
109
- function I(m, n) {
110
- c.value = m, u.value = n ?? null;
111
- }
112
- const E = W(() => {
113
- var m, n;
114
- return X(
115
- ((n = u.value) == null ? void 0 : n.expiryAmount.reduce(
116
- (e, t) => e + t.amount,
117
- ((m = u.value) == null ? void 0 : m.amount) ?? 0
118
- )) ?? 0,
119
- 2
120
- );
121
- }), R = W(() => {
122
- var m, n, e, t, o;
123
- return u.value ? [
124
- {
125
- label: "Transaction ID",
126
- value: (m = u.value) == null ? void 0 : m._id
127
- },
128
- {
129
- label: "Date/Time",
130
- value: T(z(u.value._id.toString())).format(
131
- "D MMM YYYY, hh:mmA"
132
- )
133
- },
134
- {
135
- label: "Amount",
136
- component: () => l(
137
- "span",
138
- {
139
- class: [
140
- "pr-2",
141
- +E.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
142
- ]
143
- },
144
- E.value
145
- )
146
- },
147
- {
148
- label: "Type",
149
- value: A.formattedType(u.value)
150
- },
151
- {
152
- label: "Source",
153
- value: j(A.getReason(u.value.source))
154
- },
155
- {
156
- label: "User",
157
- value: (e = (n = u.value) == null ? void 0 : n.pf_user) == null ? void 0 : e.name
158
- },
159
- {
160
- label: "Phone Number",
161
- value: (o = (t = u.value) == null ? void 0 : t.pf_user) == null ? void 0 : o.phoneNumber
162
- }
163
- ] : [];
164
- }), d = W(() => {
165
- var o, y, p, D;
166
- if (!u.value) return [];
167
- const m = [], n = (o = u.value) == null ? void 0 : o.metadata, e = u.value;
168
- if (n != null && n.campaign) {
169
- const f = S.campaigns.all.find(
170
- (V) => V._id === (n == null ? void 0 : n.campaign)
171
- );
172
- f && m.push({
173
- label: "Campaign",
174
- value: f.name
175
- });
176
- }
177
- const t = A.formattedRemark(e);
178
- return t && m.push({
179
- label: "Remark",
180
- value: t
181
- }), (y = u.value) != null && y.ref.startsWith("bill_") && m.push({
182
- label: "Bill Number",
183
- value: (p = u.value) == null ? void 0 : p.ref,
184
- copy: () => {
185
- var f;
186
- return Z((f = u.value) == null ? void 0 : f.ref);
187
- }
188
- }), n != null && n.location && m.push({
189
- label: "Location",
190
- value: (D = h.locations.find(
191
- (f) => f._id.toString() === (n == null ? void 0 : n.location)
192
- )) == null ? void 0 : D.name
193
- }), e.source === se.enum.STORE && m.push({
194
- label: "Store Transaction",
195
- value: e.ref
196
- }), n != null && n.originTransaction && m.push({
197
- label: "Parent Transaction",
198
- value: n.originTransaction
199
- }), n != null && n.referral_count && m.push({
200
- label: "Referral Count",
201
- value: n.referral_count
202
- }), e.refundedFrom && m.push({
203
- label: "Refunded From",
204
- value: e.refundedFrom
205
- }), m;
206
- });
207
- return w({
208
- showSheet: I
209
- }), (m, n) => {
210
- const e = Y("FmButton"), t = Y("FmSideSheet");
211
- return P(), te(t, {
212
- "max-width": 560,
213
- modelValue: s(c),
214
- "onUpdate:modelValue": n[1] || (n[1] = (o) => ve(c) ? c.value = o : null),
215
- header: "Transaction Details"
216
- }, {
217
- "side-sheet-footer": oe(() => [
218
- x("div", $e, [
219
- C(e, {
220
- label: "Close",
221
- onClick: n[0] || (n[0] = (o) => I(!1)),
222
- variant: "tertiary"
223
- })
224
- ])
225
- ]),
226
- default: oe(() => [
227
- x("div", Pe, [
228
- x("div", Ve, [
229
- (P(!0), O(Q, null, ne(s(R), (o) => (P(), O("div", {
230
- key: o.label,
231
- class: "flex flex-col gap-4"
232
- }, [
233
- x("div", Oe, K(o.label), 1),
234
- x("div", {
235
- class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
236
- onClick: o.copy
237
- }, [
238
- xe(K(o.accessorFn ? o.accessorFn() : o.value) + " ", 1),
239
- (P(), te(Se(o.component)))
240
- ], 8, ze),
241
- n[2] || (n[2] = x("hr", { class: "mt-3" }, null, -1))
242
- ]))), 128)),
243
- (P(!0), O(Q, null, ne(s(d), (o) => (P(), O("div", {
244
- key: o.label,
245
- class: "flex flex-col gap-4"
246
- }, [
247
- x("div", Ye, K(o.label), 1),
248
- x("div", {
249
- class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
250
- onClick: o.copy
251
- }, K(o.accessorFn ? o.accessorFn() : o.value), 9, Ue),
252
- n[3] || (n[3] = x("hr", { class: "mt-3" }, null, -1))
253
- ]))), 128))
254
- ])
255
- ])
256
- ]),
257
- _: 1
258
- }, 8, ["modelValue"]);
259
- };
260
- }
261
- }), Le = { class: "hidden xs:!flex items-center justify-end" }, Ke = { class: "flex items-center justify-between" }, Ge = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, We = { class: "xs:hidden" }, Fa = /* @__PURE__ */ J({
262
- __name: "CollectionTransactions",
263
- props: {
264
- user: {
265
- type: String
266
- }
267
- },
268
- setup(_) {
269
- const { t: w } = pe(), c = ie(), u = de(), S = Fe(), h = _, I = M(!1), { minor: E } = fe, R = [
270
- {
271
- header: "Transaction ID",
272
- accessorKey: "_id",
273
- meta: {
274
- maxWidth: "100px"
275
- },
276
- cell(a) {
277
- return l("div", { class: "flex items-center" }, [
278
- l(v.FmIcon, {
279
- name: "content_copy",
280
- outline: !0,
281
- size: "sm",
282
- class: "cursor-pointer mr-4",
283
- onClick: (r) => {
284
- r.preventDefault(), r.stopPropagation(), Z(a.row.original._id.toString());
285
- }
286
- }),
287
- l(
288
- "div",
289
- { class: "pr-2 text-ellipsis overflow-hidden" },
290
- a.row.original._id.toString()
291
- )
292
- ]);
293
- },
294
- enableSorting: !1
295
- },
296
- {
297
- header: "Created at",
298
- accessorKey: "_id",
299
- accessorFn: (a) => T(z(a._id.toString())),
300
- cell: (a) => T(z(a.row.original._id.toString())).format(
301
- "D MMM YYYY, hh:mmA"
302
- ),
303
- enableSorting: !0
304
- },
305
- {
306
- header: "Amount",
307
- // accessorKey: 'totalAmount',
308
- enableSorting: !1,
309
- cell(a) {
310
- var g, i, k, U;
311
- const r = X(
312
- a.row.original.expiryAmount.reduce(
313
- ($, B) => $ + B.amount,
314
- a.row.original.amount ?? 0
315
- ),
316
- 2
317
- ), b = (i = (g = a.row.original.expiryAmount) == null ? void 0 : g[0]) != null && i.expiredAt ? T((U = (k = a.row.original.expiryAmount) == null ? void 0 : k[0]) == null ? void 0 : U.expiredAt).format(
318
- "D MMM YYYY"
319
- ) : "";
320
- return l("div", { class: "flex items-center" }, [
321
- l(
322
- "div",
323
- {
324
- class: [
325
- "pr-2",
326
- +r > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
327
- ]
328
- },
329
- r
330
- ),
331
- l("div", { class: "flex items-center" }, [
332
- a.row.original.expiryAmount.length > 0 ? l(
333
- v.FmTooltip,
334
- {
335
- content: `Expired on ${b}`
336
- },
337
- [
338
- l(v.FmIcon, {
339
- name: "info",
340
- outline: !0,
341
- size: "sm"
342
- })
343
- ]
344
- ) : l("div")
345
- ])
346
- ]);
347
- }
348
- },
349
- {
350
- header: "Type",
351
- accessorKey: "pf_collectible.type",
352
- accessorFn: (a) => A.formattedType(a),
353
- meta: {
354
- maxWidth: "200px"
355
- },
356
- cell(a) {
357
- const r = A.formattedType(a.row.original);
358
- return l("div", { class: "flex items-center" }, [
359
- l("div", { class: "truncate text-ellipsis" }, r),
360
- r.length > 20 ? l(
361
- v.FmTooltip,
362
- {
363
- content: r
364
- },
365
- [
366
- l(v.FmIcon, {
367
- name: "info",
368
- color: "primary",
369
- outline: !0,
370
- size: "sm"
371
- })
372
- ]
373
- ) : null
374
- ]);
375
- }
376
- },
377
- {
378
- header: "Source",
379
- accessorKey: "source",
380
- cell(a) {
381
- var r;
382
- return l("div", { class: "flex items-center gap-4" }, [
383
- l(
384
- "div",
385
- { class: "truncate text-ellipsis" },
386
- j(A.getReason(a.row.original.source))
387
- ),
388
- ...(r = a.row.original.metadata) != null && r.campaign ? [
389
- l(
390
- v.FmTooltip,
391
- {
392
- get content() {
393
- var b;
394
- return (b = u.campaigns.all.find(
395
- (g) => {
396
- var i;
397
- return g._id === ((i = a.row.original.metadata) == null ? void 0 : i.campaign);
398
- }
399
- )) == null ? void 0 : b.name;
400
- }
401
- },
402
- [
403
- l(v.FmIcon, {
404
- name: "info",
405
- color: "primary",
406
- size: "sm",
407
- onClick: async (b) => {
408
- b.preventDefault(), b.stopPropagation();
409
- const g = u.campaigns.all.find(
410
- (i) => {
411
- var k;
412
- return i._id === ((k = a.row.original.metadata) == null ? void 0 : k.campaign);
413
- }
414
- );
415
- if (g)
416
- switch (g.type) {
417
- case "VOUCHER":
418
- case "PROMOTION":
419
- case "BROADCAST":
420
- await S.push({
421
- name: G[`$connect-CAMPAIGN_${g.type}`]
422
- });
423
- break;
424
- case "GAME":
425
- case "CREDIT":
426
- case "MISSION":
427
- await S.push({
428
- name: G[`$connect-PROGRAM_${g.type}`]
429
- });
430
- break;
431
- case "POINT":
432
- await S.push({
433
- name: G["$connect-PROGRAM_EXPERIENCE"]
434
- });
435
- break;
436
- case "COIN":
437
- await S.push({
438
- name: G["$connect-PROGRAM_POINT"]
439
- });
440
- break;
441
- }
442
- }
443
- })
444
- ]
445
- )
446
- ] : []
447
- ]);
448
- }
449
- },
450
- {
451
- header: "User",
452
- accessorKey: "pf_user.name",
453
- cell(a) {
454
- return ue(a.row.original.pf_user);
455
- }
456
- },
457
- {
458
- header: "Phone No.",
459
- accessorKey: "pf_user.phoneNumber",
460
- accessorFn: (a) => {
461
- var r;
462
- return ((r = a == null ? void 0 : a.pf_user) == null ? void 0 : r.phoneNumber) || "";
463
- }
464
- },
465
- {
466
- header: "Status",
467
- id: "status",
468
- enableSorting: !1,
469
- cell(a) {
470
- const r = !!a.row.original.refunded;
471
- return l(v.FmChip, {
472
- label: w(r ? "connect.transaction.refunded" : "connect.transaction.completed"),
473
- variant: "plain",
474
- class: r ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-success bg-fm-color-system-success-100"
475
- });
476
- }
477
- },
478
- {
479
- accessorFn: (a) => a.ref,
480
- header: "References",
481
- accessorKey: "ref",
482
- cell(a) {
483
- const r = A.formattedRemark(a.row.original);
484
- return l("div", { class: "flex items-center justify-between gap-4" }, [
485
- l("div", { class: "flex items-center" }, [
486
- r ? l(
487
- v.FmTooltip,
488
- {
489
- content: r
490
- },
491
- [
492
- l(v.FmIcon, {
493
- name: "info",
494
- class: "pl-2",
495
- outline: !0,
496
- size: "sm"
497
- })
498
- ]
499
- ) : l("div")
500
- ]),
501
- l("div", { class: "flex-1" }, a.row.original.ref)
502
- ]);
503
- }
504
- }
505
- ], d = M({
506
- search: "",
507
- "pf_collectible.type": [],
508
- "metadata.location": [],
509
- dateRange: {
510
- startDate: T().subtract(7, "day").toISOString(),
511
- endDate: T().endOf("day").toISOString()
512
- },
513
- source: []
514
- }), m = () => ({
515
- ...d.value,
516
- user: h.user,
517
- dateRange: {
518
- start: new Date(d.value.dateRange.startDate).toISOString(),
519
- end: new Date(d.value.dateRange.endDate).toISOString()
520
- }
521
- }), {
522
- tableMeta: n,
523
- rowData: e,
524
- onSort: t,
525
- debouncedFetchData: o,
526
- resetCursorState: y
527
- } = Ee(async (a) => {
528
- const r = await q.readAllCursor(
529
- a,
530
- m()
531
- );
532
- return {
533
- resources: r.resources.map((b) => {
534
- const g = p.value.find((i) => i._id === b.ref);
535
- return { ...b, ref: (g == null ? void 0 : g.seqNumber) || b.ref };
536
- }),
537
- meta: r.meta
538
- };
539
- }), p = M([]), D = se.options.map((a) => ({ label: j(A.getReason(a)), value: a })), f = W(
540
- () => c.locations.map((a) => ({ label: a.name, value: a._id }))
541
- );
542
- re(
543
- d,
544
- () => {
545
- y(), o({ pageIndex: 0 });
546
- },
547
- { deep: !0 }
548
- );
549
- async function V() {
550
- try {
551
- I.value = !0;
552
- const a = new ke(), r = m(), b = 1e3;
553
- await E(
554
- async () => {
555
- var k, U, $, B, ee, ae;
556
- let g, i = !0;
557
- for (; i; ) {
558
- const L = await q.readAllCursor(
559
- {
560
- limit: b,
561
- sortBy: "_id",
562
- descending: !1,
563
- ...g ? { cursor: g } : {}
564
- },
565
- r
566
- );
567
- if (!L.resources.length)
568
- break;
569
- for (const F of L.resources)
570
- a.addRecord({
571
- TransactionID: F._id,
572
- CreatedAt: T(z(F._id.toString())).format(
573
- "D MMM YYYY, hh:mmA"
574
- ),
575
- Amount: X(
576
- F.expiryAmount.reduce(
577
- (he, ye) => he + ye.amount,
578
- F.amount ?? 0
579
- ),
580
- 2
581
- ),
582
- ExpiredAt: (U = (k = F.expiryAmount) == null ? void 0 : k[0]) != null && U.expiredAt ? T((B = ($ = F.expiryAmount) == null ? void 0 : $[0]) == null ? void 0 : B.expiredAt).format(
583
- "D MMM YYYY"
584
- ) : "",
585
- Type: A.formattedType(F),
586
- Source: j(A.getReason(F.source)),
587
- User: ((ee = F.pf_user) == null ? void 0 : ee.name) || "",
588
- "Phone No.": ((ae = F.pf_user) == null ? void 0 : ae.phoneNumber) || "",
589
- References: F.ref,
590
- Remark: A.formattedRemark(F)
591
- });
592
- g = L.meta.nextCursor ?? void 0, i = L.meta.hasNext && !!g;
593
- }
594
- await Ie(
595
- a.buildExcel(),
596
- `transactions-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
597
- {
598
- bookType: "xlsx",
599
- bookSST: !1,
600
- type: "array"
601
- }
602
- );
603
- },
604
- {
605
- message: "Exporting transactions...",
606
- successMessage: "transactions exported successfully"
607
- }
608
- );
609
- } catch (a) {
610
- console.error(a);
611
- } finally {
612
- I.value = !1;
613
- }
614
- }
615
- const N = M(null);
616
- function ge(a) {
617
- var r;
618
- console.log(a), (r = N.value) == null || r.showSheet(!0, a.original);
619
- }
620
- return be(async () => {
621
- await c.readLocations(), await u.read(), await o();
622
- }), (a, r) => {
623
- const b = Y("FmSearch"), g = Y("FmButton");
624
- return P(), O(Q, null, [
625
- x("div", null, [
626
- x("div", Le, [
627
- C(b, {
628
- class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
629
- modelValue: s(d).search,
630
- "onUpdate:modelValue": r[0] || (r[0] = (i) => s(d).search = i),
631
- placeholder: "Search",
632
- collapsible: ""
633
- }, null, 8, ["modelValue"]),
634
- C(g, {
635
- icon: "ios_share",
636
- variant: "tertiary",
637
- onClick: V
638
- })
639
- ]),
640
- x("div", Ke, [
641
- x("div", Ge, [
642
- C(H, {
643
- class: "cursor-pointer text-fm-color-neutral-gray-400",
644
- "right-icon": "keyboard_arrow_down",
645
- modelValue: s(d)["metadata.location"],
646
- "onUpdate:modelValue": r[1] || (r[1] = (i) => s(d)["metadata.location"] = i),
647
- icon: "storefront",
648
- "show-item-label": !0,
649
- items: s(f)
650
- }, null, 8, ["modelValue", "items"]),
651
- C(H, {
652
- class: "cursor-pointer text-fm-color-neutral-gray-400",
653
- "right-icon": "keyboard_arrow_down",
654
- modelValue: s(d)["pf_collectible.type"],
655
- "onUpdate:modelValue": r[2] || (r[2] = (i) => s(d)["pf_collectible.type"] = i),
656
- label: "Type: ",
657
- "show-item-label": !0,
658
- items: [
659
- { label: "Point", value: "COIN" },
660
- { label: "Credit", value: "CREDIT" },
661
- { label: "Voucher", value: "VOUCHER" },
662
- { label: "Experience", value: "POINT" },
663
- { label: "Tier", value: "TIER" },
664
- { label: "Title", value: "TITLE" },
665
- { label: "Game", value: "GAME" },
666
- { label: "Stamp", value: "STAMP" }
667
- ]
668
- }, null, 8, ["modelValue"]),
669
- C(H, {
670
- class: "cursor-pointer text-fm-color-neutral-gray-400",
671
- "right-icon": "keyboard_arrow_down",
672
- modelValue: s(d).source,
673
- "onUpdate:modelValue": r[3] || (r[3] = (i) => s(d).source = i),
674
- label: "Source: ",
675
- "show-item-label": !0,
676
- items: s(D)
677
- }, null, 8, ["modelValue", "items"]),
678
- C(le, {
679
- "model-value": {
680
- startDate: s(d).dateRange.startDate,
681
- endDate: s(d).dateRange.endDate
682
- },
683
- "onUpdate:modelValue": r[4] || (r[4] = (i) => s(d).dateRange = {
684
- startDate: s(T)(i.startDate).startOf("d").toISOString(),
685
- endDate: s(T)(i.endDate).endOf("d").toISOString()
686
- })
687
- }, null, 8, ["model-value"])
688
- ]),
689
- C(b, {
690
- class: "xs:hidden",
691
- modelValue: s(d).search,
692
- "onUpdate:modelValue": r[5] || (r[5] = (i) => s(d).search = i),
693
- placeholder: "Search",
694
- collapsible: ""
695
- }, null, 8, ["modelValue"]),
696
- x("div", We, [
697
- C(g, {
698
- icon: "ios_share",
699
- variant: "tertiary",
700
- onClick: V
701
- })
702
- ])
703
- ]),
704
- C(ce, {
705
- loading: s(n).isLoading,
706
- "row-data": s(e),
707
- "row-count": s(n).totalRows,
708
- "column-defs": R.filter(
709
- (i) => !h.user || i.header !== "User" && i.header !== "Phone No."
710
- ),
711
- "page-count": s(n).pageCount,
712
- "page-index": s(n).pageIndex,
713
- "page-size": s(n).pageSize,
714
- "shrink-at": !1,
715
- "pagination-mode": "cursor",
716
- "has-next": s(n).hasNext,
717
- onSortChange: s(t),
718
- onPageChange: r[6] || (r[6] = (i) => s(o)({
719
- pageSize: i.pageSize,
720
- pageIndex: i.pageIndex
721
- })),
722
- onRowClick: ge
723
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "has-next", "onSortChange"])
724
- ]),
725
- C(Be, {
726
- ref_key: "transactionDetailSheet",
727
- ref: N
728
- }, null, 512)
729
- ], 64);
730
- };
731
- }
732
- });
733
- class je extends me {
734
- }
735
- const qe = { class: "flex items-center justify-between" }, He = { class: "flex gap-8 items-center" }, Qe = { class: "flex gap-8 items-center xs:hidden" }, Da = /* @__PURE__ */ J({
736
- __name: "StoreTransactions",
737
- props: {
738
- user: {
739
- type: String
740
- }
741
- },
742
- setup(_) {
743
- const w = _, { minor: c } = fe;
744
- we();
745
- const u = [
746
- {
747
- header: "Transaction ID",
748
- meta: {
749
- maxWidth: "150px"
750
- },
751
- cell(e) {
752
- return l("div", { class: "flex items-center" }, [
753
- l(v.FmIcon, {
754
- name: "content_copy",
755
- outline: !0,
756
- size: "sm",
757
- class: "cursor-pointer mr-4 shrink-0",
758
- onClick: (t) => {
759
- t.preventDefault(), t.stopPropagation(), Z(e.row.original._id.toString());
760
- }
761
- }),
762
- l("div", { class: "truncate" }, e.row.original._id.toString())
763
- ]);
764
- }
765
- },
766
- {
767
- header: "Created at",
768
- accessorFn: (e) => T(z(e._id.toString())).format("D MMM YYYY, hh:mmA"),
769
- enableSorting: !0
770
- },
771
- {
772
- header: "Bundle",
773
- accessorFn: (e) => e.bundle.name
774
- },
775
- {
776
- header: "Location",
777
- accessorFn: (e) => e.location ? e.pf_location[0].name : "Online Store"
778
- },
779
- {
780
- header: "Payment Type",
781
- accessorFn: (e) => {
782
- var t;
783
- return ((t = e.paymentType) == null ? void 0 : t.type) ?? "N/A";
784
- },
785
- cell(e) {
786
- var t, o;
787
- return l("div", { class: "flex items-center gap-4" }, [
788
- l("div", { class: "flex items-center" }, [
789
- ((t = e.row.original.paymentType) == null ? void 0 : t.type) == "ONLINE" && e.row.original.paymentType.extra ? l(
790
- v.FmTooltip,
791
- {
792
- content: e.row.original.paymentType.extra
793
- },
794
- [
795
- l(v.FmIcon, {
796
- name: "info",
797
- outline: !0,
798
- size: "sm"
799
- })
800
- ]
801
- ) : l("div")
802
- ]),
803
- l(
804
- "div",
805
- { class: "flex-1" },
806
- ((o = e.row.original.paymentType) == null ? void 0 : o.type) ?? "N/A"
807
- )
808
- ]);
809
- }
810
- },
811
- {
812
- header: "User",
813
- cell: (e) => ue(e.row.original.pf_member)
814
- },
815
- {
816
- header: "Phone No.",
817
- accessorFn: (e) => e.pf_member.phoneNumber
818
- },
819
- {
820
- header: "Status",
821
- // accessorFn: (u) => u.status,
822
- cell(e) {
823
- var y, p, D, f;
824
- const t = e.row.original.status, o = {
825
- COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
826
- REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
827
- };
828
- return l("div", { class: "flex items-center gap-4" }, [
829
- l(v.FmChip, {
830
- label: Ne.title(t),
831
- variant: "plain",
832
- class: o[t] ?? ""
833
- }),
834
- (p = (y = e.row.original) == null ? void 0 : y.refund) != null && p.reason ? l(
835
- v.FmTooltip,
836
- {
837
- content: (f = (D = e.row.original) == null ? void 0 : D.refund) == null ? void 0 : f.reason
838
- },
839
- [
840
- l(v.FmIcon, {
841
- name: "info",
842
- color: "primary",
843
- outline: !0,
844
- size: "sm"
845
- })
846
- ]
847
- ) : null
848
- ]);
849
- }
850
- },
851
- {
852
- header: "Source",
853
- accessorFn: (e) => e.source
854
- },
855
- {
856
- header: "Ref",
857
- accessorFn: (e) => e.ref
858
- },
859
- {
860
- id: "action",
861
- cell(e) {
862
- const t = e.row.original, o = t.status === "COMPLETED" && !t.refund && t.source == "ADMIN";
863
- return o ? l(
864
- v.FmMenu,
865
- {
866
- placement: "bottom-end",
867
- onClick: (y) => {
868
- y.stopPropagation();
869
- }
870
- },
871
- {
872
- "menu-button": () => l(v.FmButton, {
873
- icon: "settings",
874
- variant: "tertiary",
875
- if: o
876
- }),
877
- default: () => [
878
- l(v.FmMenuItem, {
879
- label: "Refund",
880
- sublabel: "Refund this transaction",
881
- onClick: async (y) => {
882
- y.stopPropagation(), await m(t);
883
- }
884
- })
885
- ]
886
- }
887
- ) : l("div");
888
- }
889
- }
890
- ], S = M({
891
- searchValue: "",
892
- dateRange: {
893
- startDate: T().subtract(7, "day").toISOString(),
894
- endDate: T().toISOString()
895
- }
896
- }), { tableMeta: h, rowData: I, onSort: E, debouncedFetchData: R, onSearch: d } = Ce(async (e) => {
897
- const t = {
898
- ...S.value.dateRange,
899
- user: w.user
900
- };
901
- return await q.readStoreTransactions(e, t);
902
- });
903
- async function m(e) {
904
- await Te.confirm(
905
- "Are you sure you want to refund this transaction?",
906
- "Refund Store Transaction",
907
- "Confirm",
908
- "Cancel"
909
- ) && await c(
910
- async () => {
911
- var o;
912
- await Ae.refundStoreTransaction({
913
- id: e._id,
914
- reason: `ADMIN:${(o = De().sessionUser) == null ? void 0 : o.name}`
915
- }), await R();
916
- },
917
- {
918
- message: "Refunding transaction...",
919
- successMessage: "Transaction refunded successfully"
920
- }
921
- );
922
- }
923
- re(
924
- S,
925
- () => {
926
- R();
927
- },
928
- { deep: !0 }
929
- ), _e(async () => {
930
- await R();
931
- });
932
- const n = async () => Re({
933
- exporter: new je(),
934
- readFunction: (e) => q.readStoreTransactions(e, {
935
- ...S.value.dateRange,
936
- user: w.user
937
- }),
938
- transformRecord: (e) => {
939
- var t, o, y, p, D, f;
940
- return {
941
- TransactionId: ((t = e._id) == null ? void 0 : t.toString()) || "",
942
- CreatedAt: T(z(e._id.toString())).format(
943
- "DD/MM/YYYY HH:mm:ss"
944
- ),
945
- Bundle: e.bundle.name || "",
946
- Location: e.location ? e.pf_location[0].name : "Online Store",
947
- PaymentType: ((o = e.paymentType) == null ? void 0 : o.type) || "N/A",
948
- PaymentExtra: ((y = e.paymentType) == null ? void 0 : y.extra) || "",
949
- User: ((p = e.pf_member) == null ? void 0 : p.name) || "",
950
- PhoneNumber: ((D = e.pf_member) == null ? void 0 : D.phoneNumber) || "",
951
- Status: e.status || "",
952
- RefundReason: ((f = e == null ? void 0 : e.refund) == null ? void 0 : f.reason) || "",
953
- Ref: (e == null ? void 0 : e.ref) || ""
954
- };
955
- },
956
- filename: "store-transactions"
957
- });
958
- return (e, t) => {
959
- const o = Y("FmSearch"), y = Y("FmButton");
960
- return P(), O("div", null, [
961
- x("div", qe, [
962
- x("div", He, [
963
- C(le, {
964
- modelValue: s(S).dateRange,
965
- "onUpdate:modelValue": t[0] || (t[0] = (p) => s(S).dateRange = p)
966
- }, null, 8, ["modelValue"])
967
- ]),
968
- x("div", Qe, [
969
- C(o, {
970
- modelValue: s(h).searchValue,
971
- "onUpdate:modelValue": [
972
- t[1] || (t[1] = (p) => s(h).searchValue = p),
973
- s(d)
974
- ],
975
- placeholder: "Search",
976
- collapsible: ""
977
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
978
- C(y, {
979
- icon: "ios_share",
980
- variant: "tertiary",
981
- onClick: n
982
- })
983
- ])
984
- ]),
985
- C(ce, {
986
- loading: s(h).isLoading,
987
- "row-data": s(I),
988
- "row-count": s(h).totalRows,
989
- "column-defs": u.filter(
990
- (p) => !w.user || p.header !== "User" && p.header !== "Phone No."
991
- ),
992
- "page-count": s(h).pageCount,
993
- "page-index": s(h).pageIndex,
994
- "page-size": s(h).pageSize,
995
- "shrink-at": !1,
996
- onSortChange: s(E),
997
- onPageChange: t[2] || (t[2] = (p) => s(R)({
998
- pageSize: p.pageSize,
999
- pageIndex: p.pageIndex
1000
- }))
1001
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
1002
- ]);
1003
- };
1004
- }
1005
- });
1006
- export {
1007
- Fa as _,
1008
- Da as a
1009
- };