@feedmepos/mf-connect 0.1.38-beta.7 → 0.1.38-beta.70
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-NNi-22sK.js → Analytic-qVhEo_im.js} +16 -16
- package/dist/{App-Bu14Mro_.js → App-Ixv1jrHc.js} +625 -619
- package/dist/AuditLogs-B2D62tMF.js +1991 -0
- package/dist/{Bin-CnAQA85j.js → Bin-Lj7jtS9m.js} +10 -10
- package/dist/Broadcast-BpP9VJsx.js +267 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DC_fReu7.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BB43gKXv.js} +6 -6
- package/dist/{Card-DqAGiETA.js → Card-CjArjpou.js} +144 -140
- package/dist/Collections-CFzUAHxz.js +540 -0
- package/dist/Credit-D43x-T3d.js +261 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DlgTeQLe.js +3167 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-9UhSzClJ.js +351 -0
- package/dist/Experience-BaUbRoHV.js +260 -0
- package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-BO_rbswB.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-DaVqgPWQ.js +331 -0
- package/dist/GenerateMaterial-DJM8fZyl.js +589 -0
- package/dist/Grab-CykZDrWI.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-C51yGAp9.js} +49 -48
- package/dist/{Index-loHkiwyo.js → Index-Do3WIIfM.js} +54 -54
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BjdBaj4c.js} +1 -1
- package/dist/{MainLayout-B1aJoR95.js → MainLayout-DD-OlYxZ.js} +1 -1
- package/dist/Marketing-C9bsnUaQ.js +145 -0
- package/dist/MarketingMaterialEdit-CbSh8dpn.js +746 -0
- package/dist/{Member-BQjQQdoA.js → Member-IcVRwAAS.js} +38 -37
- package/dist/{MemberList-WPsEUKf_.js → MemberList-C_A4PrQN.js} +158 -159
- package/dist/{MemberTransactions-BtM7dugy.js → MemberTransactions-CBoaY-gv.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Bl9sFIwG.js → MessageInput.vue_vue_type_script_setup_true_lang-Dx28XNPi.js} +13463 -10597
- package/dist/Mission-COY_uhwz.js +335 -0
- package/dist/{Overview-Bsf5IPOg.js → Overview-DDSz2R4K.js} +24 -25
- package/dist/Point-C-KEwgx4.js +263 -0
- package/dist/Promotion-BpW9qWzf.js +397 -0
- package/dist/{Queue-XFVbSuDw.js → Queue-CO32O8i6.js} +14 -15
- package/dist/{Record-CQzujESE.js → Record-BrT5DR9L.js} +10 -10
- package/dist/{Reward-Dj_h_May.js → Reward-CbrEw-If.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Clxk-oYM.js → RewardGroup.vue_vue_type_script_setup_true_lang-CpNjlbjZ.js} +13 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BS5jsRiN.js +1912 -0
- package/dist/{Segment-D_DUu_Sp.js → Segment-Cu9_qwXc.js} +273 -274
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-D3C2mVlv.js → SelectItems.vue_vue_type_script_setup_true_lang-BH-hzxSs.js} +23 -23
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0vsl8oV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DGm3gujH.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-5HkJROSb.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DcUb8X-q.js} +4 -4
- package/dist/Setting-CQKfb5b_.js +1999 -0
- package/dist/SettingAdvertisements-BxR6Gl-5.js +263 -0
- package/dist/Store-6TUpmqAr.js +1995 -0
- package/dist/StoreRewards-BOThAOWU.js +534 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYD229dz.js +1034 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CAamZtdf.js +7005 -0
- package/dist/{Tier-YQsLRt06.js → Tier-MF-ad-xm.js} +561 -480
- package/dist/{Title-C5gxYNvh.js → Title-MkjTHBzb.js} +149 -147
- package/dist/{Transaction-CZ_QdIii.js → Transaction-trYJwTrc.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DqUu7wSt.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DwlNK1TC.js} +7 -7
- package/dist/Voucher-BD5dTdht.js +422 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BhR_s48Q.js +421 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DCtdp-LK.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcTe5TJL.js} +2 -2
- package/dist/app-CybjF-6Q.js +59071 -0
- package/dist/app.js +1 -1
- package/dist/{business-DZYFoAKz.js → business-2hCbD0JX.js} +11 -8
- package/dist/{campaign-Ca4l6UUg.js → campaign-Bv-8uM2S.js} +29 -25
- package/dist/campaign-h1J8NTAo.js +253 -0
- package/dist/campaign.enum-Dea0E4o1.js +26 -0
- package/dist/campaign.fn-DqxZMyu0.js +776 -0
- package/dist/{collectible.enum-DnIeDAB-.js → collectible.enum-DOyAoz4F.js} +1 -1
- package/dist/{collection.fn-mQfXEwJv.js → collection.fn-DU2HuZod.js} +2 -2
- package/dist/dto-CT65-FHY.js +222 -0
- package/dist/duplicateCampaign-YJGHvOqb.js +51 -0
- package/dist/effect-XZ767UQ4.js +89 -0
- package/dist/{email-addresses-CQYqi2rN.js → email-addresses-DSgkxSnV.js} +2 -2
- package/dist/{export-BsikVZw2.js → export-4gx5C9s9.js} +9 -10
- package/dist/{helper-n74IteBU.js → helper-HOLsJca3.js} +22 -7
- package/dist/index-BO7N-s4K.js +8912 -0
- package/dist/{index-Dt6wui_L.js → index-BfRa1sI3.js} +3 -3
- package/dist/index-BnCtmlvU.js +28897 -0
- package/dist/{index-Bg3fAg5z.js → index-C5VvGYtP.js} +1 -1
- package/dist/index-CSzvYzf4.js +3419 -0
- package/dist/{index-Do7TcKmg.js → index-CrdkPXsx.js} +4 -1
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/{index-DTErPYrT.js → index-CxE-VVlL.js} +1 -1
- package/dist/{index-DRrSsoqp.js → index-Djenbz3F.js} +1 -1
- package/dist/{index-BJ-IAF-1.js → index-IHteBJ_D.js} +1 -1
- package/dist/{index-BpjT8Rx0.js → index-dUhOAfj9.js} +455 -245
- package/dist/index-wm4nGBB_.js +30289 -0
- package/dist/{index-CrHCbDIs.js → index-xTrAj026.js} +3 -3
- package/dist/index-yViT18i_.js +36 -0
- package/dist/{index.esm2017-T7F54Aqa.js → index.esm2017-Wq4FUMEv.js} +185 -185
- package/dist/loading-D22xapd8.js +215 -0
- package/dist/{lodash-B5I3zXaY.js → lodash-HM6bxuWV.js} +1 -1
- package/dist/{membership-BRy4jMt2.js → membership-CX464ZBI.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-B9Auav5u.js → money-B3cPZAZu.js} +1 -1
- package/dist/{number-BdhIBsUp.js → number-DT65dEZt.js} +1 -1
- package/dist/objectid-DZWw4iLL.js +145 -0
- package/dist/{campaign-162kZMje.js → plugins-D-4BlIGs.js} +784 -777
- package/dist/remy-D_Deb3ue.js +13 -0
- package/dist/{reward-UuqZUHsq.js → reward-C6B-kn0X.js} +1 -1
- package/dist/{rule-D158NIpm.js → rule-B94SrDX1.js} +505 -487
- package/dist/rule-builder-CQ3uHeX4.js +102 -0
- package/dist/style.css +11 -2
- package/dist/template-CXB2Ez2S.js +188 -0
- package/dist/timezone-D3NuV-rx.js +1154 -0
- package/dist/trigger-BsCVC_nU.js +213 -0
- package/dist/usePagination-BOZ0-D67.js +223 -0
- package/dist/user-Dxp7kluY.js +55 -0
- package/dist/vue-i18n-DpCWu1gI.js +2365 -0
- package/dist/{xlsx-Ddqi5i8p.js → xlsx-Cc2a2IL9.js} +1 -1
- package/dist/{zod-Bg2FbC-D.js → zod-BCSHGdXs.js} +32 -31
- package/package.json +14 -6
- package/dist/AuditLogs-Cai9CVBl.js +0 -1887
- package/dist/Broadcast-DskXjXn4.js +0 -227
- package/dist/Collections-DuaIQAk7.js +0 -465
- package/dist/Credit-D40Vzu2g.js +0 -222
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsQ4iAsV.js +0 -2185
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CDCX5B5k.js +0 -347
- package/dist/Experience-B9yHQPuj.js +0 -223
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
- package/dist/Game-e9-Q3qmO.js +0 -278
- package/dist/Marketing-CipbukIV.js +0 -20073
- package/dist/Mission-B_DJ3Yu_.js +0 -296
- package/dist/Point-DMphcWjy.js +0 -226
- package/dist/Promotion-B33A-Jwe.js +0 -289
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CGAXTOLN.js +0 -1751
- package/dist/Setting-CtdC4G3W.js +0 -1936
- package/dist/Store-DCksWACh.js +0 -1842
- package/dist/StoreRewards-CHWKYKet.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D1TDyD6N.js +0 -1029
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D59sGO3F.js +0 -139
- package/dist/Voucher-BzV8yZ3o.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DjBj_3EF.js +0 -419
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/app-FFOpPHwj.js +0 -33357
- package/dist/app-az9e8Yfl.js +0 -7086
- package/dist/campaign.enum-DWjyDV2D.js +0 -20
- package/dist/campaign.fn-DWWJ74z-.js +0 -758
- package/dist/dto-mKZIPV4o.js +0 -214
- package/dist/effect-B8UexeyG.js +0 -78
- package/dist/index-5ShiAY8U.js +0 -8861
- package/dist/index-Bf6AmJwX.js +0 -32260
- package/dist/index-C5gjIb5d.js +0 -146
- package/dist/index-C9YrDtDN.js +0 -38
- package/dist/index-CK-MAqWE.js +0 -3120
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/index-f4MzX8IY.js +0 -30038
- package/dist/loading-BEAayQS-.js +0 -71
- package/dist/objectid-K-JVTsfA.js +0 -145
- package/dist/plugins-CWlRYif_.js +0 -208
- package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
- package/dist/rule-builder-DNeViq0I.js +0 -89
- package/dist/template-B02wYF7G.js +0 -190
- package/dist/trigger-BDjnKHLI.js +0 -144
- package/dist/usePagination-BeF5K3M7.js +0 -223
- package/dist/user-DbP37Ohh.js +0 -54
- package/dist/vue-i18n-BbhkYWlk.js +0 -2365
|
@@ -0,0 +1,1034 @@
|
|
|
1
|
+
import { defineComponent as Q, ref as M, computed as K, h as r, resolveComponent as Y, openBlock as N, createBlock as ae, unref as l, isRef as he, withCtx as oe, createElementVNode as h, createVNode as R, createElementBlock as V, Fragment as W, renderList as ne, toDisplayString as z, createTextVNode as be, resolveDynamicComponent as ve, watch as re, onBeforeMount as _e, onMounted as xe } from "vue";
|
|
2
|
+
import { components as g, useDialog as Se } from "@feedmepos/ui-library";
|
|
3
|
+
import { r as X } from "./index-CSzvYzf4.js";
|
|
4
|
+
import "./index-wm4nGBB_.js";
|
|
5
|
+
import { s as we } from "./index-xTrAj026.js";
|
|
6
|
+
import { h as x } from "./moment-D7p2TMB-.js";
|
|
7
|
+
import { _ as j } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
8
|
+
import { _ as se } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js";
|
|
9
|
+
import { s as G } from "./index-CuvNtC_M.js";
|
|
10
|
+
import { f as J } from "./number-DT65dEZt.js";
|
|
11
|
+
import { u as le } from "./business-2hCbD0JX.js";
|
|
12
|
+
import { u as ie, _ as ce } from "./usePagination-BOZ0-D67.js";
|
|
13
|
+
import { a as Z, c as Te, p as Re } from "./plugins-D-4BlIGs.js";
|
|
14
|
+
import { g as ue } from "./user-Dxp7kluY.js";
|
|
15
|
+
import { B as me, e as de } from "./export-4gx5C9s9.js";
|
|
16
|
+
import { u as pe } from "./campaign-Bv-8uM2S.js";
|
|
17
|
+
import "./index-Djenbz3F.js";
|
|
18
|
+
import "./index-dUhOAfj9.js";
|
|
19
|
+
import "./index-BO7N-s4K.js";
|
|
20
|
+
import "./index-BfRa1sI3.js";
|
|
21
|
+
import { u as fe } from "./vue-i18n-DpCWu1gI.js";
|
|
22
|
+
import { o as U } from "./objectId-dwaoBfJX.js";
|
|
23
|
+
import { u as ge, m as Ce } from "./loading-D22xapd8.js";
|
|
24
|
+
import { useRouter as Ie } from "vue-router";
|
|
25
|
+
import { t as L } from "./index-C5VvGYtP.js";
|
|
26
|
+
import { R as H } from "./app-CybjF-6Q.js";
|
|
27
|
+
import { F as q } from "./collectible.enum-DOyAoz4F.js";
|
|
28
|
+
import { useCoreStore as De } from "@feedmepos/mf-common";
|
|
29
|
+
function Fe(d) {
|
|
30
|
+
let p = "";
|
|
31
|
+
switch (d) {
|
|
32
|
+
case "PORTAL":
|
|
33
|
+
p = "ADMIN";
|
|
34
|
+
break;
|
|
35
|
+
case "BENEFIT":
|
|
36
|
+
p = "MEMBERSHIP";
|
|
37
|
+
break;
|
|
38
|
+
case "ORDER":
|
|
39
|
+
p = "ORDER";
|
|
40
|
+
break;
|
|
41
|
+
case "BILL":
|
|
42
|
+
p = "SPENDING";
|
|
43
|
+
break;
|
|
44
|
+
case "CASHBACK":
|
|
45
|
+
p = "CASHBACK";
|
|
46
|
+
break;
|
|
47
|
+
case "CYCLE":
|
|
48
|
+
p = "EXPIRED";
|
|
49
|
+
break;
|
|
50
|
+
case "COUNTER_CONSUME":
|
|
51
|
+
p = "COUNTER REDEEM";
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
p = d;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return p;
|
|
58
|
+
}
|
|
59
|
+
function Ae(d) {
|
|
60
|
+
var p, C, u, S, b, I;
|
|
61
|
+
switch ((p = d == null ? void 0 : d.pf_collectible) == null ? void 0 : p.type) {
|
|
62
|
+
case "VOUCHER":
|
|
63
|
+
return `${(C = d.pf_collectible) == null ? void 0 : C.type} (${(u = d.pf_collectible) == null ? void 0 : u.name})`;
|
|
64
|
+
case "TITLE":
|
|
65
|
+
return `${(S = d.pf_collectible) == null ? void 0 : S.type} (${(b = d.pf_collectible) == null ? void 0 : b.name})`;
|
|
66
|
+
case "POINT":
|
|
67
|
+
return "Experience";
|
|
68
|
+
case "COIN":
|
|
69
|
+
return "Point";
|
|
70
|
+
default:
|
|
71
|
+
return we((I = d == null ? void 0 : d.pf_collectible) == null ? void 0 : I.type);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function Ee(d) {
|
|
75
|
+
switch (d) {
|
|
76
|
+
case "ONLINE":
|
|
77
|
+
return "Online";
|
|
78
|
+
case "COIN":
|
|
79
|
+
return "Point";
|
|
80
|
+
default:
|
|
81
|
+
return d;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const O = {
|
|
85
|
+
getReason: Fe,
|
|
86
|
+
formattedType: Ae,
|
|
87
|
+
formattedPaymentType: Ee
|
|
88
|
+
};
|
|
89
|
+
class Ne extends me {
|
|
90
|
+
}
|
|
91
|
+
const Oe = { class: "space-y-24 pr-12" }, ke = { class: "w-full space-y-16" }, Me = { class: "fm-typo-en-body-lg-600" }, Pe = ["onClick"], Ve = { class: "fm-typo-en-body-lg-600" }, Ue = ["onClick"], Ye = { class: "flex items-center gap-8" }, Be = /* @__PURE__ */ Q({
|
|
92
|
+
__name: "TransactionDetailSheet",
|
|
93
|
+
setup(d, { expose: p }) {
|
|
94
|
+
fe();
|
|
95
|
+
const C = M(!1), u = M(), S = pe(), b = le();
|
|
96
|
+
function I(c, o) {
|
|
97
|
+
C.value = c, u.value = o ?? null;
|
|
98
|
+
}
|
|
99
|
+
const P = K(() => {
|
|
100
|
+
var c, o;
|
|
101
|
+
return J(
|
|
102
|
+
((o = u.value) == null ? void 0 : o.expiryAmount.reduce(
|
|
103
|
+
(e, n) => e + n.amount,
|
|
104
|
+
((c = u.value) == null ? void 0 : c.amount) ?? 0
|
|
105
|
+
)) ?? 0,
|
|
106
|
+
2
|
|
107
|
+
);
|
|
108
|
+
}), E = K(() => {
|
|
109
|
+
var c, o, e, n, i;
|
|
110
|
+
return u.value ? [
|
|
111
|
+
{
|
|
112
|
+
label: "Transaction ID",
|
|
113
|
+
value: (c = u.value) == null ? void 0 : c._id
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: "Date/Time",
|
|
117
|
+
value: x(U(u.value._id.toString())).format(
|
|
118
|
+
"D MMM YYYY, hh:mmA"
|
|
119
|
+
)
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: "Amount",
|
|
123
|
+
component: () => r(
|
|
124
|
+
"span",
|
|
125
|
+
{
|
|
126
|
+
class: [
|
|
127
|
+
"pr-2",
|
|
128
|
+
+P.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
P.value
|
|
132
|
+
)
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: "Type",
|
|
136
|
+
value: O.formattedType(u.value)
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: "Source",
|
|
140
|
+
value: G(O.getReason(u.value.source))
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: "User",
|
|
144
|
+
value: (e = (o = u.value) == null ? void 0 : o.pf_user) == null ? void 0 : e.name
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: "Phone Number",
|
|
148
|
+
value: (i = (n = u.value) == null ? void 0 : n.pf_user) == null ? void 0 : i.phoneNumber
|
|
149
|
+
}
|
|
150
|
+
] : [];
|
|
151
|
+
}), m = K(() => {
|
|
152
|
+
var n, i, v, y;
|
|
153
|
+
if (!u.value) return [];
|
|
154
|
+
const c = [], o = (n = u.value) == null ? void 0 : n.metadata, e = u.value;
|
|
155
|
+
if (o != null && o.campaign) {
|
|
156
|
+
const w = S.campaigns.all.find(
|
|
157
|
+
(F) => F._id === (o == null ? void 0 : o.campaign)
|
|
158
|
+
);
|
|
159
|
+
if (!w) return;
|
|
160
|
+
c.push({
|
|
161
|
+
label: "Campaign",
|
|
162
|
+
value: w.name
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return o != null && o.remark && c.push({
|
|
166
|
+
label: "Remark",
|
|
167
|
+
value: o.remark
|
|
168
|
+
}), (i = u.value) != null && i.ref.startsWith("bill_") && c.push({
|
|
169
|
+
label: "Bill Number",
|
|
170
|
+
value: (v = u.value) == null ? void 0 : v.ref,
|
|
171
|
+
copy: () => {
|
|
172
|
+
var w;
|
|
173
|
+
return Z((w = u.value) == null ? void 0 : w.ref);
|
|
174
|
+
}
|
|
175
|
+
}), o != null && o.location && c.push({
|
|
176
|
+
label: "Location",
|
|
177
|
+
value: (y = b.locations.find(
|
|
178
|
+
(w) => w._id.toString() === (o == null ? void 0 : o.location)
|
|
179
|
+
)) == null ? void 0 : y.name
|
|
180
|
+
}), e.source === X.enum.STORE && c.push({
|
|
181
|
+
label: "Store Transaction",
|
|
182
|
+
value: e.ref
|
|
183
|
+
}), o != null && o.originTransaction && c.push({
|
|
184
|
+
label: "Parent Transaction",
|
|
185
|
+
value: o.originTransaction
|
|
186
|
+
}), o != null && o.referral_count && c.push({
|
|
187
|
+
label: "Referral Count",
|
|
188
|
+
value: o.referral_count
|
|
189
|
+
}), e.refundedFrom && c.push({
|
|
190
|
+
label: "Refunded From",
|
|
191
|
+
value: e.refundedFrom
|
|
192
|
+
}), c;
|
|
193
|
+
});
|
|
194
|
+
return p({
|
|
195
|
+
showSheet: I
|
|
196
|
+
}), (c, o) => {
|
|
197
|
+
const e = Y("FmButton"), n = Y("FmSideSheet");
|
|
198
|
+
return N(), ae(n, {
|
|
199
|
+
"max-width": 560,
|
|
200
|
+
modelValue: l(C),
|
|
201
|
+
"onUpdate:modelValue": o[1] || (o[1] = (i) => he(C) ? C.value = i : null),
|
|
202
|
+
header: "Transaction Details"
|
|
203
|
+
}, {
|
|
204
|
+
"side-sheet-footer": oe(() => [
|
|
205
|
+
h("div", Ye, [
|
|
206
|
+
R(e, {
|
|
207
|
+
label: "Close",
|
|
208
|
+
onClick: o[0] || (o[0] = (i) => I(!1)),
|
|
209
|
+
variant: "tertiary"
|
|
210
|
+
})
|
|
211
|
+
])
|
|
212
|
+
]),
|
|
213
|
+
default: oe(() => [
|
|
214
|
+
h("div", Oe, [
|
|
215
|
+
h("div", ke, [
|
|
216
|
+
(N(!0), V(W, null, ne(l(E), (i) => (N(), V("div", {
|
|
217
|
+
key: i.label,
|
|
218
|
+
class: "flex flex-col gap-4"
|
|
219
|
+
}, [
|
|
220
|
+
h("div", Me, z(i.label), 1),
|
|
221
|
+
h("div", {
|
|
222
|
+
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
223
|
+
onClick: i.copy
|
|
224
|
+
}, [
|
|
225
|
+
be(z(i.accessorFn ? i.accessorFn() : i.value) + " ", 1),
|
|
226
|
+
(N(), ae(ve(i.component)))
|
|
227
|
+
], 8, Pe),
|
|
228
|
+
o[2] || (o[2] = h("hr", { class: "mt-3" }, null, -1))
|
|
229
|
+
]))), 128)),
|
|
230
|
+
(N(!0), V(W, null, ne(l(m), (i) => (N(), V("div", {
|
|
231
|
+
key: i.label,
|
|
232
|
+
class: "flex flex-col gap-4"
|
|
233
|
+
}, [
|
|
234
|
+
h("div", Ve, z(i.label), 1),
|
|
235
|
+
h("div", {
|
|
236
|
+
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
237
|
+
onClick: i.copy
|
|
238
|
+
}, z(i.accessorFn ? i.accessorFn() : i.value), 9, Ue),
|
|
239
|
+
o[3] || (o[3] = h("hr", { class: "mt-3" }, null, -1))
|
|
240
|
+
]))), 128))
|
|
241
|
+
])
|
|
242
|
+
])
|
|
243
|
+
]),
|
|
244
|
+
_: 1
|
|
245
|
+
}, 8, ["modelValue"]);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}), $e = { class: "hidden xs:!flex items-center justify-end" }, Le = { class: "flex items-center justify-between" }, ze = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, He = { class: "xs:hidden" }, wt = /* @__PURE__ */ Q({
|
|
249
|
+
__name: "CollectionTransactions",
|
|
250
|
+
props: {
|
|
251
|
+
user: {
|
|
252
|
+
type: String
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
setup(d) {
|
|
256
|
+
const { t: p } = fe(), C = le(), u = pe(), S = Ie(), b = d, I = M(!1), { minor: P } = ge, E = [
|
|
257
|
+
{
|
|
258
|
+
header: "Transaction ID",
|
|
259
|
+
accessorKey: "_id",
|
|
260
|
+
meta: {
|
|
261
|
+
maxWidth: "100px"
|
|
262
|
+
},
|
|
263
|
+
cell(a) {
|
|
264
|
+
return r("div", { class: "flex items-center" }, [
|
|
265
|
+
r(g.FmIcon, {
|
|
266
|
+
name: "content_copy",
|
|
267
|
+
outline: !0,
|
|
268
|
+
size: "sm",
|
|
269
|
+
class: "cursor-pointer mr-4",
|
|
270
|
+
onClick: (t) => {
|
|
271
|
+
t.preventDefault(), t.stopPropagation(), Z(a.row.original._id.toString());
|
|
272
|
+
}
|
|
273
|
+
}),
|
|
274
|
+
r(
|
|
275
|
+
"div",
|
|
276
|
+
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
277
|
+
a.row.original._id.toString()
|
|
278
|
+
)
|
|
279
|
+
]);
|
|
280
|
+
},
|
|
281
|
+
enableSorting: !1
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
header: "Created at",
|
|
285
|
+
accessorKey: "_id",
|
|
286
|
+
accessorFn: (a) => x(U(a._id.toString())),
|
|
287
|
+
cell: (a) => x(U(a.row.original._id.toString())).format(
|
|
288
|
+
"D MMM YYYY, hh:mmA"
|
|
289
|
+
),
|
|
290
|
+
enableSorting: !0
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
header: "Amount",
|
|
294
|
+
// accessorKey: 'totalAmount',
|
|
295
|
+
enableSorting: !1,
|
|
296
|
+
cell(a) {
|
|
297
|
+
var _, s, T, A;
|
|
298
|
+
const t = J(
|
|
299
|
+
a.row.original.expiryAmount.reduce(
|
|
300
|
+
(D, B) => D + B.amount,
|
|
301
|
+
a.row.original.amount ?? 0
|
|
302
|
+
),
|
|
303
|
+
2
|
|
304
|
+
), f = (s = (_ = a.row.original.expiryAmount) == null ? void 0 : _[0]) != null && s.expiredAt ? x((A = (T = a.row.original.expiryAmount) == null ? void 0 : T[0]) == null ? void 0 : A.expiredAt).format(
|
|
305
|
+
"D MMM YYYY"
|
|
306
|
+
) : "";
|
|
307
|
+
return r("div", { class: "flex items-center" }, [
|
|
308
|
+
r(
|
|
309
|
+
"div",
|
|
310
|
+
{
|
|
311
|
+
class: [
|
|
312
|
+
"pr-2",
|
|
313
|
+
+t > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
t
|
|
317
|
+
),
|
|
318
|
+
r("div", { class: "flex items-center" }, [
|
|
319
|
+
a.row.original.expiryAmount.length > 0 ? r(
|
|
320
|
+
g.FmTooltip,
|
|
321
|
+
{
|
|
322
|
+
content: `Expired on ${f}`
|
|
323
|
+
},
|
|
324
|
+
[
|
|
325
|
+
r(g.FmIcon, {
|
|
326
|
+
name: "info",
|
|
327
|
+
outline: !0,
|
|
328
|
+
size: "sm"
|
|
329
|
+
})
|
|
330
|
+
]
|
|
331
|
+
) : r("div")
|
|
332
|
+
])
|
|
333
|
+
]);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
header: "Type",
|
|
338
|
+
accessorKey: "pf_collectible.type",
|
|
339
|
+
accessorFn: (a) => O.formattedType(a),
|
|
340
|
+
meta: {
|
|
341
|
+
maxWidth: "200px"
|
|
342
|
+
},
|
|
343
|
+
cell(a) {
|
|
344
|
+
const t = O.formattedType(a.row.original);
|
|
345
|
+
return r("div", { class: "flex items-center" }, [
|
|
346
|
+
r("div", { class: "truncate text-ellipsis" }, t),
|
|
347
|
+
t.length > 20 ? r(
|
|
348
|
+
g.FmTooltip,
|
|
349
|
+
{
|
|
350
|
+
content: t
|
|
351
|
+
},
|
|
352
|
+
[
|
|
353
|
+
r(g.FmIcon, {
|
|
354
|
+
name: "info",
|
|
355
|
+
color: "primary",
|
|
356
|
+
outline: !0,
|
|
357
|
+
size: "sm"
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
) : null
|
|
361
|
+
]);
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
header: "Source",
|
|
366
|
+
accessorKey: "source",
|
|
367
|
+
cell(a) {
|
|
368
|
+
var t;
|
|
369
|
+
return r("div", { class: "flex items-center gap-4" }, [
|
|
370
|
+
r(
|
|
371
|
+
"div",
|
|
372
|
+
{ class: "truncate text-ellipsis" },
|
|
373
|
+
G(O.getReason(a.row.original.source))
|
|
374
|
+
),
|
|
375
|
+
...(t = a.row.original.metadata) != null && t.campaign ? [
|
|
376
|
+
r(
|
|
377
|
+
g.FmTooltip,
|
|
378
|
+
{
|
|
379
|
+
get content() {
|
|
380
|
+
var f;
|
|
381
|
+
return (f = u.campaigns.all.find(
|
|
382
|
+
(_) => {
|
|
383
|
+
var s;
|
|
384
|
+
return _._id === ((s = a.row.original.metadata) == null ? void 0 : s.campaign);
|
|
385
|
+
}
|
|
386
|
+
)) == null ? void 0 : f.name;
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
[
|
|
390
|
+
r(g.FmIcon, {
|
|
391
|
+
name: "info",
|
|
392
|
+
color: "primary",
|
|
393
|
+
size: "sm",
|
|
394
|
+
onClick: async (f) => {
|
|
395
|
+
f.preventDefault(), f.stopPropagation();
|
|
396
|
+
const _ = u.campaigns.all.find(
|
|
397
|
+
(s) => {
|
|
398
|
+
var T;
|
|
399
|
+
return s._id === ((T = a.row.original.metadata) == null ? void 0 : T.campaign);
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
if (_)
|
|
403
|
+
switch (_.type) {
|
|
404
|
+
case "VOUCHER":
|
|
405
|
+
case "PROMOTION":
|
|
406
|
+
case "BROADCAST":
|
|
407
|
+
await S.push({
|
|
408
|
+
name: H[`$connect-CAMPAIGN_${_.type}`]
|
|
409
|
+
});
|
|
410
|
+
break;
|
|
411
|
+
case "GAME":
|
|
412
|
+
case "CREDIT":
|
|
413
|
+
case "MISSION":
|
|
414
|
+
await S.push({
|
|
415
|
+
name: H[`$connect-PROGRAM_${_.type}`]
|
|
416
|
+
});
|
|
417
|
+
break;
|
|
418
|
+
case "POINT":
|
|
419
|
+
await S.push({
|
|
420
|
+
name: H["$connect-PROGRAM_EXPERIENCE"]
|
|
421
|
+
});
|
|
422
|
+
break;
|
|
423
|
+
case "COIN":
|
|
424
|
+
await S.push({
|
|
425
|
+
name: H["$connect-PROGRAM_POINT"]
|
|
426
|
+
});
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
})
|
|
431
|
+
]
|
|
432
|
+
)
|
|
433
|
+
] : []
|
|
434
|
+
]);
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
header: "User",
|
|
439
|
+
accessorKey: "pf_user.name",
|
|
440
|
+
cell(a) {
|
|
441
|
+
return ue(a.row.original.pf_user);
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
header: "Phone No.",
|
|
446
|
+
accessorKey: "pf_user.phoneNumber",
|
|
447
|
+
accessorFn: (a) => {
|
|
448
|
+
var t;
|
|
449
|
+
return ((t = a == null ? void 0 : a.pf_user) == null ? void 0 : t.phoneNumber) || "";
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
header: "Status",
|
|
454
|
+
id: "status",
|
|
455
|
+
enableSorting: !1,
|
|
456
|
+
cell(a) {
|
|
457
|
+
const t = !!a.row.original.refunded;
|
|
458
|
+
return r(g.FmChip, {
|
|
459
|
+
label: p(t ? "connect.transaction.refunded" : "connect.transaction.completed"),
|
|
460
|
+
variant: "plain",
|
|
461
|
+
class: t ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-success bg-fm-color-system-success-100"
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
accessorFn: (a) => a.ref,
|
|
467
|
+
header: "References",
|
|
468
|
+
accessorKey: "ref",
|
|
469
|
+
cell(a) {
|
|
470
|
+
var t, f;
|
|
471
|
+
return r("div", { class: "flex items-center justify-between gap-4" }, [
|
|
472
|
+
r("div", { class: "flex items-center" }, [
|
|
473
|
+
(t = a.row.original.metadata) != null && t.remark ? r(
|
|
474
|
+
g.FmTooltip,
|
|
475
|
+
{
|
|
476
|
+
content: (f = a.row.original.metadata) == null ? void 0 : f.remark
|
|
477
|
+
},
|
|
478
|
+
[
|
|
479
|
+
r(g.FmIcon, {
|
|
480
|
+
name: "info",
|
|
481
|
+
class: "pl-2",
|
|
482
|
+
outline: !0,
|
|
483
|
+
size: "sm"
|
|
484
|
+
})
|
|
485
|
+
]
|
|
486
|
+
) : r("div")
|
|
487
|
+
]),
|
|
488
|
+
r("div", { class: "flex-1" }, a.row.original.ref)
|
|
489
|
+
]);
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
header: "Actions",
|
|
494
|
+
cell(a) {
|
|
495
|
+
const t = a.row.original;
|
|
496
|
+
return r(
|
|
497
|
+
g.FmTooltip,
|
|
498
|
+
{
|
|
499
|
+
get content() {
|
|
500
|
+
return "Revert Transaction";
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
[
|
|
504
|
+
r(g.FmButton, {
|
|
505
|
+
variant: "tertiary",
|
|
506
|
+
icon: "amend",
|
|
507
|
+
iconColor: "neutral-gray-400",
|
|
508
|
+
disabled: !t.isRevertable,
|
|
509
|
+
onClick: (f) => {
|
|
510
|
+
f.stopPropagation(), F(t);
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
]
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
], m = M({
|
|
518
|
+
search: "",
|
|
519
|
+
"pf_collectible.type": [],
|
|
520
|
+
"metadata.location": [],
|
|
521
|
+
dateRange: {
|
|
522
|
+
startDate: x().subtract(7, "day").toISOString(),
|
|
523
|
+
endDate: x().endOf("day").toISOString()
|
|
524
|
+
},
|
|
525
|
+
source: []
|
|
526
|
+
}), { tableMeta: c, rowData: o, onSort: e, debouncedFetchData: n, onSearch: i } = ie(async (a) => {
|
|
527
|
+
const t = {
|
|
528
|
+
...m.value,
|
|
529
|
+
user: b.user,
|
|
530
|
+
dateRange: {
|
|
531
|
+
start: new Date(m.value.dateRange.startDate).toISOString(),
|
|
532
|
+
end: new Date(m.value.dateRange.endDate).toISOString()
|
|
533
|
+
}
|
|
534
|
+
}, f = await L.readAll(a, t);
|
|
535
|
+
return {
|
|
536
|
+
resources: await Promise.all(
|
|
537
|
+
f.resources.map(async (s) => {
|
|
538
|
+
let T;
|
|
539
|
+
if (s.source !== X.enum.BILL)
|
|
540
|
+
T = !1;
|
|
541
|
+
else {
|
|
542
|
+
const D = s.refunded || !!s.refundedFrom;
|
|
543
|
+
if (s.expiryAmount.reduce(
|
|
544
|
+
($, k) => $ + k.amount,
|
|
545
|
+
s.amount ?? 0
|
|
546
|
+
) > 0) {
|
|
547
|
+
let $ = [];
|
|
548
|
+
[
|
|
549
|
+
q.enum.STAMP,
|
|
550
|
+
q.enum.POINT
|
|
551
|
+
].includes(s.pf_collectible.type) ? T = !1 : T = !D;
|
|
552
|
+
} else
|
|
553
|
+
switch (s.pf_collectible.type) {
|
|
554
|
+
case q.enum.VOUCHER:
|
|
555
|
+
T = s.expiryAmount.some(
|
|
556
|
+
(k) => !k.expiredAt || x(k.expiredAt).isAfter(x())
|
|
557
|
+
) && !D;
|
|
558
|
+
break;
|
|
559
|
+
default:
|
|
560
|
+
T = !D;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const A = v.value.find((D) => D._id === s.ref);
|
|
565
|
+
return {
|
|
566
|
+
...s,
|
|
567
|
+
ref: (A == null ? void 0 : A.seqNumber) || s.ref,
|
|
568
|
+
isRevertable: T
|
|
569
|
+
};
|
|
570
|
+
})
|
|
571
|
+
),
|
|
572
|
+
meta: f.meta
|
|
573
|
+
};
|
|
574
|
+
}), v = M([]), y = X.options.map((a) => ({ label: G(O.getReason(a)), value: a })), w = K(
|
|
575
|
+
() => C.locations.map((a) => ({ label: a.name, value: a._id }))
|
|
576
|
+
);
|
|
577
|
+
re(
|
|
578
|
+
m,
|
|
579
|
+
() => {
|
|
580
|
+
n();
|
|
581
|
+
},
|
|
582
|
+
{ deep: !0 }
|
|
583
|
+
);
|
|
584
|
+
async function F(a) {
|
|
585
|
+
P(
|
|
586
|
+
async () => {
|
|
587
|
+
await L.revertTransaction({
|
|
588
|
+
id: a._id.toString()
|
|
589
|
+
}), await n();
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
message: "Reverting transaction...",
|
|
593
|
+
successMessage: "Transaction reverted successfully"
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
async function ee() {
|
|
598
|
+
try {
|
|
599
|
+
I.value = !0;
|
|
600
|
+
const a = {
|
|
601
|
+
...m.value,
|
|
602
|
+
user: b.user,
|
|
603
|
+
dateRange: {
|
|
604
|
+
start: new Date(m.value.dateRange.startDate).toISOString(),
|
|
605
|
+
end: new Date(m.value.dateRange.endDate).toISOString()
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
await de({
|
|
609
|
+
exporter: new Ne(),
|
|
610
|
+
readFunction: (t) => L.readAll(t, a),
|
|
611
|
+
transformRecord: (t) => {
|
|
612
|
+
var f, _, s, T, A, D, B;
|
|
613
|
+
return {
|
|
614
|
+
TransactionID: t._id,
|
|
615
|
+
CreatedAt: x(U(t._id.toString())).format(
|
|
616
|
+
"D MMM YYYY, hh:mmA"
|
|
617
|
+
),
|
|
618
|
+
Amount: J(
|
|
619
|
+
t.expiryAmount.reduce(
|
|
620
|
+
($, k) => $ + k.amount,
|
|
621
|
+
t.amount ?? 0
|
|
622
|
+
),
|
|
623
|
+
2
|
|
624
|
+
),
|
|
625
|
+
ExpiredAt: (_ = (f = t.expiryAmount) == null ? void 0 : f[0]) != null && _.expiredAt ? x((T = (s = t.expiryAmount) == null ? void 0 : s[0]) == null ? void 0 : T.expiredAt).format("D MMM YYYY") : "",
|
|
626
|
+
Type: O.formattedType(t),
|
|
627
|
+
Source: G(O.getReason(t.source)),
|
|
628
|
+
User: ((A = t.pf_user) == null ? void 0 : A.name) || "",
|
|
629
|
+
"Phone No.": ((D = t.pf_user) == null ? void 0 : D.phoneNumber) || "",
|
|
630
|
+
References: t.ref,
|
|
631
|
+
Remark: ((B = t.metadata) == null ? void 0 : B.remark) || ""
|
|
632
|
+
};
|
|
633
|
+
},
|
|
634
|
+
filename: "transactions"
|
|
635
|
+
});
|
|
636
|
+
} catch (a) {
|
|
637
|
+
console.error(a);
|
|
638
|
+
} finally {
|
|
639
|
+
I.value = !1;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
const te = M(null);
|
|
643
|
+
function ye(a) {
|
|
644
|
+
var t;
|
|
645
|
+
console.log(a), (t = te.value) == null || t.showSheet(!0, a.original);
|
|
646
|
+
}
|
|
647
|
+
return _e(async () => {
|
|
648
|
+
await C.readLocations(), await u.read(), await n();
|
|
649
|
+
}), (a, t) => {
|
|
650
|
+
const f = Y("FmSearch"), _ = Y("FmButton");
|
|
651
|
+
return N(), V(W, null, [
|
|
652
|
+
h("div", null, [
|
|
653
|
+
h("div", $e, [
|
|
654
|
+
R(f, {
|
|
655
|
+
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
656
|
+
modelValue: l(m).search,
|
|
657
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => l(m).search = s),
|
|
658
|
+
placeholder: "Search",
|
|
659
|
+
collapsible: ""
|
|
660
|
+
}, null, 8, ["modelValue"]),
|
|
661
|
+
R(_, {
|
|
662
|
+
icon: "ios_share",
|
|
663
|
+
variant: "tertiary",
|
|
664
|
+
onClick: ee
|
|
665
|
+
})
|
|
666
|
+
]),
|
|
667
|
+
h("div", Le, [
|
|
668
|
+
h("div", ze, [
|
|
669
|
+
R(j, {
|
|
670
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
671
|
+
"right-icon": "keyboard_arrow_down",
|
|
672
|
+
modelValue: l(m)["metadata.location"],
|
|
673
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => l(m)["metadata.location"] = s),
|
|
674
|
+
icon: "storefront",
|
|
675
|
+
"show-item-label": !0,
|
|
676
|
+
items: l(w)
|
|
677
|
+
}, null, 8, ["modelValue", "items"]),
|
|
678
|
+
R(j, {
|
|
679
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
680
|
+
"right-icon": "keyboard_arrow_down",
|
|
681
|
+
modelValue: l(m)["pf_collectible.type"],
|
|
682
|
+
"onUpdate:modelValue": t[2] || (t[2] = (s) => l(m)["pf_collectible.type"] = s),
|
|
683
|
+
label: "Type: ",
|
|
684
|
+
"show-item-label": !0,
|
|
685
|
+
items: [
|
|
686
|
+
{ label: "Point", value: "COIN" },
|
|
687
|
+
{ label: "Credit", value: "CREDIT" },
|
|
688
|
+
{ label: "Voucher", value: "VOUCHER" },
|
|
689
|
+
{ label: "Experience", value: "POINT" },
|
|
690
|
+
{ label: "Tier", value: "TIER" },
|
|
691
|
+
{ label: "Title", value: "TITLE" },
|
|
692
|
+
{ label: "Game", value: "GAME" },
|
|
693
|
+
{ label: "Stamp", value: "STAMP" }
|
|
694
|
+
]
|
|
695
|
+
}, null, 8, ["modelValue"]),
|
|
696
|
+
R(j, {
|
|
697
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
698
|
+
"right-icon": "keyboard_arrow_down",
|
|
699
|
+
modelValue: l(m).source,
|
|
700
|
+
"onUpdate:modelValue": t[3] || (t[3] = (s) => l(m).source = s),
|
|
701
|
+
label: "Source: ",
|
|
702
|
+
"show-item-label": !0,
|
|
703
|
+
items: l(y)
|
|
704
|
+
}, null, 8, ["modelValue", "items"]),
|
|
705
|
+
R(se, {
|
|
706
|
+
"model-value": {
|
|
707
|
+
startDate: l(m).dateRange.startDate,
|
|
708
|
+
endDate: l(m).dateRange.endDate
|
|
709
|
+
},
|
|
710
|
+
"onUpdate:modelValue": t[4] || (t[4] = (s) => l(m).dateRange = {
|
|
711
|
+
startDate: l(x)(s.startDate).startOf("d").toISOString(),
|
|
712
|
+
endDate: l(x)(s.endDate).endOf("d").toISOString()
|
|
713
|
+
})
|
|
714
|
+
}, null, 8, ["model-value"])
|
|
715
|
+
]),
|
|
716
|
+
R(f, {
|
|
717
|
+
class: "xs:hidden",
|
|
718
|
+
modelValue: l(m).search,
|
|
719
|
+
"onUpdate:modelValue": t[5] || (t[5] = (s) => l(m).search = s),
|
|
720
|
+
placeholder: "Search",
|
|
721
|
+
collapsible: ""
|
|
722
|
+
}, null, 8, ["modelValue"]),
|
|
723
|
+
h("div", He, [
|
|
724
|
+
R(_, {
|
|
725
|
+
icon: "ios_share",
|
|
726
|
+
variant: "tertiary",
|
|
727
|
+
onClick: ee
|
|
728
|
+
})
|
|
729
|
+
])
|
|
730
|
+
]),
|
|
731
|
+
R(ce, {
|
|
732
|
+
loading: l(c).isLoading,
|
|
733
|
+
"row-data": l(o),
|
|
734
|
+
"row-count": l(c).totalRows,
|
|
735
|
+
"column-defs": E.filter(
|
|
736
|
+
(s) => !b.user || s.header !== "User" && s.header !== "Phone No."
|
|
737
|
+
),
|
|
738
|
+
"page-count": l(c).pageCount,
|
|
739
|
+
"page-index": l(c).pageIndex,
|
|
740
|
+
"page-size": l(c).pageSize,
|
|
741
|
+
"shrink-at": !1,
|
|
742
|
+
onSortChange: l(e),
|
|
743
|
+
onPageChange: t[6] || (t[6] = (s) => l(n)({
|
|
744
|
+
pageSize: s.pageSize,
|
|
745
|
+
pageIndex: s.pageIndex
|
|
746
|
+
})),
|
|
747
|
+
onRowClick: ye
|
|
748
|
+
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
749
|
+
]),
|
|
750
|
+
R(Be, {
|
|
751
|
+
ref_key: "transactionDetailSheet",
|
|
752
|
+
ref: te
|
|
753
|
+
}, null, 512)
|
|
754
|
+
], 64);
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
class Ke extends me {
|
|
759
|
+
}
|
|
760
|
+
const Ge = { class: "flex items-center justify-between" }, je = { class: "flex gap-8 items-center" }, qe = { class: "flex gap-8 items-center xs:hidden" }, Tt = /* @__PURE__ */ Q({
|
|
761
|
+
__name: "StoreTransactions",
|
|
762
|
+
props: {
|
|
763
|
+
user: {
|
|
764
|
+
type: String
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
setup(d) {
|
|
768
|
+
const p = d, { minor: C } = ge;
|
|
769
|
+
Se();
|
|
770
|
+
const u = [
|
|
771
|
+
{
|
|
772
|
+
header: "Transaction ID",
|
|
773
|
+
meta: {
|
|
774
|
+
maxWidth: "150px"
|
|
775
|
+
},
|
|
776
|
+
cell(e) {
|
|
777
|
+
return r("div", { class: "flex items-center" }, [
|
|
778
|
+
r(g.FmIcon, {
|
|
779
|
+
name: "content_copy",
|
|
780
|
+
outline: !0,
|
|
781
|
+
size: "sm",
|
|
782
|
+
class: "cursor-pointer mr-4 shrink-0",
|
|
783
|
+
onClick: (n) => {
|
|
784
|
+
n.preventDefault(), n.stopPropagation(), Z(e.row.original._id.toString());
|
|
785
|
+
}
|
|
786
|
+
}),
|
|
787
|
+
r("div", { class: "truncate" }, e.row.original._id.toString())
|
|
788
|
+
]);
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
header: "Created at",
|
|
793
|
+
accessorFn: (e) => x(U(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
794
|
+
enableSorting: !0
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
header: "Bundle",
|
|
798
|
+
accessorFn: (e) => e.bundle.name
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
header: "Location",
|
|
802
|
+
accessorFn: (e) => e.location ? e.pf_location[0].name : "Online Store"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
header: "Payment Type",
|
|
806
|
+
accessorFn: (e) => {
|
|
807
|
+
var n;
|
|
808
|
+
return ((n = e.paymentType) == null ? void 0 : n.type) ?? "N/A";
|
|
809
|
+
},
|
|
810
|
+
cell(e) {
|
|
811
|
+
var n, i;
|
|
812
|
+
return r("div", { class: "flex items-center gap-4" }, [
|
|
813
|
+
r("div", { class: "flex items-center" }, [
|
|
814
|
+
((n = e.row.original.paymentType) == null ? void 0 : n.type) == "ONLINE" && e.row.original.paymentType.extra ? r(
|
|
815
|
+
g.FmTooltip,
|
|
816
|
+
{
|
|
817
|
+
content: e.row.original.paymentType.extra
|
|
818
|
+
},
|
|
819
|
+
[
|
|
820
|
+
r(g.FmIcon, {
|
|
821
|
+
name: "info",
|
|
822
|
+
outline: !0,
|
|
823
|
+
size: "sm"
|
|
824
|
+
})
|
|
825
|
+
]
|
|
826
|
+
) : r("div")
|
|
827
|
+
]),
|
|
828
|
+
r(
|
|
829
|
+
"div",
|
|
830
|
+
{ class: "flex-1" },
|
|
831
|
+
((i = e.row.original.paymentType) == null ? void 0 : i.type) ?? "N/A"
|
|
832
|
+
)
|
|
833
|
+
]);
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
header: "User",
|
|
838
|
+
cell: (e) => ue(e.row.original.pf_member)
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
header: "Phone No.",
|
|
842
|
+
accessorFn: (e) => e.pf_member.phoneNumber
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
header: "Status",
|
|
846
|
+
// accessorFn: (u) => u.status,
|
|
847
|
+
cell(e) {
|
|
848
|
+
var v, y, w, F;
|
|
849
|
+
const n = e.row.original.status, i = {
|
|
850
|
+
COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
851
|
+
REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
|
|
852
|
+
};
|
|
853
|
+
return r("div", { class: "flex items-center gap-4" }, [
|
|
854
|
+
r(g.FmChip, {
|
|
855
|
+
label: Te.title(n),
|
|
856
|
+
variant: "plain",
|
|
857
|
+
class: i[n] ?? ""
|
|
858
|
+
}),
|
|
859
|
+
(y = (v = e.row.original) == null ? void 0 : v.refund) != null && y.reason ? r(
|
|
860
|
+
g.FmTooltip,
|
|
861
|
+
{
|
|
862
|
+
content: (F = (w = e.row.original) == null ? void 0 : w.refund) == null ? void 0 : F.reason
|
|
863
|
+
},
|
|
864
|
+
[
|
|
865
|
+
r(g.FmIcon, {
|
|
866
|
+
name: "info",
|
|
867
|
+
color: "primary",
|
|
868
|
+
outline: !0,
|
|
869
|
+
size: "sm"
|
|
870
|
+
})
|
|
871
|
+
]
|
|
872
|
+
) : null
|
|
873
|
+
]);
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
header: "Source",
|
|
878
|
+
accessorFn: (e) => e.source
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
header: "Ref",
|
|
882
|
+
accessorFn: (e) => e.ref
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
id: "action",
|
|
886
|
+
cell(e) {
|
|
887
|
+
const n = e.row.original, i = n.status === "COMPLETED" && !n.refund && n.source == "ADMIN";
|
|
888
|
+
return i ? r(
|
|
889
|
+
g.FmMenu,
|
|
890
|
+
{
|
|
891
|
+
placement: "bottom-end",
|
|
892
|
+
onClick: (v) => {
|
|
893
|
+
v.stopPropagation();
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"menu-button": () => r(g.FmButton, {
|
|
898
|
+
icon: "settings",
|
|
899
|
+
variant: "tertiary",
|
|
900
|
+
if: i
|
|
901
|
+
}),
|
|
902
|
+
default: () => [
|
|
903
|
+
r(g.FmMenuItem, {
|
|
904
|
+
label: "Refund",
|
|
905
|
+
sublabel: "Refund this transaction",
|
|
906
|
+
onClick: async (v) => {
|
|
907
|
+
v.stopPropagation(), await c(n);
|
|
908
|
+
}
|
|
909
|
+
})
|
|
910
|
+
]
|
|
911
|
+
}
|
|
912
|
+
) : r("div");
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
], S = M({
|
|
916
|
+
searchValue: "",
|
|
917
|
+
dateRange: {
|
|
918
|
+
startDate: x().subtract(7, "day").toISOString(),
|
|
919
|
+
endDate: x().toISOString()
|
|
920
|
+
}
|
|
921
|
+
}), { tableMeta: b, rowData: I, onSort: P, debouncedFetchData: E, onSearch: m } = ie(async (e) => {
|
|
922
|
+
const n = {
|
|
923
|
+
...S.value.dateRange,
|
|
924
|
+
user: p.user
|
|
925
|
+
};
|
|
926
|
+
return await L.readStoreTransactions(e, n);
|
|
927
|
+
});
|
|
928
|
+
async function c(e) {
|
|
929
|
+
await Re.confirm(
|
|
930
|
+
"Are you sure you want to refund this transaction?",
|
|
931
|
+
"Refund Store Transaction",
|
|
932
|
+
"Confirm",
|
|
933
|
+
"Cancel"
|
|
934
|
+
) && await C(
|
|
935
|
+
async () => {
|
|
936
|
+
var i;
|
|
937
|
+
await Ce.refundStoreTransaction({
|
|
938
|
+
id: e._id,
|
|
939
|
+
reason: `ADMIN:${(i = De().sessionUser) == null ? void 0 : i.name}`
|
|
940
|
+
}), await E();
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
message: "Refunding transaction...",
|
|
944
|
+
successMessage: "Transaction refunded successfully"
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
re(
|
|
949
|
+
S,
|
|
950
|
+
() => {
|
|
951
|
+
E();
|
|
952
|
+
},
|
|
953
|
+
{ deep: !0 }
|
|
954
|
+
), xe(async () => {
|
|
955
|
+
await E();
|
|
956
|
+
});
|
|
957
|
+
const o = async () => de({
|
|
958
|
+
exporter: new Ke(),
|
|
959
|
+
readFunction: (e) => L.readStoreTransactions(e, {
|
|
960
|
+
...S.value.dateRange,
|
|
961
|
+
user: p.user
|
|
962
|
+
}),
|
|
963
|
+
transformRecord: (e) => {
|
|
964
|
+
var n, i, v, y, w, F;
|
|
965
|
+
return {
|
|
966
|
+
TransactionId: ((n = e._id) == null ? void 0 : n.toString()) || "",
|
|
967
|
+
CreatedAt: x(U(e._id.toString())).format(
|
|
968
|
+
"DD/MM/YYYY HH:mm:ss"
|
|
969
|
+
),
|
|
970
|
+
Bundle: e.bundle.name || "",
|
|
971
|
+
Location: e.location ? e.pf_location[0].name : "Online Store",
|
|
972
|
+
PaymentType: ((i = e.paymentType) == null ? void 0 : i.type) || "N/A",
|
|
973
|
+
PaymentExtra: ((v = e.paymentType) == null ? void 0 : v.extra) || "",
|
|
974
|
+
User: ((y = e.pf_member) == null ? void 0 : y.name) || "",
|
|
975
|
+
PhoneNumber: ((w = e.pf_member) == null ? void 0 : w.phoneNumber) || "",
|
|
976
|
+
Status: e.status || "",
|
|
977
|
+
RefundReason: ((F = e == null ? void 0 : e.refund) == null ? void 0 : F.reason) || "",
|
|
978
|
+
Ref: (e == null ? void 0 : e.ref) || ""
|
|
979
|
+
};
|
|
980
|
+
},
|
|
981
|
+
filename: "store-transactions"
|
|
982
|
+
});
|
|
983
|
+
return (e, n) => {
|
|
984
|
+
const i = Y("FmSearch"), v = Y("FmButton");
|
|
985
|
+
return N(), V("div", null, [
|
|
986
|
+
h("div", Ge, [
|
|
987
|
+
h("div", je, [
|
|
988
|
+
R(se, {
|
|
989
|
+
modelValue: l(S).dateRange,
|
|
990
|
+
"onUpdate:modelValue": n[0] || (n[0] = (y) => l(S).dateRange = y)
|
|
991
|
+
}, null, 8, ["modelValue"])
|
|
992
|
+
]),
|
|
993
|
+
h("div", qe, [
|
|
994
|
+
R(i, {
|
|
995
|
+
modelValue: l(b).searchValue,
|
|
996
|
+
"onUpdate:modelValue": [
|
|
997
|
+
n[1] || (n[1] = (y) => l(b).searchValue = y),
|
|
998
|
+
l(m)
|
|
999
|
+
],
|
|
1000
|
+
placeholder: "Search",
|
|
1001
|
+
collapsible: ""
|
|
1002
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1003
|
+
R(v, {
|
|
1004
|
+
icon: "ios_share",
|
|
1005
|
+
variant: "tertiary",
|
|
1006
|
+
onClick: o
|
|
1007
|
+
})
|
|
1008
|
+
])
|
|
1009
|
+
]),
|
|
1010
|
+
R(ce, {
|
|
1011
|
+
loading: l(b).isLoading,
|
|
1012
|
+
"row-data": l(I),
|
|
1013
|
+
"row-count": l(b).totalRows,
|
|
1014
|
+
"column-defs": u.filter(
|
|
1015
|
+
(y) => !p.user || y.header !== "User" && y.header !== "Phone No."
|
|
1016
|
+
),
|
|
1017
|
+
"page-count": l(b).pageCount,
|
|
1018
|
+
"page-index": l(b).pageIndex,
|
|
1019
|
+
"page-size": l(b).pageSize,
|
|
1020
|
+
"shrink-at": !1,
|
|
1021
|
+
onSortChange: l(P),
|
|
1022
|
+
onPageChange: n[2] || (n[2] = (y) => l(E)({
|
|
1023
|
+
pageSize: y.pageSize,
|
|
1024
|
+
pageIndex: y.pageIndex
|
|
1025
|
+
}))
|
|
1026
|
+
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1027
|
+
]);
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
export {
|
|
1032
|
+
wt as _,
|
|
1033
|
+
Tt as a
|
|
1034
|
+
};
|