@feedmepos/mf-connect 0.1.98-beta.4 → 0.1.98-beta.41
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.
- package/dist/{App-BGv_JihW.js → App-C6JJ9uQ8.js} +808 -665
- package/dist/{AuditLogs-53rnjCmD.js → AuditLogs-CAlgtDgx.js} +12 -11
- package/dist/{Bin-B0Q_WpuY.js → Bin-D8jwhwER.js} +8 -8
- package/dist/{Broadcast-PiJE1Syl.js → Broadcast-CP8DRfkT.js} +39 -36
- package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dz2KsBZl.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js} +7 -5
- package/dist/{Card-DlqMu3Sl.js → Card-QribXJwZ.js} +21 -20
- package/dist/{Collections-BWcBlDDR.js → Collections-X9xbt43V.js} +14 -13
- package/dist/Credit-QmbsW1eb.js +286 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCvH0lGA.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js} +35 -30
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B_FyeWq4.js → EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js} +16 -16
- package/dist/{Experience-DacFmPYy.js → Experience-CPGMg847.js} +112 -86
- package/dist/{FileSaver.min-CMZKiGkX.js → FileSaver.min-CK67LsPG.js} +1 -1
- package/dist/Game-BrkiEFCS.js +356 -0
- package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
- package/dist/{Grab-DaBL5y3H.js → Grab-BgtDzK1B.js} +32 -31
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BaY_nQio.js → ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js} +1 -1
- package/dist/{Index-2UrjF35w.js → Index-KJgzalOd.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BuVBZsCN.js → LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-6wUxYqWe.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js} +1 -1
- package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
- package/dist/MainLayout-DlfTKHQ-.js +143 -0
- package/dist/{Marketing-DEp--hFd.js → Marketing-Crx_JQpi.js} +7 -6
- package/dist/{MarketingMaterialEdit-BHL8Ptsu.js → MarketingMaterialEdit-BfsdcMXJ.js} +15 -14
- package/dist/{Member-BU1YxoEV.js → Member-C50Nrsko.js} +14 -13
- package/dist/{MemberList-zjvJBYf0.js → MemberList-C9uUKw1o.js} +37 -35
- package/dist/{MemberTransactions-BvyLV69V.js → MemberTransactions-DZ7zPOHX.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-_YOM1SlS.js → MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js} +5434 -5279
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
- package/dist/Mission-D_km8zi6.js +360 -0
- package/dist/{Overview-BToUlbsH.js → Overview-BBieK6qQ.js} +21 -20
- package/dist/Overview-B_kmLOcc.js +1316 -0
- package/dist/Point-D0q9N7f9.js +288 -0
- package/dist/Promotion-DoFTy-NK.js +423 -0
- package/dist/{Queue-D3vUkKN9.js → Queue-Dh5sDRHW.js} +13 -12
- package/dist/{Record-BViEbZZ8.js → Record-0owEBKqN.js} +9 -9
- package/dist/Review-DV2fnpOH.js +45 -0
- package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
- package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
- package/dist/{Reward-CZsvsYW_.js → Reward-Co20Xrss.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BASPLoRa.js → RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js} +14 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B90meAnV.js → RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js} +17 -15
- package/dist/{Segment-CN8NEg8w.js → Segment-7dQKeHWK.js} +38 -35
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BGyYQST4.js → SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BxW-Kc6t.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js} +37 -36
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-C9dwcEr5.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js} +4 -4
- package/dist/{Setting-DLPbZW11.js → Setting-Bvahxs-y.js} +14 -14
- package/dist/{SettingAdvertisements-BIq8gS5g.js → SettingAdvertisements-fbXLRwfb.js} +12 -12
- package/dist/Settings-C_HWDFN8.js +179 -0
- package/dist/Store-8yBKDR1b.js +2413 -0
- package/dist/{StoreRewards-BoEjVFk6.js → StoreRewards-DKaJvoJs.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bv9ABH1K.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js} +400 -455
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DNHgSfIg.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js} +2 -2
- package/dist/{Tier-kQ6X9h-t.js → Tier-CD-CjXC3.js} +44 -41
- package/dist/{Title-XosVAF2Y.js → Title-C_lcgye8.js} +49 -46
- package/dist/{Transaction-CO6oLPKR.js → Transaction-BvUYm-rT.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-McMR2Y7Y.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js} +6 -6
- package/dist/{Voucher-CogaCxx2.js → Voucher-CYaG0GLU.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DjHwHFBq.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Dor9klZ8.js → ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js} +2 -2
- package/dist/{app-C9UPXbDs.js → app-CE5hQ4Uq.js} +6656 -5653
- package/dist/app.js +1 -1
- package/dist/{business-CYpW6-Ls.js → business-CE_4siXc.js} +1 -1
- package/dist/{campaign-BtLa7KeF.js → campaign-BP6rvSpg.js} +74 -96
- package/dist/campaign-CXQtKpeb.js +100 -0
- package/dist/{campaign.enum-DiLhS5il.js → campaign.enum-Dx-Zo68Q.js} +1 -1
- package/dist/{campaign.fn-CLB9gBHo.js → campaign.fn-DKnBpE1N.js} +119 -119
- package/dist/{collectible.enum-CmwWcfBh.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/collection.fn-Cg16QZSp.js +26 -0
- package/dist/{duplicateCampaign-DGhOBd5l.js → duplicateCampaign-DbtVAGsT.js} +2 -2
- package/dist/{effect-CY5Y6sxy.js → effect-CLI8NI4O.js} +1 -1
- package/dist/{email-addresses-BEnOHWj_.js → email-addresses-DlLiZ1io.js} +2 -2
- package/dist/{export-BgYu7SCd.js → export-6Hr34dBU.js} +3 -3
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-DTDgoyEh.js → helper-vkjFqj70.js} +1 -1
- package/dist/index-BIyKgw4m.js +72 -0
- package/dist/{index-C8ehLvXG.js → index-BLQJ-rv3.js} +1 -1
- package/dist/{index-CP-7qATP.js → index-BbTIqReL.js} +1 -1
- package/dist/index-BuMfQxMf.js +897 -0
- package/dist/index-C8cXXcLk.js +45 -0
- package/dist/{index-kS20rM5m.js → index-CSVhIZSY.js} +589 -580
- package/dist/{index-zF0gIg9H.js → index-CVHacTbc.js} +1 -1
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-goRooQn5.js → index-CmNsGhDf.js} +272 -368
- package/dist/index-CnTeeRyJ.js +53 -0
- package/dist/{index-Ck3PeOQ5.js → index-CzbNobLv.js} +105 -123
- package/dist/index-D06n1h1b.js +146 -0
- package/dist/{index-CNKP1_IW.js → index-D4SDAfbP.js} +8027 -10766
- package/dist/{index-DntoqWT_.js → index-DVnYQ3Hs.js} +1 -1
- package/dist/{index-BZVhi3ZG.js → index-DcjnS5Sv.js} +2 -2
- package/dist/{index-DtyWsBgg.js → index-Dx9h0FNH.js} +1 -1
- package/dist/{index-CDk0Itu1.js → index-YgP4ihQL.js} +1 -1
- package/dist/{index-B4IAURA_.js → index-kedErkLZ.js} +1759 -2480
- package/dist/{index-CLZnH782.js → index-lnQT4P3d.js} +10 -9
- package/dist/{index.esm2017-C79fd6cz.js → index.esm2017-Jhv2lkrq.js} +105 -105
- package/dist/{loading-Dfr_97Ri.js → loading-NY-FPxVY.js} +1 -1
- package/dist/{lodash-BX2mJOxF.js → lodash-BC_P6kLg.js} +1 -1
- package/dist/{membership-ncNOUJwj.js → membership-BWaK-9FY.js} +3 -3
- package/dist/{money-vEtTzt04.js → money-COoh4GXK.js} +1 -1
- package/dist/{number-BjgTlMsp.js → number-BX5OEXgq.js} +1 -1
- package/dist/objectid-1SUSRtmY.js +145 -0
- package/dist/{plugins-BVGqEmE1.js → plugins-ur-FAoye.js} +3 -3
- package/dist/remy-Qz_pNsUS.js +13 -0
- package/dist/{reward-BGTLhhzT.js → reward-DSsylZ22.js} +1 -1
- package/dist/{rule-BB2VX3Gy.js → rule-BM9GUd1C.js} +3 -3
- package/dist/rule-builder-gC9LH2AC.js +126 -0
- package/dist/{template-DLiHnpjK.js → template-CUV3AMFI.js} +6 -6
- package/dist/timezone-BFZhekOU.js +20 -0
- package/dist/transaction.fn-C5MlkEIC.js +64 -0
- package/dist/{trigger-DrKnfSoi.js → trigger-CbjiuoSo.js} +14 -14
- package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
- package/dist/{usePagination-Dgd-onzU.js → usePagination-Caah4sJr.js} +1 -1
- package/dist/{user-BcDUmNrZ.js → user-BZC4P_jL.js} +1 -1
- package/dist/{vue-i18n-DNBGmwox.js → vue-i18n-BYz7XAr_.js} +390 -390
- package/dist/{xlsx-BX-U0_Au.js → xlsx-Bn7BqUFA.js} +1 -1
- package/dist/{zod-Mx51GBPY.js → zod-DHH42rXG.js} +1 -1
- package/package.json +3 -3
- package/dist/Credit-CMfcuj5n.js +0 -260
- package/dist/Game-DXKnGuhR.js +0 -330
- package/dist/LoyaltyDashboard-DIArPp71.js +0 -1082
- package/dist/MainLayout-BjvTxTPG.js +0 -41
- package/dist/Mission-BNYk_aPM.js +0 -334
- package/dist/Point-B-L2326L.js +0 -262
- package/dist/Promotion-sMKGkL4w.js +0 -397
- package/dist/Review-CMBAk-Qu.js +0 -1067
- package/dist/ReviewFacebookCallback-BCJTFy3b.js +0 -243
- package/dist/ReviewGoogleCallback-DKUG075r.js +0 -208
- package/dist/Store-DNB3gUIR.js +0 -1996
- package/dist/campaign-CtoHyXVT.js +0 -219
- package/dist/index-P8Qh2yIP.js +0 -52
- package/dist/objectid-C9DiLwge.js +0 -145
- package/dist/useMarketingMaterialActions-B6zaDbNE.js +0 -107
|
@@ -1,103 +1,45 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { components as
|
|
3
|
-
import { s as Z } from "./index-
|
|
4
|
-
import "./index-
|
|
5
|
-
import {
|
|
6
|
-
import { h as
|
|
7
|
-
import { _ as
|
|
1
|
+
import { ref as E, defineComponent as ae, computed as q, h as s, resolveComponent as U, openBlock as V, createBlock as se, unref as l, isRef as Se, withCtx as le, createElementVNode as x, createVNode as R, createElementBlock as Y, Fragment as J, renderList as ie, toDisplayString as W, createTextVNode as _e, resolveDynamicComponent as we, watch as ce, onBeforeMount as Te, onMounted as Ce } from "vue";
|
|
2
|
+
import { components as g, useDialog as Re } from "@feedmepos/ui-library";
|
|
3
|
+
import { s as Z } from "./index-kedErkLZ.js";
|
|
4
|
+
import "./index-D4SDAfbP.js";
|
|
5
|
+
import { T as z } from "./transaction.fn-C5MlkEIC.js";
|
|
6
|
+
import { h as _ } from "./moment-D7p2TMB-.js";
|
|
7
|
+
import { _ as Q } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
8
8
|
import { _ as ue } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js";
|
|
9
|
-
import { s as
|
|
10
|
-
import { f as ee } from "./number-
|
|
11
|
-
import { u as me } from "./business-
|
|
12
|
-
import { _ as de, u as Fe } from "./usePagination-
|
|
13
|
-
import { c as
|
|
14
|
-
import { g as pe } from "./user-
|
|
15
|
-
import { B as fe, e as
|
|
16
|
-
import { u as ge } from "./campaign-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
9
|
+
import { s as H } from "./index-CuvNtC_M.js";
|
|
10
|
+
import { f as ee } from "./number-BX5OEXgq.js";
|
|
11
|
+
import { u as me } from "./business-CE_4siXc.js";
|
|
12
|
+
import { _ as de, u as Fe } from "./usePagination-Caah4sJr.js";
|
|
13
|
+
import { c as te, p as Ie } from "./plugins-ur-FAoye.js";
|
|
14
|
+
import { g as pe } from "./user-BZC4P_jL.js";
|
|
15
|
+
import { B as fe, e as De } from "./export-6Hr34dBU.js";
|
|
16
|
+
import { u as ge } from "./campaign-CXQtKpeb.js";
|
|
17
|
+
import "./index-Dx9h0FNH.js";
|
|
18
|
+
import "./index-CmNsGhDf.js";
|
|
19
|
+
import "./index-CSVhIZSY.js";
|
|
20
|
+
import "./index-BuMfQxMf.js";
|
|
21
|
+
import "./index-lnQT4P3d.js";
|
|
22
|
+
import { u as he } from "./vue-i18n-BYz7XAr_.js";
|
|
23
|
+
import { o as B } from "./objectId-dwaoBfJX.js";
|
|
24
|
+
import { u as ye } from "./loading-NY-FPxVY.js";
|
|
25
|
+
import { w as Ae } from "./xlsx-Bn7BqUFA.js";
|
|
25
26
|
import { useRouter as Ne } from "vue-router";
|
|
26
|
-
import { t as L } from "./index-
|
|
27
|
-
import { R as
|
|
28
|
-
import { F as
|
|
29
|
-
import { useCoreStore as
|
|
30
|
-
import { c as
|
|
31
|
-
import { m as
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
p = "MEMBERSHIP";
|
|
40
|
-
break;
|
|
41
|
-
case "ORDER":
|
|
42
|
-
p = "ORDER";
|
|
43
|
-
break;
|
|
44
|
-
case "BILL":
|
|
45
|
-
p = "SPENDING";
|
|
46
|
-
break;
|
|
47
|
-
case "CASHBACK":
|
|
48
|
-
p = "CASHBACK";
|
|
49
|
-
break;
|
|
50
|
-
case "CYCLE":
|
|
51
|
-
p = "EXPIRED";
|
|
52
|
-
break;
|
|
53
|
-
case "COUNTER_CONSUME":
|
|
54
|
-
p = "COUNTER REDEEM";
|
|
55
|
-
break;
|
|
56
|
-
default:
|
|
57
|
-
p = c;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
return p;
|
|
61
|
-
}
|
|
62
|
-
function Ve(c) {
|
|
63
|
-
var p, u, m, x, h, T;
|
|
64
|
-
switch ((p = c == null ? void 0 : c.pf_collectible) == null ? void 0 : p.type) {
|
|
65
|
-
case "VOUCHER":
|
|
66
|
-
return `${(u = c.pf_collectible) == null ? void 0 : u.type} (${(m = c.pf_collectible) == null ? void 0 : m.name})`;
|
|
67
|
-
case "TITLE":
|
|
68
|
-
return `${(x = c.pf_collectible) == null ? void 0 : x.type} (${(h = c.pf_collectible) == null ? void 0 : h.name})`;
|
|
69
|
-
case "POINT":
|
|
70
|
-
return "Experience";
|
|
71
|
-
case "COIN":
|
|
72
|
-
return "Point";
|
|
73
|
-
default:
|
|
74
|
-
return Ie((T = c == null ? void 0 : c.pf_collectible) == null ? void 0 : T.type);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function ze(c) {
|
|
78
|
-
switch (c) {
|
|
79
|
-
case "ONLINE":
|
|
80
|
-
return "Online";
|
|
81
|
-
case "COIN":
|
|
82
|
-
return "Point";
|
|
83
|
-
default:
|
|
84
|
-
return c;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const z = {
|
|
88
|
-
getReason: ke,
|
|
89
|
-
formattedType: Ve,
|
|
90
|
-
formattedPaymentType: ze
|
|
91
|
-
}, Be = (c) => {
|
|
92
|
-
if (c.startsWith("_") || c.includes("."))
|
|
93
|
-
return c;
|
|
94
|
-
for (const p of ["pf_user_", "pf_collectible_"])
|
|
95
|
-
if (c.startsWith(p))
|
|
96
|
-
return `${p.slice(0, -1)}.${c.slice(p.length).replace(new RegExp("_", "g"), ".")}`;
|
|
97
|
-
return c.replace(new RegExp("_", "g"), ".");
|
|
27
|
+
import { t as L } from "./index-BbTIqReL.js";
|
|
28
|
+
import { R as j } from "./app-CE5hQ4Uq.js";
|
|
29
|
+
import { F as X } from "./collectible.enum-Liy2wH3s.js";
|
|
30
|
+
import { useCoreStore as Me } from "@feedmepos/mf-common";
|
|
31
|
+
import { c as Ee } from "./string-Gcy5IM_H.js";
|
|
32
|
+
import { m as Pe } from "./index-CVHacTbc.js";
|
|
33
|
+
const ke = (w) => {
|
|
34
|
+
if (w.startsWith("_") || w.includes("."))
|
|
35
|
+
return w;
|
|
36
|
+
for (const T of ["pf_user_", "pf_collectible_"])
|
|
37
|
+
if (w.startsWith(T))
|
|
38
|
+
return `${T.slice(0, -1)}.${w.slice(T.length).replace(new RegExp("_", "g"), ".")}`;
|
|
39
|
+
return w.replace(new RegExp("_", "g"), ".");
|
|
98
40
|
};
|
|
99
|
-
function
|
|
100
|
-
const u =
|
|
41
|
+
function Oe(w, T = { key: "_id", descending: !0 }) {
|
|
42
|
+
const u = E({
|
|
101
43
|
pageCount: 1,
|
|
102
44
|
searchValue: "",
|
|
103
45
|
pageIndex: 0,
|
|
@@ -105,88 +47,88 @@ function Ue(c, p = { key: "_id", descending: !0 }) {
|
|
|
105
47
|
isLoading: !1,
|
|
106
48
|
pageSize: 10,
|
|
107
49
|
hasNext: !1
|
|
108
|
-
}), m =
|
|
109
|
-
function
|
|
50
|
+
}), m = E(T), b = E([]), h = E([void 0]);
|
|
51
|
+
function D() {
|
|
110
52
|
h.value = [void 0], u.value.pageIndex = 0, u.value.pageCount = 1, u.value.hasNext = !1;
|
|
111
53
|
}
|
|
112
|
-
const
|
|
113
|
-
const o = n.pageSize ?? u.value.pageSize,
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
u.value.isLoading = !0, u.value.pageSize = o,
|
|
54
|
+
const P = async (n = {}) => {
|
|
55
|
+
const o = n.pageSize ?? u.value.pageSize, y = o !== u.value.pageSize;
|
|
56
|
+
y && D();
|
|
57
|
+
const f = y ? 0 : Math.max(n.pageIndex ?? u.value.pageIndex, 0), C = f === 0 || !!h.value[f] ? f : u.value.pageIndex, K = h.value[C];
|
|
58
|
+
u.value.isLoading = !0, u.value.pageSize = o, b.value = [];
|
|
117
59
|
try {
|
|
118
|
-
const
|
|
60
|
+
const N = await w({
|
|
119
61
|
limit: o,
|
|
120
62
|
sortBy: m.value.key,
|
|
121
63
|
descending: m.value.descending,
|
|
122
64
|
search: u.value.searchValue,
|
|
123
65
|
...K ? { cursor: K } : {}
|
|
124
66
|
});
|
|
125
|
-
|
|
126
|
-
} catch (
|
|
127
|
-
console.error("Error fetching data:",
|
|
67
|
+
b.value = N.resources, u.value.pageIndex = C, u.value.totalRows = N.resources.length, u.value.hasNext = N.meta.hasNext, u.value.pageCount = C + (N.meta.hasNext ? 2 : 1), N.meta.nextCursor ? h.value[C + 1] = N.meta.nextCursor : h.value.splice(C + 1);
|
|
68
|
+
} catch (N) {
|
|
69
|
+
console.error("Error fetching data:", N), u.value.hasNext = !1;
|
|
128
70
|
} finally {
|
|
129
71
|
u.value.isLoading = !1;
|
|
130
72
|
}
|
|
131
73
|
};
|
|
132
|
-
let
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
74
|
+
let I, p;
|
|
75
|
+
const d = (n) => (I && clearTimeout(I), p && p(), new Promise((o) => {
|
|
76
|
+
p = o, I = setTimeout(async () => {
|
|
77
|
+
I = void 0, p = void 0, await P(n), o();
|
|
136
78
|
}, 200);
|
|
137
79
|
}));
|
|
138
80
|
return {
|
|
139
81
|
tableMeta: u,
|
|
140
|
-
rowData:
|
|
82
|
+
rowData: b,
|
|
141
83
|
sortBy: m,
|
|
142
84
|
pageCursors: h,
|
|
143
|
-
resetCursorState:
|
|
144
|
-
fetchData:
|
|
145
|
-
debouncedFetchData:
|
|
85
|
+
resetCursorState: D,
|
|
86
|
+
fetchData: P,
|
|
87
|
+
debouncedFetchData: d,
|
|
146
88
|
onSort: async (n) => {
|
|
147
89
|
n.length ? m.value = {
|
|
148
|
-
key:
|
|
90
|
+
key: ke(n[0].id),
|
|
149
91
|
descending: n[0].desc
|
|
150
|
-
} : m.value =
|
|
92
|
+
} : m.value = T, D(), await d({
|
|
151
93
|
pageIndex: 0,
|
|
152
94
|
pageSize: u.value.pageSize
|
|
153
95
|
});
|
|
154
96
|
},
|
|
155
|
-
onSearch: () => (
|
|
97
|
+
onSearch: () => (D(), d({
|
|
156
98
|
pageIndex: 0,
|
|
157
99
|
pageSize: u.value.pageSize
|
|
158
100
|
}))
|
|
159
101
|
};
|
|
160
102
|
}
|
|
161
|
-
class
|
|
103
|
+
class Ve extends fe {
|
|
162
104
|
}
|
|
163
|
-
const
|
|
105
|
+
const ze = { class: "space-y-24 pr-12" }, Ye = { class: "w-full space-y-16" }, Be = { class: "fm-typo-en-body-lg-600" }, Ue = ["onClick"], $e = { class: "fm-typo-en-body-lg-600" }, Le = ["onClick"], Ke = { class: "flex items-center gap-8" }, Ge = /* @__PURE__ */ ae({
|
|
164
106
|
__name: "TransactionDetailSheet",
|
|
165
|
-
setup(
|
|
166
|
-
|
|
167
|
-
const u =
|
|
168
|
-
function
|
|
169
|
-
u.value =
|
|
107
|
+
setup(w, { expose: T }) {
|
|
108
|
+
he();
|
|
109
|
+
const u = E(!1), m = E(), b = ge(), h = me();
|
|
110
|
+
function D(d, t) {
|
|
111
|
+
u.value = d, m.value = t ?? null;
|
|
170
112
|
}
|
|
171
|
-
const
|
|
172
|
-
var
|
|
113
|
+
const P = q(() => {
|
|
114
|
+
var d, t;
|
|
173
115
|
return ee(
|
|
174
|
-
((
|
|
116
|
+
((t = m.value) == null ? void 0 : t.expiryAmount.reduce(
|
|
175
117
|
(e, n) => e + n.amount,
|
|
176
|
-
((
|
|
118
|
+
((d = m.value) == null ? void 0 : d.amount) ?? 0
|
|
177
119
|
)) ?? 0,
|
|
178
120
|
2
|
|
179
121
|
);
|
|
180
|
-
}),
|
|
181
|
-
var
|
|
122
|
+
}), I = q(() => {
|
|
123
|
+
var d, t, e, n, o;
|
|
182
124
|
return m.value ? [
|
|
183
125
|
{
|
|
184
126
|
label: "Transaction ID",
|
|
185
|
-
value: (
|
|
127
|
+
value: (d = m.value) == null ? void 0 : d._id
|
|
186
128
|
},
|
|
187
129
|
{
|
|
188
130
|
label: "Date/Time",
|
|
189
|
-
value:
|
|
131
|
+
value: _(B(m.value._id.toString())).format(
|
|
190
132
|
"D MMM YYYY, hh:mmA"
|
|
191
133
|
)
|
|
192
134
|
},
|
|
@@ -197,10 +139,10 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
197
139
|
{
|
|
198
140
|
class: [
|
|
199
141
|
"pr-2",
|
|
200
|
-
+
|
|
142
|
+
+P.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
201
143
|
]
|
|
202
144
|
},
|
|
203
|
-
|
|
145
|
+
P.value
|
|
204
146
|
)
|
|
205
147
|
},
|
|
206
148
|
{
|
|
@@ -209,106 +151,106 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
209
151
|
},
|
|
210
152
|
{
|
|
211
153
|
label: "Source",
|
|
212
|
-
value:
|
|
154
|
+
value: H(z.getReason(m.value.source))
|
|
213
155
|
},
|
|
214
156
|
{
|
|
215
157
|
label: "User",
|
|
216
|
-
value: (e = (
|
|
158
|
+
value: (e = (t = m.value) == null ? void 0 : t.pf_user) == null ? void 0 : e.name
|
|
217
159
|
},
|
|
218
160
|
{
|
|
219
161
|
label: "Phone Number",
|
|
220
162
|
value: (o = (n = m.value) == null ? void 0 : n.pf_user) == null ? void 0 : o.phoneNumber
|
|
221
163
|
}
|
|
222
164
|
] : [];
|
|
223
|
-
}),
|
|
224
|
-
var n, o,
|
|
165
|
+
}), p = q(() => {
|
|
166
|
+
var n, o, y, f;
|
|
225
167
|
if (!m.value) return [];
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
(
|
|
168
|
+
const d = [], t = (n = m.value) == null ? void 0 : n.metadata, e = m.value;
|
|
169
|
+
if (t != null && t.campaign) {
|
|
170
|
+
const S = b.campaigns.all.find(
|
|
171
|
+
(C) => C._id === (t == null ? void 0 : t.campaign)
|
|
230
172
|
);
|
|
231
|
-
if (!
|
|
232
|
-
|
|
173
|
+
if (!S) return;
|
|
174
|
+
d.push({
|
|
233
175
|
label: "Campaign",
|
|
234
|
-
value:
|
|
176
|
+
value: S.name
|
|
235
177
|
});
|
|
236
178
|
}
|
|
237
|
-
return
|
|
179
|
+
return t != null && t.remark && d.push({
|
|
238
180
|
label: "Remark",
|
|
239
|
-
value:
|
|
240
|
-
}), (o = m.value) != null && o.ref.startsWith("bill_") &&
|
|
181
|
+
value: t.remark
|
|
182
|
+
}), (o = m.value) != null && o.ref.startsWith("bill_") && d.push({
|
|
241
183
|
label: "Bill Number",
|
|
242
|
-
value: (
|
|
184
|
+
value: (y = m.value) == null ? void 0 : y.ref,
|
|
243
185
|
copy: () => {
|
|
244
|
-
var
|
|
245
|
-
return
|
|
186
|
+
var S;
|
|
187
|
+
return te((S = m.value) == null ? void 0 : S.ref);
|
|
246
188
|
}
|
|
247
|
-
}),
|
|
189
|
+
}), t != null && t.location && d.push({
|
|
248
190
|
label: "Location",
|
|
249
|
-
value: (
|
|
250
|
-
(
|
|
251
|
-
)) == null ? void 0 :
|
|
252
|
-
}), e.source === Z.enum.STORE &&
|
|
191
|
+
value: (f = h.locations.find(
|
|
192
|
+
(S) => S._id.toString() === (t == null ? void 0 : t.location)
|
|
193
|
+
)) == null ? void 0 : f.name
|
|
194
|
+
}), e.source === Z.enum.STORE && d.push({
|
|
253
195
|
label: "Store Transaction",
|
|
254
196
|
value: e.ref
|
|
255
|
-
}),
|
|
197
|
+
}), t != null && t.originTransaction && d.push({
|
|
256
198
|
label: "Parent Transaction",
|
|
257
|
-
value:
|
|
258
|
-
}),
|
|
199
|
+
value: t.originTransaction
|
|
200
|
+
}), t != null && t.referral_count && d.push({
|
|
259
201
|
label: "Referral Count",
|
|
260
|
-
value:
|
|
261
|
-
}), e.refundedFrom &&
|
|
202
|
+
value: t.referral_count
|
|
203
|
+
}), e.refundedFrom && d.push({
|
|
262
204
|
label: "Refunded From",
|
|
263
205
|
value: e.refundedFrom
|
|
264
|
-
}),
|
|
206
|
+
}), d;
|
|
265
207
|
});
|
|
266
|
-
return
|
|
267
|
-
showSheet:
|
|
268
|
-
}), (
|
|
269
|
-
const e =
|
|
208
|
+
return T({
|
|
209
|
+
showSheet: D
|
|
210
|
+
}), (d, t) => {
|
|
211
|
+
const e = U("FmButton"), n = U("FmSideSheet");
|
|
270
212
|
return V(), se(n, {
|
|
271
213
|
"max-width": 560,
|
|
272
214
|
modelValue: l(u),
|
|
273
|
-
"onUpdate:modelValue":
|
|
215
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => Se(u) ? u.value = o : null),
|
|
274
216
|
header: "Transaction Details"
|
|
275
217
|
}, {
|
|
276
218
|
"side-sheet-footer": le(() => [
|
|
277
|
-
|
|
278
|
-
|
|
219
|
+
x("div", Ke, [
|
|
220
|
+
R(e, {
|
|
279
221
|
label: "Close",
|
|
280
|
-
onClick:
|
|
222
|
+
onClick: t[0] || (t[0] = (o) => D(!1)),
|
|
281
223
|
variant: "tertiary"
|
|
282
224
|
})
|
|
283
225
|
])
|
|
284
226
|
]),
|
|
285
227
|
default: le(() => [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
(V(!0),
|
|
228
|
+
x("div", ze, [
|
|
229
|
+
x("div", Ye, [
|
|
230
|
+
(V(!0), Y(J, null, ie(l(I), (o) => (V(), Y("div", {
|
|
289
231
|
key: o.label,
|
|
290
232
|
class: "flex flex-col gap-4"
|
|
291
233
|
}, [
|
|
292
|
-
|
|
293
|
-
|
|
234
|
+
x("div", Be, W(o.label), 1),
|
|
235
|
+
x("div", {
|
|
294
236
|
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
295
237
|
onClick: o.copy
|
|
296
238
|
}, [
|
|
297
|
-
_e(
|
|
239
|
+
_e(W(o.accessorFn ? o.accessorFn() : o.value) + " ", 1),
|
|
298
240
|
(V(), se(we(o.component)))
|
|
299
|
-
], 8,
|
|
300
|
-
|
|
241
|
+
], 8, Ue),
|
|
242
|
+
t[2] || (t[2] = x("hr", { class: "mt-3" }, null, -1))
|
|
301
243
|
]))), 128)),
|
|
302
|
-
(V(!0),
|
|
244
|
+
(V(!0), Y(J, null, ie(l(p), (o) => (V(), Y("div", {
|
|
303
245
|
key: o.label,
|
|
304
246
|
class: "flex flex-col gap-4"
|
|
305
247
|
}, [
|
|
306
|
-
|
|
307
|
-
|
|
248
|
+
x("div", $e, W(o.label), 1),
|
|
249
|
+
x("div", {
|
|
308
250
|
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
309
251
|
onClick: o.copy
|
|
310
|
-
},
|
|
311
|
-
|
|
252
|
+
}, W(o.accessorFn ? o.accessorFn() : o.value), 9, Le),
|
|
253
|
+
t[3] || (t[3] = x("hr", { class: "mt-3" }, null, -1))
|
|
312
254
|
]))), 128))
|
|
313
255
|
])
|
|
314
256
|
])
|
|
@@ -317,36 +259,36 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
317
259
|
}, 8, ["modelValue"]);
|
|
318
260
|
};
|
|
319
261
|
}
|
|
320
|
-
}),
|
|
262
|
+
}), We = { class: "hidden xs:!flex items-center justify-end" }, je = { class: "flex items-center justify-between" }, qe = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, He = { class: "xs:hidden" }, Ma = /* @__PURE__ */ ae({
|
|
321
263
|
__name: "CollectionTransactions",
|
|
322
264
|
props: {
|
|
323
265
|
user: {
|
|
324
266
|
type: String
|
|
325
267
|
}
|
|
326
268
|
},
|
|
327
|
-
setup(
|
|
328
|
-
const { t:
|
|
269
|
+
setup(w) {
|
|
270
|
+
const { t: T } = he(), u = me(), m = ge(), b = Ne(), h = w, D = E(!1), { minor: P } = ye, I = [
|
|
329
271
|
{
|
|
330
272
|
header: "Transaction ID",
|
|
331
273
|
accessorKey: "_id",
|
|
332
274
|
meta: {
|
|
333
275
|
maxWidth: "100px"
|
|
334
276
|
},
|
|
335
|
-
cell(
|
|
277
|
+
cell(a) {
|
|
336
278
|
return s("div", { class: "flex items-center" }, [
|
|
337
|
-
s(
|
|
279
|
+
s(g.FmIcon, {
|
|
338
280
|
name: "content_copy",
|
|
339
281
|
outline: !0,
|
|
340
282
|
size: "sm",
|
|
341
283
|
class: "cursor-pointer mr-4",
|
|
342
284
|
onClick: (r) => {
|
|
343
|
-
r.preventDefault(), r.stopPropagation(),
|
|
285
|
+
r.preventDefault(), r.stopPropagation(), te(a.row.original._id.toString());
|
|
344
286
|
}
|
|
345
287
|
}),
|
|
346
288
|
s(
|
|
347
289
|
"div",
|
|
348
290
|
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
349
|
-
|
|
291
|
+
a.row.original._id.toString()
|
|
350
292
|
)
|
|
351
293
|
]);
|
|
352
294
|
},
|
|
@@ -355,8 +297,8 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
355
297
|
{
|
|
356
298
|
header: "Created at",
|
|
357
299
|
accessorKey: "_id",
|
|
358
|
-
accessorFn: (
|
|
359
|
-
cell: (
|
|
300
|
+
accessorFn: (a) => _(B(a._id.toString())),
|
|
301
|
+
cell: (a) => _(B(a.row.original._id.toString())).format(
|
|
360
302
|
"D MMM YYYY, hh:mmA"
|
|
361
303
|
),
|
|
362
304
|
enableSorting: !0
|
|
@@ -365,15 +307,15 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
365
307
|
header: "Amount",
|
|
366
308
|
// accessorKey: 'totalAmount',
|
|
367
309
|
enableSorting: !1,
|
|
368
|
-
cell(
|
|
369
|
-
var
|
|
310
|
+
cell(a) {
|
|
311
|
+
var c, i, F, M;
|
|
370
312
|
const r = ee(
|
|
371
|
-
|
|
372
|
-
($,
|
|
373
|
-
|
|
313
|
+
a.row.original.expiryAmount.reduce(
|
|
314
|
+
($, k) => $ + k.amount,
|
|
315
|
+
a.row.original.amount ?? 0
|
|
374
316
|
),
|
|
375
317
|
2
|
|
376
|
-
),
|
|
318
|
+
), v = (i = (c = a.row.original.expiryAmount) == null ? void 0 : c[0]) != null && i.expiredAt ? _((M = (F = a.row.original.expiryAmount) == null ? void 0 : F[0]) == null ? void 0 : M.expiredAt).format(
|
|
377
319
|
"D MMM YYYY"
|
|
378
320
|
) : "";
|
|
379
321
|
return s("div", { class: "flex items-center" }, [
|
|
@@ -388,13 +330,13 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
388
330
|
r
|
|
389
331
|
),
|
|
390
332
|
s("div", { class: "flex items-center" }, [
|
|
391
|
-
|
|
392
|
-
|
|
333
|
+
a.row.original.expiryAmount.length > 0 ? s(
|
|
334
|
+
g.FmTooltip,
|
|
393
335
|
{
|
|
394
|
-
content: `Expired on ${
|
|
336
|
+
content: `Expired on ${v}`
|
|
395
337
|
},
|
|
396
338
|
[
|
|
397
|
-
s(
|
|
339
|
+
s(g.FmIcon, {
|
|
398
340
|
name: "info",
|
|
399
341
|
outline: !0,
|
|
400
342
|
size: "sm"
|
|
@@ -408,21 +350,21 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
408
350
|
{
|
|
409
351
|
header: "Type",
|
|
410
352
|
accessorKey: "pf_collectible.type",
|
|
411
|
-
accessorFn: (
|
|
353
|
+
accessorFn: (a) => z.formattedType(a),
|
|
412
354
|
meta: {
|
|
413
355
|
maxWidth: "200px"
|
|
414
356
|
},
|
|
415
|
-
cell(
|
|
416
|
-
const r = z.formattedType(
|
|
357
|
+
cell(a) {
|
|
358
|
+
const r = z.formattedType(a.row.original);
|
|
417
359
|
return s("div", { class: "flex items-center" }, [
|
|
418
360
|
s("div", { class: "truncate text-ellipsis" }, r),
|
|
419
361
|
r.length > 20 ? s(
|
|
420
|
-
|
|
362
|
+
g.FmTooltip,
|
|
421
363
|
{
|
|
422
364
|
content: r
|
|
423
365
|
},
|
|
424
366
|
[
|
|
425
|
-
s(
|
|
367
|
+
s(g.FmIcon, {
|
|
426
368
|
name: "info",
|
|
427
369
|
color: "primary",
|
|
428
370
|
outline: !0,
|
|
@@ -436,65 +378,65 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
436
378
|
{
|
|
437
379
|
header: "Source",
|
|
438
380
|
accessorKey: "source",
|
|
439
|
-
cell(
|
|
381
|
+
cell(a) {
|
|
440
382
|
var r;
|
|
441
383
|
return s("div", { class: "flex items-center gap-4" }, [
|
|
442
384
|
s(
|
|
443
385
|
"div",
|
|
444
386
|
{ class: "truncate text-ellipsis" },
|
|
445
|
-
|
|
387
|
+
H(z.getReason(a.row.original.source))
|
|
446
388
|
),
|
|
447
|
-
...(r =
|
|
389
|
+
...(r = a.row.original.metadata) != null && r.campaign ? [
|
|
448
390
|
s(
|
|
449
|
-
|
|
391
|
+
g.FmTooltip,
|
|
450
392
|
{
|
|
451
393
|
get content() {
|
|
452
|
-
var
|
|
453
|
-
return (
|
|
454
|
-
(
|
|
394
|
+
var v;
|
|
395
|
+
return (v = m.campaigns.all.find(
|
|
396
|
+
(c) => {
|
|
455
397
|
var i;
|
|
456
|
-
return
|
|
398
|
+
return c._id === ((i = a.row.original.metadata) == null ? void 0 : i.campaign);
|
|
457
399
|
}
|
|
458
|
-
)) == null ? void 0 :
|
|
400
|
+
)) == null ? void 0 : v.name;
|
|
459
401
|
}
|
|
460
402
|
},
|
|
461
403
|
[
|
|
462
|
-
s(
|
|
404
|
+
s(g.FmIcon, {
|
|
463
405
|
name: "info",
|
|
464
406
|
color: "primary",
|
|
465
407
|
size: "sm",
|
|
466
|
-
onClick: async (
|
|
467
|
-
|
|
468
|
-
const
|
|
408
|
+
onClick: async (v) => {
|
|
409
|
+
v.preventDefault(), v.stopPropagation();
|
|
410
|
+
const c = m.campaigns.all.find(
|
|
469
411
|
(i) => {
|
|
470
|
-
var
|
|
471
|
-
return i._id === ((
|
|
412
|
+
var F;
|
|
413
|
+
return i._id === ((F = a.row.original.metadata) == null ? void 0 : F.campaign);
|
|
472
414
|
}
|
|
473
415
|
);
|
|
474
|
-
if (
|
|
475
|
-
switch (
|
|
416
|
+
if (c)
|
|
417
|
+
switch (c.type) {
|
|
476
418
|
case "VOUCHER":
|
|
477
419
|
case "PROMOTION":
|
|
478
420
|
case "BROADCAST":
|
|
479
|
-
await
|
|
480
|
-
name:
|
|
421
|
+
await b.push({
|
|
422
|
+
name: j[`$connect-CAMPAIGN_${c.type}`]
|
|
481
423
|
});
|
|
482
424
|
break;
|
|
483
425
|
case "GAME":
|
|
484
426
|
case "CREDIT":
|
|
485
427
|
case "MISSION":
|
|
486
|
-
await
|
|
487
|
-
name:
|
|
428
|
+
await b.push({
|
|
429
|
+
name: j[`$connect-PROGRAM_${c.type}`]
|
|
488
430
|
});
|
|
489
431
|
break;
|
|
490
432
|
case "POINT":
|
|
491
|
-
await
|
|
492
|
-
name:
|
|
433
|
+
await b.push({
|
|
434
|
+
name: j["$connect-PROGRAM_EXPERIENCE"]
|
|
493
435
|
});
|
|
494
436
|
break;
|
|
495
437
|
case "COIN":
|
|
496
|
-
await
|
|
497
|
-
name:
|
|
438
|
+
await b.push({
|
|
439
|
+
name: j["$connect-PROGRAM_POINT"]
|
|
498
440
|
});
|
|
499
441
|
break;
|
|
500
442
|
}
|
|
@@ -509,46 +451,46 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
509
451
|
{
|
|
510
452
|
header: "User",
|
|
511
453
|
accessorKey: "pf_user.name",
|
|
512
|
-
cell(
|
|
513
|
-
return pe(
|
|
454
|
+
cell(a) {
|
|
455
|
+
return pe(a.row.original.pf_user);
|
|
514
456
|
}
|
|
515
457
|
},
|
|
516
458
|
{
|
|
517
459
|
header: "Phone No.",
|
|
518
460
|
accessorKey: "pf_user.phoneNumber",
|
|
519
|
-
accessorFn: (
|
|
461
|
+
accessorFn: (a) => {
|
|
520
462
|
var r;
|
|
521
|
-
return ((r =
|
|
463
|
+
return ((r = a == null ? void 0 : a.pf_user) == null ? void 0 : r.phoneNumber) || "";
|
|
522
464
|
}
|
|
523
465
|
},
|
|
524
466
|
{
|
|
525
467
|
header: "Status",
|
|
526
468
|
id: "status",
|
|
527
469
|
enableSorting: !1,
|
|
528
|
-
cell(
|
|
529
|
-
const r = !!
|
|
530
|
-
return s(
|
|
531
|
-
label:
|
|
470
|
+
cell(a) {
|
|
471
|
+
const r = !!a.row.original.refunded;
|
|
472
|
+
return s(g.FmChip, {
|
|
473
|
+
label: T(r ? "connect.transaction.refunded" : "connect.transaction.completed"),
|
|
532
474
|
variant: "plain",
|
|
533
475
|
class: r ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-success bg-fm-color-system-success-100"
|
|
534
476
|
});
|
|
535
477
|
}
|
|
536
478
|
},
|
|
537
479
|
{
|
|
538
|
-
accessorFn: (
|
|
480
|
+
accessorFn: (a) => a.ref,
|
|
539
481
|
header: "References",
|
|
540
482
|
accessorKey: "ref",
|
|
541
|
-
cell(
|
|
542
|
-
var r,
|
|
483
|
+
cell(a) {
|
|
484
|
+
var r, v;
|
|
543
485
|
return s("div", { class: "flex items-center justify-between gap-4" }, [
|
|
544
486
|
s("div", { class: "flex items-center" }, [
|
|
545
|
-
(r =
|
|
546
|
-
|
|
487
|
+
(r = a.row.original.metadata) != null && r.remark ? s(
|
|
488
|
+
g.FmTooltip,
|
|
547
489
|
{
|
|
548
|
-
content: (
|
|
490
|
+
content: (v = a.row.original.metadata) == null ? void 0 : v.remark
|
|
549
491
|
},
|
|
550
492
|
[
|
|
551
|
-
s(
|
|
493
|
+
s(g.FmIcon, {
|
|
552
494
|
name: "info",
|
|
553
495
|
class: "pl-2",
|
|
554
496
|
outline: !0,
|
|
@@ -557,110 +499,113 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
557
499
|
]
|
|
558
500
|
) : s("div")
|
|
559
501
|
]),
|
|
560
|
-
s("div", { class: "flex-1" },
|
|
502
|
+
s("div", { class: "flex-1" }, a.row.original.ref)
|
|
561
503
|
]);
|
|
562
504
|
}
|
|
563
505
|
},
|
|
564
506
|
{
|
|
565
507
|
header: "Actions",
|
|
566
|
-
cell(
|
|
567
|
-
const r =
|
|
508
|
+
cell(a) {
|
|
509
|
+
const r = a.row.original;
|
|
568
510
|
return s(
|
|
569
|
-
|
|
511
|
+
g.FmTooltip,
|
|
570
512
|
{
|
|
571
513
|
get content() {
|
|
572
514
|
return "Revert Transaction";
|
|
573
515
|
}
|
|
574
516
|
},
|
|
575
517
|
[
|
|
576
|
-
s(
|
|
518
|
+
s(g.FmButton, {
|
|
577
519
|
variant: "tertiary",
|
|
578
520
|
icon: "amend",
|
|
579
521
|
iconColor: "neutral-gray-400",
|
|
580
522
|
disabled: !r.isRevertable,
|
|
581
|
-
onClick: (
|
|
582
|
-
|
|
523
|
+
onClick: (v) => {
|
|
524
|
+
v.stopPropagation(), K(r);
|
|
583
525
|
}
|
|
584
526
|
})
|
|
585
527
|
]
|
|
586
528
|
);
|
|
587
529
|
}
|
|
588
530
|
}
|
|
589
|
-
],
|
|
531
|
+
], p = E({
|
|
590
532
|
search: "",
|
|
591
533
|
"pf_collectible.type": [],
|
|
592
534
|
"metadata.location": [],
|
|
593
535
|
dateRange: {
|
|
594
|
-
startDate:
|
|
595
|
-
endDate:
|
|
536
|
+
startDate: _().subtract(7, "day").toISOString(),
|
|
537
|
+
endDate: _().endOf("day").toISOString()
|
|
596
538
|
},
|
|
597
539
|
source: []
|
|
598
|
-
}),
|
|
599
|
-
...
|
|
540
|
+
}), d = () => ({
|
|
541
|
+
...p.value,
|
|
600
542
|
user: h.user,
|
|
601
543
|
dateRange: {
|
|
602
|
-
start: new Date(
|
|
603
|
-
end: new Date(
|
|
544
|
+
start: new Date(p.value.dateRange.startDate).toISOString(),
|
|
545
|
+
end: new Date(p.value.dateRange.endDate).toISOString()
|
|
604
546
|
}
|
|
605
|
-
}), { tableMeta:
|
|
547
|
+
}), { tableMeta: t, rowData: e, onSort: n, debouncedFetchData: o, resetCursorState: y } = Oe(async (a) => {
|
|
606
548
|
const r = await L.readAllCursor(
|
|
607
|
-
|
|
608
|
-
|
|
549
|
+
a,
|
|
550
|
+
d()
|
|
551
|
+
), v = await Promise.all(
|
|
552
|
+
r.resources.map(async (c) => {
|
|
553
|
+
let i;
|
|
554
|
+
if (c.source !== Z.enum.BILL)
|
|
555
|
+
i = !1;
|
|
556
|
+
else {
|
|
557
|
+
const M = c.refunded || !!c.refundedFrom;
|
|
558
|
+
if (c.expiryAmount.reduce(
|
|
559
|
+
(k, O) => k + O.amount,
|
|
560
|
+
c.amount ?? 0
|
|
561
|
+
) > 0) {
|
|
562
|
+
let k = [];
|
|
563
|
+
[
|
|
564
|
+
X.enum.STAMP,
|
|
565
|
+
X.enum.POINT
|
|
566
|
+
].includes(c.pf_collectible.type) ? i = !1 : i = !M;
|
|
567
|
+
} else
|
|
568
|
+
switch (c.pf_collectible.type) {
|
|
569
|
+
case X.enum.VOUCHER:
|
|
570
|
+
i = c.expiryAmount.some(
|
|
571
|
+
(O) => !O.expiredAt || _(O.expiredAt).isAfter(_())
|
|
572
|
+
) && !M;
|
|
573
|
+
break;
|
|
574
|
+
default:
|
|
575
|
+
i = !M;
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const F = f.value.find((M) => M._id === c.ref);
|
|
580
|
+
return {
|
|
581
|
+
...c,
|
|
582
|
+
ref: (F == null ? void 0 : F.seqNumber) || c.ref,
|
|
583
|
+
isRevertable: i
|
|
584
|
+
};
|
|
585
|
+
})
|
|
609
586
|
);
|
|
610
587
|
return {
|
|
611
|
-
resources:
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
i = !1;
|
|
616
|
-
else {
|
|
617
|
-
const N = d.refunded || !!d.refundedFrom;
|
|
618
|
-
if (d.expiryAmount.reduce(
|
|
619
|
-
(O, k) => O + k.amount,
|
|
620
|
-
d.amount ?? 0
|
|
621
|
-
) > 0) {
|
|
622
|
-
let O = [];
|
|
623
|
-
[
|
|
624
|
-
Q.enum.STAMP,
|
|
625
|
-
Q.enum.POINT
|
|
626
|
-
].includes(d.pf_collectible.type) ? i = !1 : i = !N;
|
|
627
|
-
} else
|
|
628
|
-
switch (d.pf_collectible.type) {
|
|
629
|
-
case Q.enum.VOUCHER:
|
|
630
|
-
i = d.expiryAmount.some(
|
|
631
|
-
(k) => !k.expiredAt || C(k.expiredAt).isAfter(C())
|
|
632
|
-
) && !N;
|
|
633
|
-
break;
|
|
634
|
-
default:
|
|
635
|
-
i = !N;
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
const D = y.value.find((N) => N._id === d.ref);
|
|
640
|
-
return {
|
|
641
|
-
...d,
|
|
642
|
-
ref: (D == null ? void 0 : D.seqNumber) || d.ref,
|
|
643
|
-
isRevertable: i
|
|
644
|
-
};
|
|
645
|
-
})
|
|
646
|
-
),
|
|
588
|
+
resources: r.resources.map((c) => {
|
|
589
|
+
const i = f.value.find((F) => F._id === c.ref);
|
|
590
|
+
return { ...c, ref: (i == null ? void 0 : i.seqNumber) || c.ref };
|
|
591
|
+
}),
|
|
647
592
|
meta: r.meta
|
|
648
593
|
};
|
|
649
|
-
}),
|
|
650
|
-
() => u.locations.map((
|
|
594
|
+
}), f = E([]), S = Z.options.map((a) => ({ label: H(z.getReason(a)), value: a })), C = q(
|
|
595
|
+
() => u.locations.map((a) => ({ label: a.name, value: a._id }))
|
|
651
596
|
);
|
|
652
597
|
ce(
|
|
653
|
-
|
|
598
|
+
p,
|
|
654
599
|
() => {
|
|
655
|
-
|
|
600
|
+
y(), o({ pageIndex: 0 });
|
|
656
601
|
},
|
|
657
602
|
{ deep: !0 }
|
|
658
603
|
);
|
|
659
|
-
async function K(
|
|
660
|
-
|
|
604
|
+
async function K(a) {
|
|
605
|
+
P(
|
|
661
606
|
async () => {
|
|
662
607
|
await L.revertTransaction({
|
|
663
|
-
id:
|
|
608
|
+
id: a._id.toString()
|
|
664
609
|
}), await o();
|
|
665
610
|
},
|
|
666
611
|
{
|
|
@@ -669,51 +614,51 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
669
614
|
}
|
|
670
615
|
);
|
|
671
616
|
}
|
|
672
|
-
async function
|
|
617
|
+
async function N() {
|
|
673
618
|
try {
|
|
674
|
-
|
|
675
|
-
const
|
|
676
|
-
await
|
|
619
|
+
D.value = !0;
|
|
620
|
+
const a = new Ve(), r = d(), v = 1e3;
|
|
621
|
+
await P(
|
|
677
622
|
async () => {
|
|
678
|
-
var
|
|
679
|
-
let
|
|
623
|
+
var F, M, $, k, O, ne, re;
|
|
624
|
+
let c, i = !0;
|
|
680
625
|
for (; i; ) {
|
|
681
|
-
const
|
|
626
|
+
const G = await L.readAllCursor(
|
|
682
627
|
{
|
|
683
|
-
limit:
|
|
628
|
+
limit: v,
|
|
684
629
|
sortBy: "_id",
|
|
685
630
|
descending: !1,
|
|
686
|
-
...
|
|
631
|
+
...c ? { cursor: c } : {}
|
|
687
632
|
},
|
|
688
633
|
r
|
|
689
634
|
);
|
|
690
|
-
if (!
|
|
635
|
+
if (!G.resources.length)
|
|
691
636
|
break;
|
|
692
|
-
for (const
|
|
693
|
-
|
|
694
|
-
TransactionID:
|
|
695
|
-
CreatedAt:
|
|
637
|
+
for (const A of G.resources)
|
|
638
|
+
a.addRecord({
|
|
639
|
+
TransactionID: A._id,
|
|
640
|
+
CreatedAt: _(B(A._id.toString())).format(
|
|
696
641
|
"D MMM YYYY, hh:mmA"
|
|
697
642
|
),
|
|
698
643
|
Amount: ee(
|
|
699
|
-
|
|
644
|
+
A.expiryAmount.reduce(
|
|
700
645
|
(xe, be) => xe + be.amount,
|
|
701
|
-
|
|
646
|
+
A.amount ?? 0
|
|
702
647
|
),
|
|
703
648
|
2
|
|
704
649
|
),
|
|
705
|
-
ExpiredAt: (
|
|
706
|
-
Type: z.formattedType(
|
|
707
|
-
Source:
|
|
708
|
-
User: ((
|
|
709
|
-
"Phone No.": ((ne =
|
|
710
|
-
References:
|
|
711
|
-
Remark: ((re =
|
|
650
|
+
ExpiredAt: (M = (F = A.expiryAmount) == null ? void 0 : F[0]) != null && M.expiredAt ? _((k = ($ = A.expiryAmount) == null ? void 0 : $[0]) == null ? void 0 : k.expiredAt).format("D MMM YYYY") : "",
|
|
651
|
+
Type: z.formattedType(A),
|
|
652
|
+
Source: H(z.getReason(A.source)),
|
|
653
|
+
User: ((O = A.pf_user) == null ? void 0 : O.name) || "",
|
|
654
|
+
"Phone No.": ((ne = A.pf_user) == null ? void 0 : ne.phoneNumber) || "",
|
|
655
|
+
References: A.ref,
|
|
656
|
+
Remark: ((re = A.metadata) == null ? void 0 : re.remark) || ""
|
|
712
657
|
});
|
|
713
|
-
|
|
658
|
+
c = G.meta.nextCursor ?? void 0, i = G.meta.hasNext && !!c;
|
|
714
659
|
}
|
|
715
660
|
await Ae(
|
|
716
|
-
|
|
661
|
+
a.buildExcel(),
|
|
717
662
|
`transactions-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
718
663
|
{
|
|
719
664
|
bookType: "xlsx",
|
|
@@ -727,53 +672,53 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
727
672
|
successMessage: "transactions exported successfully"
|
|
728
673
|
}
|
|
729
674
|
);
|
|
730
|
-
} catch (
|
|
731
|
-
console.error(
|
|
675
|
+
} catch (a) {
|
|
676
|
+
console.error(a);
|
|
732
677
|
} finally {
|
|
733
|
-
|
|
678
|
+
D.value = !1;
|
|
734
679
|
}
|
|
735
680
|
}
|
|
736
|
-
const oe =
|
|
737
|
-
function ve(
|
|
681
|
+
const oe = E(null);
|
|
682
|
+
function ve(a) {
|
|
738
683
|
var r;
|
|
739
|
-
console.log(
|
|
684
|
+
console.log(a), (r = oe.value) == null || r.showSheet(!0, a.original);
|
|
740
685
|
}
|
|
741
|
-
return
|
|
686
|
+
return Te(async () => {
|
|
742
687
|
await u.readLocations(), await m.read(), await o();
|
|
743
|
-
}), (
|
|
744
|
-
const
|
|
745
|
-
return V(),
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
688
|
+
}), (a, r) => {
|
|
689
|
+
const v = U("FmSearch"), c = U("FmButton");
|
|
690
|
+
return V(), Y(J, null, [
|
|
691
|
+
x("div", null, [
|
|
692
|
+
x("div", We, [
|
|
693
|
+
R(v, {
|
|
749
694
|
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
750
|
-
modelValue: l(
|
|
751
|
-
"onUpdate:modelValue": r[0] || (r[0] = (i) => l(
|
|
695
|
+
modelValue: l(p).search,
|
|
696
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => l(p).search = i),
|
|
752
697
|
placeholder: "Search",
|
|
753
698
|
collapsible: ""
|
|
754
699
|
}, null, 8, ["modelValue"]),
|
|
755
|
-
|
|
700
|
+
R(c, {
|
|
756
701
|
icon: "ios_share",
|
|
757
702
|
variant: "tertiary",
|
|
758
|
-
onClick:
|
|
703
|
+
onClick: N
|
|
759
704
|
})
|
|
760
705
|
]),
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
706
|
+
x("div", je, [
|
|
707
|
+
x("div", qe, [
|
|
708
|
+
R(Q, {
|
|
764
709
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
765
710
|
"right-icon": "keyboard_arrow_down",
|
|
766
|
-
modelValue: l(
|
|
767
|
-
"onUpdate:modelValue": r[1] || (r[1] = (i) => l(
|
|
711
|
+
modelValue: l(p)["metadata.location"],
|
|
712
|
+
"onUpdate:modelValue": r[1] || (r[1] = (i) => l(p)["metadata.location"] = i),
|
|
768
713
|
icon: "storefront",
|
|
769
714
|
"show-item-label": !0,
|
|
770
|
-
items: l(
|
|
715
|
+
items: l(C)
|
|
771
716
|
}, null, 8, ["modelValue", "items"]),
|
|
772
|
-
|
|
717
|
+
R(Q, {
|
|
773
718
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
774
719
|
"right-icon": "keyboard_arrow_down",
|
|
775
|
-
modelValue: l(
|
|
776
|
-
"onUpdate:modelValue": r[2] || (r[2] = (i) => l(
|
|
720
|
+
modelValue: l(p)["pf_collectible.type"],
|
|
721
|
+
"onUpdate:modelValue": r[2] || (r[2] = (i) => l(p)["pf_collectible.type"] = i),
|
|
777
722
|
label: "Type: ",
|
|
778
723
|
"show-item-label": !0,
|
|
779
724
|
items: [
|
|
@@ -787,54 +732,54 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
787
732
|
{ label: "Stamp", value: "STAMP" }
|
|
788
733
|
]
|
|
789
734
|
}, null, 8, ["modelValue"]),
|
|
790
|
-
|
|
735
|
+
R(Q, {
|
|
791
736
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
792
737
|
"right-icon": "keyboard_arrow_down",
|
|
793
|
-
modelValue: l(
|
|
794
|
-
"onUpdate:modelValue": r[3] || (r[3] = (i) => l(
|
|
738
|
+
modelValue: l(p).source,
|
|
739
|
+
"onUpdate:modelValue": r[3] || (r[3] = (i) => l(p).source = i),
|
|
795
740
|
label: "Source: ",
|
|
796
741
|
"show-item-label": !0,
|
|
797
|
-
items: l(
|
|
742
|
+
items: l(S)
|
|
798
743
|
}, null, 8, ["modelValue", "items"]),
|
|
799
|
-
|
|
744
|
+
R(ue, {
|
|
800
745
|
"model-value": {
|
|
801
|
-
startDate: l(
|
|
802
|
-
endDate: l(
|
|
746
|
+
startDate: l(p).dateRange.startDate,
|
|
747
|
+
endDate: l(p).dateRange.endDate
|
|
803
748
|
},
|
|
804
|
-
"onUpdate:modelValue": r[4] || (r[4] = (i) => l(
|
|
805
|
-
startDate: l(
|
|
806
|
-
endDate: l(
|
|
749
|
+
"onUpdate:modelValue": r[4] || (r[4] = (i) => l(p).dateRange = {
|
|
750
|
+
startDate: l(_)(i.startDate).startOf("d").toISOString(),
|
|
751
|
+
endDate: l(_)(i.endDate).endOf("d").toISOString()
|
|
807
752
|
})
|
|
808
753
|
}, null, 8, ["model-value"])
|
|
809
754
|
]),
|
|
810
|
-
|
|
755
|
+
R(v, {
|
|
811
756
|
class: "xs:hidden",
|
|
812
|
-
modelValue: l(
|
|
813
|
-
"onUpdate:modelValue": r[5] || (r[5] = (i) => l(
|
|
757
|
+
modelValue: l(p).search,
|
|
758
|
+
"onUpdate:modelValue": r[5] || (r[5] = (i) => l(p).search = i),
|
|
814
759
|
placeholder: "Search",
|
|
815
760
|
collapsible: ""
|
|
816
761
|
}, null, 8, ["modelValue"]),
|
|
817
|
-
|
|
818
|
-
|
|
762
|
+
x("div", He, [
|
|
763
|
+
R(c, {
|
|
819
764
|
icon: "ios_share",
|
|
820
765
|
variant: "tertiary",
|
|
821
|
-
onClick:
|
|
766
|
+
onClick: N
|
|
822
767
|
})
|
|
823
768
|
])
|
|
824
769
|
]),
|
|
825
|
-
|
|
826
|
-
loading: l(
|
|
770
|
+
R(de, {
|
|
771
|
+
loading: l(t).isLoading,
|
|
827
772
|
"row-data": l(e),
|
|
828
|
-
"row-count": l(
|
|
829
|
-
"column-defs":
|
|
773
|
+
"row-count": l(t).totalRows,
|
|
774
|
+
"column-defs": I.filter(
|
|
830
775
|
(i) => !h.user || i.header !== "User" && i.header !== "Phone No."
|
|
831
776
|
),
|
|
832
|
-
"page-count": l(
|
|
833
|
-
"page-index": l(
|
|
834
|
-
"page-size": l(
|
|
777
|
+
"page-count": l(t).pageCount,
|
|
778
|
+
"page-index": l(t).pageIndex,
|
|
779
|
+
"page-size": l(t).pageSize,
|
|
835
780
|
"shrink-at": !1,
|
|
836
781
|
"pagination-mode": "cursor",
|
|
837
|
-
"has-next": l(
|
|
782
|
+
"has-next": l(t).hasNext,
|
|
838
783
|
onSortChange: l(n),
|
|
839
784
|
onPageChange: r[6] || (r[6] = (i) => l(o)({
|
|
840
785
|
pageSize: i.pageSize,
|
|
@@ -843,7 +788,7 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
843
788
|
onRowClick: ve
|
|
844
789
|
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "has-next", "onSortChange"])
|
|
845
790
|
]),
|
|
846
|
-
|
|
791
|
+
R(Ge, {
|
|
847
792
|
ref_key: "transactionDetailSheet",
|
|
848
793
|
ref: oe
|
|
849
794
|
}, null, 512)
|
|
@@ -851,17 +796,17 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
851
796
|
};
|
|
852
797
|
}
|
|
853
798
|
});
|
|
854
|
-
class
|
|
799
|
+
class Qe extends fe {
|
|
855
800
|
}
|
|
856
|
-
const
|
|
801
|
+
const Xe = { class: "flex items-center justify-between" }, Je = { class: "flex gap-8 items-center" }, Ze = { class: "flex gap-8 items-center xs:hidden" }, Ea = /* @__PURE__ */ ae({
|
|
857
802
|
__name: "StoreTransactions",
|
|
858
803
|
props: {
|
|
859
804
|
user: {
|
|
860
805
|
type: String
|
|
861
806
|
}
|
|
862
807
|
},
|
|
863
|
-
setup(
|
|
864
|
-
const
|
|
808
|
+
setup(w) {
|
|
809
|
+
const T = w, { minor: u } = ye;
|
|
865
810
|
Re();
|
|
866
811
|
const m = [
|
|
867
812
|
{
|
|
@@ -871,13 +816,13 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
871
816
|
},
|
|
872
817
|
cell(e) {
|
|
873
818
|
return s("div", { class: "flex items-center" }, [
|
|
874
|
-
s(
|
|
819
|
+
s(g.FmIcon, {
|
|
875
820
|
name: "content_copy",
|
|
876
821
|
outline: !0,
|
|
877
822
|
size: "sm",
|
|
878
823
|
class: "cursor-pointer mr-4 shrink-0",
|
|
879
824
|
onClick: (n) => {
|
|
880
|
-
n.preventDefault(), n.stopPropagation(),
|
|
825
|
+
n.preventDefault(), n.stopPropagation(), te(e.row.original._id.toString());
|
|
881
826
|
}
|
|
882
827
|
}),
|
|
883
828
|
s("div", { class: "truncate" }, e.row.original._id.toString())
|
|
@@ -886,7 +831,7 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
886
831
|
},
|
|
887
832
|
{
|
|
888
833
|
header: "Created at",
|
|
889
|
-
accessorFn: (e) =>
|
|
834
|
+
accessorFn: (e) => _(B(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
890
835
|
enableSorting: !0
|
|
891
836
|
},
|
|
892
837
|
{
|
|
@@ -908,12 +853,12 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
908
853
|
return s("div", { class: "flex items-center gap-4" }, [
|
|
909
854
|
s("div", { class: "flex items-center" }, [
|
|
910
855
|
((n = e.row.original.paymentType) == null ? void 0 : n.type) == "ONLINE" && e.row.original.paymentType.extra ? s(
|
|
911
|
-
|
|
856
|
+
g.FmTooltip,
|
|
912
857
|
{
|
|
913
858
|
content: e.row.original.paymentType.extra
|
|
914
859
|
},
|
|
915
860
|
[
|
|
916
|
-
s(
|
|
861
|
+
s(g.FmIcon, {
|
|
917
862
|
name: "info",
|
|
918
863
|
outline: !0,
|
|
919
864
|
size: "sm"
|
|
@@ -941,24 +886,24 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
941
886
|
header: "Status",
|
|
942
887
|
// accessorFn: (u) => u.status,
|
|
943
888
|
cell(e) {
|
|
944
|
-
var
|
|
889
|
+
var y, f, S, C;
|
|
945
890
|
const n = e.row.original.status, o = {
|
|
946
891
|
COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
947
892
|
REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
|
|
948
893
|
};
|
|
949
894
|
return s("div", { class: "flex items-center gap-4" }, [
|
|
950
|
-
s(
|
|
951
|
-
label:
|
|
895
|
+
s(g.FmChip, {
|
|
896
|
+
label: Ee.title(n),
|
|
952
897
|
variant: "plain",
|
|
953
898
|
class: o[n] ?? ""
|
|
954
899
|
}),
|
|
955
|
-
(
|
|
956
|
-
|
|
900
|
+
(f = (y = e.row.original) == null ? void 0 : y.refund) != null && f.reason ? s(
|
|
901
|
+
g.FmTooltip,
|
|
957
902
|
{
|
|
958
|
-
content: (
|
|
903
|
+
content: (C = (S = e.row.original) == null ? void 0 : S.refund) == null ? void 0 : C.reason
|
|
959
904
|
},
|
|
960
905
|
[
|
|
961
|
-
s(
|
|
906
|
+
s(g.FmIcon, {
|
|
962
907
|
name: "info",
|
|
963
908
|
color: "primary",
|
|
964
909
|
outline: !0,
|
|
@@ -982,25 +927,25 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
982
927
|
cell(e) {
|
|
983
928
|
const n = e.row.original, o = n.status === "COMPLETED" && !n.refund && n.source == "ADMIN";
|
|
984
929
|
return o ? s(
|
|
985
|
-
|
|
930
|
+
g.FmMenu,
|
|
986
931
|
{
|
|
987
932
|
placement: "bottom-end",
|
|
988
|
-
onClick: (
|
|
989
|
-
|
|
933
|
+
onClick: (y) => {
|
|
934
|
+
y.stopPropagation();
|
|
990
935
|
}
|
|
991
936
|
},
|
|
992
937
|
{
|
|
993
|
-
"menu-button": () => s(
|
|
938
|
+
"menu-button": () => s(g.FmButton, {
|
|
994
939
|
icon: "settings",
|
|
995
940
|
variant: "tertiary",
|
|
996
941
|
if: o
|
|
997
942
|
}),
|
|
998
943
|
default: () => [
|
|
999
|
-
s(
|
|
944
|
+
s(g.FmMenuItem, {
|
|
1000
945
|
label: "Refund",
|
|
1001
946
|
sublabel: "Refund this transaction",
|
|
1002
|
-
onClick: async (
|
|
1003
|
-
|
|
947
|
+
onClick: async (y) => {
|
|
948
|
+
y.stopPropagation(), await d(n);
|
|
1004
949
|
}
|
|
1005
950
|
})
|
|
1006
951
|
]
|
|
@@ -1008,21 +953,21 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1008
953
|
) : s("div");
|
|
1009
954
|
}
|
|
1010
955
|
}
|
|
1011
|
-
],
|
|
956
|
+
], b = E({
|
|
1012
957
|
searchValue: "",
|
|
1013
958
|
dateRange: {
|
|
1014
|
-
startDate:
|
|
1015
|
-
endDate:
|
|
959
|
+
startDate: _().subtract(7, "day").toISOString(),
|
|
960
|
+
endDate: _().toISOString()
|
|
1016
961
|
}
|
|
1017
|
-
}), { tableMeta: h, rowData:
|
|
962
|
+
}), { tableMeta: h, rowData: D, onSort: P, debouncedFetchData: I, onSearch: p } = Fe(async (e) => {
|
|
1018
963
|
const n = {
|
|
1019
|
-
...
|
|
1020
|
-
user:
|
|
964
|
+
...b.value.dateRange,
|
|
965
|
+
user: T.user
|
|
1021
966
|
};
|
|
1022
967
|
return await L.readStoreTransactions(e, n);
|
|
1023
968
|
});
|
|
1024
|
-
async function
|
|
1025
|
-
await
|
|
969
|
+
async function d(e) {
|
|
970
|
+
await Ie.confirm(
|
|
1026
971
|
"Are you sure you want to refund this transaction?",
|
|
1027
972
|
"Refund Store Transaction",
|
|
1028
973
|
"Confirm",
|
|
@@ -1030,10 +975,10 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1030
975
|
) && await u(
|
|
1031
976
|
async () => {
|
|
1032
977
|
var o;
|
|
1033
|
-
await
|
|
978
|
+
await Pe.refundStoreTransaction({
|
|
1034
979
|
id: e._id,
|
|
1035
|
-
reason: `ADMIN:${(o =
|
|
1036
|
-
}), await
|
|
980
|
+
reason: `ADMIN:${(o = Me().sessionUser) == null ? void 0 : o.name}`
|
|
981
|
+
}), await I();
|
|
1037
982
|
},
|
|
1038
983
|
{
|
|
1039
984
|
message: "Refunding transaction...",
|
|
@@ -1042,82 +987,82 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1042
987
|
);
|
|
1043
988
|
}
|
|
1044
989
|
ce(
|
|
1045
|
-
|
|
990
|
+
b,
|
|
1046
991
|
() => {
|
|
1047
|
-
|
|
992
|
+
I();
|
|
1048
993
|
},
|
|
1049
994
|
{ deep: !0 }
|
|
1050
|
-
),
|
|
1051
|
-
await
|
|
995
|
+
), Ce(async () => {
|
|
996
|
+
await I();
|
|
1052
997
|
});
|
|
1053
|
-
const
|
|
1054
|
-
exporter: new
|
|
998
|
+
const t = async () => De({
|
|
999
|
+
exporter: new Qe(),
|
|
1055
1000
|
readFunction: (e) => L.readStoreTransactions(e, {
|
|
1056
|
-
...
|
|
1057
|
-
user:
|
|
1001
|
+
...b.value.dateRange,
|
|
1002
|
+
user: T.user
|
|
1058
1003
|
}),
|
|
1059
1004
|
transformRecord: (e) => {
|
|
1060
|
-
var n, o,
|
|
1005
|
+
var n, o, y, f, S, C;
|
|
1061
1006
|
return {
|
|
1062
1007
|
TransactionId: ((n = e._id) == null ? void 0 : n.toString()) || "",
|
|
1063
|
-
CreatedAt:
|
|
1008
|
+
CreatedAt: _(B(e._id.toString())).format(
|
|
1064
1009
|
"DD/MM/YYYY HH:mm:ss"
|
|
1065
1010
|
),
|
|
1066
1011
|
Bundle: e.bundle.name || "",
|
|
1067
1012
|
Location: e.location ? e.pf_location[0].name : "Online Store",
|
|
1068
1013
|
PaymentType: ((o = e.paymentType) == null ? void 0 : o.type) || "N/A",
|
|
1069
|
-
PaymentExtra: ((
|
|
1070
|
-
User: ((
|
|
1071
|
-
PhoneNumber: ((
|
|
1014
|
+
PaymentExtra: ((y = e.paymentType) == null ? void 0 : y.extra) || "",
|
|
1015
|
+
User: ((f = e.pf_member) == null ? void 0 : f.name) || "",
|
|
1016
|
+
PhoneNumber: ((S = e.pf_member) == null ? void 0 : S.phoneNumber) || "",
|
|
1072
1017
|
Status: e.status || "",
|
|
1073
|
-
RefundReason: ((
|
|
1018
|
+
RefundReason: ((C = e == null ? void 0 : e.refund) == null ? void 0 : C.reason) || "",
|
|
1074
1019
|
Ref: (e == null ? void 0 : e.ref) || ""
|
|
1075
1020
|
};
|
|
1076
1021
|
},
|
|
1077
1022
|
filename: "store-transactions"
|
|
1078
1023
|
});
|
|
1079
1024
|
return (e, n) => {
|
|
1080
|
-
const o =
|
|
1081
|
-
return V(),
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
modelValue: l(
|
|
1086
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
1025
|
+
const o = U("FmSearch"), y = U("FmButton");
|
|
1026
|
+
return V(), Y("div", null, [
|
|
1027
|
+
x("div", Xe, [
|
|
1028
|
+
x("div", Je, [
|
|
1029
|
+
R(ue, {
|
|
1030
|
+
modelValue: l(b).dateRange,
|
|
1031
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => l(b).dateRange = f)
|
|
1087
1032
|
}, null, 8, ["modelValue"])
|
|
1088
1033
|
]),
|
|
1089
|
-
|
|
1090
|
-
|
|
1034
|
+
x("div", Ze, [
|
|
1035
|
+
R(o, {
|
|
1091
1036
|
modelValue: l(h).searchValue,
|
|
1092
1037
|
"onUpdate:modelValue": [
|
|
1093
|
-
n[1] || (n[1] = (
|
|
1094
|
-
l(
|
|
1038
|
+
n[1] || (n[1] = (f) => l(h).searchValue = f),
|
|
1039
|
+
l(p)
|
|
1095
1040
|
],
|
|
1096
1041
|
placeholder: "Search",
|
|
1097
1042
|
collapsible: ""
|
|
1098
1043
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1099
|
-
|
|
1044
|
+
R(y, {
|
|
1100
1045
|
icon: "ios_share",
|
|
1101
1046
|
variant: "tertiary",
|
|
1102
|
-
onClick:
|
|
1047
|
+
onClick: t
|
|
1103
1048
|
})
|
|
1104
1049
|
])
|
|
1105
1050
|
]),
|
|
1106
|
-
|
|
1051
|
+
R(de, {
|
|
1107
1052
|
loading: l(h).isLoading,
|
|
1108
|
-
"row-data": l(
|
|
1053
|
+
"row-data": l(D),
|
|
1109
1054
|
"row-count": l(h).totalRows,
|
|
1110
1055
|
"column-defs": m.filter(
|
|
1111
|
-
(
|
|
1056
|
+
(f) => !T.user || f.header !== "User" && f.header !== "Phone No."
|
|
1112
1057
|
),
|
|
1113
1058
|
"page-count": l(h).pageCount,
|
|
1114
1059
|
"page-index": l(h).pageIndex,
|
|
1115
1060
|
"page-size": l(h).pageSize,
|
|
1116
1061
|
"shrink-at": !1,
|
|
1117
|
-
onSortChange: l(
|
|
1118
|
-
onPageChange: n[2] || (n[2] = (
|
|
1119
|
-
pageSize:
|
|
1120
|
-
pageIndex:
|
|
1062
|
+
onSortChange: l(P),
|
|
1063
|
+
onPageChange: n[2] || (n[2] = (f) => l(I)({
|
|
1064
|
+
pageSize: f.pageSize,
|
|
1065
|
+
pageIndex: f.pageIndex
|
|
1121
1066
|
}))
|
|
1122
1067
|
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1123
1068
|
]);
|
|
@@ -1125,6 +1070,6 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1125
1070
|
}
|
|
1126
1071
|
});
|
|
1127
1072
|
export {
|
|
1128
|
-
|
|
1129
|
-
|
|
1073
|
+
Ma as _,
|
|
1074
|
+
Ea as a
|
|
1130
1075
|
};
|