@feedmepos/mf-connect 0.1.89-prod → 0.1.91-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/dist/{Analytic-Caz3AQQ2.js → Analytic-NC-USqGi.js} +11 -11
- package/dist/{App-D_q4nHiY.js → App-7D_MZN0d.js} +7 -7
- package/dist/{Bin-DURa0qe2.js → Bin-60inU7_9.js} +8 -8
- package/dist/{Broadcast-ByDjXqap.js → Broadcast-BFMikTv0.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BD8mWUzO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrHHwGED.js} +7 -7
- package/dist/{Card-BSSzVrbz.js → Card-vafU4dyU.js} +19 -19
- package/dist/{Collections-CTwUl8W3.js → Collections-BNSNZg7H.js} +8 -8
- package/dist/{Credit-TgZBmYsM.js → Credit-Cy6YPGph.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DZV3JtDl.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-7IXALR4_.js} +33 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BwOs5NHt.js → EffectSheet.vue_vue_type_style_index_0_lang-7Tanljx6.js} +6 -6
- package/dist/{Experience-DUCO6do6.js → Experience-BVneXtjz.js} +8 -8
- package/dist/{FileSaver.min-BaCfYtPG.js → FileSaver.min-DRZVt2c-.js} +1 -1
- package/dist/{Game-DcwQSCjZ.js → Game-leXiqv6v.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BSMwEFqp.js → ImageInput.vue_vue_type_script_setup_true_lang-bvPXAI2I.js} +1 -1
- package/dist/{Index-Bp2CKHw3.js → Index-BU3ubcCK.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-WWVHvcOU.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DmnST0XL.js} +1 -1
- package/dist/{MainLayout-Q_0POZ4I.js → MainLayout-DfMxhjyZ.js} +1 -1
- package/dist/{Marketing-D52IYXPR.js → Marketing-DVZfv6KL.js} +6 -6
- package/dist/{Member-sxjxhLwQ.js → Member-C1UGjz3K.js} +12 -12
- package/dist/{MemberList-vLNFHNRw.js → MemberList-B51qk9PN.js} +436 -441
- package/dist/{MemberTransactions-BeHeN0Rk.js → MemberTransactions-XeeZVSj7.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B6cF0EC3.js → MessageInput.vue_vue_type_script_setup_true_lang-BZFh4LbN.js} +9 -9
- package/dist/{Mission-CnJCjBhe.js → Mission-_2ubnxed.js} +9 -9
- package/dist/{Overview-B3jRs_Cg.js → Overview-Wtw2Gxca.js} +19 -19
- package/dist/{Point-BldY5wb0.js → Point-BWNPBISs.js} +8 -8
- package/dist/{Promotion-CsGhqlY0.js → Promotion-Cq1rta1U.js} +9 -9
- package/dist/{Queue-CLa2pSXF.js → Queue-BislCglv.js} +11 -11
- package/dist/{Record-JbbAM6lI.js → Record-DllYWBQs.js} +9 -9
- package/dist/{Reward-wgiBCIV3.js → Reward-DNnMSiIt.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DiNlpy7_.js → RewardGroup.vue_vue_type_script_setup_true_lang-CYgKBX4A.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B3Ylb1vx.js → RuleGroup.vue_vue_type_script_setup_true_lang-CBLDHomx.js} +15 -15
- package/dist/{Segment-BQiZ51Wi.js → Segment-BawFn2kF.js} +25 -25
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DbXFTjAN.js → SelectItems.vue_vue_type_script_setup_true_lang-DaF39TyG.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Be_kiAB6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-vxFwpQoN.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DS1MWUOc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BBddcORt.js} +4 -4
- package/dist/Setting-Gt-j2X-h.js +2028 -0
- package/dist/{SettingAdvertisements-OdDM05s7.js → SettingAdvertisements-CETtBWdy.js} +12 -12
- package/dist/{Store-D1Q0wOXk.js → Store-DxBaC_7y.js} +22 -22
- package/dist/StoreRewards-CbmzaAnf.js +537 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CB6y-TEk.js +1118 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BKzZIJkt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Ckdg2H3D.js} +5 -3
- package/dist/{Tier-DOnYGgah.js → Tier-BRBr_4Vs.js} +22 -22
- package/dist/{Title-F4XJw6oN.js → Title-N1Aoum66.js} +21 -21
- package/dist/{Transaction-Ws7kBZUE.js → Transaction-DzrBiUhw.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BZb0EXgi.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-xtnyUh_C.js} +6 -6
- package/dist/{Voucher-DX8MKz00.js → Voucher-95IbNNON.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-tUNn1vRE.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BOf9umaT.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BvgIZlIh.js → ZodTextField.vue_vue_type_script_setup_true_lang-vCA6xspO.js} +2 -2
- package/dist/{app-C-nC9SMv.js → app-CSXjCxhe.js} +49 -45
- package/dist/app.js +1 -1
- package/dist/{business-CrQ_qouH.js → business-B1gGiOi3.js} +1 -1
- package/dist/{campaign-CBRSag11.js → campaign-CJ-3fIa_.js} +8 -8
- package/dist/{campaign-shm1Nb7g.js → campaign-CTPJV80W.js} +1 -1
- package/dist/{campaign.enum-C-p5_XEd.js → campaign.enum-C6mTkAc0.js} +1 -1
- package/dist/campaign.fn-Dnq8oOA7.js +776 -0
- package/dist/{collectible.enum-DxOoBouZ.js → collectible.enum-Bm9ym61N.js} +1 -1
- package/dist/{collection.fn-BKmv2KVW.js → collection.fn-eGKUovTx.js} +2 -2
- package/dist/{dto-BRQj35uX.js → dto-BmlZ970m.js} +4 -4
- package/dist/{effect-Bbc7QO26.js → effect-Fi165HuU.js} +1 -1
- package/dist/{email-addresses-CdmKczY8.js → email-addresses-CkqIxXsD.js} +2 -2
- package/dist/{export-xWupGZRl.js → export-BINxBZ3o.js} +3 -3
- package/dist/{helper-C_t7u0sc.js → helper-BJpoVem-.js} +1 -1
- package/dist/{index-C6PeL89d.js → index-BBTSDrdg.js} +3 -3
- package/dist/{index-BxosLsfW.js → index-BazRPGxz.js} +1 -1
- package/dist/{index-CLvFXL_E.js → index-C-7bzCQ9.js} +4 -4
- package/dist/{index-REoHVOcy.js → index-CMnMUrQv.js} +1 -1
- package/dist/index-Ceebw9zT.js +85 -0
- package/dist/{index-ClEGMTrv.js → index-CfEzixyr.js} +1 -1
- package/dist/{index-lZq2A3X2.js → index-Cg170bHf.js} +3 -3
- package/dist/{index-DW7nPyed.js → index-D2lJ7rbj.js} +6 -6
- package/dist/{index-DAhj82tf.js → index-D_D_KuCj.js} +1 -1
- package/dist/{index-DaCQrz9t.js → index-ShgzGUii.js} +3 -3
- package/dist/{index-BHwWZLKa.js → index-agtRTQ1_.js} +5 -3
- package/dist/{index-RsNRLaWL.js → index-elY0gYnL.js} +23 -12
- package/dist/{index-BaGjDOR2.js → index-msYk4Nww.js} +1 -1
- package/dist/{index.esm2017-DIVK9KD2.js → index.esm2017-CFwZeNKo.js} +1 -1
- package/dist/{loading-xptL2Ny2.js → loading-CWsuOmex.js} +1 -1
- package/dist/{lodash-88xjswCi.js → lodash-Cm9Z1YF2.js} +1 -1
- package/dist/{membership-eoLCZt_p.js → membership-DMInG-QR.js} +3 -3
- package/dist/{money-DcsDa1nm.js → money-COObXSez.js} +1 -1
- package/dist/{number-BkGWCSrD.js → number-ZsyBuNFr.js} +1 -1
- package/dist/objectid-Tx-E_slw.js +145 -0
- package/dist/{plugins-DoTCd9nY.js → plugins-CvqTFq6l.js} +3 -3
- package/dist/{reward-Culc3-Rv.js → reward-BDSUzN0_.js} +1 -1
- package/dist/{rule-DUDjRs8M.js → rule-BzWFD4lu.js} +3 -3
- package/dist/{rule-builder-CkZtoez-.js → rule-builder-y5PUkSk9.js} +1 -1
- package/dist/{template-CxhdtuLf.js → template-CO3A7_3t.js} +7 -7
- package/dist/{timezone-CdsdekR2.js → timezone-ClbAM0Sw.js} +5 -3
- package/dist/{trigger-CFXIiuLd.js → trigger-DGoPndhx.js} +5 -5
- package/dist/usePagination-COHUplyH.js +220 -0
- package/dist/{user-C7hrMSvV.js → user-CnDTKRSl.js} +1 -1
- package/dist/{vue-i18n-BdGyU2Nr.js → vue-i18n-X1TYXdQD.js} +387 -387
- package/dist/{xlsx-BN2KFkI2.js → xlsx-W_9bPRI8.js} +166 -166
- package/dist/{zod-DvUTBth7.js → zod-D9xVg76J.js} +1 -1
- package/package.json +1 -1
- package/dist/Setting-De1lCG6N.js +0 -1989
- package/dist/StoreRewards-2Gdv7uu4.js +0 -535
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-NtxHf8HF.js +0 -1016
- package/dist/campaign.fn-BGzZfg1o.js +0 -776
- package/dist/index-DDQaEXt7.js +0 -76
- package/dist/objectid-gUqB9tj7.js +0 -145
- package/dist/usePagination-BSeGmTq6.js +0 -177
|
@@ -1,1016 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, mergeModels as ee, useModel as ye, computed as P, onMounted as ae, watch as Q, resolveComponent as O, openBlock as E, createBlock as q, withCtx as W, createVNode as R, unref as n, ref as M, h as r, isRef as he, createElementVNode as x, createElementBlock as V, Fragment as X, renderList as te, toDisplayString as L, createTextVNode as ve, resolveDynamicComponent as be, onBeforeMount as _e } from "vue";
|
|
2
|
-
import { components as b, useDialog as Se } from "@feedmepos/ui-library";
|
|
3
|
-
import { r as oe } from "./index-CLvFXL_E.js";
|
|
4
|
-
import "./index-DaCQrz9t.js";
|
|
5
|
-
import { s as xe } from "./index-REoHVOcy.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-BkGWCSrD.js";
|
|
10
|
-
import { u as ne } from "./business-CrQ_qouH.js";
|
|
11
|
-
import { u as re, _ as se } from "./usePagination-BSeGmTq6.js";
|
|
12
|
-
import { a as Z, c as we, p as De } from "./plugins-DoTCd9nY.js";
|
|
13
|
-
import { g as le } from "./user-C7hrMSvV.js";
|
|
14
|
-
import { B as ie, e as ce } from "./export-xWupGZRl.js";
|
|
15
|
-
import { u as ue } from "./campaign-shm1Nb7g.js";
|
|
16
|
-
import "./index-BxosLsfW.js";
|
|
17
|
-
import "./index-lZq2A3X2.js";
|
|
18
|
-
import "./index-DW7nPyed.js";
|
|
19
|
-
import "./index-ClEGMTrv.js";
|
|
20
|
-
import "./index-C6PeL89d.js";
|
|
21
|
-
import { u as me } from "./vue-i18n-BdGyU2Nr.js";
|
|
22
|
-
import { o as Y } from "./objectId-dwaoBfJX.js";
|
|
23
|
-
import { useRouter as Re } from "vue-router";
|
|
24
|
-
import { t as G } from "./index-RsNRLaWL.js";
|
|
25
|
-
import { R as z } from "./app-C-nC9SMv.js";
|
|
26
|
-
import { u as Ce } from "./loading-xptL2Ny2.js";
|
|
27
|
-
import { useCoreStore as Te } from "@feedmepos/mf-common";
|
|
28
|
-
import { m as Fe } from "./index-DAhj82tf.js";
|
|
29
|
-
function Ie(m) {
|
|
30
|
-
let f = "";
|
|
31
|
-
switch (m) {
|
|
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 = m;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
return f;
|
|
58
|
-
}
|
|
59
|
-
function Ee(m) {
|
|
60
|
-
var f, S, u, d, _, C;
|
|
61
|
-
switch ((f = m == null ? void 0 : m.pf_collectible) == null ? void 0 : f.type) {
|
|
62
|
-
case "VOUCHER":
|
|
63
|
-
return `${(S = m.pf_collectible) == null ? void 0 : S.type} (${(u = m.pf_collectible) == null ? void 0 : u.name})`;
|
|
64
|
-
case "TITLE":
|
|
65
|
-
return `${(d = m.pf_collectible) == null ? void 0 : d.type} (${(_ = m.pf_collectible) == null ? void 0 : _.name})`;
|
|
66
|
-
case "POINT":
|
|
67
|
-
return "Experience";
|
|
68
|
-
case "COIN":
|
|
69
|
-
return "Point";
|
|
70
|
-
default:
|
|
71
|
-
return xe((C = m == null ? void 0 : m.pf_collectible) == null ? void 0 : C.type);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function Ne(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 N = {
|
|
85
|
-
getReason: Ie,
|
|
86
|
-
formattedType: Ee,
|
|
87
|
-
formattedPaymentType: Ne
|
|
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(m, { emit: f }) {
|
|
107
|
-
const S = m, u = f, d = ye(m, "dateRange"), _ = P(() => d.value ? `${C.value.startDate ?? "Start"} - ${C.value.endDate ?? "End"}` : "No dates selected."), C = P(() => ({
|
|
108
|
-
startDate: d.value.startDate ? y(d.value.startDate).format(k) : void 0,
|
|
109
|
-
endDate: d.value.endDate ? y(d.value.endDate).format(k) : void 0
|
|
110
|
-
}));
|
|
111
|
-
return ae(() => {
|
|
112
|
-
d.value = {
|
|
113
|
-
startDate: S.modelValue.startDate ? y(S.modelValue.startDate).format(k) : void 0,
|
|
114
|
-
endDate: S.modelValue.endDate ? y(S.modelValue.endDate).format(k) : void 0
|
|
115
|
-
};
|
|
116
|
-
}), Q(
|
|
117
|
-
() => d.value,
|
|
118
|
-
() => {
|
|
119
|
-
u("update:model-value", C.value);
|
|
120
|
-
}
|
|
121
|
-
), (A, c) => {
|
|
122
|
-
const T = O("FmChip"), p = O("FmDateRangePicker");
|
|
123
|
-
return E(), q(p, {
|
|
124
|
-
modelValue: d.value,
|
|
125
|
-
"onUpdate:modelValue": c[0] || (c[0] = (o) => d.value = o),
|
|
126
|
-
"show-predefined-range": ""
|
|
127
|
-
}, {
|
|
128
|
-
"trigger-button": W(() => [
|
|
129
|
-
R(T, {
|
|
130
|
-
label: n(_),
|
|
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 Oe extends ie {
|
|
142
|
-
}
|
|
143
|
-
const Ae = { class: "space-y-24 pr-12" }, Me = { class: "w-full space-y-16" }, ke = { class: "fm-typo-en-body-lg-600" }, Ve = ["onClick"], Pe = { class: "fm-typo-en-body-lg-600" }, Ye = ["onClick"], Ue = { class: "flex items-center gap-8" }, $e = /* @__PURE__ */ H({
|
|
144
|
-
__name: "TransactionDetailSheet",
|
|
145
|
-
setup(m, { expose: f }) {
|
|
146
|
-
me();
|
|
147
|
-
const S = M(!1), u = M(), d = ue(), _ = ne();
|
|
148
|
-
function C(p, o) {
|
|
149
|
-
S.value = p, u.value = o ?? null;
|
|
150
|
-
}
|
|
151
|
-
const A = P(() => {
|
|
152
|
-
var p, o;
|
|
153
|
-
return J(
|
|
154
|
-
((o = u.value) == null ? void 0 : o.expiryAmount.reduce(
|
|
155
|
-
(e, l) => e + l.amount,
|
|
156
|
-
((p = u.value) == null ? void 0 : p.amount) ?? 0
|
|
157
|
-
)) ?? 0,
|
|
158
|
-
2
|
|
159
|
-
);
|
|
160
|
-
}), c = P(() => {
|
|
161
|
-
var p, o, e, l, s;
|
|
162
|
-
return u.value ? [
|
|
163
|
-
{
|
|
164
|
-
label: "Transaction ID",
|
|
165
|
-
value: (p = u.value) == null ? void 0 : p._id
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
label: "Date/Time",
|
|
169
|
-
value: y(Y(u.value._id.toString())).format(
|
|
170
|
-
"D MMM YYYY, hh:mmA"
|
|
171
|
-
)
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
label: "Amount",
|
|
175
|
-
component: () => r(
|
|
176
|
-
"span",
|
|
177
|
-
{
|
|
178
|
-
class: [
|
|
179
|
-
"pr-2",
|
|
180
|
-
+A.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
A.value
|
|
184
|
-
)
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
label: "Type",
|
|
188
|
-
value: N.formattedType(u.value)
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
label: "Source",
|
|
192
|
-
value: K(N.getReason(u.value.source))
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
label: "User",
|
|
196
|
-
value: (e = (o = u.value) == null ? void 0 : o.pf_user) == null ? void 0 : e.name
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
label: "Phone Number",
|
|
200
|
-
value: (s = (l = u.value) == null ? void 0 : l.pf_user) == null ? void 0 : s.phoneNumber
|
|
201
|
-
}
|
|
202
|
-
] : [];
|
|
203
|
-
}), T = P(() => {
|
|
204
|
-
var l, s, w, g;
|
|
205
|
-
if (!u.value) return [];
|
|
206
|
-
const p = [], o = (l = u.value) == null ? void 0 : l.metadata, e = u.value;
|
|
207
|
-
if (o != null && o.campaign) {
|
|
208
|
-
const D = d.campaigns.all.find(
|
|
209
|
-
(F) => F._id === (o == null ? void 0 : o.campaign)
|
|
210
|
-
);
|
|
211
|
-
if (!D) return;
|
|
212
|
-
p.push({
|
|
213
|
-
label: "Campaign",
|
|
214
|
-
value: D.name
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
return o != null && o.remark && p.push({
|
|
218
|
-
label: "Remark",
|
|
219
|
-
value: o.remark
|
|
220
|
-
}), (s = u.value) != null && s.ref.startsWith("bill_") && p.push({
|
|
221
|
-
label: "Bill Number",
|
|
222
|
-
value: (w = u.value) == null ? void 0 : w.ref,
|
|
223
|
-
copy: () => {
|
|
224
|
-
var D;
|
|
225
|
-
return Z((D = u.value) == null ? void 0 : D.ref);
|
|
226
|
-
}
|
|
227
|
-
}), o != null && o.location && p.push({
|
|
228
|
-
label: "Location",
|
|
229
|
-
value: (g = _.locations.find(
|
|
230
|
-
(D) => D._id.toString() === (o == null ? void 0 : o.location)
|
|
231
|
-
)) == null ? void 0 : g.name
|
|
232
|
-
}), e.source === oe.enum.STORE && p.push({
|
|
233
|
-
label: "Store Transaction",
|
|
234
|
-
value: e.ref
|
|
235
|
-
}), o != null && o.originTransaction && p.push({
|
|
236
|
-
label: "Parent Transaction",
|
|
237
|
-
value: o.originTransaction
|
|
238
|
-
}), o != null && o.referral_count && p.push({
|
|
239
|
-
label: "Referral Count",
|
|
240
|
-
value: o.referral_count
|
|
241
|
-
}), e.refundedFrom && p.push({
|
|
242
|
-
label: "Refunded From",
|
|
243
|
-
value: e.refundedFrom
|
|
244
|
-
}), p;
|
|
245
|
-
});
|
|
246
|
-
return f({
|
|
247
|
-
showSheet: C
|
|
248
|
-
}), (p, o) => {
|
|
249
|
-
const e = O("FmButton"), l = O("FmSideSheet");
|
|
250
|
-
return E(), q(l, {
|
|
251
|
-
"max-width": 560,
|
|
252
|
-
modelValue: n(S),
|
|
253
|
-
"onUpdate:modelValue": o[1] || (o[1] = (s) => he(S) ? S.value = s : null),
|
|
254
|
-
header: "Transaction Details"
|
|
255
|
-
}, {
|
|
256
|
-
"side-sheet-footer": W(() => [
|
|
257
|
-
x("div", Ue, [
|
|
258
|
-
R(e, {
|
|
259
|
-
label: "Close",
|
|
260
|
-
onClick: o[0] || (o[0] = (s) => C(!1)),
|
|
261
|
-
variant: "tertiary"
|
|
262
|
-
})
|
|
263
|
-
])
|
|
264
|
-
]),
|
|
265
|
-
default: W(() => [
|
|
266
|
-
x("div", Ae, [
|
|
267
|
-
x("div", Me, [
|
|
268
|
-
(E(!0), V(X, null, te(n(c), (s) => (E(), V("div", {
|
|
269
|
-
key: s.label,
|
|
270
|
-
class: "flex flex-col gap-4"
|
|
271
|
-
}, [
|
|
272
|
-
x("div", ke, L(s.label), 1),
|
|
273
|
-
x("div", {
|
|
274
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
275
|
-
onClick: s.copy
|
|
276
|
-
}, [
|
|
277
|
-
ve(L(s.accessorFn ? s.accessorFn() : s.value) + " ", 1),
|
|
278
|
-
(E(), q(be(s.component)))
|
|
279
|
-
], 8, Ve),
|
|
280
|
-
o[2] || (o[2] = x("hr", { class: "mt-3" }, null, -1))
|
|
281
|
-
]))), 128)),
|
|
282
|
-
(E(!0), V(X, null, te(n(T), (s) => (E(), V("div", {
|
|
283
|
-
key: s.label,
|
|
284
|
-
class: "flex flex-col gap-4"
|
|
285
|
-
}, [
|
|
286
|
-
x("div", Pe, L(s.label), 1),
|
|
287
|
-
x("div", {
|
|
288
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
289
|
-
onClick: s.copy
|
|
290
|
-
}, L(s.accessorFn ? s.accessorFn() : s.value), 9, Ye),
|
|
291
|
-
o[3] || (o[3] = x("hr", { class: "mt-3" }, null, -1))
|
|
292
|
-
]))), 128))
|
|
293
|
-
])
|
|
294
|
-
])
|
|
295
|
-
]),
|
|
296
|
-
_: 1
|
|
297
|
-
}, 8, ["modelValue"]);
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
}), Be = { 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" }, Ke = { class: "xs:hidden" }, wt = /* @__PURE__ */ H({
|
|
301
|
-
__name: "CollectionTransactions",
|
|
302
|
-
props: {
|
|
303
|
-
user: {
|
|
304
|
-
type: String
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
setup(m) {
|
|
308
|
-
const { t: f } = me(), S = ne(), u = ue(), d = Re(), _ = m, C = M(!1), A = [
|
|
309
|
-
{
|
|
310
|
-
header: "Transaction ID",
|
|
311
|
-
accessorKey: "_id",
|
|
312
|
-
meta: {
|
|
313
|
-
maxWidth: "100px"
|
|
314
|
-
},
|
|
315
|
-
cell(a) {
|
|
316
|
-
return r("div", { class: "flex items-center" }, [
|
|
317
|
-
r(b.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(a.row.original._id.toString());
|
|
324
|
-
}
|
|
325
|
-
}),
|
|
326
|
-
r(
|
|
327
|
-
"div",
|
|
328
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
329
|
-
a.row.original._id.toString()
|
|
330
|
-
)
|
|
331
|
-
]);
|
|
332
|
-
},
|
|
333
|
-
enableSorting: !1
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
header: "Created at",
|
|
337
|
-
accessorKey: "_id",
|
|
338
|
-
accessorFn: (a) => y(Y(a._id.toString())),
|
|
339
|
-
cell: (a) => y(Y(a.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(a) {
|
|
349
|
-
var v, i, I, U;
|
|
350
|
-
const t = J(
|
|
351
|
-
a.row.original.expiryAmount.reduce(
|
|
352
|
-
($, B) => $ + B.amount,
|
|
353
|
-
a.row.original.amount ?? 0
|
|
354
|
-
),
|
|
355
|
-
2
|
|
356
|
-
), h = (i = (v = a.row.original.expiryAmount) == null ? void 0 : v[0]) != null && i.expiredAt ? y((U = (I = a.row.original.expiryAmount) == null ? void 0 : I[0]) == null ? void 0 : U.expiredAt).format(
|
|
357
|
-
"D MMM YYYY"
|
|
358
|
-
) : "";
|
|
359
|
-
return r("div", { class: "flex items-center" }, [
|
|
360
|
-
r(
|
|
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
|
-
r("div", { class: "flex items-center" }, [
|
|
371
|
-
a.row.original.expiryAmount.length > 0 ? r(
|
|
372
|
-
b.FmTooltip,
|
|
373
|
-
{
|
|
374
|
-
content: `Expired on ${h}`
|
|
375
|
-
},
|
|
376
|
-
[
|
|
377
|
-
r(b.FmIcon, {
|
|
378
|
-
name: "info",
|
|
379
|
-
outline: !0,
|
|
380
|
-
size: "sm"
|
|
381
|
-
})
|
|
382
|
-
]
|
|
383
|
-
) : r("div")
|
|
384
|
-
])
|
|
385
|
-
]);
|
|
386
|
-
}
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
header: "Type",
|
|
390
|
-
accessorKey: "pf_collectible.type",
|
|
391
|
-
accessorFn: (a) => N.formattedType(a),
|
|
392
|
-
meta: {
|
|
393
|
-
maxWidth: "200px"
|
|
394
|
-
},
|
|
395
|
-
cell(a) {
|
|
396
|
-
const t = N.formattedType(a.row.original);
|
|
397
|
-
return r("div", { class: "flex items-center" }, [
|
|
398
|
-
r("div", { class: "truncate text-ellipsis" }, t),
|
|
399
|
-
t.length > 20 ? r(
|
|
400
|
-
b.FmTooltip,
|
|
401
|
-
{
|
|
402
|
-
content: t
|
|
403
|
-
},
|
|
404
|
-
[
|
|
405
|
-
r(b.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(a) {
|
|
420
|
-
var t;
|
|
421
|
-
return r("div", { class: "flex items-center gap-4" }, [
|
|
422
|
-
r(
|
|
423
|
-
"div",
|
|
424
|
-
{ class: "truncate text-ellipsis" },
|
|
425
|
-
K(N.getReason(a.row.original.source))
|
|
426
|
-
),
|
|
427
|
-
...(t = a.row.original.metadata) != null && t.campaign ? [
|
|
428
|
-
r(
|
|
429
|
-
b.FmTooltip,
|
|
430
|
-
{
|
|
431
|
-
get content() {
|
|
432
|
-
var h;
|
|
433
|
-
return (h = u.campaigns.all.find(
|
|
434
|
-
(v) => {
|
|
435
|
-
var i;
|
|
436
|
-
return v._id === ((i = a.row.original.metadata) == null ? void 0 : i.campaign);
|
|
437
|
-
}
|
|
438
|
-
)) == null ? void 0 : h.name;
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
[
|
|
442
|
-
r(b.FmIcon, {
|
|
443
|
-
name: "info",
|
|
444
|
-
color: "primary",
|
|
445
|
-
size: "sm",
|
|
446
|
-
onClick: async (h) => {
|
|
447
|
-
h.preventDefault(), h.stopPropagation();
|
|
448
|
-
const v = u.campaigns.all.find(
|
|
449
|
-
(i) => {
|
|
450
|
-
var I;
|
|
451
|
-
return i._id === ((I = a.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 d.push({
|
|
460
|
-
name: z[`$connect-CAMPAIGN_${v.type}`]
|
|
461
|
-
});
|
|
462
|
-
break;
|
|
463
|
-
case "GAME":
|
|
464
|
-
case "CREDIT":
|
|
465
|
-
case "MISSION":
|
|
466
|
-
await d.push({
|
|
467
|
-
name: z[`$connect-PROGRAM_${v.type}`]
|
|
468
|
-
});
|
|
469
|
-
break;
|
|
470
|
-
case "POINT":
|
|
471
|
-
await d.push({
|
|
472
|
-
name: z["$connect-PROGRAM_EXPERIENCE"]
|
|
473
|
-
});
|
|
474
|
-
break;
|
|
475
|
-
case "COIN":
|
|
476
|
-
await d.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(a) {
|
|
493
|
-
return le(a.row.original.pf_user);
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
header: "Phone No.",
|
|
498
|
-
accessorKey: "pf_user.phoneNumber",
|
|
499
|
-
accessorFn: (a) => {
|
|
500
|
-
var t;
|
|
501
|
-
return ((t = a == null ? void 0 : a.pf_user) == null ? void 0 : t.phoneNumber) || "";
|
|
502
|
-
}
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
header: "Status",
|
|
506
|
-
id: "status",
|
|
507
|
-
enableSorting: !1,
|
|
508
|
-
cell(a) {
|
|
509
|
-
const t = !!a.row.original.refunded;
|
|
510
|
-
return r(b.FmChip, {
|
|
511
|
-
label: f(t ? "connect.transaction.refunded" : "connect.transaction.completed"),
|
|
512
|
-
variant: "plain",
|
|
513
|
-
class: t ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-success bg-fm-color-system-success-100"
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
accessorFn: (a) => a.ref,
|
|
519
|
-
header: "References",
|
|
520
|
-
accessorKey: "ref",
|
|
521
|
-
cell(a) {
|
|
522
|
-
var t, h;
|
|
523
|
-
return r("div", { class: "flex items-center justify-between gap-4" }, [
|
|
524
|
-
r("div", { class: "flex items-center" }, [
|
|
525
|
-
(t = a.row.original.metadata) != null && t.remark ? r(
|
|
526
|
-
b.FmTooltip,
|
|
527
|
-
{
|
|
528
|
-
content: (h = a.row.original.metadata) == null ? void 0 : h.remark
|
|
529
|
-
},
|
|
530
|
-
[
|
|
531
|
-
r(b.FmIcon, {
|
|
532
|
-
name: "info",
|
|
533
|
-
class: "pl-2",
|
|
534
|
-
outline: !0,
|
|
535
|
-
size: "sm"
|
|
536
|
-
})
|
|
537
|
-
]
|
|
538
|
-
) : r("div")
|
|
539
|
-
]),
|
|
540
|
-
r("div", { class: "flex-1" }, a.row.original.ref)
|
|
541
|
-
]);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
], c = M({
|
|
545
|
-
search: "",
|
|
546
|
-
"pf_collectible.type": [],
|
|
547
|
-
"metadata.location": [],
|
|
548
|
-
dateRange: {
|
|
549
|
-
startDate: y().subtract(7, "day").toISOString(),
|
|
550
|
-
endDate: y().endOf("day").toISOString()
|
|
551
|
-
},
|
|
552
|
-
source: []
|
|
553
|
-
}), { tableMeta: T, rowData: p, onSort: o, debouncedFetchData: e, onSearch: l } = re(async (a) => {
|
|
554
|
-
const t = {
|
|
555
|
-
...c.value,
|
|
556
|
-
user: _.user,
|
|
557
|
-
dateRange: {
|
|
558
|
-
start: new Date(c.value.dateRange.startDate).toISOString(),
|
|
559
|
-
end: new Date(c.value.dateRange.endDate).toISOString()
|
|
560
|
-
}
|
|
561
|
-
}, h = await G.readAll(a, t);
|
|
562
|
-
return {
|
|
563
|
-
resources: h.resources.map((v) => {
|
|
564
|
-
const i = s.value.find((I) => I._id === v.ref);
|
|
565
|
-
return { ...v, ref: (i == null ? void 0 : i.seqNumber) || v.ref };
|
|
566
|
-
}),
|
|
567
|
-
meta: h.meta
|
|
568
|
-
};
|
|
569
|
-
}), s = M([]), w = oe.options.map((a) => ({ label: K(N.getReason(a)), value: a })), g = P(
|
|
570
|
-
() => S.locations.map((a) => ({ label: a.name, value: a._id }))
|
|
571
|
-
);
|
|
572
|
-
Q(
|
|
573
|
-
c,
|
|
574
|
-
() => {
|
|
575
|
-
e();
|
|
576
|
-
},
|
|
577
|
-
{ deep: !0 }
|
|
578
|
-
);
|
|
579
|
-
async function D() {
|
|
580
|
-
try {
|
|
581
|
-
C.value = !0;
|
|
582
|
-
const a = {
|
|
583
|
-
...c.value,
|
|
584
|
-
user: _.user,
|
|
585
|
-
dateRange: {
|
|
586
|
-
start: new Date(c.value.dateRange.startDate).toISOString(),
|
|
587
|
-
end: new Date(c.value.dateRange.endDate).toISOString()
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
await ce({
|
|
591
|
-
exporter: new Oe(),
|
|
592
|
-
readFunction: (t) => G.readAll(t, a),
|
|
593
|
-
transformRecord: (t) => {
|
|
594
|
-
var h, v, i, I, U, $, B;
|
|
595
|
-
return {
|
|
596
|
-
TransactionID: t._id,
|
|
597
|
-
CreatedAt: y(Y(t._id.toString())).format(
|
|
598
|
-
"D MMM YYYY, hh:mmA"
|
|
599
|
-
),
|
|
600
|
-
Amount: J(
|
|
601
|
-
t.expiryAmount.reduce(
|
|
602
|
-
(fe, ge) => fe + ge.amount,
|
|
603
|
-
t.amount ?? 0
|
|
604
|
-
),
|
|
605
|
-
2
|
|
606
|
-
),
|
|
607
|
-
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") : "",
|
|
608
|
-
Type: N.formattedType(t),
|
|
609
|
-
Source: K(N.getReason(t.source)),
|
|
610
|
-
User: ((U = t.pf_user) == null ? void 0 : U.name) || "",
|
|
611
|
-
"Phone No.": (($ = t.pf_user) == null ? void 0 : $.phoneNumber) || "",
|
|
612
|
-
References: t.ref,
|
|
613
|
-
Remark: ((B = t.metadata) == null ? void 0 : B.remark) || ""
|
|
614
|
-
};
|
|
615
|
-
},
|
|
616
|
-
filename: "transactions"
|
|
617
|
-
});
|
|
618
|
-
} catch (a) {
|
|
619
|
-
console.error(a);
|
|
620
|
-
} finally {
|
|
621
|
-
C.value = !1;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
const F = M(null);
|
|
625
|
-
function pe(a) {
|
|
626
|
-
var t;
|
|
627
|
-
console.log(a), (t = F.value) == null || t.showSheet(!0, a.original);
|
|
628
|
-
}
|
|
629
|
-
return _e(async () => {
|
|
630
|
-
await S.readLocations(), await u.read(), await e();
|
|
631
|
-
}), (a, t) => {
|
|
632
|
-
const h = O("FmSearch"), v = O("FmButton");
|
|
633
|
-
return E(), V(X, null, [
|
|
634
|
-
x("div", null, [
|
|
635
|
-
x("div", Be, [
|
|
636
|
-
R(h, {
|
|
637
|
-
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
638
|
-
modelValue: n(c).search,
|
|
639
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => n(c).search = i),
|
|
640
|
-
placeholder: "Search",
|
|
641
|
-
collapsible: ""
|
|
642
|
-
}, null, 8, ["modelValue"]),
|
|
643
|
-
R(v, {
|
|
644
|
-
icon: "ios_share",
|
|
645
|
-
variant: "tertiary",
|
|
646
|
-
onClick: D
|
|
647
|
-
})
|
|
648
|
-
]),
|
|
649
|
-
x("div", Le, [
|
|
650
|
-
x("div", ze, [
|
|
651
|
-
R(j, {
|
|
652
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
653
|
-
"right-icon": "keyboard_arrow_down",
|
|
654
|
-
modelValue: n(c)["metadata.location"],
|
|
655
|
-
"onUpdate:modelValue": t[1] || (t[1] = (i) => n(c)["metadata.location"] = i),
|
|
656
|
-
icon: "storefront",
|
|
657
|
-
"show-item-label": !0,
|
|
658
|
-
items: n(g)
|
|
659
|
-
}, null, 8, ["modelValue", "items"]),
|
|
660
|
-
R(j, {
|
|
661
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
662
|
-
"right-icon": "keyboard_arrow_down",
|
|
663
|
-
modelValue: n(c)["pf_collectible.type"],
|
|
664
|
-
"onUpdate:modelValue": t[2] || (t[2] = (i) => n(c)["pf_collectible.type"] = i),
|
|
665
|
-
label: "Type: ",
|
|
666
|
-
"show-item-label": !0,
|
|
667
|
-
items: [
|
|
668
|
-
{ label: "Point", value: "COIN" },
|
|
669
|
-
{ label: "Credit", value: "CREDIT" },
|
|
670
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
671
|
-
{ label: "Experience", value: "POINT" },
|
|
672
|
-
{ label: "Tier", value: "TIER" },
|
|
673
|
-
{ label: "Title", value: "TITLE" },
|
|
674
|
-
{ label: "Game", value: "GAME" },
|
|
675
|
-
{ label: "Stamp", value: "STAMP" }
|
|
676
|
-
]
|
|
677
|
-
}, null, 8, ["modelValue"]),
|
|
678
|
-
R(j, {
|
|
679
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
680
|
-
"right-icon": "keyboard_arrow_down",
|
|
681
|
-
modelValue: n(c).source,
|
|
682
|
-
"onUpdate:modelValue": t[3] || (t[3] = (i) => n(c).source = i),
|
|
683
|
-
label: "Source: ",
|
|
684
|
-
"show-item-label": !0,
|
|
685
|
-
items: n(w)
|
|
686
|
-
}, null, 8, ["modelValue", "items"]),
|
|
687
|
-
R(de, {
|
|
688
|
-
"model-value": {
|
|
689
|
-
startDate: n(c).dateRange.startDate,
|
|
690
|
-
endDate: n(c).dateRange.endDate
|
|
691
|
-
},
|
|
692
|
-
"onUpdate:modelValue": t[4] || (t[4] = (i) => n(c).dateRange = {
|
|
693
|
-
startDate: n(y)(i.startDate).startOf("d").toISOString(),
|
|
694
|
-
endDate: n(y)(i.endDate).endOf("d").toISOString()
|
|
695
|
-
})
|
|
696
|
-
}, null, 8, ["model-value"])
|
|
697
|
-
]),
|
|
698
|
-
R(h, {
|
|
699
|
-
class: "xs:hidden",
|
|
700
|
-
modelValue: n(c).search,
|
|
701
|
-
"onUpdate:modelValue": t[5] || (t[5] = (i) => n(c).search = i),
|
|
702
|
-
placeholder: "Search",
|
|
703
|
-
collapsible: ""
|
|
704
|
-
}, null, 8, ["modelValue"]),
|
|
705
|
-
x("div", Ke, [
|
|
706
|
-
R(v, {
|
|
707
|
-
icon: "ios_share",
|
|
708
|
-
variant: "tertiary",
|
|
709
|
-
onClick: D
|
|
710
|
-
})
|
|
711
|
-
])
|
|
712
|
-
]),
|
|
713
|
-
R(se, {
|
|
714
|
-
loading: n(T).isLoading,
|
|
715
|
-
"row-data": n(p),
|
|
716
|
-
"row-count": n(T).totalRows,
|
|
717
|
-
"column-defs": A.filter(
|
|
718
|
-
(i) => !_.user || i.header !== "User" && i.header !== "Phone No."
|
|
719
|
-
),
|
|
720
|
-
"page-count": n(T).pageCount,
|
|
721
|
-
"page-index": n(T).pageIndex,
|
|
722
|
-
"page-size": n(T).pageSize,
|
|
723
|
-
"shrink-at": !1,
|
|
724
|
-
onSortChange: n(o),
|
|
725
|
-
onPageChange: t[6] || (t[6] = (i) => n(e)({
|
|
726
|
-
pageSize: i.pageSize,
|
|
727
|
-
pageIndex: i.pageIndex
|
|
728
|
-
})),
|
|
729
|
-
onRowClick: pe
|
|
730
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
731
|
-
]),
|
|
732
|
-
R($e, {
|
|
733
|
-
ref_key: "transactionDetailSheet",
|
|
734
|
-
ref: F
|
|
735
|
-
}, null, 512)
|
|
736
|
-
], 64);
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
class Ge extends ie {
|
|
741
|
-
}
|
|
742
|
-
const He = { class: "flex items-center justify-between" }, je = { class: "flex gap-8 items-center" }, qe = { class: "flex gap-8 items-center xs:hidden" }, Dt = /* @__PURE__ */ H({
|
|
743
|
-
__name: "StoreTransactions",
|
|
744
|
-
props: {
|
|
745
|
-
user: {
|
|
746
|
-
type: String
|
|
747
|
-
}
|
|
748
|
-
},
|
|
749
|
-
setup(m) {
|
|
750
|
-
const f = m, { minor: S } = Ce;
|
|
751
|
-
Se();
|
|
752
|
-
const u = [
|
|
753
|
-
{
|
|
754
|
-
header: "Transaction ID",
|
|
755
|
-
meta: {
|
|
756
|
-
maxWidth: "150px"
|
|
757
|
-
},
|
|
758
|
-
cell(e) {
|
|
759
|
-
return r("div", { class: "flex items-center" }, [
|
|
760
|
-
r(b.FmIcon, {
|
|
761
|
-
name: "content_copy",
|
|
762
|
-
outline: !0,
|
|
763
|
-
size: "sm",
|
|
764
|
-
class: "cursor-pointer mr-4 shrink-0",
|
|
765
|
-
onClick: (l) => {
|
|
766
|
-
l.preventDefault(), l.stopPropagation(), Z(e.row.original._id.toString());
|
|
767
|
-
}
|
|
768
|
-
}),
|
|
769
|
-
r("div", { class: "truncate" }, e.row.original._id.toString())
|
|
770
|
-
]);
|
|
771
|
-
}
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
header: "Created at",
|
|
775
|
-
accessorFn: (e) => y(Y(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
776
|
-
enableSorting: !0
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
header: "Bundle",
|
|
780
|
-
accessorFn: (e) => e.bundle.name
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
header: "Location",
|
|
784
|
-
accessorFn: (e) => e.location ? e.pf_location[0].name : "Online Store"
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
header: "Payment Type",
|
|
788
|
-
accessorFn: (e) => {
|
|
789
|
-
var l;
|
|
790
|
-
return ((l = e.paymentType) == null ? void 0 : l.type) ?? "N/A";
|
|
791
|
-
},
|
|
792
|
-
cell(e) {
|
|
793
|
-
var l, s;
|
|
794
|
-
return r("div", { class: "flex items-center gap-4" }, [
|
|
795
|
-
r("div", { class: "flex items-center" }, [
|
|
796
|
-
((l = e.row.original.paymentType) == null ? void 0 : l.type) == "ONLINE" && e.row.original.paymentType.extra ? r(
|
|
797
|
-
b.FmTooltip,
|
|
798
|
-
{
|
|
799
|
-
content: e.row.original.paymentType.extra
|
|
800
|
-
},
|
|
801
|
-
[
|
|
802
|
-
r(b.FmIcon, {
|
|
803
|
-
name: "info",
|
|
804
|
-
outline: !0,
|
|
805
|
-
size: "sm"
|
|
806
|
-
})
|
|
807
|
-
]
|
|
808
|
-
) : r("div")
|
|
809
|
-
]),
|
|
810
|
-
r(
|
|
811
|
-
"div",
|
|
812
|
-
{ class: "flex-1" },
|
|
813
|
-
((s = e.row.original.paymentType) == null ? void 0 : s.type) ?? "N/A"
|
|
814
|
-
)
|
|
815
|
-
]);
|
|
816
|
-
}
|
|
817
|
-
},
|
|
818
|
-
{
|
|
819
|
-
header: "User",
|
|
820
|
-
cell: (e) => le(e.row.original.pf_member)
|
|
821
|
-
},
|
|
822
|
-
{
|
|
823
|
-
header: "Phone No.",
|
|
824
|
-
accessorFn: (e) => e.pf_member.phoneNumber
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
header: "Status",
|
|
828
|
-
// accessorFn: (u) => u.status,
|
|
829
|
-
cell(e) {
|
|
830
|
-
var w, g, D, F;
|
|
831
|
-
const l = e.row.original.status, s = {
|
|
832
|
-
COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
833
|
-
REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
|
|
834
|
-
};
|
|
835
|
-
return r("div", { class: "flex items-center gap-4" }, [
|
|
836
|
-
r(b.FmChip, {
|
|
837
|
-
label: we.title(l),
|
|
838
|
-
variant: "plain",
|
|
839
|
-
class: s[l] ?? ""
|
|
840
|
-
}),
|
|
841
|
-
(g = (w = e.row.original) == null ? void 0 : w.refund) != null && g.reason ? r(
|
|
842
|
-
b.FmTooltip,
|
|
843
|
-
{
|
|
844
|
-
content: (F = (D = e.row.original) == null ? void 0 : D.refund) == null ? void 0 : F.reason
|
|
845
|
-
},
|
|
846
|
-
[
|
|
847
|
-
r(b.FmIcon, {
|
|
848
|
-
name: "info",
|
|
849
|
-
color: "primary",
|
|
850
|
-
outline: !0,
|
|
851
|
-
size: "sm"
|
|
852
|
-
})
|
|
853
|
-
]
|
|
854
|
-
) : null
|
|
855
|
-
]);
|
|
856
|
-
}
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
header: "Source",
|
|
860
|
-
accessorFn: (e) => e.source
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
header: "Ref",
|
|
864
|
-
accessorFn: (e) => e.ref
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
id: "action",
|
|
868
|
-
cell(e) {
|
|
869
|
-
const l = e.row.original, s = l.status === "COMPLETED" && !l.refund && l.source == "ADMIN";
|
|
870
|
-
return s ? r(
|
|
871
|
-
b.FmMenu,
|
|
872
|
-
{
|
|
873
|
-
placement: "bottom-end",
|
|
874
|
-
onClick: (w) => {
|
|
875
|
-
w.stopPropagation();
|
|
876
|
-
}
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
"menu-button": () => r(b.FmButton, {
|
|
880
|
-
icon: "settings",
|
|
881
|
-
variant: "tertiary",
|
|
882
|
-
if: s
|
|
883
|
-
}),
|
|
884
|
-
default: () => [
|
|
885
|
-
r(b.FmMenuItem, {
|
|
886
|
-
label: "Refund",
|
|
887
|
-
sublabel: "Refund this transaction",
|
|
888
|
-
onClick: async (w) => {
|
|
889
|
-
w.stopPropagation(), await p(l);
|
|
890
|
-
}
|
|
891
|
-
})
|
|
892
|
-
]
|
|
893
|
-
}
|
|
894
|
-
) : r("div");
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
], d = M({
|
|
898
|
-
searchValue: "",
|
|
899
|
-
dateRange: {
|
|
900
|
-
startDate: y().subtract(7, "day").toISOString(),
|
|
901
|
-
endDate: y().toISOString()
|
|
902
|
-
}
|
|
903
|
-
}), { tableMeta: _, rowData: C, onSort: A, debouncedFetchData: c, onSearch: T } = re(async (e) => {
|
|
904
|
-
const l = {
|
|
905
|
-
...d.value.dateRange,
|
|
906
|
-
user: f.user
|
|
907
|
-
};
|
|
908
|
-
return await G.readStoreTransactions(e, l);
|
|
909
|
-
});
|
|
910
|
-
async function p(e) {
|
|
911
|
-
await De.confirm(
|
|
912
|
-
"Are you sure you want to refund this transaction?",
|
|
913
|
-
"Refund Store Transaction",
|
|
914
|
-
"Confirm",
|
|
915
|
-
"Cancel"
|
|
916
|
-
) && await S(
|
|
917
|
-
async () => {
|
|
918
|
-
var s;
|
|
919
|
-
await Fe.refundStoreTransaction({
|
|
920
|
-
id: e._id,
|
|
921
|
-
reason: `ADMIN:${(s = Te().sessionUser) == null ? void 0 : s.name}`
|
|
922
|
-
}), await c();
|
|
923
|
-
},
|
|
924
|
-
{
|
|
925
|
-
message: "Refunding transaction...",
|
|
926
|
-
successMessage: "Transaction refunded successfully"
|
|
927
|
-
}
|
|
928
|
-
);
|
|
929
|
-
}
|
|
930
|
-
Q(
|
|
931
|
-
d,
|
|
932
|
-
() => {
|
|
933
|
-
c();
|
|
934
|
-
},
|
|
935
|
-
{ deep: !0 }
|
|
936
|
-
), ae(async () => {
|
|
937
|
-
await c();
|
|
938
|
-
});
|
|
939
|
-
const o = async () => ce({
|
|
940
|
-
exporter: new Ge(),
|
|
941
|
-
readFunction: (e) => G.readStoreTransactions(e, {
|
|
942
|
-
...d.value.dateRange,
|
|
943
|
-
user: f.user
|
|
944
|
-
}),
|
|
945
|
-
transformRecord: (e) => {
|
|
946
|
-
var l, s, w, g, D, F;
|
|
947
|
-
return {
|
|
948
|
-
TransactionId: ((l = e._id) == null ? void 0 : l.toString()) || "",
|
|
949
|
-
CreatedAt: y(Y(e._id.toString())).format(
|
|
950
|
-
"DD/MM/YYYY HH:mm:ss"
|
|
951
|
-
),
|
|
952
|
-
Bundle: e.bundle.name || "",
|
|
953
|
-
Location: e.location ? e.pf_location[0].name : "Online Store",
|
|
954
|
-
PaymentType: ((s = e.paymentType) == null ? void 0 : s.type) || "N/A",
|
|
955
|
-
PaymentExtra: ((w = e.paymentType) == null ? void 0 : w.extra) || "",
|
|
956
|
-
User: ((g = e.pf_member) == null ? void 0 : g.name) || "",
|
|
957
|
-
PhoneNumber: ((D = e.pf_member) == null ? void 0 : D.phoneNumber) || "",
|
|
958
|
-
Status: e.status || "",
|
|
959
|
-
RefundReason: ((F = e == null ? void 0 : e.refund) == null ? void 0 : F.reason) || "",
|
|
960
|
-
Ref: (e == null ? void 0 : e.ref) || ""
|
|
961
|
-
};
|
|
962
|
-
},
|
|
963
|
-
filename: "store-transactions"
|
|
964
|
-
});
|
|
965
|
-
return (e, l) => {
|
|
966
|
-
const s = O("FmSearch"), w = O("FmButton");
|
|
967
|
-
return E(), V("div", null, [
|
|
968
|
-
x("div", He, [
|
|
969
|
-
x("div", je, [
|
|
970
|
-
R(de, {
|
|
971
|
-
modelValue: n(d).dateRange,
|
|
972
|
-
"onUpdate:modelValue": l[0] || (l[0] = (g) => n(d).dateRange = g)
|
|
973
|
-
}, null, 8, ["modelValue"])
|
|
974
|
-
]),
|
|
975
|
-
x("div", qe, [
|
|
976
|
-
R(s, {
|
|
977
|
-
modelValue: n(_).searchValue,
|
|
978
|
-
"onUpdate:modelValue": [
|
|
979
|
-
l[1] || (l[1] = (g) => n(_).searchValue = g),
|
|
980
|
-
n(T)
|
|
981
|
-
],
|
|
982
|
-
placeholder: "Search",
|
|
983
|
-
collapsible: ""
|
|
984
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
985
|
-
R(w, {
|
|
986
|
-
icon: "ios_share",
|
|
987
|
-
variant: "tertiary",
|
|
988
|
-
onClick: o
|
|
989
|
-
})
|
|
990
|
-
])
|
|
991
|
-
]),
|
|
992
|
-
R(se, {
|
|
993
|
-
loading: n(_).isLoading,
|
|
994
|
-
"row-data": n(C),
|
|
995
|
-
"row-count": n(_).totalRows,
|
|
996
|
-
"column-defs": u.filter(
|
|
997
|
-
(g) => !f.user || g.header !== "User" && g.header !== "Phone No."
|
|
998
|
-
),
|
|
999
|
-
"page-count": n(_).pageCount,
|
|
1000
|
-
"page-index": n(_).pageIndex,
|
|
1001
|
-
"page-size": n(_).pageSize,
|
|
1002
|
-
"shrink-at": !1,
|
|
1003
|
-
onSortChange: n(A),
|
|
1004
|
-
onPageChange: l[2] || (l[2] = (g) => n(c)({
|
|
1005
|
-
pageSize: g.pageSize,
|
|
1006
|
-
pageIndex: g.pageIndex
|
|
1007
|
-
}))
|
|
1008
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1009
|
-
]);
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
});
|
|
1013
|
-
export {
|
|
1014
|
-
wt as _,
|
|
1015
|
-
Dt as a
|
|
1016
|
-
};
|