@feedmepos/mf-connect 0.1.57-prod → 0.1.58-prod
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/package.json +1 -1
- package/dist/Analytic-BqvhYgCU.js +0 -427
- package/dist/App-Dtl_D0cH.js +0 -4630
- package/dist/Bin-y4ikpgPS.js +0 -166
- package/dist/Broadcast-DSROFwe4.js +0 -233
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
- package/dist/Card-BiSEPsZb.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CX-nN7Xj.js +0 -458
- package/dist/Credit-IiV9b4cB.js +0 -228
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
- package/dist/Experience-Cf-EMhKy.js +0 -229
- package/dist/FileSaver.min-NlMItPOc.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C8mfJn6W.js +0 -284
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
- package/dist/Index-DkvO1AoT.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-xJTIo3RF.js +0 -319
- package/dist/Member-DZkYoKW8.js +0 -279
- package/dist/MemberList-CAYEJnf3.js +0 -1607
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
- package/dist/Mission-C_NbNWZw.js +0 -302
- package/dist/Overview-DyxEwEfe.js +0 -1079
- package/dist/Point-CsEWk61V.js +0 -232
- package/dist/Promotion--pWgy9Dx.js +0 -289
- package/dist/Queue-k3qAQR7B.js +0 -260
- package/dist/Record-D5F5JyVA.js +0 -341
- package/dist/Reward-3FSrq5mX.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
- package/dist/Segment-BWJn6ODR.js +0 -882
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
- package/dist/Setting-UiTXazZV.js +0 -1936
- package/dist/Store-BrvmHPCX.js +0 -1842
- package/dist/StoreRewards-D_7fr-Ef.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
- package/dist/Tier-C4wvx8F7.js +0 -895
- package/dist/Title-CPHT85Uj.js +0 -566
- package/dist/Transaction-6Ig2W00P.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
- package/dist/Voucher-Bbl-7gZ5.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BDVZwARN.js +0 -7057
- package/dist/app-CAEhNFRG.js +0 -57962
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -6
- package/dist/business-6C_ol5wd.js +0 -82
- package/dist/campaign-B13G6pZ3.js +0 -1810
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DrQp6qBu.js +0 -94
- package/dist/campaign.enum-DnTrlaNC.js +0 -20
- package/dist/campaign.fn-BZse90_k.js +0 -758
- package/dist/collectible.enum-633Me0yR.js +0 -19
- package/dist/collection.fn-C96855j5.js +0 -26
- package/dist/dto-2bMujqmZ.js +0 -216
- package/dist/effect-C7lAJwKh.js +0 -78
- package/dist/email-addresses-3ayN-9jv.js +0 -705
- package/dist/export-BNbDV7SC.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/helper-CsfZ__dQ.js +0 -71
- package/dist/index-BLSAz0gK.js +0 -32
- package/dist/index-BY9I3Cer.js +0 -3
- package/dist/index-BdnRNcVO.js +0 -146
- package/dist/index-BmyNfpfG.js +0 -30076
- package/dist/index-CSBRkhKy.js +0 -38
- package/dist/index-Cf_fcvoS.js +0 -54
- package/dist/index-CqrO13uj.js +0 -76
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D4kdSzs9.js +0 -3070
- package/dist/index-DcJq7tl4.js +0 -32269
- package/dist/index-DdjSIwSL.js +0 -44
- package/dist/index-LKr2k8J2.js +0 -8861
- package/dist/index-XAxwm-1v.js +0 -2130
- package/dist/index-b82LrGSB.js +0 -121
- package/dist/index-tcAb0W5F.js +0 -31
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-BklqmujQ.js +0 -3069
- package/dist/loading-OXARGiqO.js +0 -71
- package/dist/lodash-B5I3zXaY.js +0 -3678
- package/dist/membership-D1Vb1rUo.js +0 -235
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-BpyAytEq.js +0 -15
- package/dist/number-C-PtPOOj.js +0 -12
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-BrLIKTmQ.js +0 -145
- package/dist/plugins-CjPWhNb2.js +0 -208
- package/dist/reward-DonQFzvW.js +0 -36
- package/dist/rule-AtNPBnbE.js +0 -1951
- package/dist/rule-builder-C0Q-3g6T.js +0 -102
- package/dist/style.css +0 -4
- package/dist/template-CNjE7eht.js +0 -190
- package/dist/tier-BJDhpH6X.js +0 -4
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-CYbdI3q2.js +0 -1151
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-Bdi6n80h.js +0 -144
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/usePagination-Ds-cuHop.js +0 -223
- package/dist/user-BwGm78n8.js +0 -54
- package/dist/vue-i18n-D1nTd69a.js +0 -2365
- package/dist/xlsx-DF5iW3wh.js +0 -15491
- package/dist/zod-Bg2FbC-D.js +0 -90
|
@@ -1,995 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, mergeModels as ee, useModel as fe, computed as U, onMounted as ae, watch as Q, resolveComponent as A, openBlock as F, createBlock as q, withCtx as W, createVNode as D, unref as l, ref as O, h as n, isRef as ge, createElementVNode as S, createElementBlock as V, Fragment as X, renderList as te, toDisplayString as L, createTextVNode as ye, resolveDynamicComponent as he, onBeforeMount as ve } from "vue";
|
|
2
|
-
import { components as x, useDialog as be } from "@feedmepos/ui-library";
|
|
3
|
-
import { r as oe } from "./index-D4kdSzs9.js";
|
|
4
|
-
import "./index-DcJq7tl4.js";
|
|
5
|
-
import { s as _e } from "./index-tcAb0W5F.js";
|
|
6
|
-
import { h as y } from "./moment-D7p2TMB-.js";
|
|
7
|
-
import { _ as j } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
8
|
-
import { s as K } from "./index-CuvNtC_M.js";
|
|
9
|
-
import { f as J } from "./number-C-PtPOOj.js";
|
|
10
|
-
import { u as ne } from "./business-6C_ol5wd.js";
|
|
11
|
-
import { u as re, _ as le } from "./usePagination-Ds-cuHop.js";
|
|
12
|
-
import { a as Z, c as Se, p as xe } from "./plugins-CjPWhNb2.js";
|
|
13
|
-
import { g as se } from "./user-BwGm78n8.js";
|
|
14
|
-
import { B as ie, e as ce } from "./export-BNbDV7SC.js";
|
|
15
|
-
import { u as ue } from "./campaign-DrQp6qBu.js";
|
|
16
|
-
import "./index-BY9I3Cer.js";
|
|
17
|
-
import "./index-LKr2k8J2.js";
|
|
18
|
-
import "./index-XAxwm-1v.js";
|
|
19
|
-
import "./index-CSBRkhKy.js";
|
|
20
|
-
import "./index-Cf_fcvoS.js";
|
|
21
|
-
import { u as we } from "./vue-i18n-D1nTd69a.js";
|
|
22
|
-
import { o as P } from "./objectId-dwaoBfJX.js";
|
|
23
|
-
import { useRouter as De } from "vue-router";
|
|
24
|
-
import { t as G } from "./index-DdjSIwSL.js";
|
|
25
|
-
import { R as z } from "./app-BDVZwARN.js";
|
|
26
|
-
import { u as Re } from "./loading-OXARGiqO.js";
|
|
27
|
-
import { useCoreStore as Te } from "@feedmepos/mf-common";
|
|
28
|
-
import { m as Ce } from "./index-BdnRNcVO.js";
|
|
29
|
-
function Ie(u) {
|
|
30
|
-
let f = "";
|
|
31
|
-
switch (u) {
|
|
32
|
-
case "PORTAL":
|
|
33
|
-
f = "ADMIN";
|
|
34
|
-
break;
|
|
35
|
-
case "BENEFIT":
|
|
36
|
-
f = "MEMBERSHIP";
|
|
37
|
-
break;
|
|
38
|
-
case "ORDER":
|
|
39
|
-
f = "ORDER";
|
|
40
|
-
break;
|
|
41
|
-
case "BILL":
|
|
42
|
-
f = "SPENDING";
|
|
43
|
-
break;
|
|
44
|
-
case "CASHBACK":
|
|
45
|
-
f = "CASHBACK";
|
|
46
|
-
break;
|
|
47
|
-
case "CYCLE":
|
|
48
|
-
f = "EXPIRED";
|
|
49
|
-
break;
|
|
50
|
-
case "COUNTER_CONSUME":
|
|
51
|
-
f = "COUNTER REDEEM";
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
f = u;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
return f;
|
|
58
|
-
}
|
|
59
|
-
function Fe(u) {
|
|
60
|
-
var f, b, c, m, _, T;
|
|
61
|
-
switch ((f = u == null ? void 0 : u.pf_collectible) == null ? void 0 : f.type) {
|
|
62
|
-
case "VOUCHER":
|
|
63
|
-
return `${(b = u.pf_collectible) == null ? void 0 : b.type} (${(c = u.pf_collectible) == null ? void 0 : c.name})`;
|
|
64
|
-
case "TITLE":
|
|
65
|
-
return `${(m = u.pf_collectible) == null ? void 0 : m.type} (${(_ = u.pf_collectible) == null ? void 0 : _.name})`;
|
|
66
|
-
case "POINT":
|
|
67
|
-
return "Experience";
|
|
68
|
-
case "COIN":
|
|
69
|
-
return "Point";
|
|
70
|
-
default:
|
|
71
|
-
return _e((T = u == null ? void 0 : u.pf_collectible) == null ? void 0 : T.type);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function Ee(u) {
|
|
75
|
-
switch (u) {
|
|
76
|
-
case "ONLINE":
|
|
77
|
-
return "Online";
|
|
78
|
-
case "COIN":
|
|
79
|
-
return "Point";
|
|
80
|
-
default:
|
|
81
|
-
return u;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const E = {
|
|
85
|
-
getReason: Ie,
|
|
86
|
-
formattedType: Fe,
|
|
87
|
-
formattedPaymentType: Ee
|
|
88
|
-
}, k = "YYYY-MM-DD", de = /* @__PURE__ */ H({
|
|
89
|
-
__name: "DateRangeChip",
|
|
90
|
-
props: /* @__PURE__ */ ee({
|
|
91
|
-
modelValue: {
|
|
92
|
-
type: Object,
|
|
93
|
-
required: !0
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
dateRange: {
|
|
97
|
-
type: Object,
|
|
98
|
-
default: () => ({
|
|
99
|
-
startDate: y().subtract(7, "day").format(k),
|
|
100
|
-
endDate: y().endOf("day").format(k)
|
|
101
|
-
})
|
|
102
|
-
},
|
|
103
|
-
dateRangeModifiers: {}
|
|
104
|
-
}),
|
|
105
|
-
emits: /* @__PURE__ */ ee(["update:model-value"], ["update:dateRange"]),
|
|
106
|
-
setup(u, { emit: f }) {
|
|
107
|
-
const b = u, c = f, m = fe(u, "dateRange"), _ = U(() => m.value ? `${T.value.startDate ?? "Start"} - ${T.value.endDate ?? "End"}` : "No dates selected."), T = U(() => ({
|
|
108
|
-
startDate: m.value.startDate ? y(m.value.startDate).format(k) : void 0,
|
|
109
|
-
endDate: m.value.endDate ? y(m.value.endDate).format(k) : void 0
|
|
110
|
-
}));
|
|
111
|
-
return ae(() => {
|
|
112
|
-
m.value = {
|
|
113
|
-
startDate: b.modelValue.startDate ? y(b.modelValue.startDate).format(k) : void 0,
|
|
114
|
-
endDate: b.modelValue.endDate ? y(b.modelValue.endDate).format(k) : void 0
|
|
115
|
-
};
|
|
116
|
-
}), Q(
|
|
117
|
-
() => m.value,
|
|
118
|
-
() => {
|
|
119
|
-
c("update:model-value", T.value);
|
|
120
|
-
}
|
|
121
|
-
), (d, R) => {
|
|
122
|
-
const N = A("FmChip"), p = A("FmDateRangePicker");
|
|
123
|
-
return F(), q(p, {
|
|
124
|
-
modelValue: m.value,
|
|
125
|
-
"onUpdate:modelValue": R[0] || (R[0] = (a) => m.value = a),
|
|
126
|
-
"show-predefined-range": ""
|
|
127
|
-
}, {
|
|
128
|
-
"trigger-button": W(() => [
|
|
129
|
-
D(N, {
|
|
130
|
-
label: l(_),
|
|
131
|
-
icon: "calendar_month",
|
|
132
|
-
"right-icon": "keyboard_arrow_down",
|
|
133
|
-
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
134
|
-
}, null, 8, ["label"])
|
|
135
|
-
]),
|
|
136
|
-
_: 1
|
|
137
|
-
}, 8, ["modelValue"]);
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
class Ae extends ie {
|
|
142
|
-
}
|
|
143
|
-
const Ne = { class: "space-y-24 pr-12" }, Oe = { class: "w-full space-y-16" }, Me = { class: "fm-typo-en-body-lg-600" }, ke = ["onClick"], Ve = { class: "fm-typo-en-body-lg-600" }, Pe = ["onClick"], Ye = { class: "flex items-center gap-8" }, Ue = /* @__PURE__ */ H({
|
|
144
|
-
__name: "TransactionDetailSheet",
|
|
145
|
-
setup(u, { expose: f }) {
|
|
146
|
-
we();
|
|
147
|
-
const b = O(!1), c = O(), m = ue(), _ = ne();
|
|
148
|
-
function T(p, a) {
|
|
149
|
-
b.value = p, c.value = a ?? null;
|
|
150
|
-
}
|
|
151
|
-
const d = U(() => {
|
|
152
|
-
var p, a;
|
|
153
|
-
return J(
|
|
154
|
-
((a = c.value) == null ? void 0 : a.expiryAmount.reduce(
|
|
155
|
-
(e, s) => e + s.amount,
|
|
156
|
-
((p = c.value) == null ? void 0 : p.amount) ?? 0
|
|
157
|
-
)) ?? 0,
|
|
158
|
-
2
|
|
159
|
-
);
|
|
160
|
-
}), R = U(() => {
|
|
161
|
-
var p, a, e, s, r;
|
|
162
|
-
return c.value ? [
|
|
163
|
-
{
|
|
164
|
-
label: "Transaction ID",
|
|
165
|
-
value: (p = c.value) == null ? void 0 : p._id
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
label: "Date/Time",
|
|
169
|
-
value: y(P(c.value._id.toString())).format(
|
|
170
|
-
"D MMM YYYY, hh:mmA"
|
|
171
|
-
)
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
label: "Amount",
|
|
175
|
-
component: () => n(
|
|
176
|
-
"span",
|
|
177
|
-
{
|
|
178
|
-
class: [
|
|
179
|
-
"pr-2",
|
|
180
|
-
+d.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
d.value
|
|
184
|
-
)
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
label: "Type",
|
|
188
|
-
value: E.formattedType(c.value)
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
label: "Source",
|
|
192
|
-
value: K(E.getReason(c.value.source))
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
label: "User",
|
|
196
|
-
value: (e = (a = c.value) == null ? void 0 : a.pf_user) == null ? void 0 : e.name
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
label: "Phone Number",
|
|
200
|
-
value: (r = (s = c.value) == null ? void 0 : s.pf_user) == null ? void 0 : r.phoneNumber
|
|
201
|
-
}
|
|
202
|
-
] : [];
|
|
203
|
-
}), N = U(() => {
|
|
204
|
-
var s, r, w, g;
|
|
205
|
-
if (!c.value) return [];
|
|
206
|
-
const p = [], a = (s = c.value) == null ? void 0 : s.metadata, e = c.value;
|
|
207
|
-
if (a != null && a.campaign) {
|
|
208
|
-
const C = m.campaigns.all.find(
|
|
209
|
-
(M) => M._id === (a == null ? void 0 : a.campaign)
|
|
210
|
-
);
|
|
211
|
-
if (!C) return;
|
|
212
|
-
p.push({
|
|
213
|
-
label: "Campaign",
|
|
214
|
-
value: C.name
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
return a != null && a.remark && p.push({
|
|
218
|
-
label: "Remark",
|
|
219
|
-
value: a.remark
|
|
220
|
-
}), (r = c.value) != null && r.ref.startsWith("bill_") && p.push({
|
|
221
|
-
label: "Bill Number",
|
|
222
|
-
value: (w = c.value) == null ? void 0 : w.ref,
|
|
223
|
-
copy: () => {
|
|
224
|
-
var C;
|
|
225
|
-
return Z((C = c.value) == null ? void 0 : C.ref);
|
|
226
|
-
}
|
|
227
|
-
}), a != null && a.location && p.push({
|
|
228
|
-
label: "Location",
|
|
229
|
-
value: (g = _.locations.find(
|
|
230
|
-
(C) => C._id.toString() === (a == null ? void 0 : a.location)
|
|
231
|
-
)) == null ? void 0 : g.name
|
|
232
|
-
}), e.source === oe.enum.STORE && p.push({
|
|
233
|
-
label: "Store Transaction",
|
|
234
|
-
value: e.ref
|
|
235
|
-
}), a != null && a.originTransaction && p.push({
|
|
236
|
-
label: "Parent Transaction",
|
|
237
|
-
value: a.originTransaction
|
|
238
|
-
}), a != null && a.referral_count && p.push({
|
|
239
|
-
label: "Referral Count",
|
|
240
|
-
value: a.referral_count
|
|
241
|
-
}), e.refunded && p.push({
|
|
242
|
-
label: "Refunded From",
|
|
243
|
-
value: e.refundedFrom
|
|
244
|
-
}), p;
|
|
245
|
-
});
|
|
246
|
-
return f({
|
|
247
|
-
showSheet: T
|
|
248
|
-
}), (p, a) => {
|
|
249
|
-
const e = A("FmButton"), s = A("FmSideSheet");
|
|
250
|
-
return F(), q(s, {
|
|
251
|
-
"max-width": 560,
|
|
252
|
-
modelValue: l(b),
|
|
253
|
-
"onUpdate:modelValue": a[1] || (a[1] = (r) => ge(b) ? b.value = r : null),
|
|
254
|
-
header: "Transaction Details"
|
|
255
|
-
}, {
|
|
256
|
-
"side-sheet-footer": W(() => [
|
|
257
|
-
S("div", Ye, [
|
|
258
|
-
D(e, {
|
|
259
|
-
label: "Close",
|
|
260
|
-
onClick: a[0] || (a[0] = (r) => T(!1)),
|
|
261
|
-
variant: "tertiary"
|
|
262
|
-
})
|
|
263
|
-
])
|
|
264
|
-
]),
|
|
265
|
-
default: W(() => [
|
|
266
|
-
S("div", Ne, [
|
|
267
|
-
S("div", Oe, [
|
|
268
|
-
(F(!0), V(X, null, te(l(R), (r) => (F(), V("div", {
|
|
269
|
-
key: r.label,
|
|
270
|
-
class: "flex flex-col gap-4"
|
|
271
|
-
}, [
|
|
272
|
-
S("div", Me, L(r.label), 1),
|
|
273
|
-
S("div", {
|
|
274
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
275
|
-
onClick: r.copy
|
|
276
|
-
}, [
|
|
277
|
-
ye(L(r.accessorFn ? r.accessorFn() : r.value) + " ", 1),
|
|
278
|
-
(F(), q(he(r.component)))
|
|
279
|
-
], 8, ke),
|
|
280
|
-
a[2] || (a[2] = S("hr", { class: "mt-3" }, null, -1))
|
|
281
|
-
]))), 128)),
|
|
282
|
-
(F(!0), V(X, null, te(l(N), (r) => (F(), V("div", {
|
|
283
|
-
key: r.label,
|
|
284
|
-
class: "flex flex-col gap-4"
|
|
285
|
-
}, [
|
|
286
|
-
S("div", Ve, L(r.label), 1),
|
|
287
|
-
S("div", {
|
|
288
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
289
|
-
onClick: r.copy
|
|
290
|
-
}, L(r.accessorFn ? r.accessorFn() : r.value), 9, Pe),
|
|
291
|
-
a[3] || (a[3] = S("hr", { class: "mt-3" }, null, -1))
|
|
292
|
-
]))), 128))
|
|
293
|
-
])
|
|
294
|
-
])
|
|
295
|
-
]),
|
|
296
|
-
_: 1
|
|
297
|
-
}, 8, ["modelValue"]);
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
}), $e = { class: "hidden xs:flex items-center justify-end" }, Be = { class: "flex items-center justify-between" }, Le = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, ze = { class: "xs:hidden" }, xt = /* @__PURE__ */ H({
|
|
301
|
-
__name: "CollectionTransactions",
|
|
302
|
-
props: {
|
|
303
|
-
user: {
|
|
304
|
-
type: String
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
setup(u) {
|
|
308
|
-
const f = ne(), b = ue(), c = De(), m = u, _ = O(!1), T = [
|
|
309
|
-
{
|
|
310
|
-
header: "Transaction ID",
|
|
311
|
-
accessorKey: "_id",
|
|
312
|
-
meta: {
|
|
313
|
-
maxWidth: "100px"
|
|
314
|
-
},
|
|
315
|
-
cell(o) {
|
|
316
|
-
return n("div", { class: "flex items-center" }, [
|
|
317
|
-
n(x.FmIcon, {
|
|
318
|
-
name: "content_copy",
|
|
319
|
-
outline: !0,
|
|
320
|
-
size: "sm",
|
|
321
|
-
class: "cursor-pointer mr-4",
|
|
322
|
-
onClick: (t) => {
|
|
323
|
-
t.preventDefault(), t.stopPropagation(), Z(o.row.original._id.toString());
|
|
324
|
-
}
|
|
325
|
-
}),
|
|
326
|
-
n(
|
|
327
|
-
"div",
|
|
328
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
329
|
-
o.row.original._id.toString()
|
|
330
|
-
)
|
|
331
|
-
]);
|
|
332
|
-
},
|
|
333
|
-
enableSorting: !1
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
header: "Created at",
|
|
337
|
-
accessorKey: "_id",
|
|
338
|
-
accessorFn: (o) => y(P(o._id.toString())),
|
|
339
|
-
cell: (o) => y(P(o.row.original._id.toString())).format(
|
|
340
|
-
"D MMM YYYY, hh:mmA"
|
|
341
|
-
),
|
|
342
|
-
enableSorting: !0
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
header: "Amount",
|
|
346
|
-
// accessorKey: 'totalAmount',
|
|
347
|
-
enableSorting: !1,
|
|
348
|
-
cell(o) {
|
|
349
|
-
var v, i, I, Y;
|
|
350
|
-
const t = J(
|
|
351
|
-
o.row.original.expiryAmount.reduce(
|
|
352
|
-
($, B) => $ + B.amount,
|
|
353
|
-
o.row.original.amount ?? 0
|
|
354
|
-
),
|
|
355
|
-
2
|
|
356
|
-
), h = (i = (v = o.row.original.expiryAmount) == null ? void 0 : v[0]) != null && i.expiredAt ? y((Y = (I = o.row.original.expiryAmount) == null ? void 0 : I[0]) == null ? void 0 : Y.expiredAt).format(
|
|
357
|
-
"D MMM YYYY"
|
|
358
|
-
) : "";
|
|
359
|
-
return n("div", { class: "flex items-center" }, [
|
|
360
|
-
n(
|
|
361
|
-
"div",
|
|
362
|
-
{
|
|
363
|
-
class: [
|
|
364
|
-
"pr-2",
|
|
365
|
-
+t > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
366
|
-
]
|
|
367
|
-
},
|
|
368
|
-
t
|
|
369
|
-
),
|
|
370
|
-
n("div", { class: "flex items-center" }, [
|
|
371
|
-
o.row.original.expiryAmount.length > 0 ? n(
|
|
372
|
-
x.FmTooltip,
|
|
373
|
-
{
|
|
374
|
-
content: `Expired on ${h}`
|
|
375
|
-
},
|
|
376
|
-
[
|
|
377
|
-
n(x.FmIcon, {
|
|
378
|
-
name: "info",
|
|
379
|
-
outline: !0,
|
|
380
|
-
size: "sm"
|
|
381
|
-
})
|
|
382
|
-
]
|
|
383
|
-
) : n("div")
|
|
384
|
-
])
|
|
385
|
-
]);
|
|
386
|
-
}
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
header: "Type",
|
|
390
|
-
accessorKey: "pf_collectible.type",
|
|
391
|
-
accessorFn: (o) => E.formattedType(o),
|
|
392
|
-
meta: {
|
|
393
|
-
maxWidth: "200px"
|
|
394
|
-
},
|
|
395
|
-
cell(o) {
|
|
396
|
-
const t = E.formattedType(o.row.original);
|
|
397
|
-
return n("div", { class: "flex items-center" }, [
|
|
398
|
-
n("div", { class: "truncate text-ellipsis" }, t),
|
|
399
|
-
t.length > 20 ? n(
|
|
400
|
-
x.FmTooltip,
|
|
401
|
-
{
|
|
402
|
-
content: t
|
|
403
|
-
},
|
|
404
|
-
[
|
|
405
|
-
n(x.FmIcon, {
|
|
406
|
-
name: "info",
|
|
407
|
-
color: "primary",
|
|
408
|
-
outline: !0,
|
|
409
|
-
size: "sm"
|
|
410
|
-
})
|
|
411
|
-
]
|
|
412
|
-
) : null
|
|
413
|
-
]);
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
header: "Source",
|
|
418
|
-
accessorKey: "source",
|
|
419
|
-
cell(o) {
|
|
420
|
-
var t;
|
|
421
|
-
return n("div", { class: "flex items-center gap-4" }, [
|
|
422
|
-
n(
|
|
423
|
-
"div",
|
|
424
|
-
{ class: "truncate text-ellipsis" },
|
|
425
|
-
K(E.getReason(o.row.original.source))
|
|
426
|
-
),
|
|
427
|
-
...(t = o.row.original.metadata) != null && t.campaign ? [
|
|
428
|
-
n(
|
|
429
|
-
x.FmTooltip,
|
|
430
|
-
{
|
|
431
|
-
get content() {
|
|
432
|
-
var h;
|
|
433
|
-
return (h = b.campaigns.all.find(
|
|
434
|
-
(v) => {
|
|
435
|
-
var i;
|
|
436
|
-
return v._id === ((i = o.row.original.metadata) == null ? void 0 : i.campaign);
|
|
437
|
-
}
|
|
438
|
-
)) == null ? void 0 : h.name;
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
[
|
|
442
|
-
n(x.FmIcon, {
|
|
443
|
-
name: "info",
|
|
444
|
-
color: "primary",
|
|
445
|
-
size: "sm",
|
|
446
|
-
onClick: async (h) => {
|
|
447
|
-
h.preventDefault(), h.stopPropagation();
|
|
448
|
-
const v = b.campaigns.all.find(
|
|
449
|
-
(i) => {
|
|
450
|
-
var I;
|
|
451
|
-
return i._id === ((I = o.row.original.metadata) == null ? void 0 : I.campaign);
|
|
452
|
-
}
|
|
453
|
-
);
|
|
454
|
-
if (v)
|
|
455
|
-
switch (v.type) {
|
|
456
|
-
case "VOUCHER":
|
|
457
|
-
case "PROMOTION":
|
|
458
|
-
case "BROADCAST":
|
|
459
|
-
await c.push({
|
|
460
|
-
name: z[`$connect-CAMPAIGN_${v.type}`]
|
|
461
|
-
});
|
|
462
|
-
break;
|
|
463
|
-
case "GAME":
|
|
464
|
-
case "CREDIT":
|
|
465
|
-
case "MISSION":
|
|
466
|
-
await c.push({
|
|
467
|
-
name: z[`$connect-PROGRAM_${v.type}`]
|
|
468
|
-
});
|
|
469
|
-
break;
|
|
470
|
-
case "POINT":
|
|
471
|
-
await c.push({
|
|
472
|
-
name: z["$connect-PROGRAM_EXPERIENCE"]
|
|
473
|
-
});
|
|
474
|
-
break;
|
|
475
|
-
case "COIN":
|
|
476
|
-
await c.push({
|
|
477
|
-
name: z["$connect-PROGRAM_POINT"]
|
|
478
|
-
});
|
|
479
|
-
break;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
})
|
|
483
|
-
]
|
|
484
|
-
)
|
|
485
|
-
] : []
|
|
486
|
-
]);
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
header: "User",
|
|
491
|
-
accessorKey: "pf_user.name",
|
|
492
|
-
cell(o) {
|
|
493
|
-
return se(o.row.original.pf_user);
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
header: "Phone No.",
|
|
498
|
-
accessorKey: "pf_user.phoneNumber",
|
|
499
|
-
accessorFn: (o) => {
|
|
500
|
-
var t;
|
|
501
|
-
return ((t = o == null ? void 0 : o.pf_user) == null ? void 0 : t.phoneNumber) || "";
|
|
502
|
-
}
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
accessorFn: (o) => o.ref,
|
|
506
|
-
header: "References",
|
|
507
|
-
accessorKey: "ref",
|
|
508
|
-
cell(o) {
|
|
509
|
-
var t, h;
|
|
510
|
-
return n("div", { class: "flex items-center justify-between gap-4" }, [
|
|
511
|
-
n("div", { class: "flex items-center" }, [
|
|
512
|
-
(t = o.row.original.metadata) != null && t.remark ? n(
|
|
513
|
-
x.FmTooltip,
|
|
514
|
-
{
|
|
515
|
-
content: (h = o.row.original.metadata) == null ? void 0 : h.remark
|
|
516
|
-
},
|
|
517
|
-
[
|
|
518
|
-
n(x.FmIcon, {
|
|
519
|
-
name: "info",
|
|
520
|
-
class: "pl-2",
|
|
521
|
-
outline: !0,
|
|
522
|
-
size: "sm"
|
|
523
|
-
})
|
|
524
|
-
]
|
|
525
|
-
) : n("div")
|
|
526
|
-
]),
|
|
527
|
-
n("div", { class: "flex-1" }, o.row.original.ref)
|
|
528
|
-
]);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
], d = O({
|
|
532
|
-
search: "",
|
|
533
|
-
"pf_collectible.type": [],
|
|
534
|
-
"metadata.location": [],
|
|
535
|
-
dateRange: {
|
|
536
|
-
startDate: y().subtract(7, "day").toISOString(),
|
|
537
|
-
endDate: y().endOf("day").toISOString()
|
|
538
|
-
},
|
|
539
|
-
source: []
|
|
540
|
-
}), { tableMeta: R, rowData: N, onSort: p, debouncedFetchData: a, onSearch: e } = re(async (o) => {
|
|
541
|
-
const t = {
|
|
542
|
-
...d.value,
|
|
543
|
-
user: m.user,
|
|
544
|
-
dateRange: {
|
|
545
|
-
start: new Date(d.value.dateRange.startDate).toISOString(),
|
|
546
|
-
end: new Date(d.value.dateRange.endDate).toISOString()
|
|
547
|
-
}
|
|
548
|
-
}, h = await G.readAll(o, t);
|
|
549
|
-
return {
|
|
550
|
-
resources: h.resources.map((v) => {
|
|
551
|
-
const i = s.value.find((I) => I._id === v.ref);
|
|
552
|
-
return { ...v, ref: (i == null ? void 0 : i.seqNumber) || v.ref };
|
|
553
|
-
}),
|
|
554
|
-
meta: h.meta
|
|
555
|
-
};
|
|
556
|
-
}), s = O([]), r = oe.options.map((o) => ({ label: K(E.getReason(o)), value: o })), w = f.locations.map((o) => ({ label: o.name, value: o._id }));
|
|
557
|
-
Q(
|
|
558
|
-
d,
|
|
559
|
-
() => {
|
|
560
|
-
a();
|
|
561
|
-
},
|
|
562
|
-
{ deep: !0 }
|
|
563
|
-
);
|
|
564
|
-
async function g() {
|
|
565
|
-
try {
|
|
566
|
-
_.value = !0;
|
|
567
|
-
const o = {
|
|
568
|
-
...d.value,
|
|
569
|
-
user: m.user,
|
|
570
|
-
dateRange: {
|
|
571
|
-
start: new Date(d.value.dateRange.startDate).toISOString(),
|
|
572
|
-
end: new Date(d.value.dateRange.endDate).toISOString()
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
await ce({
|
|
576
|
-
exporter: new Ae(),
|
|
577
|
-
readFunction: (t) => G.readAll(t, o),
|
|
578
|
-
transformRecord: (t) => {
|
|
579
|
-
var h, v, i, I, Y, $, B;
|
|
580
|
-
return {
|
|
581
|
-
TransactionID: t._id,
|
|
582
|
-
CreatedAt: y(P(t._id.toString())).format(
|
|
583
|
-
"D MMM YYYY, hh:mmA"
|
|
584
|
-
),
|
|
585
|
-
Amount: J(
|
|
586
|
-
t.expiryAmount.reduce(
|
|
587
|
-
(me, pe) => me + pe.amount,
|
|
588
|
-
t.amount ?? 0
|
|
589
|
-
),
|
|
590
|
-
2
|
|
591
|
-
),
|
|
592
|
-
ExpiredAt: (v = (h = t.expiryAmount) == null ? void 0 : h[0]) != null && v.expiredAt ? y((I = (i = t.expiryAmount) == null ? void 0 : i[0]) == null ? void 0 : I.expiredAt).format("D MMM YYYY") : "",
|
|
593
|
-
Type: E.formattedType(t),
|
|
594
|
-
Source: K(E.getReason(t.source)),
|
|
595
|
-
User: ((Y = t.pf_user) == null ? void 0 : Y.name) || "",
|
|
596
|
-
"Phone No.": (($ = t.pf_user) == null ? void 0 : $.phoneNumber) || "",
|
|
597
|
-
References: t.ref,
|
|
598
|
-
Remark: ((B = t.metadata) == null ? void 0 : B.remark) || ""
|
|
599
|
-
};
|
|
600
|
-
},
|
|
601
|
-
filename: "transactions"
|
|
602
|
-
});
|
|
603
|
-
} catch (o) {
|
|
604
|
-
console.error(o);
|
|
605
|
-
} finally {
|
|
606
|
-
_.value = !1;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
const C = O(null);
|
|
610
|
-
function M(o) {
|
|
611
|
-
var t;
|
|
612
|
-
console.log(o), (t = C.value) == null || t.showSheet(!0, o.original);
|
|
613
|
-
}
|
|
614
|
-
return ve(async () => {
|
|
615
|
-
await f.readLocations(), await b.read(), await a();
|
|
616
|
-
}), (o, t) => {
|
|
617
|
-
const h = A("FmSearch"), v = A("FmButton");
|
|
618
|
-
return F(), V(X, null, [
|
|
619
|
-
S("div", null, [
|
|
620
|
-
S("div", $e, [
|
|
621
|
-
D(h, {
|
|
622
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
623
|
-
modelValue: l(d).search,
|
|
624
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => l(d).search = i),
|
|
625
|
-
placeholder: "Search",
|
|
626
|
-
collapsible: ""
|
|
627
|
-
}, null, 8, ["modelValue"]),
|
|
628
|
-
D(v, {
|
|
629
|
-
icon: "ios_share",
|
|
630
|
-
variant: "tertiary",
|
|
631
|
-
onClick: g
|
|
632
|
-
})
|
|
633
|
-
]),
|
|
634
|
-
S("div", Be, [
|
|
635
|
-
S("div", Le, [
|
|
636
|
-
D(j, {
|
|
637
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
638
|
-
"right-icon": "keyboard_arrow_down",
|
|
639
|
-
modelValue: l(d)["metadata.location"],
|
|
640
|
-
"onUpdate:modelValue": t[1] || (t[1] = (i) => l(d)["metadata.location"] = i),
|
|
641
|
-
icon: "storefront",
|
|
642
|
-
"show-item-label": !0,
|
|
643
|
-
items: l(w)
|
|
644
|
-
}, null, 8, ["modelValue", "items"]),
|
|
645
|
-
D(j, {
|
|
646
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
647
|
-
"right-icon": "keyboard_arrow_down",
|
|
648
|
-
modelValue: l(d)["pf_collectible.type"],
|
|
649
|
-
"onUpdate:modelValue": t[2] || (t[2] = (i) => l(d)["pf_collectible.type"] = i),
|
|
650
|
-
label: "Type: ",
|
|
651
|
-
"show-item-label": !0,
|
|
652
|
-
items: [
|
|
653
|
-
{ label: "Point", value: "COIN" },
|
|
654
|
-
{ label: "Credit", value: "CREDIT" },
|
|
655
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
656
|
-
{ label: "Experience", value: "POINT" },
|
|
657
|
-
{ label: "Tier", value: "TIER" },
|
|
658
|
-
{ label: "Title", value: "TITLE" },
|
|
659
|
-
{ label: "Game", value: "GAME" },
|
|
660
|
-
{ label: "Stamp", value: "STAMP" }
|
|
661
|
-
]
|
|
662
|
-
}, null, 8, ["modelValue"]),
|
|
663
|
-
D(j, {
|
|
664
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
665
|
-
"right-icon": "keyboard_arrow_down",
|
|
666
|
-
modelValue: l(d).source,
|
|
667
|
-
"onUpdate:modelValue": t[3] || (t[3] = (i) => l(d).source = i),
|
|
668
|
-
label: "Source: ",
|
|
669
|
-
"show-item-label": !0,
|
|
670
|
-
items: l(r)
|
|
671
|
-
}, null, 8, ["modelValue", "items"]),
|
|
672
|
-
D(de, {
|
|
673
|
-
"model-value": {
|
|
674
|
-
startDate: l(d).dateRange.startDate,
|
|
675
|
-
endDate: l(d).dateRange.endDate
|
|
676
|
-
},
|
|
677
|
-
"onUpdate:modelValue": t[4] || (t[4] = (i) => l(d).dateRange = {
|
|
678
|
-
startDate: l(y)(i.startDate).startOf("d").toISOString(),
|
|
679
|
-
endDate: l(y)(i.endDate).endOf("d").toISOString()
|
|
680
|
-
})
|
|
681
|
-
}, null, 8, ["model-value"])
|
|
682
|
-
]),
|
|
683
|
-
D(h, {
|
|
684
|
-
class: "xs:hidden",
|
|
685
|
-
modelValue: l(d).search,
|
|
686
|
-
"onUpdate:modelValue": t[5] || (t[5] = (i) => l(d).search = i),
|
|
687
|
-
placeholder: "Search",
|
|
688
|
-
collapsible: ""
|
|
689
|
-
}, null, 8, ["modelValue"]),
|
|
690
|
-
S("div", ze, [
|
|
691
|
-
D(v, {
|
|
692
|
-
icon: "ios_share",
|
|
693
|
-
variant: "tertiary",
|
|
694
|
-
onClick: g
|
|
695
|
-
})
|
|
696
|
-
])
|
|
697
|
-
]),
|
|
698
|
-
D(le, {
|
|
699
|
-
loading: l(R).isLoading,
|
|
700
|
-
"row-data": l(N),
|
|
701
|
-
"row-count": l(R).totalRows,
|
|
702
|
-
"column-defs": T.filter(
|
|
703
|
-
(i) => !m.user || i.header !== "User" && i.header !== "Phone No."
|
|
704
|
-
),
|
|
705
|
-
"page-count": l(R).pageCount,
|
|
706
|
-
"page-index": l(R).pageIndex,
|
|
707
|
-
"page-size": l(R).pageSize,
|
|
708
|
-
"shrink-at": !1,
|
|
709
|
-
onSortChange: l(p),
|
|
710
|
-
onPageChange: t[6] || (t[6] = (i) => l(a)({
|
|
711
|
-
pageSize: i.pageSize,
|
|
712
|
-
pageIndex: i.pageIndex
|
|
713
|
-
})),
|
|
714
|
-
onRowClick: M
|
|
715
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
716
|
-
]),
|
|
717
|
-
D(Ue, {
|
|
718
|
-
ref_key: "transactionDetailSheet",
|
|
719
|
-
ref: C
|
|
720
|
-
}, null, 512)
|
|
721
|
-
], 64);
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
class Ke extends ie {
|
|
726
|
-
}
|
|
727
|
-
const Ge = { class: "flex items-center justify-between" }, He = { class: "flex gap-8 items-center" }, je = { class: "flex gap-8 items-center xs:hidden" }, wt = /* @__PURE__ */ H({
|
|
728
|
-
__name: "StoreTransactions",
|
|
729
|
-
props: {
|
|
730
|
-
user: {
|
|
731
|
-
type: String
|
|
732
|
-
}
|
|
733
|
-
},
|
|
734
|
-
setup(u) {
|
|
735
|
-
const f = u, { minor: b } = Re;
|
|
736
|
-
be();
|
|
737
|
-
const c = [
|
|
738
|
-
{
|
|
739
|
-
header: "Transaction ID",
|
|
740
|
-
meta: {
|
|
741
|
-
maxWidth: "150px"
|
|
742
|
-
},
|
|
743
|
-
cell(e) {
|
|
744
|
-
return n("div", { class: "flex items-center" }, [
|
|
745
|
-
n(x.FmIcon, {
|
|
746
|
-
name: "content_copy",
|
|
747
|
-
outline: !0,
|
|
748
|
-
size: "sm",
|
|
749
|
-
class: "cursor-pointer mr-4 shrink-0",
|
|
750
|
-
onClick: (s) => {
|
|
751
|
-
s.preventDefault(), s.stopPropagation(), Z(e.row.original._id.toString());
|
|
752
|
-
}
|
|
753
|
-
}),
|
|
754
|
-
n("div", { class: "truncate" }, e.row.original._id.toString())
|
|
755
|
-
]);
|
|
756
|
-
}
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
header: "Created at",
|
|
760
|
-
accessorFn: (e) => y(P(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
761
|
-
enableSorting: !0
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
header: "Bundle",
|
|
765
|
-
accessorFn: (e) => e.bundle.name
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
header: "Location",
|
|
769
|
-
accessorFn: (e) => e.location ? e.pf_location.name : "Online Store"
|
|
770
|
-
},
|
|
771
|
-
{
|
|
772
|
-
header: "Payment Type",
|
|
773
|
-
accessorFn: (e) => {
|
|
774
|
-
var s;
|
|
775
|
-
return ((s = e.paymentType) == null ? void 0 : s.type) ?? "N/A";
|
|
776
|
-
},
|
|
777
|
-
cell(e) {
|
|
778
|
-
var s, r;
|
|
779
|
-
return n("div", { class: "flex items-center gap-4" }, [
|
|
780
|
-
n("div", { class: "flex items-center" }, [
|
|
781
|
-
((s = e.row.original.paymentType) == null ? void 0 : s.type) == "ONLINE" && e.row.original.paymentType.extra ? n(
|
|
782
|
-
x.FmTooltip,
|
|
783
|
-
{
|
|
784
|
-
content: e.row.original.paymentType.extra
|
|
785
|
-
},
|
|
786
|
-
[
|
|
787
|
-
n(x.FmIcon, {
|
|
788
|
-
name: "info",
|
|
789
|
-
outline: !0,
|
|
790
|
-
size: "sm"
|
|
791
|
-
})
|
|
792
|
-
]
|
|
793
|
-
) : n("div")
|
|
794
|
-
]),
|
|
795
|
-
n(
|
|
796
|
-
"div",
|
|
797
|
-
{ class: "flex-1" },
|
|
798
|
-
((r = e.row.original.paymentType) == null ? void 0 : r.type) ?? "N/A"
|
|
799
|
-
)
|
|
800
|
-
]);
|
|
801
|
-
}
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
header: "User",
|
|
805
|
-
cell: (e) => se(e.row.original.pf_member)
|
|
806
|
-
},
|
|
807
|
-
{
|
|
808
|
-
header: "Phone No.",
|
|
809
|
-
accessorFn: (e) => e.pf_member.phoneNumber
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
header: "Status",
|
|
813
|
-
// accessorFn: (u) => u.status,
|
|
814
|
-
cell(e) {
|
|
815
|
-
var s, r, w, g;
|
|
816
|
-
return n("div", { class: "flex items-center" }, [
|
|
817
|
-
n("div", Se.title(e.row.original.status)),
|
|
818
|
-
n("div", { class: "flex items-center" }, [
|
|
819
|
-
(r = (s = e.row.original) == null ? void 0 : s.refund) != null && r.reason ? n(
|
|
820
|
-
x.FmTooltip,
|
|
821
|
-
{
|
|
822
|
-
content: (g = (w = e.row.original) == null ? void 0 : w.refund) == null ? void 0 : g.reason
|
|
823
|
-
},
|
|
824
|
-
[
|
|
825
|
-
n(x.FmIcon, {
|
|
826
|
-
name: "info",
|
|
827
|
-
color: "primary",
|
|
828
|
-
outline: !0,
|
|
829
|
-
size: "sm",
|
|
830
|
-
class: "pl-2"
|
|
831
|
-
})
|
|
832
|
-
]
|
|
833
|
-
) : n("div")
|
|
834
|
-
])
|
|
835
|
-
]);
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
header: "Source",
|
|
840
|
-
accessorFn: (e) => e.source
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
header: "Ref",
|
|
844
|
-
accessorFn: (e) => e.ref
|
|
845
|
-
},
|
|
846
|
-
{
|
|
847
|
-
id: "action",
|
|
848
|
-
cell(e) {
|
|
849
|
-
const s = e.row.original, r = s.status === "COMPLETED" && !s.refund && s.source == "ADMIN";
|
|
850
|
-
return r ? n(
|
|
851
|
-
x.FmMenu,
|
|
852
|
-
{
|
|
853
|
-
placement: "bottom-end",
|
|
854
|
-
onClick: (w) => {
|
|
855
|
-
w.stopPropagation();
|
|
856
|
-
}
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
"menu-button": () => n(x.FmButton, {
|
|
860
|
-
icon: "settings",
|
|
861
|
-
variant: "tertiary",
|
|
862
|
-
if: r
|
|
863
|
-
}),
|
|
864
|
-
default: () => [
|
|
865
|
-
n(x.FmMenuItem, {
|
|
866
|
-
label: "Refund",
|
|
867
|
-
sublabel: "Refund this transaction",
|
|
868
|
-
onClick: async (w) => {
|
|
869
|
-
w.stopPropagation(), await p(s);
|
|
870
|
-
}
|
|
871
|
-
})
|
|
872
|
-
]
|
|
873
|
-
}
|
|
874
|
-
) : n("div");
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
], m = O({
|
|
878
|
-
searchValue: "",
|
|
879
|
-
dateRange: {
|
|
880
|
-
startDate: y().subtract(7, "day").toISOString(),
|
|
881
|
-
endDate: y().toISOString()
|
|
882
|
-
}
|
|
883
|
-
}), { tableMeta: _, rowData: T, onSort: d, debouncedFetchData: R, onSearch: N } = re(async (e) => {
|
|
884
|
-
const s = {
|
|
885
|
-
...m.value.dateRange,
|
|
886
|
-
user: f.user
|
|
887
|
-
};
|
|
888
|
-
return await G.readStoreTransactions(e, s);
|
|
889
|
-
});
|
|
890
|
-
async function p(e) {
|
|
891
|
-
await xe.confirm(
|
|
892
|
-
"Are you sure you want to refund this transaction?",
|
|
893
|
-
"Refund Store Transaction",
|
|
894
|
-
"Confirm",
|
|
895
|
-
"Cancel"
|
|
896
|
-
) && await b(
|
|
897
|
-
async () => {
|
|
898
|
-
var r;
|
|
899
|
-
await Ce.refundStoreTransaction({
|
|
900
|
-
id: e._id,
|
|
901
|
-
reason: `ADMIN:${(r = Te().sessionUser) == null ? void 0 : r.name}`
|
|
902
|
-
}), await R();
|
|
903
|
-
},
|
|
904
|
-
{
|
|
905
|
-
message: "Refunding transaction...",
|
|
906
|
-
successMessage: "Transaction refunded successfully"
|
|
907
|
-
}
|
|
908
|
-
);
|
|
909
|
-
}
|
|
910
|
-
Q(
|
|
911
|
-
m,
|
|
912
|
-
() => {
|
|
913
|
-
R();
|
|
914
|
-
},
|
|
915
|
-
{ deep: !0 }
|
|
916
|
-
), ae(async () => {
|
|
917
|
-
await R();
|
|
918
|
-
});
|
|
919
|
-
const a = async () => ce({
|
|
920
|
-
exporter: new Ke(),
|
|
921
|
-
readFunction: (e) => G.readStoreTransactions(e, {
|
|
922
|
-
...m.value.dateRange,
|
|
923
|
-
user: f.user
|
|
924
|
-
}),
|
|
925
|
-
transformRecord: (e) => {
|
|
926
|
-
var s, r, w, g, C, M;
|
|
927
|
-
return {
|
|
928
|
-
TransactionId: ((s = e._id) == null ? void 0 : s.toString()) || "",
|
|
929
|
-
CreatedAt: y(P(e._id.toString())).format(
|
|
930
|
-
"DD/MM/YYYY HH:mm:ss"
|
|
931
|
-
),
|
|
932
|
-
Bundle: e.bundle.name || "",
|
|
933
|
-
Location: e.location ? e.pf_location.name : "Online Store",
|
|
934
|
-
PaymentType: ((r = e.paymentType) == null ? void 0 : r.type) || "N/A",
|
|
935
|
-
PaymentExtra: ((w = e.paymentType) == null ? void 0 : w.extra) || "",
|
|
936
|
-
User: ((g = e.pf_member) == null ? void 0 : g.name) || "",
|
|
937
|
-
PhoneNumber: ((C = e.pf_member) == null ? void 0 : C.phoneNumber) || "",
|
|
938
|
-
Status: e.status || "",
|
|
939
|
-
RefundReason: ((M = e == null ? void 0 : e.refund) == null ? void 0 : M.reason) || ""
|
|
940
|
-
};
|
|
941
|
-
},
|
|
942
|
-
filename: "store-transactions"
|
|
943
|
-
});
|
|
944
|
-
return (e, s) => {
|
|
945
|
-
const r = A("FmSearch"), w = A("FmButton");
|
|
946
|
-
return F(), V("div", null, [
|
|
947
|
-
S("div", Ge, [
|
|
948
|
-
S("div", He, [
|
|
949
|
-
D(de, {
|
|
950
|
-
modelValue: l(m).dateRange,
|
|
951
|
-
"onUpdate:modelValue": s[0] || (s[0] = (g) => l(m).dateRange = g)
|
|
952
|
-
}, null, 8, ["modelValue"])
|
|
953
|
-
]),
|
|
954
|
-
S("div", je, [
|
|
955
|
-
D(r, {
|
|
956
|
-
modelValue: l(_).searchValue,
|
|
957
|
-
"onUpdate:modelValue": [
|
|
958
|
-
s[1] || (s[1] = (g) => l(_).searchValue = g),
|
|
959
|
-
l(N)
|
|
960
|
-
],
|
|
961
|
-
placeholder: "Search",
|
|
962
|
-
collapsible: ""
|
|
963
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
964
|
-
D(w, {
|
|
965
|
-
icon: "ios_share",
|
|
966
|
-
variant: "tertiary",
|
|
967
|
-
onClick: a
|
|
968
|
-
})
|
|
969
|
-
])
|
|
970
|
-
]),
|
|
971
|
-
D(le, {
|
|
972
|
-
loading: l(_).isLoading,
|
|
973
|
-
"row-data": l(T),
|
|
974
|
-
"row-count": l(_).totalRows,
|
|
975
|
-
"column-defs": c.filter(
|
|
976
|
-
(g) => !f.user || g.header !== "User" && g.header !== "Phone No."
|
|
977
|
-
),
|
|
978
|
-
"page-count": l(_).pageCount,
|
|
979
|
-
"page-index": l(_).pageIndex,
|
|
980
|
-
"page-size": l(_).pageSize,
|
|
981
|
-
"shrink-at": !1,
|
|
982
|
-
onSortChange: l(d),
|
|
983
|
-
onPageChange: s[2] || (s[2] = (g) => l(R)({
|
|
984
|
-
pageSize: g.pageSize,
|
|
985
|
-
pageIndex: g.pageIndex
|
|
986
|
-
}))
|
|
987
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
988
|
-
]);
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
});
|
|
992
|
-
export {
|
|
993
|
-
xt as _,
|
|
994
|
-
wt as a
|
|
995
|
-
};
|