@feedmepos/mf-connect 0.1.0-beta.65 → 0.1.0-beta.67
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-BykZRzDs.js → Analytic-knY-Fody.js} +11 -11
- package/dist/{App-DlJhQ-d7.js → App-CaSjMnkY.js} +6 -6
- package/dist/{AuditLogs-D_Tj-hN5.js → AuditLogs-DyJ0BWHt.js} +8 -8
- package/dist/{Bin-B9DIsHlV.js → Bin-D73Ky2O3.js} +8 -8
- package/dist/{Broadcast-HujD0CH6.js → Broadcast-BRMyf2ZA.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B9KbyT0Z.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-0I_Pp2.js} +6 -6
- package/dist/{Card-dEGuVh8Y.js → Card-BEgNn8SY.js} +15 -15
- package/dist/{Collections-DLU_r242.js → Collections-C0KqBg5k.js} +5 -5
- package/dist/{Credit-DPxRywNS.js → Credit-D3Y1U0-i.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BO7Zjzjn.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJ7AzlQk.js} +28 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CDCnlwRw.js → EffectSheet.vue_vue_type_style_index_0_lang-C9JgRiyA.js} +6 -6
- package/dist/{Experience-DbeeaSny.js → Experience-B0LMRyXY.js} +9 -9
- package/dist/{Game-DF-tRQmA.js → Game-Bz0eGUGe.js} +10 -10
- package/dist/{Index-D-Gl4vEU.js → Index-DV7FO6TN.js} +10 -10
- package/dist/{Marketing-BVUn9m1D.js → Marketing-xdKdn8qo.js} +6 -6
- package/dist/{Member-DeAQPJ5c.js → Member-CGDUgKb7.js} +5 -5
- package/dist/{MemberList-CK3ItLYd.js → MemberList-D1OLQAcR.js} +24 -24
- package/dist/{MemberTransactions-ChvkxttB.js → MemberTransactions-DO59eyLa.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DJjiapX-.js → MessageInput.vue_vue_type_script_setup_true_lang-bBjpPoOo.js} +2 -2
- package/dist/{Mission-af0CLDdi.js → Mission-CZvAG4ev.js} +10 -10
- package/dist/{Overview-bE-CxDyW.js → Overview-DMCKeCar.js} +17 -17
- package/dist/{Point-DMUJXRIW.js → Point-BMyDzFyO.js} +9 -9
- package/dist/{Promotion-C72ZIHQC.js → Promotion-D1nOUTxD.js} +10 -10
- package/dist/{Queue-BxVMOXfX.js → Queue-CGl0yzB4.js} +13 -13
- package/dist/{Record-BTXkLR-X.js → Record-BGmigp0Z.js} +7 -7
- package/dist/{Reward-UtZnwyhC.js → Reward-ZYXuU6-e.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BBSqJfeS.js → RewardGroup.vue_vue_type_script_setup_true_lang-C02Mj9a0.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-u9z-Uco-.js → RuleGroup.vue_vue_type_script_setup_true_lang-DGS3_lis.js} +12 -12
- package/dist/{Segment-CsCYYgLL.js → Segment-BXxgrHVs.js} +14 -14
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B7jbLxek.js → SelectItems.vue_vue_type_script_setup_true_lang-CSVXVt5K.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-kBXjyEyt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D9dpqYTQ.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BVE_boAC.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CM9312dS.js} +3 -3
- package/dist/{Setting-B1W1sMAI.js → Setting-B3HficZP.js} +10 -10
- package/dist/{Store-DC3YkCuT.js → Store-CWhmG8qW.js} +18 -18
- package/dist/{StoreRewards-BLSf4yL5.js → StoreRewards-6Cjh9q4d.js} +13 -13
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CTUT_564.js +1028 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Bj7An5CY.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-B059fdPj.js} +1 -1
- package/dist/{Tier-DoGYPOK2.js → Tier-qm79T_vU.js} +19 -19
- package/dist/{Title-Dcg5_aiJ.js → Title-DOWrRYW8.js} +19 -19
- package/dist/{Transaction-DjzGqSTu.js → Transaction-DW7bUI7j.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CWv6o4xN.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-38On7ek-.js} +6 -6
- package/dist/{Voucher-COtfsGvM.js → Voucher-BJBXjxZV.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-tl9RMCof.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DzdxjFhD.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B6abwK-T.js → ZodTextField.vue_vue_type_script_setup_true_lang-CJ_O28uk.js} +1 -1
- package/dist/{app-CTeqEkoa.js → app-BLFTLZqS.js} +1 -1
- package/dist/{app-SUKcprMq.js → app-CHUmGvDF.js} +31 -31
- package/dist/app.js +1 -1
- package/dist/{business-DcFWQWQ_.js → business-Dl7vGxa1.js} +1 -1
- package/dist/{campaign-9l1-4E18.js → campaign-DMIBFpmQ.js} +9 -9
- package/dist/{campaign-B1xMjgeN.js → campaign-XH_j4bGc.js} +2 -2
- package/dist/{campaign.enum-BoBKGas3.js → campaign.enum-UniuuBvU.js} +1 -1
- package/dist/{campaign.fn-BuJQp7OR.js → campaign.fn-CDC2Cia7.js} +139 -139
- package/dist/{collectible.enum-CBU_rAz2.js → collectible.enum-Dx_pgMB9.js} +1 -1
- package/dist/{collection.fn-BzmzHuiA.js → collection.fn-D0nutrYu.js} +2 -2
- package/dist/{dto-BIamKujn.js → dto-BAPti0UX.js} +4 -4
- package/dist/{effect-B-4TI9VM.js → effect-By6CZhli.js} +1 -1
- package/dist/{email-addresses-DEv8LE3V.js → email-addresses-DPBu_l0s.js} +1 -1
- package/dist/{export-FypV374Y.js → export-C6IKCW8q.js} +3 -3
- package/dist/{helper-ByX6M5s_.js → helper-KCTyvhjf.js} +1 -1
- package/dist/{index-CcJqawSD.js → index-BHB9VPNm.js} +1 -1
- package/dist/{index-CdMXuKzu.js → index-BVcdkWyy.js} +3 -3
- package/dist/{index-B0wqzS6z.js → index-C-HL3cGP.js} +4 -4
- package/dist/{index-BsGmEByl.js → index-C9bN_nRJ.js} +1 -1
- package/dist/{index-COs3r3yx.js → index-D8dh7Th8.js} +1 -1
- package/dist/{index-wKj9Jq_Y.js → index-DDCO8cDG.js} +2 -2
- package/dist/{index-YmukhZFD.js → index-DQxldvxq.js} +456 -445
- package/dist/index-DxT_ZaWI.js +2186 -0
- package/dist/index-Sw_FxWmd.js +56 -0
- package/dist/{index-DHt_xUTS.js → index-VPs9NXB7.js} +3 -3
- package/dist/{index-uf-Xzbbb.js → index-_Fw2-H-c.js} +1 -1
- package/dist/{index--ljh_arC.js → index-e0vKYT8t.js} +1 -1
- package/dist/{index.esm2017-D2ty8PoZ.js → index.esm2017-CiHGwLIY.js} +1 -1
- package/dist/{loading-BkexxRvP.js → loading-CmczlXAc.js} +1 -1
- package/dist/{membership-DSvm3lCf.js → membership-D-uWTsu-.js} +3 -3
- package/dist/{money-BWtCy3GX.js → money-BhXbOy-4.js} +1 -1
- package/dist/{number-DeIIxnKB.js → number-CT16ZbSb.js} +1 -1
- package/dist/{objectid-5Cs5ddrm.js → objectid-BGQHcha_.js} +3 -3
- package/dist/{plugins-BovoaCMv.js → plugins-uP-mKUTQ.js} +4 -6
- package/dist/{reward-C3FKPfvO.js → reward-D7tB215Q.js} +1 -1
- package/dist/{rule-bx6kGPEY.js → rule-LLXbjCSc.js} +3 -3
- package/dist/{rule-builder-_n-2bDtG.js → rule-builder-yxSBBeW6.js} +1 -1
- package/dist/{template-DCacwacU.js → template-BRXG9AbZ.js} +4 -4
- package/dist/{trigger-DkTKCHNq.js → trigger-BQTtyAtM.js} +4 -4
- package/dist/{user-yXVKLZVM.js → user-BzRp43jn.js} +1 -1
- package/dist/{vue-i18n-bpwKTYQc.js → vue-i18n-7zGNsm-H.js} +285 -285
- package/dist/{xlsx-CyCSR0F9.js → xlsx-mkBvYNNs.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-7JAwsa6H.js +0 -943
- package/dist/index-C3R1PpLs.js +0 -44
- package/dist/index-DgkJMGFX.js +0 -73912
|
@@ -1,943 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, ref as A, computed as K, h as n, resolveComponent as M, openBlock as F, createBlock as X, unref as s, isRef as me, withCtx as J, createElementVNode as h, createVNode as S, createElementBlock as O, Fragment as H, renderList as Q, toDisplayString as $, createTextVNode as de, resolveDynamicComponent as pe, watch as Z, onBeforeMount as fe, onMounted as ge } from "vue";
|
|
2
|
-
import { components as v, useDialog as ye } from "@feedmepos/ui-library";
|
|
3
|
-
import { q as ee } from "./index-YmukhZFD.js";
|
|
4
|
-
import { a as W, c as he, p as ve } from "./plugins-BovoaCMv.js";
|
|
5
|
-
import { s as _e } from "./index-Dbd4WA4r.js";
|
|
6
|
-
import { h as w } from "./moment-BWErdI6_.js";
|
|
7
|
-
import { _ as G } from "./FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js";
|
|
8
|
-
import { _ as ae } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js";
|
|
9
|
-
import { s as z } from "./index-CsaQJMAR.js";
|
|
10
|
-
import { f as j } from "./number-DeIIxnKB.js";
|
|
11
|
-
import { u as te } from "./business-DcFWQWQ_.js";
|
|
12
|
-
import { u as oe, _ as ne } from "./usePagination-BeF5K3M7.js";
|
|
13
|
-
import { g as re } from "./user-yXVKLZVM.js";
|
|
14
|
-
import { B as se, e as le } from "./export-FypV374Y.js";
|
|
15
|
-
import { u as ie } from "./campaign-B1xMjgeN.js";
|
|
16
|
-
import "./index-uf-Xzbbb.js";
|
|
17
|
-
import "./index-DgkJMGFX.js";
|
|
18
|
-
import "./index-wKj9Jq_Y.js";
|
|
19
|
-
import "./index-CcJqawSD.js";
|
|
20
|
-
import "./index-CdMXuKzu.js";
|
|
21
|
-
import { u as be } from "./vue-i18n-bpwKTYQc.js";
|
|
22
|
-
import { o as k } from "./objectId-dwaoBfJX.js";
|
|
23
|
-
import { useRouter as Se } from "vue-router";
|
|
24
|
-
import { t as L } from "./index-C3R1PpLs.js";
|
|
25
|
-
import { R as B } from "./app-SUKcprMq.js";
|
|
26
|
-
import { u as xe } from "./loading-BkexxRvP.js";
|
|
27
|
-
import { useCoreStore as we } from "@feedmepos/mf-common";
|
|
28
|
-
import { m as Te } from "./index-B0wqzS6z.js";
|
|
29
|
-
function Re(m) {
|
|
30
|
-
let p = "";
|
|
31
|
-
switch (m) {
|
|
32
|
-
case "PORTAL":
|
|
33
|
-
p = "ADMIN";
|
|
34
|
-
break;
|
|
35
|
-
case "BENEFIT":
|
|
36
|
-
p = "MEMBERSHIP";
|
|
37
|
-
break;
|
|
38
|
-
case "ORDER":
|
|
39
|
-
p = "ORDER";
|
|
40
|
-
break;
|
|
41
|
-
case "BILL":
|
|
42
|
-
p = "SPENDING";
|
|
43
|
-
break;
|
|
44
|
-
case "CASHBACK":
|
|
45
|
-
p = "CASHBACK";
|
|
46
|
-
break;
|
|
47
|
-
case "CYCLE":
|
|
48
|
-
p = "EXPIRED";
|
|
49
|
-
break;
|
|
50
|
-
case "COUNTER_CONSUME":
|
|
51
|
-
p = "COUNTER REDEEM";
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
p = m;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
return p;
|
|
58
|
-
}
|
|
59
|
-
function Ce(m) {
|
|
60
|
-
var p, T, c, x, b, D;
|
|
61
|
-
switch ((p = m == null ? void 0 : m.pf_collectible) == null ? void 0 : p.type) {
|
|
62
|
-
case "VOUCHER":
|
|
63
|
-
return `${(T = m.pf_collectible) == null ? void 0 : T.type} (${(c = m.pf_collectible) == null ? void 0 : c.name})`;
|
|
64
|
-
case "TITLE":
|
|
65
|
-
return `${(x = m.pf_collectible) == null ? void 0 : x.type} (${(b = m.pf_collectible) == null ? void 0 : b.name})`;
|
|
66
|
-
case "POINT":
|
|
67
|
-
return "Experience";
|
|
68
|
-
case "COIN":
|
|
69
|
-
return "Point";
|
|
70
|
-
default:
|
|
71
|
-
return _e((D = m == null ? void 0 : m.pf_collectible) == null ? void 0 : D.type);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function Ie(m) {
|
|
75
|
-
switch (m) {
|
|
76
|
-
case "ONLINE":
|
|
77
|
-
return "Online";
|
|
78
|
-
case "COIN":
|
|
79
|
-
return "Point";
|
|
80
|
-
default:
|
|
81
|
-
return m;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const E = {
|
|
85
|
-
getReason: Re,
|
|
86
|
-
formattedType: Ce,
|
|
87
|
-
formattedPaymentType: Ie
|
|
88
|
-
};
|
|
89
|
-
class De extends se {
|
|
90
|
-
}
|
|
91
|
-
const Fe = { class: "space-y-24 pr-12" }, Ee = { class: "w-full space-y-16" }, Ae = { class: "fm-typo-en-body-lg-600" }, Ne = ["onClick"], Oe = { class: "fm-typo-en-body-lg-600" }, ke = ["onClick"], Me = { class: "flex items-center gap-8" }, Pe = /* @__PURE__ */ q({
|
|
92
|
-
__name: "TransactionDetailSheet",
|
|
93
|
-
setup(m, { expose: p }) {
|
|
94
|
-
be();
|
|
95
|
-
const T = A(!1), c = A(), x = ie(), b = te();
|
|
96
|
-
function D(d, o) {
|
|
97
|
-
T.value = d, c.value = o ?? null;
|
|
98
|
-
}
|
|
99
|
-
const u = K(() => {
|
|
100
|
-
var d, o;
|
|
101
|
-
return j(
|
|
102
|
-
((o = c.value) == null ? void 0 : o.expiryAmount.reduce(
|
|
103
|
-
(e, l) => e + l.amount,
|
|
104
|
-
((d = c.value) == null ? void 0 : d.amount) ?? 0
|
|
105
|
-
)) ?? 0,
|
|
106
|
-
2
|
|
107
|
-
);
|
|
108
|
-
}), C = K(() => {
|
|
109
|
-
var d, o, e, l, r;
|
|
110
|
-
return c.value ? [
|
|
111
|
-
{
|
|
112
|
-
label: "Transaction ID",
|
|
113
|
-
value: (d = c.value) == null ? void 0 : d._id
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
label: "Date/Time",
|
|
117
|
-
value: w(k(c.value._id.toString())).format(
|
|
118
|
-
"D MMM YYYY, hh:mmA"
|
|
119
|
-
)
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
label: "Amount",
|
|
123
|
-
component: () => n(
|
|
124
|
-
"span",
|
|
125
|
-
{
|
|
126
|
-
class: [
|
|
127
|
-
"pr-2",
|
|
128
|
-
+u.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
129
|
-
]
|
|
130
|
-
},
|
|
131
|
-
u.value
|
|
132
|
-
)
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
label: "Type",
|
|
136
|
-
value: E.formattedType(c.value)
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
label: "Source",
|
|
140
|
-
value: z(E.getReason(c.value.source))
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
label: "User",
|
|
144
|
-
value: (e = (o = c.value) == null ? void 0 : o.pf_user) == null ? void 0 : e.name
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
label: "Phone Number",
|
|
148
|
-
value: (r = (l = c.value) == null ? void 0 : l.pf_user) == null ? void 0 : r.phoneNumber
|
|
149
|
-
}
|
|
150
|
-
] : [];
|
|
151
|
-
}), P = K(() => {
|
|
152
|
-
var l, r, _, f;
|
|
153
|
-
if (!c.value) return [];
|
|
154
|
-
const d = [], o = (l = c.value) == null ? void 0 : l.metadata, e = c.value;
|
|
155
|
-
if (o != null && o.campaign) {
|
|
156
|
-
const R = x.campaigns.all.find(
|
|
157
|
-
(N) => N._id === (o == null ? void 0 : o.campaign)
|
|
158
|
-
);
|
|
159
|
-
if (!R) return;
|
|
160
|
-
d.push({
|
|
161
|
-
label: "Campaign",
|
|
162
|
-
value: R.name
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return o != null && o.remark && d.push({
|
|
166
|
-
label: "Remark",
|
|
167
|
-
value: o.remark
|
|
168
|
-
}), (r = c.value) != null && r.ref.startsWith("bill_") && d.push({
|
|
169
|
-
label: "Bill Number",
|
|
170
|
-
value: (_ = c.value) == null ? void 0 : _.ref,
|
|
171
|
-
copy: () => {
|
|
172
|
-
var R;
|
|
173
|
-
return W((R = c.value) == null ? void 0 : R.ref);
|
|
174
|
-
}
|
|
175
|
-
}), o != null && o.location && d.push({
|
|
176
|
-
label: "Location",
|
|
177
|
-
value: (f = b.locations.find(
|
|
178
|
-
(R) => R._id.toString() === (o == null ? void 0 : o.location)
|
|
179
|
-
)) == null ? void 0 : f.name
|
|
180
|
-
}), e.source === ee.enum.STORE && d.push({
|
|
181
|
-
label: "Store Transaction",
|
|
182
|
-
value: e.ref
|
|
183
|
-
}), o != null && o.originTransaction && d.push({
|
|
184
|
-
label: "Parent Transaction",
|
|
185
|
-
value: o.originTransaction
|
|
186
|
-
}), o != null && o.referral_count && d.push({
|
|
187
|
-
label: "Referral Count",
|
|
188
|
-
value: o.referral_count
|
|
189
|
-
}), e.refunded && d.push({
|
|
190
|
-
label: "Refunded From",
|
|
191
|
-
value: e.refundedFrom
|
|
192
|
-
}), d;
|
|
193
|
-
});
|
|
194
|
-
return p({
|
|
195
|
-
showSheet: D
|
|
196
|
-
}), (d, o) => {
|
|
197
|
-
const e = M("FmButton"), l = M("FmSideSheet");
|
|
198
|
-
return F(), X(l, {
|
|
199
|
-
"max-width": 560,
|
|
200
|
-
modelValue: s(T),
|
|
201
|
-
"onUpdate:modelValue": o[1] || (o[1] = (r) => me(T) ? T.value = r : null),
|
|
202
|
-
header: "Transaction Details"
|
|
203
|
-
}, {
|
|
204
|
-
"side-sheet-footer": J(() => [
|
|
205
|
-
h("div", Me, [
|
|
206
|
-
S(e, {
|
|
207
|
-
label: "Close",
|
|
208
|
-
onClick: o[0] || (o[0] = (r) => D(!1)),
|
|
209
|
-
variant: "tertiary"
|
|
210
|
-
})
|
|
211
|
-
])
|
|
212
|
-
]),
|
|
213
|
-
default: J(() => [
|
|
214
|
-
h("div", Fe, [
|
|
215
|
-
h("div", Ee, [
|
|
216
|
-
(F(!0), O(H, null, Q(s(C), (r) => (F(), O("div", {
|
|
217
|
-
key: r.label,
|
|
218
|
-
class: "flex flex-col gap-4"
|
|
219
|
-
}, [
|
|
220
|
-
h("div", Ae, $(r.label), 1),
|
|
221
|
-
h("div", {
|
|
222
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
223
|
-
onClick: r.copy
|
|
224
|
-
}, [
|
|
225
|
-
de($(r.accessorFn ? r.accessorFn() : r.value) + " ", 1),
|
|
226
|
-
(F(), X(pe(r.component)))
|
|
227
|
-
], 8, Ne),
|
|
228
|
-
o[2] || (o[2] = h("hr", { class: "mt-3" }, null, -1))
|
|
229
|
-
]))), 128)),
|
|
230
|
-
(F(!0), O(H, null, Q(s(P), (r) => (F(), O("div", {
|
|
231
|
-
key: r.label,
|
|
232
|
-
class: "flex flex-col gap-4"
|
|
233
|
-
}, [
|
|
234
|
-
h("div", Oe, $(r.label), 1),
|
|
235
|
-
h("div", {
|
|
236
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
237
|
-
onClick: r.copy
|
|
238
|
-
}, $(r.accessorFn ? r.accessorFn() : r.value), 9, ke),
|
|
239
|
-
o[3] || (o[3] = h("hr", { class: "mt-3" }, null, -1))
|
|
240
|
-
]))), 128))
|
|
241
|
-
])
|
|
242
|
-
])
|
|
243
|
-
]),
|
|
244
|
-
_: 1
|
|
245
|
-
}, 8, ["modelValue"]);
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
}), Ve = { class: "hidden xs:flex items-center justify-end" }, Ye = { class: "flex items-center justify-between" }, Ue = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, $e = { class: "xs:hidden" }, _a = /* @__PURE__ */ q({
|
|
249
|
-
__name: "CollectionTransactions",
|
|
250
|
-
props: {
|
|
251
|
-
user: {
|
|
252
|
-
type: String
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
setup(m) {
|
|
256
|
-
const p = te(), T = ie(), c = Se(), x = m, b = A(!1), D = [
|
|
257
|
-
{
|
|
258
|
-
header: "Transaction ID",
|
|
259
|
-
accessorKey: "_id",
|
|
260
|
-
meta: {
|
|
261
|
-
maxWidth: "100px"
|
|
262
|
-
},
|
|
263
|
-
cell(t) {
|
|
264
|
-
return n("div", { class: "flex items-center" }, [
|
|
265
|
-
n(v.FmIcon, {
|
|
266
|
-
name: "content_copy",
|
|
267
|
-
outline: !0,
|
|
268
|
-
size: "sm",
|
|
269
|
-
class: "cursor-pointer mr-4",
|
|
270
|
-
onClick: (a) => {
|
|
271
|
-
a.preventDefault(), a.stopPropagation(), W(t.row.original._id.toString());
|
|
272
|
-
}
|
|
273
|
-
}),
|
|
274
|
-
n(
|
|
275
|
-
"div",
|
|
276
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
277
|
-
t.row.original._id.toString()
|
|
278
|
-
)
|
|
279
|
-
]);
|
|
280
|
-
},
|
|
281
|
-
enableSorting: !1
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
header: "Created at",
|
|
285
|
-
accessorKey: "_id",
|
|
286
|
-
accessorFn: (t) => w(k(t._id.toString())),
|
|
287
|
-
cell: (t) => w(k(t.row.original._id.toString())).format(
|
|
288
|
-
"D MMM YYYY, hh:mmA"
|
|
289
|
-
),
|
|
290
|
-
enableSorting: !0
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
header: "Amount",
|
|
294
|
-
// accessorKey: 'totalAmount',
|
|
295
|
-
enableSorting: !1,
|
|
296
|
-
cell(t) {
|
|
297
|
-
var y, i, I, V;
|
|
298
|
-
const a = j(
|
|
299
|
-
t.row.original.expiryAmount.reduce(
|
|
300
|
-
(Y, U) => Y + U.amount,
|
|
301
|
-
t.row.original.amount ?? 0
|
|
302
|
-
),
|
|
303
|
-
2
|
|
304
|
-
), g = (i = (y = t.row.original.expiryAmount) == null ? void 0 : y[0]) != null && i.expiredAt ? w((V = (I = t.row.original.expiryAmount) == null ? void 0 : I[0]) == null ? void 0 : V.expiredAt).format(
|
|
305
|
-
"D MMM YYYY"
|
|
306
|
-
) : "";
|
|
307
|
-
return n("div", { class: "flex items-center" }, [
|
|
308
|
-
n(
|
|
309
|
-
"div",
|
|
310
|
-
{
|
|
311
|
-
class: [
|
|
312
|
-
"pr-2",
|
|
313
|
-
+a > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
314
|
-
]
|
|
315
|
-
},
|
|
316
|
-
a
|
|
317
|
-
),
|
|
318
|
-
n("div", { class: "flex items-center" }, [
|
|
319
|
-
t.row.original.expiryAmount.length > 0 ? n(
|
|
320
|
-
v.FmTooltip,
|
|
321
|
-
{
|
|
322
|
-
content: `Expired on ${g}`
|
|
323
|
-
},
|
|
324
|
-
[
|
|
325
|
-
n(v.FmIcon, {
|
|
326
|
-
name: "info",
|
|
327
|
-
outline: !0,
|
|
328
|
-
size: "sm"
|
|
329
|
-
})
|
|
330
|
-
]
|
|
331
|
-
) : n("div")
|
|
332
|
-
])
|
|
333
|
-
]);
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
header: "Type",
|
|
338
|
-
accessorKey: "pf_collectible.type",
|
|
339
|
-
accessorFn: (t) => E.formattedType(t),
|
|
340
|
-
meta: {
|
|
341
|
-
maxWidth: "200px"
|
|
342
|
-
},
|
|
343
|
-
cell(t) {
|
|
344
|
-
const a = E.formattedType(t.row.original);
|
|
345
|
-
return n("div", { class: "flex items-center" }, [
|
|
346
|
-
n("div", { class: "truncate text-ellipsis" }, a),
|
|
347
|
-
a.length > 20 ? n(
|
|
348
|
-
v.FmTooltip,
|
|
349
|
-
{
|
|
350
|
-
content: a
|
|
351
|
-
},
|
|
352
|
-
[
|
|
353
|
-
n(v.FmIcon, {
|
|
354
|
-
name: "info",
|
|
355
|
-
color: "primary",
|
|
356
|
-
outline: !0,
|
|
357
|
-
size: "sm"
|
|
358
|
-
})
|
|
359
|
-
]
|
|
360
|
-
) : null
|
|
361
|
-
]);
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
header: "Source",
|
|
366
|
-
accessorKey: "source",
|
|
367
|
-
cell(t) {
|
|
368
|
-
var a;
|
|
369
|
-
return n("div", { class: "flex items-center gap-4" }, [
|
|
370
|
-
n(
|
|
371
|
-
"div",
|
|
372
|
-
{ class: "truncate text-ellipsis" },
|
|
373
|
-
z(E.getReason(t.row.original.source))
|
|
374
|
-
),
|
|
375
|
-
...(a = t.row.original.metadata) != null && a.campaign ? [
|
|
376
|
-
n(
|
|
377
|
-
v.FmTooltip,
|
|
378
|
-
{
|
|
379
|
-
get content() {
|
|
380
|
-
var g;
|
|
381
|
-
return (g = T.campaigns.all.find(
|
|
382
|
-
(y) => {
|
|
383
|
-
var i;
|
|
384
|
-
return y._id === ((i = t.row.original.metadata) == null ? void 0 : i.campaign);
|
|
385
|
-
}
|
|
386
|
-
)) == null ? void 0 : g.name;
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
[
|
|
390
|
-
n(v.FmIcon, {
|
|
391
|
-
name: "info",
|
|
392
|
-
color: "primary",
|
|
393
|
-
size: "sm",
|
|
394
|
-
onClick: async (g) => {
|
|
395
|
-
g.preventDefault(), g.stopPropagation();
|
|
396
|
-
const y = T.campaigns.all.find(
|
|
397
|
-
(i) => {
|
|
398
|
-
var I;
|
|
399
|
-
return i._id === ((I = t.row.original.metadata) == null ? void 0 : I.campaign);
|
|
400
|
-
}
|
|
401
|
-
);
|
|
402
|
-
if (y)
|
|
403
|
-
switch (y.type) {
|
|
404
|
-
case "VOUCHER":
|
|
405
|
-
case "PROMOTION":
|
|
406
|
-
case "BROADCAST":
|
|
407
|
-
await c.push({
|
|
408
|
-
name: B[`$connect-CAMPAIGN_${y.type}`]
|
|
409
|
-
});
|
|
410
|
-
break;
|
|
411
|
-
case "GAME":
|
|
412
|
-
case "CREDIT":
|
|
413
|
-
case "MISSION":
|
|
414
|
-
await c.push({
|
|
415
|
-
name: B[`$connect-PROGRAM_${y.type}`]
|
|
416
|
-
});
|
|
417
|
-
break;
|
|
418
|
-
case "POINT":
|
|
419
|
-
await c.push({
|
|
420
|
-
name: B["$connect-PROGRAM_EXPERIENCE"]
|
|
421
|
-
});
|
|
422
|
-
break;
|
|
423
|
-
case "COIN":
|
|
424
|
-
await c.push({
|
|
425
|
-
name: B["$connect-PROGRAM_POINT"]
|
|
426
|
-
});
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
})
|
|
431
|
-
]
|
|
432
|
-
)
|
|
433
|
-
] : []
|
|
434
|
-
]);
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
header: "User",
|
|
439
|
-
accessorKey: "pf_user.name",
|
|
440
|
-
cell(t) {
|
|
441
|
-
return re(t.row.original.pf_user);
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
header: "Phone No.",
|
|
446
|
-
accessorKey: "pf_user.phoneNumber",
|
|
447
|
-
accessorFn: (t) => {
|
|
448
|
-
var a;
|
|
449
|
-
return ((a = t == null ? void 0 : t.pf_user) == null ? void 0 : a.phoneNumber) || "";
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
accessorFn: (t) => t.ref,
|
|
454
|
-
header: "References",
|
|
455
|
-
accessorKey: "ref",
|
|
456
|
-
cell(t) {
|
|
457
|
-
var a, g;
|
|
458
|
-
return n("div", { class: "flex items-center justify-between gap-4" }, [
|
|
459
|
-
n("div", { class: "flex items-center" }, [
|
|
460
|
-
(a = t.row.original.metadata) != null && a.remark ? n(
|
|
461
|
-
v.FmTooltip,
|
|
462
|
-
{
|
|
463
|
-
content: (g = t.row.original.metadata) == null ? void 0 : g.remark
|
|
464
|
-
},
|
|
465
|
-
[
|
|
466
|
-
n(v.FmIcon, {
|
|
467
|
-
name: "info",
|
|
468
|
-
class: "pl-2",
|
|
469
|
-
outline: !0,
|
|
470
|
-
size: "sm"
|
|
471
|
-
})
|
|
472
|
-
]
|
|
473
|
-
) : n("div")
|
|
474
|
-
]),
|
|
475
|
-
n("div", { class: "flex-1" }, t.row.original.ref)
|
|
476
|
-
]);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
], u = A({
|
|
480
|
-
search: "",
|
|
481
|
-
"pf_collectible.type": [],
|
|
482
|
-
"metadata.location": [],
|
|
483
|
-
dateRange: {
|
|
484
|
-
startDate: w().subtract(7, "day").toISOString(),
|
|
485
|
-
endDate: w().endOf("day").toISOString()
|
|
486
|
-
},
|
|
487
|
-
source: []
|
|
488
|
-
}), { tableMeta: C, rowData: P, onSort: d, debouncedFetchData: o, onSearch: e } = oe(async (t) => {
|
|
489
|
-
const a = {
|
|
490
|
-
...u.value,
|
|
491
|
-
user: x.user,
|
|
492
|
-
dateRange: {
|
|
493
|
-
start: new Date(u.value.dateRange.startDate).toISOString(),
|
|
494
|
-
end: new Date(u.value.dateRange.endDate).toISOString()
|
|
495
|
-
}
|
|
496
|
-
}, g = await L.readAll(t, a);
|
|
497
|
-
return {
|
|
498
|
-
resources: g.resources.map((y) => {
|
|
499
|
-
const i = l.value.find((I) => I._id === y.ref);
|
|
500
|
-
return { ...y, ref: (i == null ? void 0 : i.seqNumber) || y.ref };
|
|
501
|
-
}),
|
|
502
|
-
meta: g.meta
|
|
503
|
-
};
|
|
504
|
-
}), l = A([]), r = ee.options.map((t) => ({ label: z(E.getReason(t)), value: t })), _ = p.locations.map((t) => ({ label: t.name, value: t._id }));
|
|
505
|
-
Z(
|
|
506
|
-
u,
|
|
507
|
-
() => {
|
|
508
|
-
o();
|
|
509
|
-
},
|
|
510
|
-
{ deep: !0 }
|
|
511
|
-
);
|
|
512
|
-
async function f() {
|
|
513
|
-
try {
|
|
514
|
-
b.value = !0;
|
|
515
|
-
const t = {
|
|
516
|
-
...u.value,
|
|
517
|
-
user: x.user,
|
|
518
|
-
dateRange: {
|
|
519
|
-
start: new Date(u.value.dateRange.startDate).toISOString(),
|
|
520
|
-
end: new Date(u.value.dateRange.endDate).toISOString()
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
await le({
|
|
524
|
-
exporter: new De(),
|
|
525
|
-
readFunction: (a) => L.readAll(a, t),
|
|
526
|
-
transformRecord: (a) => {
|
|
527
|
-
var g, y, i, I, V, Y, U;
|
|
528
|
-
return {
|
|
529
|
-
TransactionID: a._id,
|
|
530
|
-
CreatedAt: w(k(a._id.toString())).format(
|
|
531
|
-
"D MMM YYYY, hh:mmA"
|
|
532
|
-
),
|
|
533
|
-
Amount: j(
|
|
534
|
-
a.expiryAmount.reduce(
|
|
535
|
-
(ce, ue) => ce + ue.amount,
|
|
536
|
-
a.amount ?? 0
|
|
537
|
-
),
|
|
538
|
-
2
|
|
539
|
-
),
|
|
540
|
-
ExpiredAt: (y = (g = a.expiryAmount) == null ? void 0 : g[0]) != null && y.expiredAt ? w((I = (i = a.expiryAmount) == null ? void 0 : i[0]) == null ? void 0 : I.expiredAt).format("D MMM YYYY") : "",
|
|
541
|
-
Type: E.formattedType(a),
|
|
542
|
-
Source: z(E.getReason(a.source)),
|
|
543
|
-
User: ((V = a.pf_user) == null ? void 0 : V.name) || "",
|
|
544
|
-
"Phone No.": ((Y = a.pf_user) == null ? void 0 : Y.phoneNumber) || "",
|
|
545
|
-
References: a.ref,
|
|
546
|
-
Remark: ((U = a.metadata) == null ? void 0 : U.remark) || ""
|
|
547
|
-
};
|
|
548
|
-
},
|
|
549
|
-
filename: "transactions"
|
|
550
|
-
});
|
|
551
|
-
} catch (t) {
|
|
552
|
-
console.error(t);
|
|
553
|
-
} finally {
|
|
554
|
-
b.value = !1;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
const R = A(null);
|
|
558
|
-
function N(t) {
|
|
559
|
-
var a;
|
|
560
|
-
console.log(t), (a = R.value) == null || a.showSheet(!0, t.original);
|
|
561
|
-
}
|
|
562
|
-
return fe(async () => {
|
|
563
|
-
await p.readLocations(), await T.read(), await o();
|
|
564
|
-
}), (t, a) => {
|
|
565
|
-
const g = M("FmSearch"), y = M("FmButton");
|
|
566
|
-
return F(), O(H, null, [
|
|
567
|
-
h("div", null, [
|
|
568
|
-
h("div", Ve, [
|
|
569
|
-
S(g, {
|
|
570
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
571
|
-
modelValue: s(u).search,
|
|
572
|
-
"onUpdate:modelValue": a[0] || (a[0] = (i) => s(u).search = i),
|
|
573
|
-
placeholder: "Search",
|
|
574
|
-
collapsible: ""
|
|
575
|
-
}, null, 8, ["modelValue"]),
|
|
576
|
-
S(y, {
|
|
577
|
-
icon: "ios_share",
|
|
578
|
-
variant: "tertiary",
|
|
579
|
-
onClick: f
|
|
580
|
-
})
|
|
581
|
-
]),
|
|
582
|
-
h("div", Ye, [
|
|
583
|
-
h("div", Ue, [
|
|
584
|
-
S(G, {
|
|
585
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
586
|
-
"right-icon": "keyboard_arrow_down",
|
|
587
|
-
modelValue: s(u)["metadata.location"],
|
|
588
|
-
"onUpdate:modelValue": a[1] || (a[1] = (i) => s(u)["metadata.location"] = i),
|
|
589
|
-
icon: "storefront",
|
|
590
|
-
"show-item-label": !0,
|
|
591
|
-
items: s(_)
|
|
592
|
-
}, null, 8, ["modelValue", "items"]),
|
|
593
|
-
S(G, {
|
|
594
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
595
|
-
"right-icon": "keyboard_arrow_down",
|
|
596
|
-
modelValue: s(u)["pf_collectible.type"],
|
|
597
|
-
"onUpdate:modelValue": a[2] || (a[2] = (i) => s(u)["pf_collectible.type"] = i),
|
|
598
|
-
label: "Type: ",
|
|
599
|
-
"show-item-label": !0,
|
|
600
|
-
items: [
|
|
601
|
-
{ label: "Point", value: "COIN" },
|
|
602
|
-
{ label: "Credit", value: "CREDIT" },
|
|
603
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
604
|
-
{ label: "Experience", value: "POINT" },
|
|
605
|
-
{ label: "Tier", value: "TIER" },
|
|
606
|
-
{ label: "Title", value: "TITLE" },
|
|
607
|
-
{ label: "Game", value: "GAME" },
|
|
608
|
-
{ label: "Stamp", value: "STAMP" }
|
|
609
|
-
]
|
|
610
|
-
}, null, 8, ["modelValue"]),
|
|
611
|
-
S(G, {
|
|
612
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
613
|
-
"right-icon": "keyboard_arrow_down",
|
|
614
|
-
modelValue: s(u).source,
|
|
615
|
-
"onUpdate:modelValue": a[3] || (a[3] = (i) => s(u).source = i),
|
|
616
|
-
label: "Source: ",
|
|
617
|
-
"show-item-label": !0,
|
|
618
|
-
items: s(r)
|
|
619
|
-
}, null, 8, ["modelValue", "items"]),
|
|
620
|
-
S(ae, {
|
|
621
|
-
"model-value": {
|
|
622
|
-
startDate: s(u).dateRange.startDate,
|
|
623
|
-
endDate: s(u).dateRange.endDate
|
|
624
|
-
},
|
|
625
|
-
"onUpdate:modelValue": a[4] || (a[4] = (i) => s(u).dateRange = {
|
|
626
|
-
startDate: s(w)(i.startDate).startOf("d").toISOString(),
|
|
627
|
-
endDate: s(w)(i.endDate).endOf("d").toISOString()
|
|
628
|
-
})
|
|
629
|
-
}, null, 8, ["model-value"])
|
|
630
|
-
]),
|
|
631
|
-
S(g, {
|
|
632
|
-
class: "xs:hidden",
|
|
633
|
-
modelValue: s(u).search,
|
|
634
|
-
"onUpdate:modelValue": a[5] || (a[5] = (i) => s(u).search = i),
|
|
635
|
-
placeholder: "Search",
|
|
636
|
-
collapsible: ""
|
|
637
|
-
}, null, 8, ["modelValue"]),
|
|
638
|
-
h("div", $e, [
|
|
639
|
-
S(y, {
|
|
640
|
-
icon: "ios_share",
|
|
641
|
-
variant: "tertiary",
|
|
642
|
-
onClick: f
|
|
643
|
-
})
|
|
644
|
-
])
|
|
645
|
-
]),
|
|
646
|
-
S(ne, {
|
|
647
|
-
loading: s(C).isLoading,
|
|
648
|
-
"row-data": s(P),
|
|
649
|
-
"row-count": s(C).totalRows,
|
|
650
|
-
"column-defs": D.filter(
|
|
651
|
-
(i) => !x.user || i.header !== "User" && i.header !== "Phone No."
|
|
652
|
-
),
|
|
653
|
-
"page-count": s(C).pageCount,
|
|
654
|
-
"page-index": s(C).pageIndex,
|
|
655
|
-
"page-size": s(C).pageSize,
|
|
656
|
-
"shrink-at": !1,
|
|
657
|
-
onSortChange: s(d),
|
|
658
|
-
onPageChange: a[6] || (a[6] = (i) => s(o)({
|
|
659
|
-
pageSize: i.pageSize,
|
|
660
|
-
pageIndex: i.pageIndex
|
|
661
|
-
})),
|
|
662
|
-
onRowClick: N
|
|
663
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
664
|
-
]),
|
|
665
|
-
S(Pe, {
|
|
666
|
-
ref_key: "transactionDetailSheet",
|
|
667
|
-
ref: R
|
|
668
|
-
}, null, 512)
|
|
669
|
-
], 64);
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
class Be extends se {
|
|
674
|
-
}
|
|
675
|
-
const ze = { class: "flex items-center justify-between" }, Le = { class: "flex gap-8 items-center" }, Ke = { class: "flex gap-8 items-center xs:hidden" }, ba = /* @__PURE__ */ q({
|
|
676
|
-
__name: "StoreTransactions",
|
|
677
|
-
props: {
|
|
678
|
-
user: {
|
|
679
|
-
type: String
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
setup(m) {
|
|
683
|
-
const p = m, { minor: T } = xe;
|
|
684
|
-
ye();
|
|
685
|
-
const c = [
|
|
686
|
-
{
|
|
687
|
-
header: "Transaction ID",
|
|
688
|
-
meta: {
|
|
689
|
-
maxWidth: "150px"
|
|
690
|
-
},
|
|
691
|
-
cell(e) {
|
|
692
|
-
return n("div", { class: "flex items-center" }, [
|
|
693
|
-
n(v.FmIcon, {
|
|
694
|
-
name: "content_copy",
|
|
695
|
-
outline: !0,
|
|
696
|
-
size: "sm",
|
|
697
|
-
class: "cursor-pointer mr-4 shrink-0",
|
|
698
|
-
onClick: (l) => {
|
|
699
|
-
l.preventDefault(), l.stopPropagation(), W(e.row.original._id.toString());
|
|
700
|
-
}
|
|
701
|
-
}),
|
|
702
|
-
n("div", { class: "truncate" }, e.row.original._id.toString())
|
|
703
|
-
]);
|
|
704
|
-
}
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
header: "Created at",
|
|
708
|
-
accessorFn: (e) => w(k(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
709
|
-
enableSorting: !0
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
header: "Bundle",
|
|
713
|
-
accessorFn: (e) => e.bundle.name
|
|
714
|
-
},
|
|
715
|
-
{
|
|
716
|
-
header: "Location",
|
|
717
|
-
accessorFn: (e) => e.location ? e.pf_location.name : "Online Store"
|
|
718
|
-
},
|
|
719
|
-
{
|
|
720
|
-
header: "Payment Type",
|
|
721
|
-
accessorFn: (e) => {
|
|
722
|
-
var l;
|
|
723
|
-
return ((l = e.paymentType) == null ? void 0 : l.type) ?? "N/A";
|
|
724
|
-
},
|
|
725
|
-
cell(e) {
|
|
726
|
-
var l, r;
|
|
727
|
-
return n("div", { class: "flex items-center gap-4" }, [
|
|
728
|
-
n("div", { class: "flex items-center" }, [
|
|
729
|
-
((l = e.row.original.paymentType) == null ? void 0 : l.type) == "ONLINE" && e.row.original.paymentType.extra ? n(
|
|
730
|
-
v.FmTooltip,
|
|
731
|
-
{
|
|
732
|
-
content: e.row.original.paymentType.extra
|
|
733
|
-
},
|
|
734
|
-
[
|
|
735
|
-
n(v.FmIcon, {
|
|
736
|
-
name: "info",
|
|
737
|
-
outline: !0,
|
|
738
|
-
size: "sm"
|
|
739
|
-
})
|
|
740
|
-
]
|
|
741
|
-
) : n("div")
|
|
742
|
-
]),
|
|
743
|
-
n(
|
|
744
|
-
"div",
|
|
745
|
-
{ class: "flex-1" },
|
|
746
|
-
((r = e.row.original.paymentType) == null ? void 0 : r.type) ?? "N/A"
|
|
747
|
-
)
|
|
748
|
-
]);
|
|
749
|
-
}
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
header: "User",
|
|
753
|
-
cell: (e) => re(e.row.original.pf_member)
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
header: "Phone No.",
|
|
757
|
-
accessorFn: (e) => e.pf_member.phoneNumber
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
header: "Status",
|
|
761
|
-
// accessorFn: (u) => u.status,
|
|
762
|
-
cell(e) {
|
|
763
|
-
var l, r, _, f;
|
|
764
|
-
return n("div", { class: "flex items-center" }, [
|
|
765
|
-
n("div", he.title(e.row.original.status)),
|
|
766
|
-
n("div", { class: "flex items-center" }, [
|
|
767
|
-
(r = (l = e.row.original) == null ? void 0 : l.refund) != null && r.reason ? n(
|
|
768
|
-
v.FmTooltip,
|
|
769
|
-
{
|
|
770
|
-
content: (f = (_ = e.row.original) == null ? void 0 : _.refund) == null ? void 0 : f.reason
|
|
771
|
-
},
|
|
772
|
-
[
|
|
773
|
-
n(v.FmIcon, {
|
|
774
|
-
name: "info",
|
|
775
|
-
color: "primary",
|
|
776
|
-
outline: !0,
|
|
777
|
-
size: "sm",
|
|
778
|
-
class: "pl-2"
|
|
779
|
-
})
|
|
780
|
-
]
|
|
781
|
-
) : n("div")
|
|
782
|
-
])
|
|
783
|
-
]);
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
header: "Source",
|
|
788
|
-
accessorFn: (e) => e.source
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
header: "Ref",
|
|
792
|
-
accessorFn: (e) => e.ref
|
|
793
|
-
},
|
|
794
|
-
{
|
|
795
|
-
id: "action",
|
|
796
|
-
cell(e) {
|
|
797
|
-
const l = e.row.original, r = l.status === "COMPLETED" && !l.refund;
|
|
798
|
-
return r ? n(
|
|
799
|
-
v.FmMenu,
|
|
800
|
-
{
|
|
801
|
-
placement: "bottom-end",
|
|
802
|
-
onClick: (_) => {
|
|
803
|
-
_.stopPropagation();
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
"menu-button": () => n(v.FmButton, {
|
|
808
|
-
icon: "settings",
|
|
809
|
-
variant: "tertiary",
|
|
810
|
-
if: r
|
|
811
|
-
}),
|
|
812
|
-
default: () => [
|
|
813
|
-
n(v.FmMenuItem, {
|
|
814
|
-
label: "Refund",
|
|
815
|
-
sublabel: "Refund this transaction",
|
|
816
|
-
onClick: async (_) => {
|
|
817
|
-
_.stopPropagation(), await d(l);
|
|
818
|
-
}
|
|
819
|
-
})
|
|
820
|
-
]
|
|
821
|
-
}
|
|
822
|
-
) : n("div");
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
], x = A({
|
|
826
|
-
searchValue: "",
|
|
827
|
-
dateRange: {
|
|
828
|
-
startDate: w().subtract(7, "day").toISOString(),
|
|
829
|
-
endDate: w().toISOString()
|
|
830
|
-
}
|
|
831
|
-
}), { tableMeta: b, rowData: D, onSort: u, debouncedFetchData: C, onSearch: P } = oe(async (e) => {
|
|
832
|
-
const l = {
|
|
833
|
-
...x.value.dateRange,
|
|
834
|
-
user: p.user
|
|
835
|
-
};
|
|
836
|
-
return await L.readStoreTransactions(e, l);
|
|
837
|
-
});
|
|
838
|
-
async function d(e) {
|
|
839
|
-
await ve.confirm(
|
|
840
|
-
"Are you sure you want to refund this transaction?",
|
|
841
|
-
"Refund Store Transaction",
|
|
842
|
-
"Confirm",
|
|
843
|
-
"Cancel"
|
|
844
|
-
) && await T(
|
|
845
|
-
async () => {
|
|
846
|
-
var r;
|
|
847
|
-
await Te.refundStoreTransaction({
|
|
848
|
-
id: e._id,
|
|
849
|
-
reason: `ADMIN:${(r = we().sessionUser) == null ? void 0 : r.name}`
|
|
850
|
-
}), await C();
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
message: "Refunding transaction...",
|
|
854
|
-
successMessage: "Transaction refunded successfully"
|
|
855
|
-
}
|
|
856
|
-
);
|
|
857
|
-
}
|
|
858
|
-
Z(
|
|
859
|
-
x,
|
|
860
|
-
() => {
|
|
861
|
-
C();
|
|
862
|
-
},
|
|
863
|
-
{ deep: !0 }
|
|
864
|
-
), ge(async () => {
|
|
865
|
-
await C();
|
|
866
|
-
});
|
|
867
|
-
const o = async () => le({
|
|
868
|
-
exporter: new Be(),
|
|
869
|
-
readFunction: (e) => L.readStoreTransactions(e, {
|
|
870
|
-
...x.value.dateRange,
|
|
871
|
-
user: p.user
|
|
872
|
-
}),
|
|
873
|
-
transformRecord: (e) => {
|
|
874
|
-
var l, r, _, f, R, N;
|
|
875
|
-
return {
|
|
876
|
-
TransactionId: ((l = e._id) == null ? void 0 : l.toString()) || "",
|
|
877
|
-
CreatedAt: w(k(e._id.toString())).format(
|
|
878
|
-
"DD/MM/YYYY HH:mm:ss"
|
|
879
|
-
),
|
|
880
|
-
Bundle: e.bundle.name || "",
|
|
881
|
-
Location: e.location ? e.pf_location.name : "Online Store",
|
|
882
|
-
PaymentType: ((r = e.paymentType) == null ? void 0 : r.type) || "N/A",
|
|
883
|
-
PaymentExtra: ((_ = e.paymentType) == null ? void 0 : _.extra) || "",
|
|
884
|
-
User: ((f = e.pf_member) == null ? void 0 : f.name) || "",
|
|
885
|
-
PhoneNumber: ((R = e.pf_member) == null ? void 0 : R.phoneNumber) || "",
|
|
886
|
-
Status: e.status || "",
|
|
887
|
-
RefundReason: ((N = e == null ? void 0 : e.refund) == null ? void 0 : N.reason) || ""
|
|
888
|
-
};
|
|
889
|
-
},
|
|
890
|
-
filename: "store-transactions"
|
|
891
|
-
});
|
|
892
|
-
return (e, l) => {
|
|
893
|
-
const r = M("FmSearch"), _ = M("FmButton");
|
|
894
|
-
return F(), O("div", null, [
|
|
895
|
-
h("div", ze, [
|
|
896
|
-
h("div", Le, [
|
|
897
|
-
S(ae, {
|
|
898
|
-
modelValue: s(x).dateRange,
|
|
899
|
-
"onUpdate:modelValue": l[0] || (l[0] = (f) => s(x).dateRange = f)
|
|
900
|
-
}, null, 8, ["modelValue"])
|
|
901
|
-
]),
|
|
902
|
-
h("div", Ke, [
|
|
903
|
-
S(r, {
|
|
904
|
-
modelValue: s(b).searchValue,
|
|
905
|
-
"onUpdate:modelValue": [
|
|
906
|
-
l[1] || (l[1] = (f) => s(b).searchValue = f),
|
|
907
|
-
s(P)
|
|
908
|
-
],
|
|
909
|
-
placeholder: "Search",
|
|
910
|
-
collapsible: ""
|
|
911
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
912
|
-
S(_, {
|
|
913
|
-
icon: "ios_share",
|
|
914
|
-
variant: "tertiary",
|
|
915
|
-
onClick: o
|
|
916
|
-
})
|
|
917
|
-
])
|
|
918
|
-
]),
|
|
919
|
-
S(ne, {
|
|
920
|
-
loading: s(b).isLoading,
|
|
921
|
-
"row-data": s(D),
|
|
922
|
-
"row-count": s(b).totalRows,
|
|
923
|
-
"column-defs": c.filter(
|
|
924
|
-
(f) => !p.user || f.header !== "User" && f.header !== "Phone No."
|
|
925
|
-
),
|
|
926
|
-
"page-count": s(b).pageCount,
|
|
927
|
-
"page-index": s(b).pageIndex,
|
|
928
|
-
"page-size": s(b).pageSize,
|
|
929
|
-
"shrink-at": !1,
|
|
930
|
-
onSortChange: s(u),
|
|
931
|
-
onPageChange: l[2] || (l[2] = (f) => s(C)({
|
|
932
|
-
pageSize: f.pageSize,
|
|
933
|
-
pageIndex: f.pageIndex
|
|
934
|
-
}))
|
|
935
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
936
|
-
]);
|
|
937
|
-
};
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
export {
|
|
941
|
-
_a as _,
|
|
942
|
-
ba as a
|
|
943
|
-
};
|