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