@feedmepos/mf-connect 0.1.89-prod → 0.1.90-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-BMwxfYv_.js} +11 -11
- package/dist/{App-D_q4nHiY.js → App-D_SZawqp.js} +7 -7
- package/dist/{Bin-DURa0qe2.js → Bin-Dd1a25j_.js} +8 -8
- package/dist/{Broadcast-ByDjXqap.js → Broadcast-UAp6rjTh.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BD8mWUzO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFe8C9fR.js} +7 -7
- package/dist/{Card-BSSzVrbz.js → Card-CQuGfckK.js} +19 -19
- package/dist/{Collections-CTwUl8W3.js → Collections-oWvNX_oo.js} +8 -8
- package/dist/{Credit-TgZBmYsM.js → Credit-tGCTd7QC.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DZV3JtDl.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7h5K6lN.js} +33 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BwOs5NHt.js → EffectSheet.vue_vue_type_style_index_0_lang-BvIk7GMj.js} +6 -6
- package/dist/{Experience-DUCO6do6.js → Experience-D6w2OyuS.js} +8 -8
- package/dist/{FileSaver.min-BaCfYtPG.js → FileSaver.min-9I0Uce_o.js} +1 -1
- package/dist/{Game-DcwQSCjZ.js → Game-Bj8mS5qz.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BSMwEFqp.js → ImageInput.vue_vue_type_script_setup_true_lang-D3B7IMDV.js} +1 -1
- package/dist/{Index-Bp2CKHw3.js → Index-Dsexv-ef.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-WWVHvcOU.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CmB12mvX.js} +1 -1
- package/dist/{MainLayout-Q_0POZ4I.js → MainLayout-o1wQv9lH.js} +1 -1
- package/dist/{Marketing-D52IYXPR.js → Marketing-Dz0sk_DR.js} +6 -6
- package/dist/{Member-sxjxhLwQ.js → Member-rFVgJTbb.js} +12 -12
- package/dist/{MemberList-vLNFHNRw.js → MemberList-BpnL4Fbw.js} +436 -441
- package/dist/{MemberTransactions-BeHeN0Rk.js → MemberTransactions-ouq288EU.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B6cF0EC3.js → MessageInput.vue_vue_type_script_setup_true_lang-wSeJMwF7.js} +9 -9
- package/dist/{Mission-CnJCjBhe.js → Mission-D1KR53bD.js} +9 -9
- package/dist/{Overview-B3jRs_Cg.js → Overview-B5bzlo0A.js} +19 -19
- package/dist/{Point-BldY5wb0.js → Point-DTifJVdo.js} +8 -8
- package/dist/{Promotion-CsGhqlY0.js → Promotion-DAtAw5kG.js} +9 -9
- package/dist/{Queue-CLa2pSXF.js → Queue-DBnvPuuW.js} +11 -11
- package/dist/{Record-JbbAM6lI.js → Record-DI-q_FuN.js} +9 -9
- package/dist/{Reward-wgiBCIV3.js → Reward-C9CxDqz_.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DiNlpy7_.js → RewardGroup.vue_vue_type_script_setup_true_lang-BBE5Ymqj.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B3Ylb1vx.js → RuleGroup.vue_vue_type_script_setup_true_lang-DNM6f0iG.js} +15 -15
- package/dist/{Segment-BQiZ51Wi.js → Segment-B0Oy6ajr.js} +25 -25
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DbXFTjAN.js → SelectItems.vue_vue_type_script_setup_true_lang-Be6Ykmkc.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Be_kiAB6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-MARrd7Nr.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DS1MWUOc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-w9sbHf1G.js} +4 -4
- package/dist/Setting-BUfHh3b6.js +2028 -0
- package/dist/{SettingAdvertisements-OdDM05s7.js → SettingAdvertisements-D2qWdId7.js} +12 -12
- package/dist/{Store-D1Q0wOXk.js → Store-mNM5AzFJ.js} +22 -22
- package/dist/{StoreRewards-2Gdv7uu4.js → StoreRewards-D4-c0EPM.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-tk42owGe.js +1118 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BKzZIJkt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C65gN2Gd.js} +5 -3
- package/dist/{Tier-DOnYGgah.js → Tier-swAmEa8-.js} +22 -22
- package/dist/{Title-F4XJw6oN.js → Title-BQQBoFOx.js} +21 -21
- package/dist/{Transaction-Ws7kBZUE.js → Transaction-BCjSkDrw.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BZb0EXgi.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-IDqjTwZt.js} +6 -6
- package/dist/{Voucher-DX8MKz00.js → Voucher-BAGLTdGv.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-tUNn1vRE.js → VoucherEditor.vue_vue_type_script_setup_true_lang-7CKmTEVm.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BvgIZlIh.js → ZodTextField.vue_vue_type_script_setup_true_lang-B_0BhFd7.js} +2 -2
- package/dist/{app-C-nC9SMv.js → app-Dij-Gw3J.js} +49 -45
- package/dist/app.js +1 -1
- package/dist/{business-CrQ_qouH.js → business-BPttWtAG.js} +1 -1
- package/dist/{campaign-CBRSag11.js → campaign-DVQC46G6.js} +8 -8
- package/dist/{campaign-shm1Nb7g.js → campaign-PkE8sv2w.js} +1 -1
- package/dist/{campaign.enum-C-p5_XEd.js → campaign.enum-D6sGv-i6.js} +1 -1
- package/dist/{campaign.fn-BGzZfg1o.js → campaign.fn-CKpORxQM.js} +161 -161
- package/dist/{collectible.enum-DxOoBouZ.js → collectible.enum-MjUCS47s.js} +1 -1
- package/dist/{collection.fn-BKmv2KVW.js → collection.fn-BgLy48_a.js} +2 -2
- package/dist/{dto-BRQj35uX.js → dto-Cr1_4S0y.js} +4 -4
- package/dist/{effect-Bbc7QO26.js → effect-CZOUmaXH.js} +1 -1
- package/dist/{email-addresses-CdmKczY8.js → email-addresses-DgPF09-i.js} +2 -2
- package/dist/{export-xWupGZRl.js → export-BGwLWDbw.js} +3 -3
- package/dist/{helper-C_t7u0sc.js → helper-BpGjM57Y.js} +1 -1
- package/dist/{index-C6PeL89d.js → index-8Mt35h00.js} +3 -3
- package/dist/{index-DaCQrz9t.js → index-AGdd55s3.js} +3 -3
- package/dist/{index-DAhj82tf.js → index-BzNxgycz.js} +1 -1
- package/dist/{index-lZq2A3X2.js → index-C2b2PGqB.js} +3 -3
- package/dist/{index-BxosLsfW.js → index-CZbs1ScI.js} +1 -1
- package/dist/index-CsjJKy32.js +85 -0
- package/dist/{index-RsNRLaWL.js → index-D3jQoHcb.js} +23 -12
- package/dist/{index-ClEGMTrv.js → index-DG88MQyX.js} +1 -1
- package/dist/{index-DW7nPyed.js → index-DVtnOY4x.js} +6 -6
- package/dist/{index-BaGjDOR2.js → index-DjEcMAQl.js} +1 -1
- package/dist/{index-CLvFXL_E.js → index-Dx04wWQ2.js} +4 -4
- package/dist/{index-REoHVOcy.js → index-dSK3QWJX.js} +1 -1
- package/dist/{index-BHwWZLKa.js → index-qGQhKrNH.js} +5 -3
- package/dist/{index.esm2017-DIVK9KD2.js → index.esm2017-BnCWqavv.js} +1 -1
- package/dist/{loading-xptL2Ny2.js → loading-kCbpDTvS.js} +1 -1
- package/dist/{lodash-88xjswCi.js → lodash-C4AZ3S-J.js} +1 -1
- package/dist/{membership-eoLCZt_p.js → membership-D2-ldXWY.js} +3 -3
- package/dist/{money-DcsDa1nm.js → money-BueaFHxA.js} +1 -1
- package/dist/{number-BkGWCSrD.js → number-DQbzn_l_.js} +1 -1
- package/dist/{objectid-gUqB9tj7.js → objectid-B_jNHjAd.js} +5 -5
- package/dist/{plugins-DoTCd9nY.js → plugins-D5Na7PGX.js} +3 -3
- package/dist/{reward-Culc3-Rv.js → reward-DJqNxI9u.js} +1 -1
- package/dist/{rule-DUDjRs8M.js → rule-CHRKj3Qt.js} +3 -3
- package/dist/{rule-builder-CkZtoez-.js → rule-builder-CEZ2VxtL.js} +1 -1
- package/dist/{template-CxhdtuLf.js → template-BFhV6iql.js} +7 -7
- package/dist/{timezone-CdsdekR2.js → timezone-BQhT-oxQ.js} +5 -3
- package/dist/{trigger-CFXIiuLd.js → trigger-nhg31Cm2.js} +5 -5
- package/dist/usePagination-z6Io9pE3.js +220 -0
- package/dist/{user-C7hrMSvV.js → user-uP7Z7WUa.js} +1 -1
- package/dist/{vue-i18n-BdGyU2Nr.js → vue-i18n-DYzNH5z4.js} +158 -158
- package/dist/{xlsx-BN2KFkI2.js → xlsx-DTeYpknU.js} +1 -1
- package/dist/{zod-DvUTBth7.js → zod-YWGh4sc1.js} +1 -1
- package/package.json +1 -1
- package/dist/Setting-De1lCG6N.js +0 -1989
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-NtxHf8HF.js +0 -1016
- package/dist/index-DDQaEXt7.js +0 -76
- package/dist/usePagination-BSeGmTq6.js +0 -177
|
@@ -0,0 +1,1118 @@
|
|
|
1
|
+
import { defineComponent as X, mergeModels as le, useModel as Se, computed as z, onMounted as ce, watch as ae, resolveComponent as P, openBlock as A, createBlock as J, withCtx as Z, createVNode as T, unref as s, ref as N, h as l, isRef as we, createElementVNode as C, createElementBlock as Y, Fragment as ee, renderList as ie, toDisplayString as H, createTextVNode as Ce, resolveDynamicComponent as De, onBeforeMount as Re } from "vue";
|
|
2
|
+
import { components as w, useDialog as Te } from "@feedmepos/ui-library";
|
|
3
|
+
import { r as ue } from "./index-Dx04wWQ2.js";
|
|
4
|
+
import "./index-AGdd55s3.js";
|
|
5
|
+
import { s as Ie } from "./index-dSK3QWJX.js";
|
|
6
|
+
import { h as x } from "./moment-D7p2TMB-.js";
|
|
7
|
+
import { _ as Q } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
8
|
+
import { s as W } from "./index-CuvNtC_M.js";
|
|
9
|
+
import { f as te } from "./number-DQbzn_l_.js";
|
|
10
|
+
import { u as de } from "./business-BPttWtAG.js";
|
|
11
|
+
import { _ as me, u as Fe } from "./usePagination-z6Io9pE3.js";
|
|
12
|
+
import { a as oe, c as Ee, p as Ne } from "./plugins-D5Na7PGX.js";
|
|
13
|
+
import { g as pe } from "./user-uP7Z7WUa.js";
|
|
14
|
+
import { B as fe, e as Me } from "./export-BGwLWDbw.js";
|
|
15
|
+
import { u as ge } from "./campaign-PkE8sv2w.js";
|
|
16
|
+
import "./index-CZbs1ScI.js";
|
|
17
|
+
import "./index-C2b2PGqB.js";
|
|
18
|
+
import "./index-DVtnOY4x.js";
|
|
19
|
+
import "./index-DG88MQyX.js";
|
|
20
|
+
import "./index-8Mt35h00.js";
|
|
21
|
+
import { u as he } from "./vue-i18n-DYzNH5z4.js";
|
|
22
|
+
import { o as $ } from "./objectId-dwaoBfJX.js";
|
|
23
|
+
import { u as ve } from "./loading-kCbpDTvS.js";
|
|
24
|
+
import { w as Ae } from "./xlsx-DTeYpknU.js";
|
|
25
|
+
import { useRouter as Oe } from "vue-router";
|
|
26
|
+
import { t as q } from "./index-D3jQoHcb.js";
|
|
27
|
+
import { R as j } from "./app-Dij-Gw3J.js";
|
|
28
|
+
import { useCoreStore as ke } from "@feedmepos/mf-common";
|
|
29
|
+
import { m as Pe } from "./index-BzNxgycz.js";
|
|
30
|
+
function Ve(c) {
|
|
31
|
+
let m = "";
|
|
32
|
+
switch (c) {
|
|
33
|
+
case "PORTAL":
|
|
34
|
+
m = "ADMIN";
|
|
35
|
+
break;
|
|
36
|
+
case "BENEFIT":
|
|
37
|
+
m = "MEMBERSHIP";
|
|
38
|
+
break;
|
|
39
|
+
case "ORDER":
|
|
40
|
+
m = "ORDER";
|
|
41
|
+
break;
|
|
42
|
+
case "BILL":
|
|
43
|
+
m = "SPENDING";
|
|
44
|
+
break;
|
|
45
|
+
case "CASHBACK":
|
|
46
|
+
m = "CASHBACK";
|
|
47
|
+
break;
|
|
48
|
+
case "CYCLE":
|
|
49
|
+
m = "EXPIRED";
|
|
50
|
+
break;
|
|
51
|
+
case "COUNTER_CONSUME":
|
|
52
|
+
m = "COUNTER REDEEM";
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
m = c;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return m;
|
|
59
|
+
}
|
|
60
|
+
function Ye(c) {
|
|
61
|
+
var m, i, u, p, h, b;
|
|
62
|
+
switch ((m = c == null ? void 0 : c.pf_collectible) == null ? void 0 : m.type) {
|
|
63
|
+
case "VOUCHER":
|
|
64
|
+
return `${(i = c.pf_collectible) == null ? void 0 : i.type} (${(u = c.pf_collectible) == null ? void 0 : u.name})`;
|
|
65
|
+
case "TITLE":
|
|
66
|
+
return `${(p = c.pf_collectible) == null ? void 0 : p.type} (${(h = c.pf_collectible) == null ? void 0 : h.name})`;
|
|
67
|
+
case "POINT":
|
|
68
|
+
return "Experience";
|
|
69
|
+
case "COIN":
|
|
70
|
+
return "Point";
|
|
71
|
+
default:
|
|
72
|
+
return Ie((b = c == null ? void 0 : c.pf_collectible) == null ? void 0 : b.type);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function ze(c) {
|
|
76
|
+
switch (c) {
|
|
77
|
+
case "ONLINE":
|
|
78
|
+
return "Online";
|
|
79
|
+
case "COIN":
|
|
80
|
+
return "Point";
|
|
81
|
+
default:
|
|
82
|
+
return c;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const k = {
|
|
86
|
+
getReason: Ve,
|
|
87
|
+
formattedType: Ye,
|
|
88
|
+
formattedPaymentType: ze
|
|
89
|
+
}, V = "YYYY-MM-DD", ye = /* @__PURE__ */ X({
|
|
90
|
+
__name: "DateRangeChip",
|
|
91
|
+
props: /* @__PURE__ */ le({
|
|
92
|
+
modelValue: {
|
|
93
|
+
type: Object,
|
|
94
|
+
required: !0
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
dateRange: {
|
|
98
|
+
type: Object,
|
|
99
|
+
default: () => ({
|
|
100
|
+
startDate: x().subtract(7, "day").format(V),
|
|
101
|
+
endDate: x().endOf("day").format(V)
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
dateRangeModifiers: {}
|
|
105
|
+
}),
|
|
106
|
+
emits: /* @__PURE__ */ le(["update:model-value"], ["update:dateRange"]),
|
|
107
|
+
setup(c, { emit: m }) {
|
|
108
|
+
const i = c, u = m, p = Se(c, "dateRange"), h = z(() => p.value ? `${b.value.startDate ?? "Start"} - ${b.value.endDate ?? "End"}` : "No dates selected."), b = z(() => ({
|
|
109
|
+
startDate: p.value.startDate ? x(p.value.startDate).format(V) : void 0,
|
|
110
|
+
endDate: p.value.endDate ? x(p.value.endDate).format(V) : void 0
|
|
111
|
+
}));
|
|
112
|
+
return ce(() => {
|
|
113
|
+
p.value = {
|
|
114
|
+
startDate: i.modelValue.startDate ? x(i.modelValue.startDate).format(V) : void 0,
|
|
115
|
+
endDate: i.modelValue.endDate ? x(i.modelValue.endDate).format(V) : void 0
|
|
116
|
+
};
|
|
117
|
+
}), ae(
|
|
118
|
+
() => p.value,
|
|
119
|
+
() => {
|
|
120
|
+
u("update:model-value", b.value);
|
|
121
|
+
}
|
|
122
|
+
), (M, D) => {
|
|
123
|
+
const g = P("FmChip"), f = P("FmDateRangePicker");
|
|
124
|
+
return A(), J(f, {
|
|
125
|
+
modelValue: p.value,
|
|
126
|
+
"onUpdate:modelValue": D[0] || (D[0] = (t) => p.value = t),
|
|
127
|
+
"show-predefined-range": ""
|
|
128
|
+
}, {
|
|
129
|
+
"trigger-button": Z(() => [
|
|
130
|
+
T(g, {
|
|
131
|
+
label: s(h),
|
|
132
|
+
icon: "calendar_month",
|
|
133
|
+
"right-icon": "keyboard_arrow_down",
|
|
134
|
+
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
135
|
+
}, null, 8, ["label"])
|
|
136
|
+
]),
|
|
137
|
+
_: 1
|
|
138
|
+
}, 8, ["modelValue"]);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}), $e = (c) => {
|
|
142
|
+
if (c.startsWith("_") || c.includes("."))
|
|
143
|
+
return c;
|
|
144
|
+
for (const m of ["pf_user_", "pf_collectible_"])
|
|
145
|
+
if (c.startsWith(m))
|
|
146
|
+
return `${m.slice(0, -1)}.${c.slice(m.length).replace(new RegExp("_", "g"), ".")}`;
|
|
147
|
+
return c.replace(new RegExp("_", "g"), ".");
|
|
148
|
+
};
|
|
149
|
+
function Ue(c, m = { key: "_id", descending: !0 }) {
|
|
150
|
+
const i = N({
|
|
151
|
+
pageCount: 1,
|
|
152
|
+
searchValue: "",
|
|
153
|
+
pageIndex: 0,
|
|
154
|
+
totalRows: 0,
|
|
155
|
+
isLoading: !1,
|
|
156
|
+
pageSize: 10,
|
|
157
|
+
hasNext: !1
|
|
158
|
+
}), u = N(m), p = N([]), h = N([void 0]);
|
|
159
|
+
function b() {
|
|
160
|
+
h.value = [void 0], i.value.pageIndex = 0, i.value.pageCount = 1, i.value.hasNext = !1;
|
|
161
|
+
}
|
|
162
|
+
const M = async (o = {}) => {
|
|
163
|
+
const n = o.pageSize ?? i.value.pageSize, _ = n !== i.value.pageSize;
|
|
164
|
+
_ && b();
|
|
165
|
+
const v = _ ? 0 : Math.max(o.pageIndex ?? i.value.pageIndex, 0), I = v === 0 || !!h.value[v] ? v : i.value.pageIndex, U = h.value[I];
|
|
166
|
+
i.value.isLoading = !0, i.value.pageSize = n, p.value = [];
|
|
167
|
+
try {
|
|
168
|
+
const E = await c({
|
|
169
|
+
limit: n,
|
|
170
|
+
sortBy: u.value.key,
|
|
171
|
+
descending: u.value.descending,
|
|
172
|
+
search: i.value.searchValue,
|
|
173
|
+
...U ? { cursor: U } : {}
|
|
174
|
+
});
|
|
175
|
+
p.value = E.resources, i.value.pageIndex = I, i.value.totalRows = E.resources.length, i.value.hasNext = E.meta.hasNext, i.value.pageCount = I + (E.meta.hasNext ? 2 : 1), E.meta.nextCursor ? h.value[I + 1] = E.meta.nextCursor : h.value.splice(I + 1);
|
|
176
|
+
} catch (E) {
|
|
177
|
+
console.error("Error fetching data:", E), i.value.hasNext = !1;
|
|
178
|
+
} finally {
|
|
179
|
+
i.value.isLoading = !1;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
let D, g;
|
|
183
|
+
const f = (o) => (D && clearTimeout(D), g && g(), new Promise((n) => {
|
|
184
|
+
g = n, D = setTimeout(async () => {
|
|
185
|
+
D = void 0, g = void 0, await M(o), n();
|
|
186
|
+
}, 200);
|
|
187
|
+
}));
|
|
188
|
+
return {
|
|
189
|
+
tableMeta: i,
|
|
190
|
+
rowData: p,
|
|
191
|
+
sortBy: u,
|
|
192
|
+
pageCursors: h,
|
|
193
|
+
resetCursorState: b,
|
|
194
|
+
fetchData: M,
|
|
195
|
+
debouncedFetchData: f,
|
|
196
|
+
onSort: async (o) => {
|
|
197
|
+
o.length ? u.value = {
|
|
198
|
+
key: $e(o[0].id),
|
|
199
|
+
descending: o[0].desc
|
|
200
|
+
} : u.value = m, b(), await f({
|
|
201
|
+
pageIndex: 0,
|
|
202
|
+
pageSize: i.value.pageSize
|
|
203
|
+
});
|
|
204
|
+
},
|
|
205
|
+
onSearch: () => (b(), f({
|
|
206
|
+
pageIndex: 0,
|
|
207
|
+
pageSize: i.value.pageSize
|
|
208
|
+
}))
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
class Be extends fe {
|
|
212
|
+
}
|
|
213
|
+
const Le = { class: "space-y-24 pr-12" }, Ke = { class: "w-full space-y-16" }, Ge = { class: "fm-typo-en-body-lg-600" }, He = ["onClick"], je = { class: "fm-typo-en-body-lg-600" }, We = ["onClick"], qe = { class: "flex items-center gap-8" }, Xe = /* @__PURE__ */ X({
|
|
214
|
+
__name: "TransactionDetailSheet",
|
|
215
|
+
setup(c, { expose: m }) {
|
|
216
|
+
he();
|
|
217
|
+
const i = N(!1), u = N(), p = ge(), h = de();
|
|
218
|
+
function b(f, t) {
|
|
219
|
+
i.value = f, u.value = t ?? null;
|
|
220
|
+
}
|
|
221
|
+
const M = z(() => {
|
|
222
|
+
var f, t;
|
|
223
|
+
return te(
|
|
224
|
+
((t = u.value) == null ? void 0 : t.expiryAmount.reduce(
|
|
225
|
+
(e, o) => e + o.amount,
|
|
226
|
+
((f = u.value) == null ? void 0 : f.amount) ?? 0
|
|
227
|
+
)) ?? 0,
|
|
228
|
+
2
|
|
229
|
+
);
|
|
230
|
+
}), D = z(() => {
|
|
231
|
+
var f, t, e, o, n;
|
|
232
|
+
return u.value ? [
|
|
233
|
+
{
|
|
234
|
+
label: "Transaction ID",
|
|
235
|
+
value: (f = u.value) == null ? void 0 : f._id
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
label: "Date/Time",
|
|
239
|
+
value: x($(u.value._id.toString())).format(
|
|
240
|
+
"D MMM YYYY, hh:mmA"
|
|
241
|
+
)
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
label: "Amount",
|
|
245
|
+
component: () => l(
|
|
246
|
+
"span",
|
|
247
|
+
{
|
|
248
|
+
class: [
|
|
249
|
+
"pr-2",
|
|
250
|
+
+M.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
M.value
|
|
254
|
+
)
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
label: "Type",
|
|
258
|
+
value: k.formattedType(u.value)
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
label: "Source",
|
|
262
|
+
value: W(k.getReason(u.value.source))
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: "User",
|
|
266
|
+
value: (e = (t = u.value) == null ? void 0 : t.pf_user) == null ? void 0 : e.name
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
label: "Phone Number",
|
|
270
|
+
value: (n = (o = u.value) == null ? void 0 : o.pf_user) == null ? void 0 : n.phoneNumber
|
|
271
|
+
}
|
|
272
|
+
] : [];
|
|
273
|
+
}), g = z(() => {
|
|
274
|
+
var o, n, _, v;
|
|
275
|
+
if (!u.value) return [];
|
|
276
|
+
const f = [], t = (o = u.value) == null ? void 0 : o.metadata, e = u.value;
|
|
277
|
+
if (t != null && t.campaign) {
|
|
278
|
+
const R = p.campaigns.all.find(
|
|
279
|
+
(I) => I._id === (t == null ? void 0 : t.campaign)
|
|
280
|
+
);
|
|
281
|
+
if (!R) return;
|
|
282
|
+
f.push({
|
|
283
|
+
label: "Campaign",
|
|
284
|
+
value: R.name
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return t != null && t.remark && f.push({
|
|
288
|
+
label: "Remark",
|
|
289
|
+
value: t.remark
|
|
290
|
+
}), (n = u.value) != null && n.ref.startsWith("bill_") && f.push({
|
|
291
|
+
label: "Bill Number",
|
|
292
|
+
value: (_ = u.value) == null ? void 0 : _.ref,
|
|
293
|
+
copy: () => {
|
|
294
|
+
var R;
|
|
295
|
+
return oe((R = u.value) == null ? void 0 : R.ref);
|
|
296
|
+
}
|
|
297
|
+
}), t != null && t.location && f.push({
|
|
298
|
+
label: "Location",
|
|
299
|
+
value: (v = h.locations.find(
|
|
300
|
+
(R) => R._id.toString() === (t == null ? void 0 : t.location)
|
|
301
|
+
)) == null ? void 0 : v.name
|
|
302
|
+
}), e.source === ue.enum.STORE && f.push({
|
|
303
|
+
label: "Store Transaction",
|
|
304
|
+
value: e.ref
|
|
305
|
+
}), t != null && t.originTransaction && f.push({
|
|
306
|
+
label: "Parent Transaction",
|
|
307
|
+
value: t.originTransaction
|
|
308
|
+
}), t != null && t.referral_count && f.push({
|
|
309
|
+
label: "Referral Count",
|
|
310
|
+
value: t.referral_count
|
|
311
|
+
}), e.refundedFrom && f.push({
|
|
312
|
+
label: "Refunded From",
|
|
313
|
+
value: e.refundedFrom
|
|
314
|
+
}), f;
|
|
315
|
+
});
|
|
316
|
+
return m({
|
|
317
|
+
showSheet: b
|
|
318
|
+
}), (f, t) => {
|
|
319
|
+
const e = P("FmButton"), o = P("FmSideSheet");
|
|
320
|
+
return A(), J(o, {
|
|
321
|
+
"max-width": 560,
|
|
322
|
+
modelValue: s(i),
|
|
323
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => we(i) ? i.value = n : null),
|
|
324
|
+
header: "Transaction Details"
|
|
325
|
+
}, {
|
|
326
|
+
"side-sheet-footer": Z(() => [
|
|
327
|
+
C("div", qe, [
|
|
328
|
+
T(e, {
|
|
329
|
+
label: "Close",
|
|
330
|
+
onClick: t[0] || (t[0] = (n) => b(!1)),
|
|
331
|
+
variant: "tertiary"
|
|
332
|
+
})
|
|
333
|
+
])
|
|
334
|
+
]),
|
|
335
|
+
default: Z(() => [
|
|
336
|
+
C("div", Le, [
|
|
337
|
+
C("div", Ke, [
|
|
338
|
+
(A(!0), Y(ee, null, ie(s(D), (n) => (A(), Y("div", {
|
|
339
|
+
key: n.label,
|
|
340
|
+
class: "flex flex-col gap-4"
|
|
341
|
+
}, [
|
|
342
|
+
C("div", Ge, H(n.label), 1),
|
|
343
|
+
C("div", {
|
|
344
|
+
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
345
|
+
onClick: n.copy
|
|
346
|
+
}, [
|
|
347
|
+
Ce(H(n.accessorFn ? n.accessorFn() : n.value) + " ", 1),
|
|
348
|
+
(A(), J(De(n.component)))
|
|
349
|
+
], 8, He),
|
|
350
|
+
t[2] || (t[2] = C("hr", { class: "mt-3" }, null, -1))
|
|
351
|
+
]))), 128)),
|
|
352
|
+
(A(!0), Y(ee, null, ie(s(g), (n) => (A(), Y("div", {
|
|
353
|
+
key: n.label,
|
|
354
|
+
class: "flex flex-col gap-4"
|
|
355
|
+
}, [
|
|
356
|
+
C("div", je, H(n.label), 1),
|
|
357
|
+
C("div", {
|
|
358
|
+
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
359
|
+
onClick: n.copy
|
|
360
|
+
}, H(n.accessorFn ? n.accessorFn() : n.value), 9, We),
|
|
361
|
+
t[3] || (t[3] = C("hr", { class: "mt-3" }, null, -1))
|
|
362
|
+
]))), 128))
|
|
363
|
+
])
|
|
364
|
+
])
|
|
365
|
+
]),
|
|
366
|
+
_: 1
|
|
367
|
+
}, 8, ["modelValue"]);
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
}), Qe = { class: "hidden xs:!flex items-center justify-end" }, Je = { class: "flex items-center justify-between" }, Ze = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, et = { class: "xs:hidden" }, Ot = /* @__PURE__ */ X({
|
|
371
|
+
__name: "CollectionTransactions",
|
|
372
|
+
props: {
|
|
373
|
+
user: {
|
|
374
|
+
type: String
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
setup(c) {
|
|
378
|
+
const { t: m } = he(), i = de(), u = ge(), p = Oe(), h = c, b = N(!1), { minor: M } = ve, D = [
|
|
379
|
+
{
|
|
380
|
+
header: "Transaction ID",
|
|
381
|
+
accessorKey: "_id",
|
|
382
|
+
meta: {
|
|
383
|
+
maxWidth: "100px"
|
|
384
|
+
},
|
|
385
|
+
cell(a) {
|
|
386
|
+
return l("div", { class: "flex items-center" }, [
|
|
387
|
+
l(w.FmIcon, {
|
|
388
|
+
name: "content_copy",
|
|
389
|
+
outline: !0,
|
|
390
|
+
size: "sm",
|
|
391
|
+
class: "cursor-pointer mr-4",
|
|
392
|
+
onClick: (r) => {
|
|
393
|
+
r.preventDefault(), r.stopPropagation(), oe(a.row.original._id.toString());
|
|
394
|
+
}
|
|
395
|
+
}),
|
|
396
|
+
l(
|
|
397
|
+
"div",
|
|
398
|
+
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
399
|
+
a.row.original._id.toString()
|
|
400
|
+
)
|
|
401
|
+
]);
|
|
402
|
+
},
|
|
403
|
+
enableSorting: !1
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
header: "Created at",
|
|
407
|
+
accessorKey: "_id",
|
|
408
|
+
accessorFn: (a) => x($(a._id.toString())),
|
|
409
|
+
cell: (a) => x($(a.row.original._id.toString())).format(
|
|
410
|
+
"D MMM YYYY, hh:mmA"
|
|
411
|
+
),
|
|
412
|
+
enableSorting: !0
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
header: "Amount",
|
|
416
|
+
// accessorKey: 'totalAmount',
|
|
417
|
+
enableSorting: !1,
|
|
418
|
+
cell(a) {
|
|
419
|
+
var y, d, O, B;
|
|
420
|
+
const r = te(
|
|
421
|
+
a.row.original.expiryAmount.reduce(
|
|
422
|
+
(L, K) => L + K.amount,
|
|
423
|
+
a.row.original.amount ?? 0
|
|
424
|
+
),
|
|
425
|
+
2
|
|
426
|
+
), S = (d = (y = a.row.original.expiryAmount) == null ? void 0 : y[0]) != null && d.expiredAt ? x((B = (O = a.row.original.expiryAmount) == null ? void 0 : O[0]) == null ? void 0 : B.expiredAt).format(
|
|
427
|
+
"D MMM YYYY"
|
|
428
|
+
) : "";
|
|
429
|
+
return l("div", { class: "flex items-center" }, [
|
|
430
|
+
l(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
class: [
|
|
434
|
+
"pr-2",
|
|
435
|
+
+r > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
436
|
+
]
|
|
437
|
+
},
|
|
438
|
+
r
|
|
439
|
+
),
|
|
440
|
+
l("div", { class: "flex items-center" }, [
|
|
441
|
+
a.row.original.expiryAmount.length > 0 ? l(
|
|
442
|
+
w.FmTooltip,
|
|
443
|
+
{
|
|
444
|
+
content: `Expired on ${S}`
|
|
445
|
+
},
|
|
446
|
+
[
|
|
447
|
+
l(w.FmIcon, {
|
|
448
|
+
name: "info",
|
|
449
|
+
outline: !0,
|
|
450
|
+
size: "sm"
|
|
451
|
+
})
|
|
452
|
+
]
|
|
453
|
+
) : l("div")
|
|
454
|
+
])
|
|
455
|
+
]);
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
header: "Type",
|
|
460
|
+
accessorKey: "pf_collectible.type",
|
|
461
|
+
accessorFn: (a) => k.formattedType(a),
|
|
462
|
+
meta: {
|
|
463
|
+
maxWidth: "200px"
|
|
464
|
+
},
|
|
465
|
+
cell(a) {
|
|
466
|
+
const r = k.formattedType(a.row.original);
|
|
467
|
+
return l("div", { class: "flex items-center" }, [
|
|
468
|
+
l("div", { class: "truncate text-ellipsis" }, r),
|
|
469
|
+
r.length > 20 ? l(
|
|
470
|
+
w.FmTooltip,
|
|
471
|
+
{
|
|
472
|
+
content: r
|
|
473
|
+
},
|
|
474
|
+
[
|
|
475
|
+
l(w.FmIcon, {
|
|
476
|
+
name: "info",
|
|
477
|
+
color: "primary",
|
|
478
|
+
outline: !0,
|
|
479
|
+
size: "sm"
|
|
480
|
+
})
|
|
481
|
+
]
|
|
482
|
+
) : null
|
|
483
|
+
]);
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
header: "Source",
|
|
488
|
+
accessorKey: "source",
|
|
489
|
+
cell(a) {
|
|
490
|
+
var r;
|
|
491
|
+
return l("div", { class: "flex items-center gap-4" }, [
|
|
492
|
+
l(
|
|
493
|
+
"div",
|
|
494
|
+
{ class: "truncate text-ellipsis" },
|
|
495
|
+
W(k.getReason(a.row.original.source))
|
|
496
|
+
),
|
|
497
|
+
...(r = a.row.original.metadata) != null && r.campaign ? [
|
|
498
|
+
l(
|
|
499
|
+
w.FmTooltip,
|
|
500
|
+
{
|
|
501
|
+
get content() {
|
|
502
|
+
var S;
|
|
503
|
+
return (S = u.campaigns.all.find(
|
|
504
|
+
(y) => {
|
|
505
|
+
var d;
|
|
506
|
+
return y._id === ((d = a.row.original.metadata) == null ? void 0 : d.campaign);
|
|
507
|
+
}
|
|
508
|
+
)) == null ? void 0 : S.name;
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
[
|
|
512
|
+
l(w.FmIcon, {
|
|
513
|
+
name: "info",
|
|
514
|
+
color: "primary",
|
|
515
|
+
size: "sm",
|
|
516
|
+
onClick: async (S) => {
|
|
517
|
+
S.preventDefault(), S.stopPropagation();
|
|
518
|
+
const y = u.campaigns.all.find(
|
|
519
|
+
(d) => {
|
|
520
|
+
var O;
|
|
521
|
+
return d._id === ((O = a.row.original.metadata) == null ? void 0 : O.campaign);
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
if (y)
|
|
525
|
+
switch (y.type) {
|
|
526
|
+
case "VOUCHER":
|
|
527
|
+
case "PROMOTION":
|
|
528
|
+
case "BROADCAST":
|
|
529
|
+
await p.push({
|
|
530
|
+
name: j[`$connect-CAMPAIGN_${y.type}`]
|
|
531
|
+
});
|
|
532
|
+
break;
|
|
533
|
+
case "GAME":
|
|
534
|
+
case "CREDIT":
|
|
535
|
+
case "MISSION":
|
|
536
|
+
await p.push({
|
|
537
|
+
name: j[`$connect-PROGRAM_${y.type}`]
|
|
538
|
+
});
|
|
539
|
+
break;
|
|
540
|
+
case "POINT":
|
|
541
|
+
await p.push({
|
|
542
|
+
name: j["$connect-PROGRAM_EXPERIENCE"]
|
|
543
|
+
});
|
|
544
|
+
break;
|
|
545
|
+
case "COIN":
|
|
546
|
+
await p.push({
|
|
547
|
+
name: j["$connect-PROGRAM_POINT"]
|
|
548
|
+
});
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
})
|
|
553
|
+
]
|
|
554
|
+
)
|
|
555
|
+
] : []
|
|
556
|
+
]);
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
header: "User",
|
|
561
|
+
accessorKey: "pf_user.name",
|
|
562
|
+
cell(a) {
|
|
563
|
+
return pe(a.row.original.pf_user);
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
header: "Phone No.",
|
|
568
|
+
accessorKey: "pf_user.phoneNumber",
|
|
569
|
+
accessorFn: (a) => {
|
|
570
|
+
var r;
|
|
571
|
+
return ((r = a == null ? void 0 : a.pf_user) == null ? void 0 : r.phoneNumber) || "";
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
header: "Status",
|
|
576
|
+
id: "status",
|
|
577
|
+
enableSorting: !1,
|
|
578
|
+
cell(a) {
|
|
579
|
+
const r = !!a.row.original.refunded;
|
|
580
|
+
return l(w.FmChip, {
|
|
581
|
+
label: m(r ? "connect.transaction.refunded" : "connect.transaction.completed"),
|
|
582
|
+
variant: "plain",
|
|
583
|
+
class: r ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-success bg-fm-color-system-success-100"
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
accessorFn: (a) => a.ref,
|
|
589
|
+
header: "References",
|
|
590
|
+
accessorKey: "ref",
|
|
591
|
+
cell(a) {
|
|
592
|
+
var r, S;
|
|
593
|
+
return l("div", { class: "flex items-center justify-between gap-4" }, [
|
|
594
|
+
l("div", { class: "flex items-center" }, [
|
|
595
|
+
(r = a.row.original.metadata) != null && r.remark ? l(
|
|
596
|
+
w.FmTooltip,
|
|
597
|
+
{
|
|
598
|
+
content: (S = a.row.original.metadata) == null ? void 0 : S.remark
|
|
599
|
+
},
|
|
600
|
+
[
|
|
601
|
+
l(w.FmIcon, {
|
|
602
|
+
name: "info",
|
|
603
|
+
class: "pl-2",
|
|
604
|
+
outline: !0,
|
|
605
|
+
size: "sm"
|
|
606
|
+
})
|
|
607
|
+
]
|
|
608
|
+
) : l("div")
|
|
609
|
+
]),
|
|
610
|
+
l("div", { class: "flex-1" }, a.row.original.ref)
|
|
611
|
+
]);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
], g = N({
|
|
615
|
+
search: "",
|
|
616
|
+
"pf_collectible.type": [],
|
|
617
|
+
"metadata.location": [],
|
|
618
|
+
dateRange: {
|
|
619
|
+
startDate: x().subtract(7, "day").toISOString(),
|
|
620
|
+
endDate: x().endOf("day").toISOString()
|
|
621
|
+
},
|
|
622
|
+
source: []
|
|
623
|
+
}), f = () => ({
|
|
624
|
+
...g.value,
|
|
625
|
+
user: h.user,
|
|
626
|
+
dateRange: {
|
|
627
|
+
start: new Date(g.value.dateRange.startDate).toISOString(),
|
|
628
|
+
end: new Date(g.value.dateRange.endDate).toISOString()
|
|
629
|
+
}
|
|
630
|
+
}), {
|
|
631
|
+
tableMeta: t,
|
|
632
|
+
rowData: e,
|
|
633
|
+
onSort: o,
|
|
634
|
+
debouncedFetchData: n,
|
|
635
|
+
resetCursorState: _
|
|
636
|
+
} = Ue(async (a) => {
|
|
637
|
+
const r = await q.readAllCursor(
|
|
638
|
+
a,
|
|
639
|
+
f()
|
|
640
|
+
);
|
|
641
|
+
return {
|
|
642
|
+
resources: r.resources.map((S) => {
|
|
643
|
+
const y = v.value.find((d) => d._id === S.ref);
|
|
644
|
+
return { ...S, ref: (y == null ? void 0 : y.seqNumber) || S.ref };
|
|
645
|
+
}),
|
|
646
|
+
meta: r.meta
|
|
647
|
+
};
|
|
648
|
+
}), v = N([]), R = ue.options.map((a) => ({ label: W(k.getReason(a)), value: a })), I = z(
|
|
649
|
+
() => i.locations.map((a) => ({ label: a.name, value: a._id }))
|
|
650
|
+
);
|
|
651
|
+
ae(
|
|
652
|
+
g,
|
|
653
|
+
() => {
|
|
654
|
+
_(), n({ pageIndex: 0 });
|
|
655
|
+
},
|
|
656
|
+
{ deep: !0 }
|
|
657
|
+
);
|
|
658
|
+
async function U() {
|
|
659
|
+
try {
|
|
660
|
+
b.value = !0;
|
|
661
|
+
const a = new Be(), r = f(), S = 1e3;
|
|
662
|
+
await M(
|
|
663
|
+
async () => {
|
|
664
|
+
var O, B, L, K, ne, re, se;
|
|
665
|
+
let y, d = !0;
|
|
666
|
+
for (; d; ) {
|
|
667
|
+
const G = await q.readAllCursor(
|
|
668
|
+
{
|
|
669
|
+
limit: S,
|
|
670
|
+
sortBy: "_id",
|
|
671
|
+
descending: !1,
|
|
672
|
+
...y ? { cursor: y } : {}
|
|
673
|
+
},
|
|
674
|
+
r
|
|
675
|
+
);
|
|
676
|
+
if (!G.resources.length)
|
|
677
|
+
break;
|
|
678
|
+
for (const F of G.resources)
|
|
679
|
+
a.addRecord({
|
|
680
|
+
TransactionID: F._id,
|
|
681
|
+
CreatedAt: x($(F._id.toString())).format(
|
|
682
|
+
"D MMM YYYY, hh:mmA"
|
|
683
|
+
),
|
|
684
|
+
Amount: te(
|
|
685
|
+
F.expiryAmount.reduce(
|
|
686
|
+
(be, _e) => be + _e.amount,
|
|
687
|
+
F.amount ?? 0
|
|
688
|
+
),
|
|
689
|
+
2
|
|
690
|
+
),
|
|
691
|
+
ExpiredAt: (B = (O = F.expiryAmount) == null ? void 0 : O[0]) != null && B.expiredAt ? x((K = (L = F.expiryAmount) == null ? void 0 : L[0]) == null ? void 0 : K.expiredAt).format(
|
|
692
|
+
"D MMM YYYY"
|
|
693
|
+
) : "",
|
|
694
|
+
Type: k.formattedType(F),
|
|
695
|
+
Source: W(k.getReason(F.source)),
|
|
696
|
+
User: ((ne = F.pf_user) == null ? void 0 : ne.name) || "",
|
|
697
|
+
"Phone No.": ((re = F.pf_user) == null ? void 0 : re.phoneNumber) || "",
|
|
698
|
+
References: F.ref,
|
|
699
|
+
Remark: ((se = F.metadata) == null ? void 0 : se.remark) || ""
|
|
700
|
+
});
|
|
701
|
+
y = G.meta.nextCursor ?? void 0, d = G.meta.hasNext && !!y;
|
|
702
|
+
}
|
|
703
|
+
await Ae(
|
|
704
|
+
a.buildExcel(),
|
|
705
|
+
`transactions-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
706
|
+
{
|
|
707
|
+
bookType: "xlsx",
|
|
708
|
+
bookSST: !1,
|
|
709
|
+
type: "array"
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
message: "Exporting transactions...",
|
|
715
|
+
successMessage: "transactions exported successfully"
|
|
716
|
+
}
|
|
717
|
+
);
|
|
718
|
+
} catch (a) {
|
|
719
|
+
console.error(a);
|
|
720
|
+
} finally {
|
|
721
|
+
b.value = !1;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
const E = N(null);
|
|
725
|
+
function xe(a) {
|
|
726
|
+
var r;
|
|
727
|
+
console.log(a), (r = E.value) == null || r.showSheet(!0, a.original);
|
|
728
|
+
}
|
|
729
|
+
return Re(async () => {
|
|
730
|
+
await i.readLocations(), await u.read(), await n();
|
|
731
|
+
}), (a, r) => {
|
|
732
|
+
const S = P("FmSearch"), y = P("FmButton");
|
|
733
|
+
return A(), Y(ee, null, [
|
|
734
|
+
C("div", null, [
|
|
735
|
+
C("div", Qe, [
|
|
736
|
+
T(S, {
|
|
737
|
+
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
738
|
+
modelValue: s(g).search,
|
|
739
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => s(g).search = d),
|
|
740
|
+
placeholder: "Search",
|
|
741
|
+
collapsible: ""
|
|
742
|
+
}, null, 8, ["modelValue"]),
|
|
743
|
+
T(y, {
|
|
744
|
+
icon: "ios_share",
|
|
745
|
+
variant: "tertiary",
|
|
746
|
+
onClick: U
|
|
747
|
+
})
|
|
748
|
+
]),
|
|
749
|
+
C("div", Je, [
|
|
750
|
+
C("div", Ze, [
|
|
751
|
+
T(Q, {
|
|
752
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
753
|
+
"right-icon": "keyboard_arrow_down",
|
|
754
|
+
modelValue: s(g)["metadata.location"],
|
|
755
|
+
"onUpdate:modelValue": r[1] || (r[1] = (d) => s(g)["metadata.location"] = d),
|
|
756
|
+
icon: "storefront",
|
|
757
|
+
"show-item-label": !0,
|
|
758
|
+
items: s(I)
|
|
759
|
+
}, null, 8, ["modelValue", "items"]),
|
|
760
|
+
T(Q, {
|
|
761
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
762
|
+
"right-icon": "keyboard_arrow_down",
|
|
763
|
+
modelValue: s(g)["pf_collectible.type"],
|
|
764
|
+
"onUpdate:modelValue": r[2] || (r[2] = (d) => s(g)["pf_collectible.type"] = d),
|
|
765
|
+
label: "Type: ",
|
|
766
|
+
"show-item-label": !0,
|
|
767
|
+
items: [
|
|
768
|
+
{ label: "Point", value: "COIN" },
|
|
769
|
+
{ label: "Credit", value: "CREDIT" },
|
|
770
|
+
{ label: "Voucher", value: "VOUCHER" },
|
|
771
|
+
{ label: "Experience", value: "POINT" },
|
|
772
|
+
{ label: "Tier", value: "TIER" },
|
|
773
|
+
{ label: "Title", value: "TITLE" },
|
|
774
|
+
{ label: "Game", value: "GAME" },
|
|
775
|
+
{ label: "Stamp", value: "STAMP" }
|
|
776
|
+
]
|
|
777
|
+
}, null, 8, ["modelValue"]),
|
|
778
|
+
T(Q, {
|
|
779
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
780
|
+
"right-icon": "keyboard_arrow_down",
|
|
781
|
+
modelValue: s(g).source,
|
|
782
|
+
"onUpdate:modelValue": r[3] || (r[3] = (d) => s(g).source = d),
|
|
783
|
+
label: "Source: ",
|
|
784
|
+
"show-item-label": !0,
|
|
785
|
+
items: s(R)
|
|
786
|
+
}, null, 8, ["modelValue", "items"]),
|
|
787
|
+
T(ye, {
|
|
788
|
+
"model-value": {
|
|
789
|
+
startDate: s(g).dateRange.startDate,
|
|
790
|
+
endDate: s(g).dateRange.endDate
|
|
791
|
+
},
|
|
792
|
+
"onUpdate:modelValue": r[4] || (r[4] = (d) => s(g).dateRange = {
|
|
793
|
+
startDate: s(x)(d.startDate).startOf("d").toISOString(),
|
|
794
|
+
endDate: s(x)(d.endDate).endOf("d").toISOString()
|
|
795
|
+
})
|
|
796
|
+
}, null, 8, ["model-value"])
|
|
797
|
+
]),
|
|
798
|
+
T(S, {
|
|
799
|
+
class: "xs:hidden",
|
|
800
|
+
modelValue: s(g).search,
|
|
801
|
+
"onUpdate:modelValue": r[5] || (r[5] = (d) => s(g).search = d),
|
|
802
|
+
placeholder: "Search",
|
|
803
|
+
collapsible: ""
|
|
804
|
+
}, null, 8, ["modelValue"]),
|
|
805
|
+
C("div", et, [
|
|
806
|
+
T(y, {
|
|
807
|
+
icon: "ios_share",
|
|
808
|
+
variant: "tertiary",
|
|
809
|
+
onClick: U
|
|
810
|
+
})
|
|
811
|
+
])
|
|
812
|
+
]),
|
|
813
|
+
T(me, {
|
|
814
|
+
loading: s(t).isLoading,
|
|
815
|
+
"row-data": s(e),
|
|
816
|
+
"row-count": s(t).totalRows,
|
|
817
|
+
"column-defs": D.filter(
|
|
818
|
+
(d) => !h.user || d.header !== "User" && d.header !== "Phone No."
|
|
819
|
+
),
|
|
820
|
+
"page-count": s(t).pageCount,
|
|
821
|
+
"page-index": s(t).pageIndex,
|
|
822
|
+
"page-size": s(t).pageSize,
|
|
823
|
+
"shrink-at": !1,
|
|
824
|
+
"pagination-mode": "cursor",
|
|
825
|
+
"has-next": s(t).hasNext,
|
|
826
|
+
onSortChange: s(o),
|
|
827
|
+
onPageChange: r[6] || (r[6] = (d) => s(n)({
|
|
828
|
+
pageSize: d.pageSize,
|
|
829
|
+
pageIndex: d.pageIndex
|
|
830
|
+
})),
|
|
831
|
+
onRowClick: xe
|
|
832
|
+
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "has-next", "onSortChange"])
|
|
833
|
+
]),
|
|
834
|
+
T(Xe, {
|
|
835
|
+
ref_key: "transactionDetailSheet",
|
|
836
|
+
ref: E
|
|
837
|
+
}, null, 512)
|
|
838
|
+
], 64);
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
class tt extends fe {
|
|
843
|
+
}
|
|
844
|
+
const at = { class: "flex items-center justify-between" }, ot = { class: "flex gap-8 items-center" }, nt = { class: "flex gap-8 items-center xs:hidden" }, kt = /* @__PURE__ */ X({
|
|
845
|
+
__name: "StoreTransactions",
|
|
846
|
+
props: {
|
|
847
|
+
user: {
|
|
848
|
+
type: String
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
setup(c) {
|
|
852
|
+
const m = c, { minor: i } = ve;
|
|
853
|
+
Te();
|
|
854
|
+
const u = [
|
|
855
|
+
{
|
|
856
|
+
header: "Transaction ID",
|
|
857
|
+
meta: {
|
|
858
|
+
maxWidth: "150px"
|
|
859
|
+
},
|
|
860
|
+
cell(e) {
|
|
861
|
+
return l("div", { class: "flex items-center" }, [
|
|
862
|
+
l(w.FmIcon, {
|
|
863
|
+
name: "content_copy",
|
|
864
|
+
outline: !0,
|
|
865
|
+
size: "sm",
|
|
866
|
+
class: "cursor-pointer mr-4 shrink-0",
|
|
867
|
+
onClick: (o) => {
|
|
868
|
+
o.preventDefault(), o.stopPropagation(), oe(e.row.original._id.toString());
|
|
869
|
+
}
|
|
870
|
+
}),
|
|
871
|
+
l("div", { class: "truncate" }, e.row.original._id.toString())
|
|
872
|
+
]);
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
header: "Created at",
|
|
877
|
+
accessorFn: (e) => x($(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
878
|
+
enableSorting: !0
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
header: "Bundle",
|
|
882
|
+
accessorFn: (e) => e.bundle.name
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
header: "Location",
|
|
886
|
+
accessorFn: (e) => e.location ? e.pf_location[0].name : "Online Store"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
header: "Payment Type",
|
|
890
|
+
accessorFn: (e) => {
|
|
891
|
+
var o;
|
|
892
|
+
return ((o = e.paymentType) == null ? void 0 : o.type) ?? "N/A";
|
|
893
|
+
},
|
|
894
|
+
cell(e) {
|
|
895
|
+
var o, n;
|
|
896
|
+
return l("div", { class: "flex items-center gap-4" }, [
|
|
897
|
+
l("div", { class: "flex items-center" }, [
|
|
898
|
+
((o = e.row.original.paymentType) == null ? void 0 : o.type) == "ONLINE" && e.row.original.paymentType.extra ? l(
|
|
899
|
+
w.FmTooltip,
|
|
900
|
+
{
|
|
901
|
+
content: e.row.original.paymentType.extra
|
|
902
|
+
},
|
|
903
|
+
[
|
|
904
|
+
l(w.FmIcon, {
|
|
905
|
+
name: "info",
|
|
906
|
+
outline: !0,
|
|
907
|
+
size: "sm"
|
|
908
|
+
})
|
|
909
|
+
]
|
|
910
|
+
) : l("div")
|
|
911
|
+
]),
|
|
912
|
+
l(
|
|
913
|
+
"div",
|
|
914
|
+
{ class: "flex-1" },
|
|
915
|
+
((n = e.row.original.paymentType) == null ? void 0 : n.type) ?? "N/A"
|
|
916
|
+
)
|
|
917
|
+
]);
|
|
918
|
+
}
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
header: "User",
|
|
922
|
+
cell: (e) => pe(e.row.original.pf_member)
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
header: "Phone No.",
|
|
926
|
+
accessorFn: (e) => e.pf_member.phoneNumber
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
header: "Status",
|
|
930
|
+
// accessorFn: (u) => u.status,
|
|
931
|
+
cell(e) {
|
|
932
|
+
var _, v, R, I;
|
|
933
|
+
const o = e.row.original.status, n = {
|
|
934
|
+
COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
935
|
+
REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
|
|
936
|
+
};
|
|
937
|
+
return l("div", { class: "flex items-center gap-4" }, [
|
|
938
|
+
l(w.FmChip, {
|
|
939
|
+
label: Ee.title(o),
|
|
940
|
+
variant: "plain",
|
|
941
|
+
class: n[o] ?? ""
|
|
942
|
+
}),
|
|
943
|
+
(v = (_ = e.row.original) == null ? void 0 : _.refund) != null && v.reason ? l(
|
|
944
|
+
w.FmTooltip,
|
|
945
|
+
{
|
|
946
|
+
content: (I = (R = e.row.original) == null ? void 0 : R.refund) == null ? void 0 : I.reason
|
|
947
|
+
},
|
|
948
|
+
[
|
|
949
|
+
l(w.FmIcon, {
|
|
950
|
+
name: "info",
|
|
951
|
+
color: "primary",
|
|
952
|
+
outline: !0,
|
|
953
|
+
size: "sm"
|
|
954
|
+
})
|
|
955
|
+
]
|
|
956
|
+
) : null
|
|
957
|
+
]);
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
header: "Source",
|
|
962
|
+
accessorFn: (e) => e.source
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
header: "Ref",
|
|
966
|
+
accessorFn: (e) => e.ref
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
id: "action",
|
|
970
|
+
cell(e) {
|
|
971
|
+
const o = e.row.original, n = o.status === "COMPLETED" && !o.refund && o.source == "ADMIN";
|
|
972
|
+
return n ? l(
|
|
973
|
+
w.FmMenu,
|
|
974
|
+
{
|
|
975
|
+
placement: "bottom-end",
|
|
976
|
+
onClick: (_) => {
|
|
977
|
+
_.stopPropagation();
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
"menu-button": () => l(w.FmButton, {
|
|
982
|
+
icon: "settings",
|
|
983
|
+
variant: "tertiary",
|
|
984
|
+
if: n
|
|
985
|
+
}),
|
|
986
|
+
default: () => [
|
|
987
|
+
l(w.FmMenuItem, {
|
|
988
|
+
label: "Refund",
|
|
989
|
+
sublabel: "Refund this transaction",
|
|
990
|
+
onClick: async (_) => {
|
|
991
|
+
_.stopPropagation(), await f(o);
|
|
992
|
+
}
|
|
993
|
+
})
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
) : l("div");
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
], p = N({
|
|
1000
|
+
searchValue: "",
|
|
1001
|
+
dateRange: {
|
|
1002
|
+
startDate: x().subtract(7, "day").toISOString(),
|
|
1003
|
+
endDate: x().toISOString()
|
|
1004
|
+
}
|
|
1005
|
+
}), { tableMeta: h, rowData: b, onSort: M, debouncedFetchData: D, onSearch: g } = Fe(async (e) => {
|
|
1006
|
+
const o = {
|
|
1007
|
+
...p.value.dateRange,
|
|
1008
|
+
user: m.user
|
|
1009
|
+
};
|
|
1010
|
+
return await q.readStoreTransactions(e, o);
|
|
1011
|
+
});
|
|
1012
|
+
async function f(e) {
|
|
1013
|
+
await Ne.confirm(
|
|
1014
|
+
"Are you sure you want to refund this transaction?",
|
|
1015
|
+
"Refund Store Transaction",
|
|
1016
|
+
"Confirm",
|
|
1017
|
+
"Cancel"
|
|
1018
|
+
) && await i(
|
|
1019
|
+
async () => {
|
|
1020
|
+
var n;
|
|
1021
|
+
await Pe.refundStoreTransaction({
|
|
1022
|
+
id: e._id,
|
|
1023
|
+
reason: `ADMIN:${(n = ke().sessionUser) == null ? void 0 : n.name}`
|
|
1024
|
+
}), await D();
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
message: "Refunding transaction...",
|
|
1028
|
+
successMessage: "Transaction refunded successfully"
|
|
1029
|
+
}
|
|
1030
|
+
);
|
|
1031
|
+
}
|
|
1032
|
+
ae(
|
|
1033
|
+
p,
|
|
1034
|
+
() => {
|
|
1035
|
+
D();
|
|
1036
|
+
},
|
|
1037
|
+
{ deep: !0 }
|
|
1038
|
+
), ce(async () => {
|
|
1039
|
+
await D();
|
|
1040
|
+
});
|
|
1041
|
+
const t = async () => Me({
|
|
1042
|
+
exporter: new tt(),
|
|
1043
|
+
readFunction: (e) => q.readStoreTransactions(e, {
|
|
1044
|
+
...p.value.dateRange,
|
|
1045
|
+
user: m.user
|
|
1046
|
+
}),
|
|
1047
|
+
transformRecord: (e) => {
|
|
1048
|
+
var o, n, _, v, R, I;
|
|
1049
|
+
return {
|
|
1050
|
+
TransactionId: ((o = e._id) == null ? void 0 : o.toString()) || "",
|
|
1051
|
+
CreatedAt: x($(e._id.toString())).format(
|
|
1052
|
+
"DD/MM/YYYY HH:mm:ss"
|
|
1053
|
+
),
|
|
1054
|
+
Bundle: e.bundle.name || "",
|
|
1055
|
+
Location: e.location ? e.pf_location[0].name : "Online Store",
|
|
1056
|
+
PaymentType: ((n = e.paymentType) == null ? void 0 : n.type) || "N/A",
|
|
1057
|
+
PaymentExtra: ((_ = e.paymentType) == null ? void 0 : _.extra) || "",
|
|
1058
|
+
User: ((v = e.pf_member) == null ? void 0 : v.name) || "",
|
|
1059
|
+
PhoneNumber: ((R = e.pf_member) == null ? void 0 : R.phoneNumber) || "",
|
|
1060
|
+
Status: e.status || "",
|
|
1061
|
+
RefundReason: ((I = e == null ? void 0 : e.refund) == null ? void 0 : I.reason) || "",
|
|
1062
|
+
Ref: (e == null ? void 0 : e.ref) || ""
|
|
1063
|
+
};
|
|
1064
|
+
},
|
|
1065
|
+
filename: "store-transactions"
|
|
1066
|
+
});
|
|
1067
|
+
return (e, o) => {
|
|
1068
|
+
const n = P("FmSearch"), _ = P("FmButton");
|
|
1069
|
+
return A(), Y("div", null, [
|
|
1070
|
+
C("div", at, [
|
|
1071
|
+
C("div", ot, [
|
|
1072
|
+
T(ye, {
|
|
1073
|
+
modelValue: s(p).dateRange,
|
|
1074
|
+
"onUpdate:modelValue": o[0] || (o[0] = (v) => s(p).dateRange = v)
|
|
1075
|
+
}, null, 8, ["modelValue"])
|
|
1076
|
+
]),
|
|
1077
|
+
C("div", nt, [
|
|
1078
|
+
T(n, {
|
|
1079
|
+
modelValue: s(h).searchValue,
|
|
1080
|
+
"onUpdate:modelValue": [
|
|
1081
|
+
o[1] || (o[1] = (v) => s(h).searchValue = v),
|
|
1082
|
+
s(g)
|
|
1083
|
+
],
|
|
1084
|
+
placeholder: "Search",
|
|
1085
|
+
collapsible: ""
|
|
1086
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1087
|
+
T(_, {
|
|
1088
|
+
icon: "ios_share",
|
|
1089
|
+
variant: "tertiary",
|
|
1090
|
+
onClick: t
|
|
1091
|
+
})
|
|
1092
|
+
])
|
|
1093
|
+
]),
|
|
1094
|
+
T(me, {
|
|
1095
|
+
loading: s(h).isLoading,
|
|
1096
|
+
"row-data": s(b),
|
|
1097
|
+
"row-count": s(h).totalRows,
|
|
1098
|
+
"column-defs": u.filter(
|
|
1099
|
+
(v) => !m.user || v.header !== "User" && v.header !== "Phone No."
|
|
1100
|
+
),
|
|
1101
|
+
"page-count": s(h).pageCount,
|
|
1102
|
+
"page-index": s(h).pageIndex,
|
|
1103
|
+
"page-size": s(h).pageSize,
|
|
1104
|
+
"shrink-at": !1,
|
|
1105
|
+
onSortChange: s(M),
|
|
1106
|
+
onPageChange: o[2] || (o[2] = (v) => s(D)({
|
|
1107
|
+
pageSize: v.pageSize,
|
|
1108
|
+
pageIndex: v.pageIndex
|
|
1109
|
+
}))
|
|
1110
|
+
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1111
|
+
]);
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
export {
|
|
1116
|
+
Ot as _,
|
|
1117
|
+
kt as a
|
|
1118
|
+
};
|