@feedmepos/mf-connect 0.1.98-beta.32 → 0.1.98-beta.34
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-CNxXYDQA.js → App-BR2UXO7l.js} +8 -8
- package/dist/{AuditLogs-1BQil5oX.js → AuditLogs-BBD1wTXb.js} +9 -9
- package/dist/{Bin-aAMGXyy9.js → Bin-DwrHg3SM.js} +8 -8
- package/dist/{Broadcast-D5bqpEmf.js → Broadcast-CDD_5WRc.js} +11 -11
- package/dist/{CampaignAnalytic-CN2WcXYn.js → CampaignAnalytic-RrQKMFge.js} +700 -540
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D9GfSdXq.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BqJ4eBqz.js} +6 -6
- package/dist/{Card-DfEuS5gl.js → Card-DtNiiVL5.js} +18 -18
- package/dist/{Collections-1OTkyEYN.js → Collections-DmHTGdZr.js} +8 -8
- package/dist/{Credit-qCK-zP2Y.js → Credit-XUkEFWyO.js} +12 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-9NWM4yOR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D1flbVc5.js} +31 -31
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dnhei4AU.js → EffectSheet.vue_vue_type_style_index_0_lang-B9RTx5e6.js} +6 -6
- package/dist/{Experience-BBU56znM.js → Experience-8FQBl3Jk.js} +12 -12
- package/dist/{FileSaver.min-D_mPZjeB.js → FileSaver.min-CJx_XKAF.js} +1 -1
- package/dist/{Game-B9mElf85.js → Game-DtG-3-20.js} +13 -13
- package/dist/{Grab-CbsGHZfG.js → Grab-D-d1UWrd.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-VL01SI_I.js → ImageInput.vue_vue_type_script_setup_true_lang-CKScubJr.js} +1 -1
- package/dist/{Index-CZIwtF0k.js → Index-CQFVY2_M.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-juzVYVi0.js → LocationPicker.vue_vue_type_script_setup_true_lang-BWaMK57y.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Br92n7M3.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyANZcR6.js} +1 -1
- package/dist/{LoyaltyDashboard-DjkNjh1M.js → LoyaltyDashboard-hdaNCbqS.js} +7 -7
- package/dist/{MainLayout-BHdPdHlp.js → MainLayout-IoBUK1t1.js} +1 -1
- package/dist/{Marketing-CQdgWswq.js → Marketing-CjmMZIjz.js} +4 -4
- package/dist/{MarketingMaterialEdit-jzSiHrVn.js → MarketingMaterialEdit-C1W9eMIl.js} +6 -6
- package/dist/{Member-CdnKnmuC.js → Member-BNH1jrcb.js} +11 -11
- package/dist/{MemberList-nA2eRYW6.js → MemberList-BqINyMhD.js} +25 -25
- package/dist/{MemberTransactions-BHALSRqB.js → MemberTransactions-0ajNUHJh.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-TXiPUFjM.js → MessageInput.vue_vue_type_script_setup_true_lang-CwJaBsFN.js} +9 -9
- package/dist/{Mission-B0aReKMJ.js → Mission-CjKBQ4hb.js} +13 -13
- package/dist/Overview-AX_6SxrE.js +1284 -0
- package/dist/{Overview-CIB61CBG.js → Overview-CKnshNlU.js} +18 -18
- package/dist/{Point-BgUEcVbF.js → Point-ggQx_C1t.js} +12 -12
- package/dist/{Promotion-CBHfk3xI.js → Promotion-2eipp2Ey.js} +13 -13
- package/dist/{Queue-DdQHEsaR.js → Queue-Dt8Qh-VK.js} +10 -10
- package/dist/{Record-BkLjJ-kq.js → Record-Ykk-3IbY.js} +9 -9
- package/dist/{Review-Cxa2Bi2q.js → Review-Bc7rBVWg.js} +2 -2
- package/dist/{ReviewFacebookCallback-BhSWj_BK.js → ReviewFacebookCallback-BqCM0C5t.js} +5 -5
- package/dist/{ReviewGoogleCallback-DlKlinv4.js → ReviewGoogleCallback-AusPx9Qd.js} +5 -5
- package/dist/{Reward-1_9Thzxv.js → Reward-BBuWaXxY.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D-pu0qTL.js → RewardGroup.vue_vue_type_script_setup_true_lang-BmFszOzd.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-C55MTCd6.js → RuleGroup.vue_vue_type_script_setup_true_lang-BmebXPla.js} +14 -14
- package/dist/{Segment-CbuM0oqp.js → Segment-BRzfoGuE.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DTw26WFe.js → SelectItems.vue_vue_type_script_setup_true_lang-ll1Zl1NM.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ChIeh5kM.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-xYvyDS15.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BtRbHWrt.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-1_KEGmQS.js} +4 -4
- package/dist/{Setting-D6XLdUHo.js → Setting-Dqd70ZVG.js} +14 -14
- package/dist/{SettingAdvertisements-CROGLyf0.js → SettingAdvertisements-k0WfcX1K.js} +12 -12
- package/dist/{Settings-DgJFEIpt.js → Settings-BJtDdCkJ.js} +5 -5
- package/dist/{Store-DDojtoEi.js → Store-Ob71BJHB.js} +21 -21
- package/dist/{StoreRewards-BTVhqRbW.js → StoreRewards-DJ3Ugt_h.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BxCy3Fk5.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CazJrfSC.js} +386 -445
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-y2NxEq4f.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DVDxB8wn.js} +2 -2
- package/dist/{Tier-BWVosUHF.js → Tier-rtR9s70b.js} +24 -24
- package/dist/{Title-Dcu9e-na.js → Title-Cj96AOQB.js} +21 -21
- package/dist/{Transaction-B0V2qZBQ.js → Transaction-oyGtjd_T.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CE1HmXwU.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-SPHicnDN.js} +6 -6
- package/dist/{Voucher-u2IJaAHw.js → Voucher-B5N-YGJK.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DlCEICsf.js → VoucherEditor.vue_vue_type_script_setup_true_lang-der0dPTi.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BqcVNJY1.js → ZodTextField.vue_vue_type_script_setup_true_lang-YICmUY9J.js} +2 -2
- package/dist/{app-J_0SevWd.js → app-DM6oVZsM.js} +120 -65
- package/dist/app.js +1 -1
- package/dist/{business-CsYOIMmN.js → business-BGKVouFN.js} +1 -1
- package/dist/{campaign-CEuSGs0P.js → campaign-lNt9Yuxj.js} +2 -2
- package/dist/{campaign-B7AmOe4b.js → campaign-u9WwQFI9.js} +7 -7
- package/dist/{campaign.fn-i8dPJ25D.js → campaign.fn-Cadt9swf.js} +20 -20
- package/dist/{collection.fn-BQ8wuiDD.js → collection.fn-RLwjpdkT.js} +2 -2
- package/dist/{duplicateCampaign-CU-vJAMn.js → duplicateCampaign-QMgpeHWr.js} +2 -2
- package/dist/{effect-CdiluX3c.js → effect-CqtFAMMC.js} +1 -1
- package/dist/{email-addresses-CRks2VoS.js → email-addresses-h8wGPJ7R.js} +2 -2
- package/dist/{export-BzO_R_tT.js → export-DY3Hegrb.js} +3 -3
- package/dist/{helper-DQ1hga5s.js → helper-DPKh_ZjU.js} +1 -1
- package/dist/{index-Ci4w7iLa.js → index-2iE9rOed.js} +1 -1
- package/dist/{index-yrH8x1-i.js → index-BSZynXOw.js} +1 -1
- package/dist/{index-CUhcefIe.js → index-BkQrvkOb.js} +2 -2
- package/dist/{index-B09Leh3n.js → index-BzhAfqFB.js} +13 -8
- package/dist/{index-DQGjv4xY.js → index-C-AVWuWN.js} +2 -2
- package/dist/{index-CCEi8Zf_.js → index-CJQKTuIk.js} +1 -1
- package/dist/{index-0O1t0S4q.js → index-CTOeD7L9.js} +1 -1
- package/dist/{index-DtlnuU5Q.js → index-D7gOjsR0.js} +3 -3
- package/dist/{index-MjBzQEFO.js → index-DNAHL9AU.js} +2 -2
- package/dist/{index-BsnVJG1F.js → index-DQ1APEdi.js} +1 -1
- package/dist/{index-BXOpGbAX.js → index-DkNqohh9.js} +23 -16
- package/dist/{index-DJUdhmNI.js → index-DqX1Vli-.js} +1 -1
- package/dist/{index-C_fi9WV2.js → index-oM-xH8hF.js} +1 -1
- package/dist/{index-D_7zLq-s.js → index-oVSJYEzS.js} +1 -1
- package/dist/{index-BmpKqhfv.js → index-ogxSJTLh.js} +2 -2
- package/dist/{index.esm2017-BIjrnzt3.js → index.esm2017-CG7XIwEp.js} +1 -1
- package/dist/{loading-Oo_J76T6.js → loading-4amdJgCm.js} +1 -1
- package/dist/{lodash-D_m_JBgX.js → lodash-DGzcyEFQ.js} +1 -1
- package/dist/{membership-BzicPSED.js → membership-Pu5_24FL.js} +2 -2
- package/dist/{money-D_TgioqX.js → money-bExnxIDJ.js} +1 -1
- package/dist/{number-C69W9t0P.js → number-CfKE2tk7.js} +1 -1
- package/dist/{objectid-8WROvPOV.js → objectid-Ku2j_Y91.js} +9 -9
- package/dist/{plugins-DU_sWFOn.js → plugins-BiRxH8HH.js} +3 -3
- package/dist/{reward-gUVChY_n.js → reward-CTrFirP6.js} +1 -1
- package/dist/{rule-DN1rfxVA.js → rule-Bpp0MdS0.js} +3 -3
- package/dist/{rule-builder-BnU36OpM.js → rule-builder-DgUulIzK.js} +1 -1
- package/dist/{template-BOXPK0-P.js → template-Dh3E1B5P.js} +6 -6
- package/dist/{timezone-CV5vHYYz.js → timezone-cJCD0TZs.js} +1 -1
- package/dist/transaction.fn-Dd-nFQlz.js +64 -0
- package/dist/{trigger-GP4mC5kc.js → trigger-CzJeib_t.js} +5 -5
- package/dist/{useMarketingMaterialActions-CC06kGq3.js → useMarketingMaterialActions-DRPPq_f7.js} +3 -3
- package/dist/{usePagination-BjV6asuC.js → usePagination-B_aAFhhT.js} +1 -1
- package/dist/{user-B_1Zm_6U.js → user-Bi_keaVG.js} +1 -1
- package/dist/{vue-i18n-CGoM6XkW.js → vue-i18n-Smvd1GuG.js} +351 -351
- package/dist/{xlsx-yGcEutsz.js → xlsx-hKexV5wm.js} +440 -440
- package/dist/{zod-BtYgzWyF.js → zod-Bik7Qsx7.js} +1 -1
- package/package.json +1 -1
- package/dist/Overview-DeeB3zo1.js +0 -1117
|
@@ -1,103 +1,44 @@
|
|
|
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-DNAHL9AU.js";
|
|
4
|
+
import "./index-D7gOjsR0.js";
|
|
5
|
+
import { T as z } from "./transaction.fn-Dd-nFQlz.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 { u as
|
|
22
|
-
import { o as
|
|
23
|
-
import { u as
|
|
24
|
-
import { w as Ae } from "./xlsx-
|
|
9
|
+
import { s as H } from "./index-CuvNtC_M.js";
|
|
10
|
+
import { f as ee } from "./number-CfKE2tk7.js";
|
|
11
|
+
import { u as me } from "./business-BGKVouFN.js";
|
|
12
|
+
import { _ as de, u as Fe } from "./usePagination-B_aAFhhT.js";
|
|
13
|
+
import { c as te, p as Ie } from "./plugins-BiRxH8HH.js";
|
|
14
|
+
import { g as pe } from "./user-Bi_keaVG.js";
|
|
15
|
+
import { B as fe, e as De } from "./export-DY3Hegrb.js";
|
|
16
|
+
import { u as ge } from "./campaign-lNt9Yuxj.js";
|
|
17
|
+
import "./index-DQ1APEdi.js";
|
|
18
|
+
import "./index-BzhAfqFB.js";
|
|
19
|
+
import "./index-BkQrvkOb.js";
|
|
20
|
+
import "./index-C-AVWuWN.js";
|
|
21
|
+
import { u as he } from "./vue-i18n-Smvd1GuG.js";
|
|
22
|
+
import { o as B } from "./objectId-dwaoBfJX.js";
|
|
23
|
+
import { u as ye } from "./loading-4amdJgCm.js";
|
|
24
|
+
import { w as Ae } from "./xlsx-hKexV5wm.js";
|
|
25
25
|
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 = u;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
return p;
|
|
61
|
-
}
|
|
62
|
-
function Ve(u) {
|
|
63
|
-
var p, m, d, x, h, T;
|
|
64
|
-
switch ((p = u == null ? void 0 : u.pf_collectible) == null ? void 0 : p.type) {
|
|
65
|
-
case "VOUCHER":
|
|
66
|
-
return `${(m = u.pf_collectible) == null ? void 0 : m.type} (${(d = u.pf_collectible) == null ? void 0 : d.name})`;
|
|
67
|
-
case "TITLE":
|
|
68
|
-
return `${(x = u.pf_collectible) == null ? void 0 : x.type} (${(h = u.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 = u == null ? void 0 : u.pf_collectible) == null ? void 0 : T.type);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function ze(u) {
|
|
78
|
-
switch (u) {
|
|
79
|
-
case "ONLINE":
|
|
80
|
-
return "Online";
|
|
81
|
-
case "COIN":
|
|
82
|
-
return "Point";
|
|
83
|
-
default:
|
|
84
|
-
return u;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const z = {
|
|
88
|
-
getReason: ke,
|
|
89
|
-
formattedType: Ve,
|
|
90
|
-
formattedPaymentType: ze
|
|
91
|
-
}, Be = (u) => {
|
|
92
|
-
if (u.startsWith("_") || u.includes("."))
|
|
93
|
-
return u;
|
|
94
|
-
for (const p of ["pf_user_", "pf_collectible_"])
|
|
95
|
-
if (u.startsWith(p))
|
|
96
|
-
return `${p.slice(0, -1)}.${u.slice(p.length).replace(new RegExp("_", "g"), ".")}`;
|
|
97
|
-
return u.replace(new RegExp("_", "g"), ".");
|
|
26
|
+
import { t as L } from "./index-CJQKTuIk.js";
|
|
27
|
+
import { R as j } from "./app-DM6oVZsM.js";
|
|
28
|
+
import { F as X } from "./collectible.enum-Liy2wH3s.js";
|
|
29
|
+
import { useCoreStore as Me } from "@feedmepos/mf-common";
|
|
30
|
+
import { c as Ee } from "./string-Gcy5IM_H.js";
|
|
31
|
+
import { m as Pe } from "./index-CTOeD7L9.js";
|
|
32
|
+
const ke = (w) => {
|
|
33
|
+
if (w.startsWith("_") || w.includes("."))
|
|
34
|
+
return w;
|
|
35
|
+
for (const T of ["pf_user_", "pf_collectible_"])
|
|
36
|
+
if (w.startsWith(T))
|
|
37
|
+
return `${T.slice(0, -1)}.${w.slice(T.length).replace(new RegExp("_", "g"), ".")}`;
|
|
38
|
+
return w.replace(new RegExp("_", "g"), ".");
|
|
98
39
|
};
|
|
99
|
-
function
|
|
100
|
-
const
|
|
40
|
+
function Oe(w, T = { key: "_id", descending: !0 }) {
|
|
41
|
+
const u = E({
|
|
101
42
|
pageCount: 1,
|
|
102
43
|
searchValue: "",
|
|
103
44
|
pageIndex: 0,
|
|
@@ -105,88 +46,88 @@ function Ue(u, p = { key: "_id", descending: !0 }) {
|
|
|
105
46
|
isLoading: !1,
|
|
106
47
|
pageSize: 10,
|
|
107
48
|
hasNext: !1
|
|
108
|
-
}),
|
|
109
|
-
function
|
|
110
|
-
h.value = [void 0],
|
|
49
|
+
}), m = E(T), b = E([]), h = E([void 0]);
|
|
50
|
+
function D() {
|
|
51
|
+
h.value = [void 0], u.value.pageIndex = 0, u.value.pageCount = 1, u.value.hasNext = !1;
|
|
111
52
|
}
|
|
112
|
-
const
|
|
113
|
-
const o = n.pageSize ??
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
53
|
+
const P = async (n = {}) => {
|
|
54
|
+
const o = n.pageSize ?? u.value.pageSize, y = o !== u.value.pageSize;
|
|
55
|
+
y && D();
|
|
56
|
+
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];
|
|
57
|
+
u.value.isLoading = !0, u.value.pageSize = o, b.value = [];
|
|
117
58
|
try {
|
|
118
|
-
const
|
|
59
|
+
const N = await w({
|
|
119
60
|
limit: o,
|
|
120
|
-
sortBy:
|
|
121
|
-
descending:
|
|
122
|
-
search:
|
|
61
|
+
sortBy: m.value.key,
|
|
62
|
+
descending: m.value.descending,
|
|
63
|
+
search: u.value.searchValue,
|
|
123
64
|
...K ? { cursor: K } : {}
|
|
124
65
|
});
|
|
125
|
-
|
|
126
|
-
} catch (
|
|
127
|
-
console.error("Error fetching data:",
|
|
66
|
+
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);
|
|
67
|
+
} catch (N) {
|
|
68
|
+
console.error("Error fetching data:", N), u.value.hasNext = !1;
|
|
128
69
|
} finally {
|
|
129
|
-
|
|
70
|
+
u.value.isLoading = !1;
|
|
130
71
|
}
|
|
131
72
|
};
|
|
132
|
-
let
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
73
|
+
let I, p;
|
|
74
|
+
const d = (n) => (I && clearTimeout(I), p && p(), new Promise((o) => {
|
|
75
|
+
p = o, I = setTimeout(async () => {
|
|
76
|
+
I = void 0, p = void 0, await P(n), o();
|
|
136
77
|
}, 200);
|
|
137
78
|
}));
|
|
138
79
|
return {
|
|
139
|
-
tableMeta:
|
|
140
|
-
rowData:
|
|
141
|
-
sortBy:
|
|
80
|
+
tableMeta: u,
|
|
81
|
+
rowData: b,
|
|
82
|
+
sortBy: m,
|
|
142
83
|
pageCursors: h,
|
|
143
|
-
resetCursorState:
|
|
144
|
-
fetchData:
|
|
145
|
-
debouncedFetchData:
|
|
84
|
+
resetCursorState: D,
|
|
85
|
+
fetchData: P,
|
|
86
|
+
debouncedFetchData: d,
|
|
146
87
|
onSort: async (n) => {
|
|
147
|
-
n.length ?
|
|
148
|
-
key:
|
|
88
|
+
n.length ? m.value = {
|
|
89
|
+
key: ke(n[0].id),
|
|
149
90
|
descending: n[0].desc
|
|
150
|
-
} :
|
|
91
|
+
} : m.value = T, D(), await d({
|
|
151
92
|
pageIndex: 0,
|
|
152
|
-
pageSize:
|
|
93
|
+
pageSize: u.value.pageSize
|
|
153
94
|
});
|
|
154
95
|
},
|
|
155
|
-
onSearch: () => (
|
|
96
|
+
onSearch: () => (D(), d({
|
|
156
97
|
pageIndex: 0,
|
|
157
|
-
pageSize:
|
|
98
|
+
pageSize: u.value.pageSize
|
|
158
99
|
}))
|
|
159
100
|
};
|
|
160
101
|
}
|
|
161
|
-
class
|
|
102
|
+
class Ve extends fe {
|
|
162
103
|
}
|
|
163
|
-
const
|
|
104
|
+
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
105
|
__name: "TransactionDetailSheet",
|
|
165
|
-
setup(
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
function
|
|
169
|
-
|
|
106
|
+
setup(w, { expose: T }) {
|
|
107
|
+
he();
|
|
108
|
+
const u = E(!1), m = E(), b = ge(), h = me();
|
|
109
|
+
function D(d, t) {
|
|
110
|
+
u.value = d, m.value = t ?? null;
|
|
170
111
|
}
|
|
171
|
-
const
|
|
172
|
-
var
|
|
112
|
+
const P = q(() => {
|
|
113
|
+
var d, t;
|
|
173
114
|
return ee(
|
|
174
|
-
((
|
|
115
|
+
((t = m.value) == null ? void 0 : t.expiryAmount.reduce(
|
|
175
116
|
(e, n) => e + n.amount,
|
|
176
|
-
((
|
|
117
|
+
((d = m.value) == null ? void 0 : d.amount) ?? 0
|
|
177
118
|
)) ?? 0,
|
|
178
119
|
2
|
|
179
120
|
);
|
|
180
|
-
}),
|
|
181
|
-
var
|
|
182
|
-
return
|
|
121
|
+
}), I = q(() => {
|
|
122
|
+
var d, t, e, n, o;
|
|
123
|
+
return m.value ? [
|
|
183
124
|
{
|
|
184
125
|
label: "Transaction ID",
|
|
185
|
-
value: (
|
|
126
|
+
value: (d = m.value) == null ? void 0 : d._id
|
|
186
127
|
},
|
|
187
128
|
{
|
|
188
129
|
label: "Date/Time",
|
|
189
|
-
value:
|
|
130
|
+
value: _(B(m.value._id.toString())).format(
|
|
190
131
|
"D MMM YYYY, hh:mmA"
|
|
191
132
|
)
|
|
192
133
|
},
|
|
@@ -197,118 +138,118 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
197
138
|
{
|
|
198
139
|
class: [
|
|
199
140
|
"pr-2",
|
|
200
|
-
+
|
|
141
|
+
+P.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
201
142
|
]
|
|
202
143
|
},
|
|
203
|
-
|
|
144
|
+
P.value
|
|
204
145
|
)
|
|
205
146
|
},
|
|
206
147
|
{
|
|
207
148
|
label: "Type",
|
|
208
|
-
value: z.formattedType(
|
|
149
|
+
value: z.formattedType(m.value)
|
|
209
150
|
},
|
|
210
151
|
{
|
|
211
152
|
label: "Source",
|
|
212
|
-
value:
|
|
153
|
+
value: H(z.getReason(m.value.source))
|
|
213
154
|
},
|
|
214
155
|
{
|
|
215
156
|
label: "User",
|
|
216
|
-
value: (e = (
|
|
157
|
+
value: (e = (t = m.value) == null ? void 0 : t.pf_user) == null ? void 0 : e.name
|
|
217
158
|
},
|
|
218
159
|
{
|
|
219
160
|
label: "Phone Number",
|
|
220
|
-
value: (o = (n =
|
|
161
|
+
value: (o = (n = m.value) == null ? void 0 : n.pf_user) == null ? void 0 : o.phoneNumber
|
|
221
162
|
}
|
|
222
163
|
] : [];
|
|
223
|
-
}),
|
|
224
|
-
var n, o,
|
|
225
|
-
if (!
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
(
|
|
164
|
+
}), p = q(() => {
|
|
165
|
+
var n, o, y, f;
|
|
166
|
+
if (!m.value) return [];
|
|
167
|
+
const d = [], t = (n = m.value) == null ? void 0 : n.metadata, e = m.value;
|
|
168
|
+
if (t != null && t.campaign) {
|
|
169
|
+
const S = b.campaigns.all.find(
|
|
170
|
+
(C) => C._id === (t == null ? void 0 : t.campaign)
|
|
230
171
|
);
|
|
231
|
-
if (!
|
|
232
|
-
|
|
172
|
+
if (!S) return;
|
|
173
|
+
d.push({
|
|
233
174
|
label: "Campaign",
|
|
234
|
-
value:
|
|
175
|
+
value: S.name
|
|
235
176
|
});
|
|
236
177
|
}
|
|
237
|
-
return
|
|
178
|
+
return t != null && t.remark && d.push({
|
|
238
179
|
label: "Remark",
|
|
239
|
-
value:
|
|
240
|
-
}), (o =
|
|
180
|
+
value: t.remark
|
|
181
|
+
}), (o = m.value) != null && o.ref.startsWith("bill_") && d.push({
|
|
241
182
|
label: "Bill Number",
|
|
242
|
-
value: (
|
|
183
|
+
value: (y = m.value) == null ? void 0 : y.ref,
|
|
243
184
|
copy: () => {
|
|
244
|
-
var
|
|
245
|
-
return
|
|
185
|
+
var S;
|
|
186
|
+
return te((S = m.value) == null ? void 0 : S.ref);
|
|
246
187
|
}
|
|
247
|
-
}),
|
|
188
|
+
}), t != null && t.location && d.push({
|
|
248
189
|
label: "Location",
|
|
249
|
-
value: (
|
|
250
|
-
(
|
|
251
|
-
)) == null ? void 0 :
|
|
252
|
-
}), e.source === Z.enum.STORE &&
|
|
190
|
+
value: (f = h.locations.find(
|
|
191
|
+
(S) => S._id.toString() === (t == null ? void 0 : t.location)
|
|
192
|
+
)) == null ? void 0 : f.name
|
|
193
|
+
}), e.source === Z.enum.STORE && d.push({
|
|
253
194
|
label: "Store Transaction",
|
|
254
195
|
value: e.ref
|
|
255
|
-
}),
|
|
196
|
+
}), t != null && t.originTransaction && d.push({
|
|
256
197
|
label: "Parent Transaction",
|
|
257
|
-
value:
|
|
258
|
-
}),
|
|
198
|
+
value: t.originTransaction
|
|
199
|
+
}), t != null && t.referral_count && d.push({
|
|
259
200
|
label: "Referral Count",
|
|
260
|
-
value:
|
|
261
|
-
}), e.refundedFrom &&
|
|
201
|
+
value: t.referral_count
|
|
202
|
+
}), e.refundedFrom && d.push({
|
|
262
203
|
label: "Refunded From",
|
|
263
204
|
value: e.refundedFrom
|
|
264
|
-
}),
|
|
205
|
+
}), d;
|
|
265
206
|
});
|
|
266
|
-
return
|
|
267
|
-
showSheet:
|
|
268
|
-
}), (
|
|
269
|
-
const e =
|
|
207
|
+
return T({
|
|
208
|
+
showSheet: D
|
|
209
|
+
}), (d, t) => {
|
|
210
|
+
const e = U("FmButton"), n = U("FmSideSheet");
|
|
270
211
|
return V(), se(n, {
|
|
271
212
|
"max-width": 560,
|
|
272
|
-
modelValue: l(
|
|
273
|
-
"onUpdate:modelValue":
|
|
213
|
+
modelValue: l(u),
|
|
214
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => Se(u) ? u.value = o : null),
|
|
274
215
|
header: "Transaction Details"
|
|
275
216
|
}, {
|
|
276
217
|
"side-sheet-footer": le(() => [
|
|
277
|
-
|
|
278
|
-
|
|
218
|
+
x("div", Ke, [
|
|
219
|
+
R(e, {
|
|
279
220
|
label: "Close",
|
|
280
|
-
onClick:
|
|
221
|
+
onClick: t[0] || (t[0] = (o) => D(!1)),
|
|
281
222
|
variant: "tertiary"
|
|
282
223
|
})
|
|
283
224
|
])
|
|
284
225
|
]),
|
|
285
226
|
default: le(() => [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
(V(!0),
|
|
227
|
+
x("div", ze, [
|
|
228
|
+
x("div", Ye, [
|
|
229
|
+
(V(!0), Y(J, null, ie(l(I), (o) => (V(), Y("div", {
|
|
289
230
|
key: o.label,
|
|
290
231
|
class: "flex flex-col gap-4"
|
|
291
232
|
}, [
|
|
292
|
-
|
|
293
|
-
|
|
233
|
+
x("div", Be, W(o.label), 1),
|
|
234
|
+
x("div", {
|
|
294
235
|
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
295
236
|
onClick: o.copy
|
|
296
237
|
}, [
|
|
297
|
-
|
|
238
|
+
_e(W(o.accessorFn ? o.accessorFn() : o.value) + " ", 1),
|
|
298
239
|
(V(), se(we(o.component)))
|
|
299
|
-
], 8,
|
|
300
|
-
|
|
240
|
+
], 8, Ue),
|
|
241
|
+
t[2] || (t[2] = x("hr", { class: "mt-3" }, null, -1))
|
|
301
242
|
]))), 128)),
|
|
302
|
-
(V(!0),
|
|
243
|
+
(V(!0), Y(J, null, ie(l(p), (o) => (V(), Y("div", {
|
|
303
244
|
key: o.label,
|
|
304
245
|
class: "flex flex-col gap-4"
|
|
305
246
|
}, [
|
|
306
|
-
|
|
307
|
-
|
|
247
|
+
x("div", $e, W(o.label), 1),
|
|
248
|
+
x("div", {
|
|
308
249
|
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
309
250
|
onClick: o.copy
|
|
310
|
-
},
|
|
311
|
-
|
|
251
|
+
}, W(o.accessorFn ? o.accessorFn() : o.value), 9, Le),
|
|
252
|
+
t[3] || (t[3] = x("hr", { class: "mt-3" }, null, -1))
|
|
312
253
|
]))), 128))
|
|
313
254
|
])
|
|
314
255
|
])
|
|
@@ -317,36 +258,36 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
317
258
|
}, 8, ["modelValue"]);
|
|
318
259
|
};
|
|
319
260
|
}
|
|
320
|
-
}),
|
|
261
|
+
}), 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" }, Na = /* @__PURE__ */ ae({
|
|
321
262
|
__name: "CollectionTransactions",
|
|
322
263
|
props: {
|
|
323
264
|
user: {
|
|
324
265
|
type: String
|
|
325
266
|
}
|
|
326
267
|
},
|
|
327
|
-
setup(
|
|
328
|
-
const { t:
|
|
268
|
+
setup(w) {
|
|
269
|
+
const { t: T } = he(), u = me(), m = ge(), b = Ne(), h = w, D = E(!1), { minor: P } = ye, I = [
|
|
329
270
|
{
|
|
330
271
|
header: "Transaction ID",
|
|
331
272
|
accessorKey: "_id",
|
|
332
273
|
meta: {
|
|
333
274
|
maxWidth: "100px"
|
|
334
275
|
},
|
|
335
|
-
cell(
|
|
276
|
+
cell(a) {
|
|
336
277
|
return s("div", { class: "flex items-center" }, [
|
|
337
|
-
s(
|
|
278
|
+
s(g.FmIcon, {
|
|
338
279
|
name: "content_copy",
|
|
339
280
|
outline: !0,
|
|
340
281
|
size: "sm",
|
|
341
282
|
class: "cursor-pointer mr-4",
|
|
342
283
|
onClick: (r) => {
|
|
343
|
-
r.preventDefault(), r.stopPropagation(),
|
|
284
|
+
r.preventDefault(), r.stopPropagation(), te(a.row.original._id.toString());
|
|
344
285
|
}
|
|
345
286
|
}),
|
|
346
287
|
s(
|
|
347
288
|
"div",
|
|
348
289
|
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
349
|
-
|
|
290
|
+
a.row.original._id.toString()
|
|
350
291
|
)
|
|
351
292
|
]);
|
|
352
293
|
},
|
|
@@ -355,8 +296,8 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
355
296
|
{
|
|
356
297
|
header: "Created at",
|
|
357
298
|
accessorKey: "_id",
|
|
358
|
-
accessorFn: (
|
|
359
|
-
cell: (
|
|
299
|
+
accessorFn: (a) => _(B(a._id.toString())),
|
|
300
|
+
cell: (a) => _(B(a.row.original._id.toString())).format(
|
|
360
301
|
"D MMM YYYY, hh:mmA"
|
|
361
302
|
),
|
|
362
303
|
enableSorting: !0
|
|
@@ -365,15 +306,15 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
365
306
|
header: "Amount",
|
|
366
307
|
// accessorKey: 'totalAmount',
|
|
367
308
|
enableSorting: !1,
|
|
368
|
-
cell(
|
|
369
|
-
var c, i, F,
|
|
309
|
+
cell(a) {
|
|
310
|
+
var c, i, F, M;
|
|
370
311
|
const r = ee(
|
|
371
|
-
|
|
372
|
-
($,
|
|
373
|
-
|
|
312
|
+
a.row.original.expiryAmount.reduce(
|
|
313
|
+
($, k) => $ + k.amount,
|
|
314
|
+
a.row.original.amount ?? 0
|
|
374
315
|
),
|
|
375
316
|
2
|
|
376
|
-
),
|
|
317
|
+
), 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
318
|
"D MMM YYYY"
|
|
378
319
|
) : "";
|
|
379
320
|
return s("div", { class: "flex items-center" }, [
|
|
@@ -388,13 +329,13 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
388
329
|
r
|
|
389
330
|
),
|
|
390
331
|
s("div", { class: "flex items-center" }, [
|
|
391
|
-
|
|
392
|
-
|
|
332
|
+
a.row.original.expiryAmount.length > 0 ? s(
|
|
333
|
+
g.FmTooltip,
|
|
393
334
|
{
|
|
394
|
-
content: `Expired on ${
|
|
335
|
+
content: `Expired on ${v}`
|
|
395
336
|
},
|
|
396
337
|
[
|
|
397
|
-
s(
|
|
338
|
+
s(g.FmIcon, {
|
|
398
339
|
name: "info",
|
|
399
340
|
outline: !0,
|
|
400
341
|
size: "sm"
|
|
@@ -408,21 +349,21 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
408
349
|
{
|
|
409
350
|
header: "Type",
|
|
410
351
|
accessorKey: "pf_collectible.type",
|
|
411
|
-
accessorFn: (
|
|
352
|
+
accessorFn: (a) => z.formattedType(a),
|
|
412
353
|
meta: {
|
|
413
354
|
maxWidth: "200px"
|
|
414
355
|
},
|
|
415
|
-
cell(
|
|
416
|
-
const r = z.formattedType(
|
|
356
|
+
cell(a) {
|
|
357
|
+
const r = z.formattedType(a.row.original);
|
|
417
358
|
return s("div", { class: "flex items-center" }, [
|
|
418
359
|
s("div", { class: "truncate text-ellipsis" }, r),
|
|
419
360
|
r.length > 20 ? s(
|
|
420
|
-
|
|
361
|
+
g.FmTooltip,
|
|
421
362
|
{
|
|
422
363
|
content: r
|
|
423
364
|
},
|
|
424
365
|
[
|
|
425
|
-
s(
|
|
366
|
+
s(g.FmIcon, {
|
|
426
367
|
name: "info",
|
|
427
368
|
color: "primary",
|
|
428
369
|
outline: !0,
|
|
@@ -436,39 +377,39 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
436
377
|
{
|
|
437
378
|
header: "Source",
|
|
438
379
|
accessorKey: "source",
|
|
439
|
-
cell(
|
|
380
|
+
cell(a) {
|
|
440
381
|
var r;
|
|
441
382
|
return s("div", { class: "flex items-center gap-4" }, [
|
|
442
383
|
s(
|
|
443
384
|
"div",
|
|
444
385
|
{ class: "truncate text-ellipsis" },
|
|
445
|
-
|
|
386
|
+
H(z.getReason(a.row.original.source))
|
|
446
387
|
),
|
|
447
|
-
...(r =
|
|
388
|
+
...(r = a.row.original.metadata) != null && r.campaign ? [
|
|
448
389
|
s(
|
|
449
|
-
|
|
390
|
+
g.FmTooltip,
|
|
450
391
|
{
|
|
451
392
|
get content() {
|
|
452
|
-
var
|
|
453
|
-
return (
|
|
393
|
+
var v;
|
|
394
|
+
return (v = m.campaigns.all.find(
|
|
454
395
|
(c) => {
|
|
455
396
|
var i;
|
|
456
|
-
return c._id === ((i =
|
|
397
|
+
return c._id === ((i = a.row.original.metadata) == null ? void 0 : i.campaign);
|
|
457
398
|
}
|
|
458
|
-
)) == null ? void 0 :
|
|
399
|
+
)) == null ? void 0 : v.name;
|
|
459
400
|
}
|
|
460
401
|
},
|
|
461
402
|
[
|
|
462
|
-
s(
|
|
403
|
+
s(g.FmIcon, {
|
|
463
404
|
name: "info",
|
|
464
405
|
color: "primary",
|
|
465
406
|
size: "sm",
|
|
466
|
-
onClick: async (
|
|
467
|
-
|
|
468
|
-
const c =
|
|
407
|
+
onClick: async (v) => {
|
|
408
|
+
v.preventDefault(), v.stopPropagation();
|
|
409
|
+
const c = m.campaigns.all.find(
|
|
469
410
|
(i) => {
|
|
470
411
|
var F;
|
|
471
|
-
return i._id === ((F =
|
|
412
|
+
return i._id === ((F = a.row.original.metadata) == null ? void 0 : F.campaign);
|
|
472
413
|
}
|
|
473
414
|
);
|
|
474
415
|
if (c)
|
|
@@ -476,25 +417,25 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
476
417
|
case "VOUCHER":
|
|
477
418
|
case "PROMOTION":
|
|
478
419
|
case "BROADCAST":
|
|
479
|
-
await
|
|
480
|
-
name:
|
|
420
|
+
await b.push({
|
|
421
|
+
name: j[`$connect-CAMPAIGN_${c.type}`]
|
|
481
422
|
});
|
|
482
423
|
break;
|
|
483
424
|
case "GAME":
|
|
484
425
|
case "CREDIT":
|
|
485
426
|
case "MISSION":
|
|
486
|
-
await
|
|
487
|
-
name:
|
|
427
|
+
await b.push({
|
|
428
|
+
name: j[`$connect-PROGRAM_${c.type}`]
|
|
488
429
|
});
|
|
489
430
|
break;
|
|
490
431
|
case "POINT":
|
|
491
|
-
await
|
|
492
|
-
name:
|
|
432
|
+
await b.push({
|
|
433
|
+
name: j["$connect-PROGRAM_EXPERIENCE"]
|
|
493
434
|
});
|
|
494
435
|
break;
|
|
495
436
|
case "COIN":
|
|
496
|
-
await
|
|
497
|
-
name:
|
|
437
|
+
await b.push({
|
|
438
|
+
name: j["$connect-PROGRAM_POINT"]
|
|
498
439
|
});
|
|
499
440
|
break;
|
|
500
441
|
}
|
|
@@ -509,46 +450,46 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
509
450
|
{
|
|
510
451
|
header: "User",
|
|
511
452
|
accessorKey: "pf_user.name",
|
|
512
|
-
cell(
|
|
513
|
-
return pe(
|
|
453
|
+
cell(a) {
|
|
454
|
+
return pe(a.row.original.pf_user);
|
|
514
455
|
}
|
|
515
456
|
},
|
|
516
457
|
{
|
|
517
458
|
header: "Phone No.",
|
|
518
459
|
accessorKey: "pf_user.phoneNumber",
|
|
519
|
-
accessorFn: (
|
|
460
|
+
accessorFn: (a) => {
|
|
520
461
|
var r;
|
|
521
|
-
return ((r =
|
|
462
|
+
return ((r = a == null ? void 0 : a.pf_user) == null ? void 0 : r.phoneNumber) || "";
|
|
522
463
|
}
|
|
523
464
|
},
|
|
524
465
|
{
|
|
525
466
|
header: "Status",
|
|
526
467
|
id: "status",
|
|
527
468
|
enableSorting: !1,
|
|
528
|
-
cell(
|
|
529
|
-
const r = !!
|
|
530
|
-
return s(
|
|
531
|
-
label:
|
|
469
|
+
cell(a) {
|
|
470
|
+
const r = !!a.row.original.refunded;
|
|
471
|
+
return s(g.FmChip, {
|
|
472
|
+
label: T(r ? "connect.transaction.refunded" : "connect.transaction.completed"),
|
|
532
473
|
variant: "plain",
|
|
533
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"
|
|
534
475
|
});
|
|
535
476
|
}
|
|
536
477
|
},
|
|
537
478
|
{
|
|
538
|
-
accessorFn: (
|
|
479
|
+
accessorFn: (a) => a.ref,
|
|
539
480
|
header: "References",
|
|
540
481
|
accessorKey: "ref",
|
|
541
|
-
cell(
|
|
542
|
-
var r,
|
|
482
|
+
cell(a) {
|
|
483
|
+
var r, v;
|
|
543
484
|
return s("div", { class: "flex items-center justify-between gap-4" }, [
|
|
544
485
|
s("div", { class: "flex items-center" }, [
|
|
545
|
-
(r =
|
|
546
|
-
|
|
486
|
+
(r = a.row.original.metadata) != null && r.remark ? s(
|
|
487
|
+
g.FmTooltip,
|
|
547
488
|
{
|
|
548
|
-
content: (
|
|
489
|
+
content: (v = a.row.original.metadata) == null ? void 0 : v.remark
|
|
549
490
|
},
|
|
550
491
|
[
|
|
551
|
-
s(
|
|
492
|
+
s(g.FmIcon, {
|
|
552
493
|
name: "info",
|
|
553
494
|
class: "pl-2",
|
|
554
495
|
outline: !0,
|
|
@@ -557,84 +498,84 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
557
498
|
]
|
|
558
499
|
) : s("div")
|
|
559
500
|
]),
|
|
560
|
-
s("div", { class: "flex-1" },
|
|
501
|
+
s("div", { class: "flex-1" }, a.row.original.ref)
|
|
561
502
|
]);
|
|
562
503
|
}
|
|
563
504
|
},
|
|
564
505
|
{
|
|
565
506
|
header: "Actions",
|
|
566
|
-
cell(
|
|
567
|
-
const r =
|
|
507
|
+
cell(a) {
|
|
508
|
+
const r = a.row.original;
|
|
568
509
|
return s(
|
|
569
|
-
|
|
510
|
+
g.FmTooltip,
|
|
570
511
|
{
|
|
571
512
|
get content() {
|
|
572
513
|
return "Revert Transaction";
|
|
573
514
|
}
|
|
574
515
|
},
|
|
575
516
|
[
|
|
576
|
-
s(
|
|
517
|
+
s(g.FmButton, {
|
|
577
518
|
variant: "tertiary",
|
|
578
519
|
icon: "amend",
|
|
579
520
|
iconColor: "neutral-gray-400",
|
|
580
521
|
disabled: !r.isRevertable,
|
|
581
|
-
onClick: (
|
|
582
|
-
|
|
522
|
+
onClick: (v) => {
|
|
523
|
+
v.stopPropagation(), K(r);
|
|
583
524
|
}
|
|
584
525
|
})
|
|
585
526
|
]
|
|
586
527
|
);
|
|
587
528
|
}
|
|
588
529
|
}
|
|
589
|
-
],
|
|
530
|
+
], p = E({
|
|
590
531
|
search: "",
|
|
591
532
|
"pf_collectible.type": [],
|
|
592
533
|
"metadata.location": [],
|
|
593
534
|
dateRange: {
|
|
594
|
-
startDate:
|
|
595
|
-
endDate:
|
|
535
|
+
startDate: _().subtract(7, "day").toISOString(),
|
|
536
|
+
endDate: _().endOf("day").toISOString()
|
|
596
537
|
},
|
|
597
538
|
source: []
|
|
598
|
-
}),
|
|
599
|
-
...
|
|
539
|
+
}), d = () => ({
|
|
540
|
+
...p.value,
|
|
600
541
|
user: h.user,
|
|
601
542
|
dateRange: {
|
|
602
|
-
start: new Date(
|
|
603
|
-
end: new Date(
|
|
543
|
+
start: new Date(p.value.dateRange.startDate).toISOString(),
|
|
544
|
+
end: new Date(p.value.dateRange.endDate).toISOString()
|
|
604
545
|
}
|
|
605
|
-
}), { tableMeta:
|
|
546
|
+
}), { tableMeta: t, rowData: e, onSort: n, debouncedFetchData: o, resetCursorState: y } = Oe(async (a) => {
|
|
606
547
|
const r = await L.readAllCursor(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
),
|
|
548
|
+
a,
|
|
549
|
+
d()
|
|
550
|
+
), v = await Promise.all(
|
|
610
551
|
r.resources.map(async (c) => {
|
|
611
552
|
let i;
|
|
612
553
|
if (c.source !== Z.enum.BILL)
|
|
613
554
|
i = !1;
|
|
614
555
|
else {
|
|
615
|
-
const
|
|
556
|
+
const M = c.refunded || !!c.refundedFrom;
|
|
616
557
|
if (c.expiryAmount.reduce(
|
|
617
|
-
(
|
|
558
|
+
(k, O) => k + O.amount,
|
|
618
559
|
c.amount ?? 0
|
|
619
560
|
) > 0) {
|
|
620
|
-
let
|
|
561
|
+
let k = [];
|
|
621
562
|
[
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
].includes(c.pf_collectible.type) ? i = !1 : i = !
|
|
563
|
+
X.enum.STAMP,
|
|
564
|
+
X.enum.POINT
|
|
565
|
+
].includes(c.pf_collectible.type) ? i = !1 : i = !M;
|
|
625
566
|
} else
|
|
626
567
|
switch (c.pf_collectible.type) {
|
|
627
|
-
case
|
|
568
|
+
case X.enum.VOUCHER:
|
|
628
569
|
i = c.expiryAmount.some(
|
|
629
|
-
(
|
|
630
|
-
) && !
|
|
570
|
+
(O) => !O.expiredAt || _(O.expiredAt).isAfter(_())
|
|
571
|
+
) && !M;
|
|
631
572
|
break;
|
|
632
573
|
default:
|
|
633
|
-
i = !
|
|
574
|
+
i = !M;
|
|
634
575
|
break;
|
|
635
576
|
}
|
|
636
577
|
}
|
|
637
|
-
const F =
|
|
578
|
+
const F = f.value.find((M) => M._id === c.ref);
|
|
638
579
|
return {
|
|
639
580
|
...c,
|
|
640
581
|
ref: (F == null ? void 0 : F.seqNumber) || c.ref,
|
|
@@ -644,26 +585,26 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
644
585
|
);
|
|
645
586
|
return {
|
|
646
587
|
resources: r.resources.map((c) => {
|
|
647
|
-
const i =
|
|
588
|
+
const i = f.value.find((F) => F._id === c.ref);
|
|
648
589
|
return { ...c, ref: (i == null ? void 0 : i.seqNumber) || c.ref };
|
|
649
590
|
}),
|
|
650
591
|
meta: r.meta
|
|
651
592
|
};
|
|
652
|
-
}),
|
|
653
|
-
() =>
|
|
593
|
+
}), f = E([]), S = Z.options.map((a) => ({ label: H(z.getReason(a)), value: a })), C = q(
|
|
594
|
+
() => u.locations.map((a) => ({ label: a.name, value: a._id }))
|
|
654
595
|
);
|
|
655
596
|
ce(
|
|
656
|
-
|
|
597
|
+
p,
|
|
657
598
|
() => {
|
|
658
|
-
|
|
599
|
+
y(), o({ pageIndex: 0 });
|
|
659
600
|
},
|
|
660
601
|
{ deep: !0 }
|
|
661
602
|
);
|
|
662
|
-
async function K(
|
|
663
|
-
|
|
603
|
+
async function K(a) {
|
|
604
|
+
P(
|
|
664
605
|
async () => {
|
|
665
606
|
await L.revertTransaction({
|
|
666
|
-
id:
|
|
607
|
+
id: a._id.toString()
|
|
667
608
|
}), await o();
|
|
668
609
|
},
|
|
669
610
|
{
|
|
@@ -672,51 +613,51 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
672
613
|
}
|
|
673
614
|
);
|
|
674
615
|
}
|
|
675
|
-
async function
|
|
616
|
+
async function N() {
|
|
676
617
|
try {
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
await
|
|
618
|
+
D.value = !0;
|
|
619
|
+
const a = new Ve(), r = d(), v = 1e3;
|
|
620
|
+
await P(
|
|
680
621
|
async () => {
|
|
681
|
-
var F,
|
|
622
|
+
var F, M, $, k, O, ne, re;
|
|
682
623
|
let c, i = !0;
|
|
683
624
|
for (; i; ) {
|
|
684
|
-
const
|
|
625
|
+
const G = await L.readAllCursor(
|
|
685
626
|
{
|
|
686
|
-
limit:
|
|
627
|
+
limit: v,
|
|
687
628
|
sortBy: "_id",
|
|
688
629
|
descending: !1,
|
|
689
630
|
...c ? { cursor: c } : {}
|
|
690
631
|
},
|
|
691
632
|
r
|
|
692
633
|
);
|
|
693
|
-
if (!
|
|
634
|
+
if (!G.resources.length)
|
|
694
635
|
break;
|
|
695
|
-
for (const
|
|
696
|
-
|
|
697
|
-
TransactionID:
|
|
698
|
-
CreatedAt:
|
|
636
|
+
for (const A of G.resources)
|
|
637
|
+
a.addRecord({
|
|
638
|
+
TransactionID: A._id,
|
|
639
|
+
CreatedAt: _(B(A._id.toString())).format(
|
|
699
640
|
"D MMM YYYY, hh:mmA"
|
|
700
641
|
),
|
|
701
642
|
Amount: ee(
|
|
702
|
-
|
|
643
|
+
A.expiryAmount.reduce(
|
|
703
644
|
(xe, be) => xe + be.amount,
|
|
704
|
-
|
|
645
|
+
A.amount ?? 0
|
|
705
646
|
),
|
|
706
647
|
2
|
|
707
648
|
),
|
|
708
|
-
ExpiredAt: (
|
|
709
|
-
Type: z.formattedType(
|
|
710
|
-
Source:
|
|
711
|
-
User: ((
|
|
712
|
-
"Phone No.": ((ne =
|
|
713
|
-
References:
|
|
714
|
-
Remark: ((re =
|
|
649
|
+
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") : "",
|
|
650
|
+
Type: z.formattedType(A),
|
|
651
|
+
Source: H(z.getReason(A.source)),
|
|
652
|
+
User: ((O = A.pf_user) == null ? void 0 : O.name) || "",
|
|
653
|
+
"Phone No.": ((ne = A.pf_user) == null ? void 0 : ne.phoneNumber) || "",
|
|
654
|
+
References: A.ref,
|
|
655
|
+
Remark: ((re = A.metadata) == null ? void 0 : re.remark) || ""
|
|
715
656
|
});
|
|
716
|
-
c =
|
|
657
|
+
c = G.meta.nextCursor ?? void 0, i = G.meta.hasNext && !!c;
|
|
717
658
|
}
|
|
718
659
|
await Ae(
|
|
719
|
-
|
|
660
|
+
a.buildExcel(),
|
|
720
661
|
`transactions-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
721
662
|
{
|
|
722
663
|
bookType: "xlsx",
|
|
@@ -730,53 +671,53 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
730
671
|
successMessage: "transactions exported successfully"
|
|
731
672
|
}
|
|
732
673
|
);
|
|
733
|
-
} catch (
|
|
734
|
-
console.error(
|
|
674
|
+
} catch (a) {
|
|
675
|
+
console.error(a);
|
|
735
676
|
} finally {
|
|
736
|
-
|
|
677
|
+
D.value = !1;
|
|
737
678
|
}
|
|
738
679
|
}
|
|
739
|
-
const oe =
|
|
740
|
-
function ve(
|
|
680
|
+
const oe = E(null);
|
|
681
|
+
function ve(a) {
|
|
741
682
|
var r;
|
|
742
|
-
console.log(
|
|
683
|
+
console.log(a), (r = oe.value) == null || r.showSheet(!0, a.original);
|
|
743
684
|
}
|
|
744
|
-
return
|
|
745
|
-
await
|
|
746
|
-
}), (
|
|
747
|
-
const
|
|
748
|
-
return V(),
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
685
|
+
return Te(async () => {
|
|
686
|
+
await u.readLocations(), await m.read(), await o();
|
|
687
|
+
}), (a, r) => {
|
|
688
|
+
const v = U("FmSearch"), c = U("FmButton");
|
|
689
|
+
return V(), Y(J, null, [
|
|
690
|
+
x("div", null, [
|
|
691
|
+
x("div", We, [
|
|
692
|
+
R(v, {
|
|
752
693
|
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
753
|
-
modelValue: l(
|
|
754
|
-
"onUpdate:modelValue": r[0] || (r[0] = (i) => l(
|
|
694
|
+
modelValue: l(p).search,
|
|
695
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => l(p).search = i),
|
|
755
696
|
placeholder: "Search",
|
|
756
697
|
collapsible: ""
|
|
757
698
|
}, null, 8, ["modelValue"]),
|
|
758
|
-
|
|
699
|
+
R(c, {
|
|
759
700
|
icon: "ios_share",
|
|
760
701
|
variant: "tertiary",
|
|
761
|
-
onClick:
|
|
702
|
+
onClick: N
|
|
762
703
|
})
|
|
763
704
|
]),
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
705
|
+
x("div", je, [
|
|
706
|
+
x("div", qe, [
|
|
707
|
+
R(Q, {
|
|
767
708
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
768
709
|
"right-icon": "keyboard_arrow_down",
|
|
769
|
-
modelValue: l(
|
|
770
|
-
"onUpdate:modelValue": r[1] || (r[1] = (i) => l(
|
|
710
|
+
modelValue: l(p)["metadata.location"],
|
|
711
|
+
"onUpdate:modelValue": r[1] || (r[1] = (i) => l(p)["metadata.location"] = i),
|
|
771
712
|
icon: "storefront",
|
|
772
713
|
"show-item-label": !0,
|
|
773
|
-
items: l(
|
|
714
|
+
items: l(C)
|
|
774
715
|
}, null, 8, ["modelValue", "items"]),
|
|
775
|
-
|
|
716
|
+
R(Q, {
|
|
776
717
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
777
718
|
"right-icon": "keyboard_arrow_down",
|
|
778
|
-
modelValue: l(
|
|
779
|
-
"onUpdate:modelValue": r[2] || (r[2] = (i) => l(
|
|
719
|
+
modelValue: l(p)["pf_collectible.type"],
|
|
720
|
+
"onUpdate:modelValue": r[2] || (r[2] = (i) => l(p)["pf_collectible.type"] = i),
|
|
780
721
|
label: "Type: ",
|
|
781
722
|
"show-item-label": !0,
|
|
782
723
|
items: [
|
|
@@ -790,54 +731,54 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
790
731
|
{ label: "Stamp", value: "STAMP" }
|
|
791
732
|
]
|
|
792
733
|
}, null, 8, ["modelValue"]),
|
|
793
|
-
|
|
734
|
+
R(Q, {
|
|
794
735
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
795
736
|
"right-icon": "keyboard_arrow_down",
|
|
796
|
-
modelValue: l(
|
|
797
|
-
"onUpdate:modelValue": r[3] || (r[3] = (i) => l(
|
|
737
|
+
modelValue: l(p).source,
|
|
738
|
+
"onUpdate:modelValue": r[3] || (r[3] = (i) => l(p).source = i),
|
|
798
739
|
label: "Source: ",
|
|
799
740
|
"show-item-label": !0,
|
|
800
|
-
items: l(
|
|
741
|
+
items: l(S)
|
|
801
742
|
}, null, 8, ["modelValue", "items"]),
|
|
802
|
-
|
|
743
|
+
R(ue, {
|
|
803
744
|
"model-value": {
|
|
804
|
-
startDate: l(
|
|
805
|
-
endDate: l(
|
|
745
|
+
startDate: l(p).dateRange.startDate,
|
|
746
|
+
endDate: l(p).dateRange.endDate
|
|
806
747
|
},
|
|
807
|
-
"onUpdate:modelValue": r[4] || (r[4] = (i) => l(
|
|
808
|
-
startDate: l(
|
|
809
|
-
endDate: l(
|
|
748
|
+
"onUpdate:modelValue": r[4] || (r[4] = (i) => l(p).dateRange = {
|
|
749
|
+
startDate: l(_)(i.startDate).startOf("d").toISOString(),
|
|
750
|
+
endDate: l(_)(i.endDate).endOf("d").toISOString()
|
|
810
751
|
})
|
|
811
752
|
}, null, 8, ["model-value"])
|
|
812
753
|
]),
|
|
813
|
-
|
|
754
|
+
R(v, {
|
|
814
755
|
class: "xs:hidden",
|
|
815
|
-
modelValue: l(
|
|
816
|
-
"onUpdate:modelValue": r[5] || (r[5] = (i) => l(
|
|
756
|
+
modelValue: l(p).search,
|
|
757
|
+
"onUpdate:modelValue": r[5] || (r[5] = (i) => l(p).search = i),
|
|
817
758
|
placeholder: "Search",
|
|
818
759
|
collapsible: ""
|
|
819
760
|
}, null, 8, ["modelValue"]),
|
|
820
|
-
|
|
821
|
-
|
|
761
|
+
x("div", He, [
|
|
762
|
+
R(c, {
|
|
822
763
|
icon: "ios_share",
|
|
823
764
|
variant: "tertiary",
|
|
824
|
-
onClick:
|
|
765
|
+
onClick: N
|
|
825
766
|
})
|
|
826
767
|
])
|
|
827
768
|
]),
|
|
828
|
-
|
|
829
|
-
loading: l(
|
|
769
|
+
R(de, {
|
|
770
|
+
loading: l(t).isLoading,
|
|
830
771
|
"row-data": l(e),
|
|
831
|
-
"row-count": l(
|
|
832
|
-
"column-defs":
|
|
772
|
+
"row-count": l(t).totalRows,
|
|
773
|
+
"column-defs": I.filter(
|
|
833
774
|
(i) => !h.user || i.header !== "User" && i.header !== "Phone No."
|
|
834
775
|
),
|
|
835
|
-
"page-count": l(
|
|
836
|
-
"page-index": l(
|
|
837
|
-
"page-size": l(
|
|
776
|
+
"page-count": l(t).pageCount,
|
|
777
|
+
"page-index": l(t).pageIndex,
|
|
778
|
+
"page-size": l(t).pageSize,
|
|
838
779
|
"shrink-at": !1,
|
|
839
780
|
"pagination-mode": "cursor",
|
|
840
|
-
"has-next": l(
|
|
781
|
+
"has-next": l(t).hasNext,
|
|
841
782
|
onSortChange: l(n),
|
|
842
783
|
onPageChange: r[6] || (r[6] = (i) => l(o)({
|
|
843
784
|
pageSize: i.pageSize,
|
|
@@ -846,7 +787,7 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
846
787
|
onRowClick: ve
|
|
847
788
|
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "has-next", "onSortChange"])
|
|
848
789
|
]),
|
|
849
|
-
|
|
790
|
+
R(Ge, {
|
|
850
791
|
ref_key: "transactionDetailSheet",
|
|
851
792
|
ref: oe
|
|
852
793
|
}, null, 512)
|
|
@@ -854,19 +795,19 @@ const $e = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, K
|
|
|
854
795
|
};
|
|
855
796
|
}
|
|
856
797
|
});
|
|
857
|
-
class
|
|
798
|
+
class Qe extends fe {
|
|
858
799
|
}
|
|
859
|
-
const
|
|
800
|
+
const Xe = { class: "flex items-center justify-between" }, Je = { class: "flex gap-8 items-center" }, Ze = { class: "flex gap-8 items-center xs:hidden" }, Ma = /* @__PURE__ */ ae({
|
|
860
801
|
__name: "StoreTransactions",
|
|
861
802
|
props: {
|
|
862
803
|
user: {
|
|
863
804
|
type: String
|
|
864
805
|
}
|
|
865
806
|
},
|
|
866
|
-
setup(
|
|
867
|
-
const
|
|
807
|
+
setup(w) {
|
|
808
|
+
const T = w, { minor: u } = ye;
|
|
868
809
|
Re();
|
|
869
|
-
const
|
|
810
|
+
const m = [
|
|
870
811
|
{
|
|
871
812
|
header: "Transaction ID",
|
|
872
813
|
meta: {
|
|
@@ -874,13 +815,13 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
874
815
|
},
|
|
875
816
|
cell(e) {
|
|
876
817
|
return s("div", { class: "flex items-center" }, [
|
|
877
|
-
s(
|
|
818
|
+
s(g.FmIcon, {
|
|
878
819
|
name: "content_copy",
|
|
879
820
|
outline: !0,
|
|
880
821
|
size: "sm",
|
|
881
822
|
class: "cursor-pointer mr-4 shrink-0",
|
|
882
823
|
onClick: (n) => {
|
|
883
|
-
n.preventDefault(), n.stopPropagation(),
|
|
824
|
+
n.preventDefault(), n.stopPropagation(), te(e.row.original._id.toString());
|
|
884
825
|
}
|
|
885
826
|
}),
|
|
886
827
|
s("div", { class: "truncate" }, e.row.original._id.toString())
|
|
@@ -889,7 +830,7 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
889
830
|
},
|
|
890
831
|
{
|
|
891
832
|
header: "Created at",
|
|
892
|
-
accessorFn: (e) =>
|
|
833
|
+
accessorFn: (e) => _(B(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
893
834
|
enableSorting: !0
|
|
894
835
|
},
|
|
895
836
|
{
|
|
@@ -911,12 +852,12 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
911
852
|
return s("div", { class: "flex items-center gap-4" }, [
|
|
912
853
|
s("div", { class: "flex items-center" }, [
|
|
913
854
|
((n = e.row.original.paymentType) == null ? void 0 : n.type) == "ONLINE" && e.row.original.paymentType.extra ? s(
|
|
914
|
-
|
|
855
|
+
g.FmTooltip,
|
|
915
856
|
{
|
|
916
857
|
content: e.row.original.paymentType.extra
|
|
917
858
|
},
|
|
918
859
|
[
|
|
919
|
-
s(
|
|
860
|
+
s(g.FmIcon, {
|
|
920
861
|
name: "info",
|
|
921
862
|
outline: !0,
|
|
922
863
|
size: "sm"
|
|
@@ -944,24 +885,24 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
944
885
|
header: "Status",
|
|
945
886
|
// accessorFn: (u) => u.status,
|
|
946
887
|
cell(e) {
|
|
947
|
-
var
|
|
888
|
+
var y, f, S, C;
|
|
948
889
|
const n = e.row.original.status, o = {
|
|
949
890
|
COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
950
891
|
REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
|
|
951
892
|
};
|
|
952
893
|
return s("div", { class: "flex items-center gap-4" }, [
|
|
953
|
-
s(
|
|
954
|
-
label:
|
|
894
|
+
s(g.FmChip, {
|
|
895
|
+
label: Ee.title(n),
|
|
955
896
|
variant: "plain",
|
|
956
897
|
class: o[n] ?? ""
|
|
957
898
|
}),
|
|
958
|
-
(
|
|
959
|
-
|
|
899
|
+
(f = (y = e.row.original) == null ? void 0 : y.refund) != null && f.reason ? s(
|
|
900
|
+
g.FmTooltip,
|
|
960
901
|
{
|
|
961
|
-
content: (
|
|
902
|
+
content: (C = (S = e.row.original) == null ? void 0 : S.refund) == null ? void 0 : C.reason
|
|
962
903
|
},
|
|
963
904
|
[
|
|
964
|
-
s(
|
|
905
|
+
s(g.FmIcon, {
|
|
965
906
|
name: "info",
|
|
966
907
|
color: "primary",
|
|
967
908
|
outline: !0,
|
|
@@ -985,25 +926,25 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
985
926
|
cell(e) {
|
|
986
927
|
const n = e.row.original, o = n.status === "COMPLETED" && !n.refund && n.source == "ADMIN";
|
|
987
928
|
return o ? s(
|
|
988
|
-
|
|
929
|
+
g.FmMenu,
|
|
989
930
|
{
|
|
990
931
|
placement: "bottom-end",
|
|
991
|
-
onClick: (
|
|
992
|
-
|
|
932
|
+
onClick: (y) => {
|
|
933
|
+
y.stopPropagation();
|
|
993
934
|
}
|
|
994
935
|
},
|
|
995
936
|
{
|
|
996
|
-
"menu-button": () => s(
|
|
937
|
+
"menu-button": () => s(g.FmButton, {
|
|
997
938
|
icon: "settings",
|
|
998
939
|
variant: "tertiary",
|
|
999
940
|
if: o
|
|
1000
941
|
}),
|
|
1001
942
|
default: () => [
|
|
1002
|
-
s(
|
|
943
|
+
s(g.FmMenuItem, {
|
|
1003
944
|
label: "Refund",
|
|
1004
945
|
sublabel: "Refund this transaction",
|
|
1005
|
-
onClick: async (
|
|
1006
|
-
|
|
946
|
+
onClick: async (y) => {
|
|
947
|
+
y.stopPropagation(), await d(n);
|
|
1007
948
|
}
|
|
1008
949
|
})
|
|
1009
950
|
]
|
|
@@ -1011,32 +952,32 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1011
952
|
) : s("div");
|
|
1012
953
|
}
|
|
1013
954
|
}
|
|
1014
|
-
],
|
|
955
|
+
], b = E({
|
|
1015
956
|
searchValue: "",
|
|
1016
957
|
dateRange: {
|
|
1017
|
-
startDate:
|
|
1018
|
-
endDate:
|
|
958
|
+
startDate: _().subtract(7, "day").toISOString(),
|
|
959
|
+
endDate: _().toISOString()
|
|
1019
960
|
}
|
|
1020
|
-
}), { tableMeta: h, rowData:
|
|
961
|
+
}), { tableMeta: h, rowData: D, onSort: P, debouncedFetchData: I, onSearch: p } = Fe(async (e) => {
|
|
1021
962
|
const n = {
|
|
1022
|
-
...
|
|
1023
|
-
user:
|
|
963
|
+
...b.value.dateRange,
|
|
964
|
+
user: T.user
|
|
1024
965
|
};
|
|
1025
966
|
return await L.readStoreTransactions(e, n);
|
|
1026
967
|
});
|
|
1027
|
-
async function
|
|
1028
|
-
await
|
|
968
|
+
async function d(e) {
|
|
969
|
+
await Ie.confirm(
|
|
1029
970
|
"Are you sure you want to refund this transaction?",
|
|
1030
971
|
"Refund Store Transaction",
|
|
1031
972
|
"Confirm",
|
|
1032
973
|
"Cancel"
|
|
1033
|
-
) && await
|
|
974
|
+
) && await u(
|
|
1034
975
|
async () => {
|
|
1035
976
|
var o;
|
|
1036
|
-
await
|
|
977
|
+
await Pe.refundStoreTransaction({
|
|
1037
978
|
id: e._id,
|
|
1038
|
-
reason: `ADMIN:${(o =
|
|
1039
|
-
}), await
|
|
979
|
+
reason: `ADMIN:${(o = Me().sessionUser) == null ? void 0 : o.name}`
|
|
980
|
+
}), await I();
|
|
1040
981
|
},
|
|
1041
982
|
{
|
|
1042
983
|
message: "Refunding transaction...",
|
|
@@ -1045,82 +986,82 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1045
986
|
);
|
|
1046
987
|
}
|
|
1047
988
|
ce(
|
|
1048
|
-
|
|
989
|
+
b,
|
|
1049
990
|
() => {
|
|
1050
|
-
|
|
991
|
+
I();
|
|
1051
992
|
},
|
|
1052
993
|
{ deep: !0 }
|
|
1053
|
-
),
|
|
1054
|
-
await
|
|
994
|
+
), Ce(async () => {
|
|
995
|
+
await I();
|
|
1055
996
|
});
|
|
1056
|
-
const
|
|
1057
|
-
exporter: new
|
|
997
|
+
const t = async () => De({
|
|
998
|
+
exporter: new Qe(),
|
|
1058
999
|
readFunction: (e) => L.readStoreTransactions(e, {
|
|
1059
|
-
...
|
|
1060
|
-
user:
|
|
1000
|
+
...b.value.dateRange,
|
|
1001
|
+
user: T.user
|
|
1061
1002
|
}),
|
|
1062
1003
|
transformRecord: (e) => {
|
|
1063
|
-
var n, o,
|
|
1004
|
+
var n, o, y, f, S, C;
|
|
1064
1005
|
return {
|
|
1065
1006
|
TransactionId: ((n = e._id) == null ? void 0 : n.toString()) || "",
|
|
1066
|
-
CreatedAt:
|
|
1007
|
+
CreatedAt: _(B(e._id.toString())).format(
|
|
1067
1008
|
"DD/MM/YYYY HH:mm:ss"
|
|
1068
1009
|
),
|
|
1069
1010
|
Bundle: e.bundle.name || "",
|
|
1070
1011
|
Location: e.location ? e.pf_location[0].name : "Online Store",
|
|
1071
1012
|
PaymentType: ((o = e.paymentType) == null ? void 0 : o.type) || "N/A",
|
|
1072
|
-
PaymentExtra: ((
|
|
1073
|
-
User: ((
|
|
1074
|
-
PhoneNumber: ((
|
|
1013
|
+
PaymentExtra: ((y = e.paymentType) == null ? void 0 : y.extra) || "",
|
|
1014
|
+
User: ((f = e.pf_member) == null ? void 0 : f.name) || "",
|
|
1015
|
+
PhoneNumber: ((S = e.pf_member) == null ? void 0 : S.phoneNumber) || "",
|
|
1075
1016
|
Status: e.status || "",
|
|
1076
|
-
RefundReason: ((
|
|
1017
|
+
RefundReason: ((C = e == null ? void 0 : e.refund) == null ? void 0 : C.reason) || "",
|
|
1077
1018
|
Ref: (e == null ? void 0 : e.ref) || ""
|
|
1078
1019
|
};
|
|
1079
1020
|
},
|
|
1080
1021
|
filename: "store-transactions"
|
|
1081
1022
|
});
|
|
1082
1023
|
return (e, n) => {
|
|
1083
|
-
const o =
|
|
1084
|
-
return V(),
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
modelValue: l(
|
|
1089
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
1024
|
+
const o = U("FmSearch"), y = U("FmButton");
|
|
1025
|
+
return V(), Y("div", null, [
|
|
1026
|
+
x("div", Xe, [
|
|
1027
|
+
x("div", Je, [
|
|
1028
|
+
R(ue, {
|
|
1029
|
+
modelValue: l(b).dateRange,
|
|
1030
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => l(b).dateRange = f)
|
|
1090
1031
|
}, null, 8, ["modelValue"])
|
|
1091
1032
|
]),
|
|
1092
|
-
|
|
1093
|
-
|
|
1033
|
+
x("div", Ze, [
|
|
1034
|
+
R(o, {
|
|
1094
1035
|
modelValue: l(h).searchValue,
|
|
1095
1036
|
"onUpdate:modelValue": [
|
|
1096
|
-
n[1] || (n[1] = (
|
|
1097
|
-
l(
|
|
1037
|
+
n[1] || (n[1] = (f) => l(h).searchValue = f),
|
|
1038
|
+
l(p)
|
|
1098
1039
|
],
|
|
1099
1040
|
placeholder: "Search",
|
|
1100
1041
|
collapsible: ""
|
|
1101
1042
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1102
|
-
|
|
1043
|
+
R(y, {
|
|
1103
1044
|
icon: "ios_share",
|
|
1104
1045
|
variant: "tertiary",
|
|
1105
|
-
onClick:
|
|
1046
|
+
onClick: t
|
|
1106
1047
|
})
|
|
1107
1048
|
])
|
|
1108
1049
|
]),
|
|
1109
|
-
|
|
1050
|
+
R(de, {
|
|
1110
1051
|
loading: l(h).isLoading,
|
|
1111
|
-
"row-data": l(
|
|
1052
|
+
"row-data": l(D),
|
|
1112
1053
|
"row-count": l(h).totalRows,
|
|
1113
|
-
"column-defs":
|
|
1114
|
-
(
|
|
1054
|
+
"column-defs": m.filter(
|
|
1055
|
+
(f) => !T.user || f.header !== "User" && f.header !== "Phone No."
|
|
1115
1056
|
),
|
|
1116
1057
|
"page-count": l(h).pageCount,
|
|
1117
1058
|
"page-index": l(h).pageIndex,
|
|
1118
1059
|
"page-size": l(h).pageSize,
|
|
1119
1060
|
"shrink-at": !1,
|
|
1120
|
-
onSortChange: l(
|
|
1121
|
-
onPageChange: n[2] || (n[2] = (
|
|
1122
|
-
pageSize:
|
|
1123
|
-
pageIndex:
|
|
1061
|
+
onSortChange: l(P),
|
|
1062
|
+
onPageChange: n[2] || (n[2] = (f) => l(I)({
|
|
1063
|
+
pageSize: f.pageSize,
|
|
1064
|
+
pageIndex: f.pageIndex
|
|
1124
1065
|
}))
|
|
1125
1066
|
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1126
1067
|
]);
|
|
@@ -1128,6 +1069,6 @@ const tt = { class: "flex items-center justify-between" }, at = { class: "flex g
|
|
|
1128
1069
|
}
|
|
1129
1070
|
});
|
|
1130
1071
|
export {
|
|
1131
|
-
|
|
1132
|
-
|
|
1072
|
+
Na as _,
|
|
1073
|
+
Ma as a
|
|
1133
1074
|
};
|