@feedmepos/mf-connect 0.1.97-prod → 0.1.98-beta.2
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/{App-DHAyGCKP.js → App-BWBeJksP.js} +118 -106
- package/dist/AuditLogs-CWVUX5o0.js +2013 -0
- package/dist/{Bin-BxyU2xtK.js → Bin-jXmZpGfg.js} +8 -8
- package/dist/{Broadcast-BJjehb02.js → Broadcast-C76pTADb.js} +18 -17
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCxP8rEW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-9kfq8OXE.js} +5 -6
- package/dist/{Card-BYDuADCn.js → Card-qXn83BYu.js} +19 -19
- package/dist/{Collections-BlPEkNm8.js → Collections-DGXUQSbz.js} +197 -185
- package/dist/{Credit-D9Eqxv2E.js → Credit-CpmrPZx9.js} +18 -17
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DAnw5TFZ.js +3377 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hpNgkLOt.js → EffectSheet.vue_vue_type_style_index_0_lang-BCAotF0P.js} +6 -6
- package/dist/{Experience-DGumSpYK.js → Experience-CuOq7hd3.js} +35 -34
- package/dist/{FileSaver.min-D_TpPHp3.js → FileSaver.min-Cjv6SzrG.js} +1 -1
- package/dist/{Game-DDsYLdKu.js → Game-D0KfLD-b.js} +16 -15
- package/dist/Grab-L1h7bHD7.js +300 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-R00i7YNe.js → ImageInput.vue_vue_type_script_setup_true_lang-DMAaHxzm.js} +1 -1
- package/dist/{Index-DwRbFOsj.js → Index-DxwMHEV3.js} +10 -10
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-i9-B25xO.js +48 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D_HOJBzW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D84v7zC_.js} +1 -1
- package/dist/LoyaltyDashboard-B5wg1EUC.js +1082 -0
- package/dist/{MainLayout-BEUAguIP.js → MainLayout-Cgi3Z3EM.js} +1 -1
- package/dist/{Marketing-WdhEZvmz.js → Marketing-Cl5OSBI1.js} +4 -4
- package/dist/{MarketingMaterialEdit-DUIkUA79.js → MarketingMaterialEdit-CzYTbdJd.js} +214 -211
- package/dist/{Member-jL3RMGsZ.js → Member-D29x5Cic.js} +20 -20
- package/dist/{MemberList-B1bdPK63.js → MemberList-DDPe6Ymr.js} +50 -51
- package/dist/{MemberTransactions-BNKJ0wtr.js → MemberTransactions-3mboVWAx.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cvsz00_4.js → MessageInput.vue_vue_type_script_setup_true_lang-C2HlA9O8.js} +11 -11
- package/dist/{Mission-CoXzS7U6.js → Mission-CMPc4NLe.js} +35 -34
- package/dist/{Overview-B16wZUSV.js → Overview-sJ2kuP4U.js} +19 -19
- package/dist/{Point-CORBv0y2.js → Point-BBP4UEhf.js} +30 -29
- package/dist/{Promotion-DQ4WnFkH.js → Promotion-Bt0RLGsd.js} +111 -105
- package/dist/{Queue-BW97QEY2.js → Queue-CzVsoIDM.js} +43 -43
- package/dist/{Record-DZOhwf13.js → Record-CAoGgaxo.js} +10 -10
- package/dist/Review-CVBJlwGK.js +959 -0
- package/dist/ReviewFacebookCallback-RGWdxXYf.js +243 -0
- package/dist/ReviewGoogleCallback-L7_Jjbkx.js +208 -0
- package/dist/{Reward-Bi9mpuyH.js → Reward-CrpFlr0a.js} +17 -17
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dtosx1wE.js → RewardGroup.vue_vue_type_script_setup_true_lang-DW-WFNI6.js} +12 -12
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DlcsO8fk.js +1911 -0
- package/dist/{Segment-COhS8SPv.js → Segment-Cy-QwYQQ.js} +77 -78
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-By_BQodK.js → SelectItems.vue_vue_type_script_setup_true_lang-ovvxxcrQ.js} +3 -3
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BoEnwoYd.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D69bJtyd.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DonadRJT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DQyoPZ_6.js} +4 -4
- package/dist/{Setting-BNtYrzdN.js → Setting-DEQIJ4fY.js} +259 -248
- package/dist/{SettingAdvertisements-Cne8GikV.js → SettingAdvertisements-NuwjCPLN.js} +13 -13
- package/dist/{Store-iTgtmUVL.js → Store-Cw2J_ecA.js} +24 -24
- package/dist/{StoreRewards-DLawXBsl.js → StoreRewards-BK5rDAaK.js} +16 -16
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B3jwaYHX.js +1130 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D_OdWctk.js +7007 -0
- package/dist/{Tier-BbZMbFSd.js → Tier-CwZ40RYc.js} +544 -469
- package/dist/{Title-Co5XWIJm.js → Title-DU7KmsK2.js} +93 -92
- package/dist/{Transaction-CoUbt5rr.js → Transaction-Uh5Ozt93.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzJpNT94.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BtnUNkcS.js} +6 -6
- package/dist/{Voucher-CXojttH0.js → Voucher-BF6ARaRe.js} +28 -27
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bxkds9_4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C7msPJdi.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CHVqFzLm.js → ZodTextField.vue_vue_type_script_setup_true_lang-BrR2WA1K.js} +2 -2
- package/dist/{app-_LtKE4PZ.js → app-DlECkPwT.js} +3408 -2913
- package/dist/app.js +4 -3
- package/dist/{business-CchrWCX9.js → business-BSe9C-xG.js} +1 -1
- package/dist/{campaign-N2x2N6OP.js → campaign-BNS2RxKc.js} +114 -64
- package/dist/{campaign-D2RzC0L1.js → campaign-CXw3jpdr.js} +13 -7
- package/dist/{campaign.enum-DqJsu1At.js → campaign.enum-CnMa2Tia.js} +3 -2
- package/dist/{campaign.fn-Da4r_dvc.js → campaign.fn-CNOinW8t.js} +131 -131
- package/dist/{collectible.enum-CHheiKkA.js → collectible.enum-BIvEz79q.js} +1 -1
- package/dist/duplicateCampaign-Co2TdbrL.js +51 -0
- package/dist/{effect-DADvE7lZ.js → effect-Bt8PE3-M.js} +1 -1
- package/dist/{email-addresses-DzUHQuVs.js → email-addresses-Dh95ALqP.js} +2 -2
- package/dist/{export-uzECYleM.js → export-DIIgAwP7.js} +3 -3
- package/dist/{helper-DMsYRFIM.js → helper-8zEdQ9jm.js} +1 -1
- package/dist/{index-CEVpWmjC.js → index-0BNEvaYc.js} +7 -7
- package/dist/{index-r8TuEpzi.js → index-BAlFstx4.js} +1 -1
- package/dist/{index-C2h4SP0A.js → index-BP5qSDQw.js} +806 -205
- package/dist/{index-KYtKBtvK.js → index-Bqxe3Gbq.js} +3 -3
- package/dist/{index-CrPHsZg1.js → index-CWypTyOP.js} +1554 -1270
- package/dist/{index-DXl_Qtu-.js → index-CfxDirFl.js} +1 -1
- package/dist/{index-Bc-pgOn6.js → index-DDp0nMys.js} +1 -1
- package/dist/index-DW4-mTTG.js +52 -0
- package/dist/{timezone-B_KZGqyd.js → index-DdCPfF8x.js} +21 -20
- package/dist/index-IPOrNVQw.js +67 -0
- package/dist/{index-XJX8_Wlh.js → index-SsUBL4IR.js} +1 -1
- package/dist/{index-Ct1Qf7kH.js → index-VS1hWlhk.js} +1 -1
- package/dist/{index-B9RmImNP.js → index-ZKJoXi1-.js} +3 -3
- package/dist/{index-DQ6H1MEw.js → index-rwlkBKrS.js} +1996 -1968
- package/dist/{index.esm2017-D9jjiQqn.js → index.esm2017-CgR02aQB.js} +209 -209
- package/dist/{loading-DK8UdxtS.js → loading-CxY9qhzD.js} +1 -1
- package/dist/{lodash-CgcQgDO8.js → lodash-CELsN1M_.js} +1 -1
- package/dist/{membership-Cs4GzRnn.js → membership-BoQMuerb.js} +3 -3
- package/dist/{money-TgbWserQ.js → money-CH913hGN.js} +1 -1
- package/dist/{number-fLCh4B45.js → number-CO-WbLdr.js} +1 -1
- package/dist/object-BYyQ0PZp.js +18 -0
- package/dist/objectid-BM2Ygj-U.js +145 -0
- package/dist/{plugins-DYcrIMpx.js → plugins-YK45gSb1.js} +94 -95
- package/dist/{reward-uQ8Oz8Fd.js → reward-3aFPahH6.js} +1 -1
- package/dist/{rule-BcbgF0xS.js → rule-DC9my0Vg.js} +505 -487
- package/dist/style.css +1 -1
- package/dist/template-tDq12e1p.js +188 -0
- package/dist/{trigger-c-_77EFL.js → trigger-DoPHRgKt.js} +5 -5
- package/dist/{useMarketingMaterialActions-BCqwGe4e.js → useMarketingMaterialActions-CEd6ODsz.js} +3 -3
- package/dist/{usePagination-C3cT5BmC.js → usePagination-C8FUj5q_.js} +1 -1
- package/dist/{user-CRIo5MyA.js → user-Dhlhrnf8.js} +1 -1
- package/dist/{vue-i18n-BU_SuDqj.js → vue-i18n-B-92uhPn.js} +175 -175
- package/dist/{xlsx-Bw1AshOG.js → xlsx-Dmxne1eM.js} +166 -166
- package/dist/{zod-CzlTW8Al.js → zod-Dcdy9Dm3.js} +1 -1
- package/package.json +8 -4
- package/dist/Analytic-Ccb5IKBy.js +0 -426
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bf8Rc-Eh.js +0 -2223
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CrvTdEPu.js +0 -1888
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cl8JEYjx.js +0 -1118
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DEEz7iEu.js +0 -142
- package/dist/collection.fn-BqDPyvUe.js +0 -26
- package/dist/dto-CstKk_3g.js +0 -216
- package/dist/index-_KlH62Ed.js +0 -55
- package/dist/object-qECH92oz.js +0 -26
- package/dist/objectid-CVxLIQ5K.js +0 -145
- package/dist/rule-builder-CIkRKgap.js +0 -102
- package/dist/template-wZEVj8lZ.js +0 -236
|
@@ -1,1118 +0,0 @@
|
|
|
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 { s as ue } from "./index-CrPHsZg1.js";
|
|
4
|
-
import "./index-KYtKBtvK.js";
|
|
5
|
-
import { s as Ie } from "./index-DXl_Qtu-.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-fLCh4B45.js";
|
|
10
|
-
import { u as de } from "./business-CchrWCX9.js";
|
|
11
|
-
import { _ as me, u as Fe } from "./usePagination-C3cT5BmC.js";
|
|
12
|
-
import { c as oe, p as Ee } from "./plugins-DYcrIMpx.js";
|
|
13
|
-
import { g as pe } from "./user-CRIo5MyA.js";
|
|
14
|
-
import { B as fe, e as Ne } from "./export-uzECYleM.js";
|
|
15
|
-
import { u as ge } from "./campaign-D2RzC0L1.js";
|
|
16
|
-
import "./index-Bc-pgOn6.js";
|
|
17
|
-
import "./index-DQ6H1MEw.js";
|
|
18
|
-
import "./index-C2h4SP0A.js";
|
|
19
|
-
import "./index-B9RmImNP.js";
|
|
20
|
-
import { u as he } from "./vue-i18n-BU_SuDqj.js";
|
|
21
|
-
import { o as $ } from "./objectId-dwaoBfJX.js";
|
|
22
|
-
import { u as ve } from "./loading-DK8UdxtS.js";
|
|
23
|
-
import { w as Me } from "./xlsx-Bw1AshOG.js";
|
|
24
|
-
import { useRouter as Ae } from "vue-router";
|
|
25
|
-
import { t as q } from "./index-_KlH62Ed.js";
|
|
26
|
-
import { R as j } from "./app-_LtKE4PZ.js";
|
|
27
|
-
import { useCoreStore as Oe } from "@feedmepos/mf-common";
|
|
28
|
-
import { c as ke } from "./string-Gcy5IM_H.js";
|
|
29
|
-
import { m as Pe } from "./index-r8TuEpzi.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 = Ae(), 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 Me(
|
|
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: ke.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 Ee.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 = Oe().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 () => Ne({
|
|
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
|
-
};
|