@feedmepos/mf-connect 0.1.0-beta.47 → 0.1.0-beta.48
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-lSdhbAE5.js → Analytic-BiWBlCjy.js} +18 -17
- package/dist/{App-5yWxPSqa.js → App-D0EdXXhP.js} +10 -6
- package/dist/AuditLogs-B2Nld9Po.js +1856 -0
- package/dist/{Broadcast-BkDCNB93.js → Broadcast-D4PumMOO.js} +36 -35
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2l4qBEIr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D5IhdwKy.js} +6 -6
- package/dist/{Card-CKh6sC-j.js → Card-B8r77l_c.js} +23 -21
- package/dist/{Collections-D81rKHHA.js → Collections-DkNX0ENB.js} +11 -9
- package/dist/{Credit-Swf1Bccg.js → Credit-us-DaVK_.js} +11 -10
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-CLFeMi0j.js +169 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CFGREAre.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DuE9a4wa.js} +28 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DN186Ykx.js → EffectSheet.vue_vue_type_style_index_0_lang-DSPI2sPl.js} +6 -6
- package/dist/{Experience-DoAwLHvr.js → Experience-B5xBVt9X.js} +26 -25
- package/dist/{Game-B4-8bZaf.js → Game-DZQngWps.js} +14 -13
- package/dist/{Index-O-qPz_45.js → Index-D6G1bPFk.js} +14 -13
- package/dist/{Marketing-A8TyRzoX.js → Marketing-BgVsJdkB.js} +8 -7
- package/dist/{Member-C9uQuhVr.js → Member-Cm0Dh1__.js} +4 -4
- package/dist/{MemberList--aWor7_G.js → MemberList--liSD7XA.js} +42 -40
- package/dist/{MemberTransactions-C-01Qdmx.js → MemberTransactions-BBbIbY5M.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cdx1rPtp.js → MessageInput.vue_vue_type_script_setup_true_lang-B41VEr7k.js} +2 -2
- package/dist/{Mission-Ln1_nTS2.js → Mission-BjwPhMvr.js} +14 -13
- package/dist/{Overview-BJlPQi5S.js → Overview-ChHHbxMZ.js} +19 -18
- package/dist/{Point-wi6j4ns_.js → Point-DJOghScx.js} +11 -10
- package/dist/{Promotion-hahMm7v9.js → Promotion-CfaXu_lI.js} +16 -15
- package/dist/{Record-BO7qqPQP.js → Record-Jgfc7mJg.js} +18 -16
- package/dist/{Reward-DQhrs6So.js → Reward-AOM8CBLj.js} +33 -32
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-a7CjUVso.js → RewardGroup.vue_vue_type_script_setup_true_lang-C8FwIGwQ.js} +13 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CIkop4iY.js → RuleGroup.vue_vue_type_script_setup_true_lang-BKZdKB1T.js} +12 -12
- package/dist/{Segment-Cdi_lkEd.js → Segment-duLNRLE3.js} +19 -17
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DIpnyCH_.js → SelectItems.vue_vue_type_script_setup_true_lang-DjdIb54T.js} +2 -2
- package/dist/{Setting-CEmkP1ak.js → Setting-O8ZQpi95.js} +131 -130
- package/dist/{Store-BXcCorEJ.js → Store-Dhec11BC.js} +24 -23
- package/dist/{StoreRewards-C6s4S1bR.js → StoreRewards-B4wePYvY.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DbD2wugh.js +939 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-9XLezVlo.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BNUxrEoR.js} +1 -1
- package/dist/{Tier-ymDmSa8e.js → Tier-DZpvxsfn.js} +21 -20
- package/dist/{Title-DyT8EwGd.js → Title-3QqFZn_-.js} +28 -27
- package/dist/{Transaction-BqfYCKHC.js → Transaction-B5iZ4MUu.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D8OzqKdh.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CQQ5HcAZ.js} +6 -6
- package/dist/{Voucher-B4H6izT-.js → Voucher-B-q9fB-f.js} +14 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BzUCl5A0.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DL0eVHb3.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Qyn1rKwq.js → ZodTextField.vue_vue_type_script_setup_true_lang-Deg2sdGO.js} +1 -1
- package/dist/{app-fgJef1gk.js → app-3eroteiC.js} +1 -1
- package/dist/{app-DFhKMlXT.js → app-BCsc9J-D.js} +121 -57
- package/dist/app.js +1 -1
- package/dist/{business-CWVg8oTw.js → business-Cp6db6DR.js} +1 -1
- package/dist/{campaign-DqE4D_Ie.js → campaign-BOGJy7S9.js} +2 -2
- package/dist/{campaign-CXx39lOY.js → campaign-D2yrg-Er.js} +9 -9
- package/dist/{campaign.enum-BhHy5QqC.js → campaign.enum-CwF2Ajv3.js} +1 -1
- package/dist/{campaign.fn-DpRMdaoZ.js → campaign.fn-Bp-ZzEJT.js} +22 -22
- package/dist/{collectible.enum-CsAoXB-o.js → collectible.enum-B-71aP1r.js} +1 -1
- package/dist/{collection.fn-BgfqVgLc.js → collection.fn-DjSa_nTr.js} +2 -2
- package/dist/{dto-CbOlUDXO.js → dto-LDNtfFmE.js} +4 -4
- package/dist/{effect-DVzBcdAh.js → effect-BmYqIMsW.js} +1 -1
- package/dist/{email-addresses-D7cuPyCu.js → email-addresses-Di8hCXyI.js} +1 -1
- package/dist/{export-fqAmDRzH.js → export-DycH87nL.js} +3 -3
- package/dist/{helper-Cr9hVBrL.js → helper-DFhx_pcj.js} +1 -1
- package/dist/{index-CoGSXqP_.js → index-BCbMOBB8.js} +101 -56
- package/dist/{index-CLeEuF1Q.js → index-CpKBy2gq.js} +1 -1
- package/dist/{index-c-mT7CUc.js → index-D0RI_RQG.js} +1 -1
- package/dist/{index-zaKL-M_1.js → index-DHA2afdR.js} +1 -1
- package/dist/{index-BrZ9oOl8.js → index-D_JGs1_m.js} +1 -1
- package/dist/{index-Lrwmot9Q.js → index-DmF2UyFL.js} +1 -1
- package/dist/{index-1fDhAPmJ.js → index-Dvwi4GLz.js} +2 -2
- package/dist/{index-iHW9prE9.js → index-Dw6vcUmt.js} +1 -1
- package/dist/{index-CLKiPqHH.js → index-EjX7PzTR.js} +3 -3
- package/dist/{index-BpqE7ONp.js → index-JDxeUUHy.js} +5 -5
- package/dist/{index-BYziLSU1.js → index-gsJpOkBA.js} +1 -1
- package/dist/{index-B-VO7A5g.js → index-zGjFnt2i.js} +4 -4
- package/dist/{index.esm2017-CZ5oluks.js → index.esm2017-Bx1gO_wH.js} +33 -33
- package/dist/loading-CkL5IkHw.js +100 -0
- package/dist/{membership-D9qRdNxE.js → membership-Bsr6Cvle.js} +3 -3
- package/dist/{money-B-nNBD6W.js → money-DUBsxwt7.js} +1 -1
- package/dist/{number--UNR-Ea-.js → number-D7RIsT0N.js} +1 -1
- package/dist/objectid-B-fcFN1Q.js +145 -0
- package/dist/{loading-D84WknQA.js → plugins-Dr9LdRza.js} +3764 -3860
- package/dist/{reward-tqNSZbg2.js → reward-BkXDV7ND.js} +1 -1
- package/dist/{rule-tJ5_2tKg.js → rule-Bq8z_m5L.js} +3 -3
- package/dist/{rule-builder-djwiKBYX.js → rule-builder-BpUdiP64.js} +1 -1
- package/dist/{template-DrDV1Aex.js → template-CKiPP35H.js} +4 -4
- package/dist/{trigger-ChRRXEa5.js → trigger-DCJmo6Nw.js} +4 -4
- package/dist/usePagination-BeF5K3M7.js +223 -0
- package/dist/{user-CwS7aiK5.js → user-CjCy_BYx.js} +1 -1
- package/dist/{vue-i18n-BLCr04dZ.js → vue-i18n-36uLpBY2.js} +291 -291
- package/dist/{usePagination--wzkJiPp.js → xlsx-C7gDU4gE.js} +2962 -3183
- package/package.json +2 -1
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-e2Phr4sy.js +0 -1099
- package/dist/objectid-DJNlN9do.js +0 -145
|
@@ -1,1099 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, ref as A, computed as P, onMounted as ee, resolveComponent as k, openBlock as I, createBlock as Y, unref as n, withCtx as U, createVNode as S, normalizeClass as X, createCommentVNode as ge, createElementVNode as w, toDisplayString as V, createElementBlock as E, Fragment as H, renderList as Q, mergeModels as oe, useModel as ye, watch as te, h as s, isRef as ve, createTextVNode as he, resolveDynamicComponent as be, onBeforeMount as _e } from "vue";
|
|
2
|
-
import { components as C, useDialog as xe } from "@feedmepos/ui-library";
|
|
3
|
-
import { x as ne } from "./index-B-VO7A5g.js";
|
|
4
|
-
import { a as ae, c as Se, p as we, u as Re } from "./loading-D84WknQA.js";
|
|
5
|
-
import { s as Ce } from "./index-Dbd4WA4r.js";
|
|
6
|
-
import { h as D } from "./moment-BWErdI6_.js";
|
|
7
|
-
import { s as G } from "./index-CsaQJMAR.js";
|
|
8
|
-
import { f as Z } from "./number--UNR-Ea-.js";
|
|
9
|
-
import { u as re } from "./business-CWVg8oTw.js";
|
|
10
|
-
import { a as le, _ as se } from "./usePagination--wzkJiPp.js";
|
|
11
|
-
import { g as ie } from "./user-CwS7aiK5.js";
|
|
12
|
-
import { B as ue, e as ce } from "./export-fqAmDRzH.js";
|
|
13
|
-
import { u as de } from "./campaign-DqE4D_Ie.js";
|
|
14
|
-
import "./index-BYziLSU1.js";
|
|
15
|
-
import "./index-1fDhAPmJ.js";
|
|
16
|
-
import "./index-CoGSXqP_.js";
|
|
17
|
-
import "./index-Lrwmot9Q.js";
|
|
18
|
-
import "./index-BpqE7ONp.js";
|
|
19
|
-
import { u as De } from "./vue-i18n-BLCr04dZ.js";
|
|
20
|
-
import { o as B } from "./objectId-dwaoBfJX.js";
|
|
21
|
-
import { useRouter as Te } from "vue-router";
|
|
22
|
-
import { t as W } from "./index-iHW9prE9.js";
|
|
23
|
-
import { R as q } from "./app-DFhKMlXT.js";
|
|
24
|
-
import { useCoreStore as Fe } from "@feedmepos/mf-common";
|
|
25
|
-
import { m as Ie } from "./index-c-mT7CUc.js";
|
|
26
|
-
function ke(u) {
|
|
27
|
-
let y = "";
|
|
28
|
-
switch (u) {
|
|
29
|
-
case "PORTAL":
|
|
30
|
-
y = "ADMIN";
|
|
31
|
-
break;
|
|
32
|
-
case "BENEFIT":
|
|
33
|
-
y = "MEMBERSHIP";
|
|
34
|
-
break;
|
|
35
|
-
case "ORDER":
|
|
36
|
-
y = "ORDER";
|
|
37
|
-
break;
|
|
38
|
-
case "BILL":
|
|
39
|
-
y = "SPENDING";
|
|
40
|
-
break;
|
|
41
|
-
case "CASHBACK":
|
|
42
|
-
y = "CASHBACK";
|
|
43
|
-
break;
|
|
44
|
-
case "CYCLE":
|
|
45
|
-
y = "EXPIRED";
|
|
46
|
-
break;
|
|
47
|
-
case "COUNTER_CONSUME":
|
|
48
|
-
y = "COUNTER REDEEM";
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
y = u;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
return y;
|
|
55
|
-
}
|
|
56
|
-
function Oe(u) {
|
|
57
|
-
var y, p, d, f, c, T;
|
|
58
|
-
switch ((y = u == null ? void 0 : u.pf_collectible) == null ? void 0 : y.type) {
|
|
59
|
-
case "VOUCHER":
|
|
60
|
-
return `${(p = u.pf_collectible) == null ? void 0 : p.type} (${(d = u.pf_collectible) == null ? void 0 : d.name})`;
|
|
61
|
-
case "TITLE":
|
|
62
|
-
return `${(f = u.pf_collectible) == null ? void 0 : f.type} (${(c = u.pf_collectible) == null ? void 0 : c.name})`;
|
|
63
|
-
case "POINT":
|
|
64
|
-
return "Experience";
|
|
65
|
-
case "COIN":
|
|
66
|
-
return "Point";
|
|
67
|
-
default:
|
|
68
|
-
return Ce((T = u == null ? void 0 : u.pf_collectible) == null ? void 0 : T.type);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function Ae(u) {
|
|
72
|
-
switch (u) {
|
|
73
|
-
case "ONLINE":
|
|
74
|
-
return "Online";
|
|
75
|
-
case "COIN":
|
|
76
|
-
return "Point";
|
|
77
|
-
default:
|
|
78
|
-
return u;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const M = {
|
|
82
|
-
getReason: ke,
|
|
83
|
-
formattedType: Oe,
|
|
84
|
-
formattedPaymentType: Ae
|
|
85
|
-
}, Me = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, J = /* @__PURE__ */ L({
|
|
86
|
-
__name: "FilterChip",
|
|
87
|
-
props: {
|
|
88
|
-
modelValue: {
|
|
89
|
-
type: Array,
|
|
90
|
-
required: !1
|
|
91
|
-
},
|
|
92
|
-
label: {
|
|
93
|
-
type: String,
|
|
94
|
-
required: !1,
|
|
95
|
-
default: ""
|
|
96
|
-
},
|
|
97
|
-
showItemLabel: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: !1
|
|
100
|
-
},
|
|
101
|
-
placement: {
|
|
102
|
-
type: String,
|
|
103
|
-
required: !1,
|
|
104
|
-
default: "bottom-end"
|
|
105
|
-
},
|
|
106
|
-
class: {
|
|
107
|
-
type: String,
|
|
108
|
-
required: !1
|
|
109
|
-
},
|
|
110
|
-
disabled: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
required: !1
|
|
113
|
-
},
|
|
114
|
-
items: {
|
|
115
|
-
type: Array,
|
|
116
|
-
required: !0
|
|
117
|
-
},
|
|
118
|
-
icon: {
|
|
119
|
-
type: String,
|
|
120
|
-
required: !1
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
emits: ["update:model-value"],
|
|
124
|
-
setup(u, { emit: y }) {
|
|
125
|
-
const p = u, d = y, f = A(!1), c = A({}), T = P(() => {
|
|
126
|
-
if (!c.value || Object.keys(c.value).length == p.items.length)
|
|
127
|
-
return "All";
|
|
128
|
-
{
|
|
129
|
-
const b = Object.keys(c.value).length;
|
|
130
|
-
return `${b > 0 ? b : "None"} selected`;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
function g(b) {
|
|
134
|
-
c.value[b] ? delete c.value[b] : c.value[b] = !0, d("update:model-value", Object.keys(c.value));
|
|
135
|
-
}
|
|
136
|
-
function R() {
|
|
137
|
-
Object.keys(c.value).length > 0 ? c.value = {} : c.value = p.items.reduce((b, m) => (b[m.value] = !0, b), {}), d("update:model-value", Object.keys(c.value));
|
|
138
|
-
}
|
|
139
|
-
return ee(() => {
|
|
140
|
-
c.value = p.modelValue.reduce(
|
|
141
|
-
(b, m) => (b[m] = !0, b),
|
|
142
|
-
{}
|
|
143
|
-
), p.modelValue.length == 0;
|
|
144
|
-
}), (b, m) => {
|
|
145
|
-
const a = k("FmIcon"), e = k("FmChip"), l = k("FmMenuItem"), r = k("FmMenu");
|
|
146
|
-
return I(), Y(r, {
|
|
147
|
-
placement: u.placement || "bottom-end",
|
|
148
|
-
disabled: u.disabled == !0,
|
|
149
|
-
"model-value": n(f),
|
|
150
|
-
onMenuChanged: m[0] || (m[0] = (v) => f.value = v),
|
|
151
|
-
"close-on-click": !1
|
|
152
|
-
}, {
|
|
153
|
-
"menu-button": U(() => [
|
|
154
|
-
S(e, {
|
|
155
|
-
label: u.label,
|
|
156
|
-
class: X(p.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
157
|
-
}, {
|
|
158
|
-
default: U(() => [
|
|
159
|
-
p.icon ? (I(), Y(a, {
|
|
160
|
-
key: 0,
|
|
161
|
-
name: p.icon,
|
|
162
|
-
class: X(p.class),
|
|
163
|
-
outline: "",
|
|
164
|
-
size: "sm"
|
|
165
|
-
}, null, 8, ["name", "class"])) : ge("", !0),
|
|
166
|
-
w("div", Me, V(p.label) + " " + V(u.showItemLabel ? n(T) : ""), 1),
|
|
167
|
-
S(a, {
|
|
168
|
-
name: n(f) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
169
|
-
class: X(p.class),
|
|
170
|
-
outline: "",
|
|
171
|
-
size: "sm"
|
|
172
|
-
}, null, 8, ["name", "class"])
|
|
173
|
-
]),
|
|
174
|
-
_: 1
|
|
175
|
-
}, 8, ["label", "class"])
|
|
176
|
-
]),
|
|
177
|
-
default: U(() => [
|
|
178
|
-
S(l, {
|
|
179
|
-
"model-value": Object.keys(n(c)).length === p.items.length,
|
|
180
|
-
label: "All",
|
|
181
|
-
"has-checkbox": !0,
|
|
182
|
-
indeterminate: !0,
|
|
183
|
-
onClick: R
|
|
184
|
-
}, null, 8, ["model-value"]),
|
|
185
|
-
(I(!0), E(H, null, Q(p.items ?? [], (v) => (I(), Y(l, {
|
|
186
|
-
key: v.value,
|
|
187
|
-
value: v.value,
|
|
188
|
-
label: v.label,
|
|
189
|
-
"has-checkbox": !0,
|
|
190
|
-
"model-value": n(c)[v.value],
|
|
191
|
-
"onUpdate:modelValue": (h) => g(v.value)
|
|
192
|
-
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
193
|
-
]),
|
|
194
|
-
_: 1
|
|
195
|
-
}, 8, ["placement", "disabled", "model-value"]);
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
}), K = "YYYY-MM-DD", me = /* @__PURE__ */ L({
|
|
199
|
-
__name: "DateRangeChip",
|
|
200
|
-
props: /* @__PURE__ */ oe({
|
|
201
|
-
modelValue: {
|
|
202
|
-
type: Object,
|
|
203
|
-
required: !0
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
dateRange: {
|
|
207
|
-
type: Object,
|
|
208
|
-
default: () => ({
|
|
209
|
-
startDate: D().subtract(7, "day").format(K),
|
|
210
|
-
endDate: D().endOf("day").format(K)
|
|
211
|
-
})
|
|
212
|
-
},
|
|
213
|
-
dateRangeModifiers: {}
|
|
214
|
-
}),
|
|
215
|
-
emits: /* @__PURE__ */ oe(["update:model-value"], ["update:dateRange"]),
|
|
216
|
-
setup(u, { emit: y }) {
|
|
217
|
-
const p = u, d = y, f = ye(u, "dateRange"), c = P(() => f.value ? `${T.value.startDate ?? "Start"} - ${T.value.endDate ?? "End"}` : "No dates selected."), T = P(() => ({
|
|
218
|
-
startDate: f.value.startDate ? D(f.value.startDate).format(K) : void 0,
|
|
219
|
-
endDate: f.value.endDate ? D(f.value.endDate).format(K) : void 0
|
|
220
|
-
}));
|
|
221
|
-
return ee(() => {
|
|
222
|
-
f.value = p.modelValue;
|
|
223
|
-
}), te(
|
|
224
|
-
() => f.value,
|
|
225
|
-
() => {
|
|
226
|
-
d("update:model-value", T.value);
|
|
227
|
-
}
|
|
228
|
-
), (g, R) => {
|
|
229
|
-
const b = k("FmChip"), m = k("FmDateRangePicker");
|
|
230
|
-
return I(), Y(m, {
|
|
231
|
-
modelValue: f.value,
|
|
232
|
-
"onUpdate:modelValue": R[0] || (R[0] = (a) => f.value = a),
|
|
233
|
-
"show-predefined-range": ""
|
|
234
|
-
}, {
|
|
235
|
-
"trigger-button": U(() => [
|
|
236
|
-
S(b, {
|
|
237
|
-
label: n(c),
|
|
238
|
-
icon: "calendar_month",
|
|
239
|
-
"right-icon": "keyboard_arrow_down",
|
|
240
|
-
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
241
|
-
}, null, 8, ["label"])
|
|
242
|
-
]),
|
|
243
|
-
_: 1
|
|
244
|
-
}, 8, ["modelValue"]);
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
class Ee extends ue {
|
|
249
|
-
}
|
|
250
|
-
const Ne = { class: "space-y-24 pr-12" }, Ve = { class: "w-full space-y-16" }, Pe = { class: "fm-typo-en-body-lg-600" }, Ye = ["onClick"], Ue = { class: "fm-typo-en-body-lg-600" }, $e = ["onClick"], Be = { class: "flex items-center gap-8" }, Le = /* @__PURE__ */ L({
|
|
251
|
-
__name: "TransactionDetailSheet",
|
|
252
|
-
setup(u, { expose: y }) {
|
|
253
|
-
De();
|
|
254
|
-
const p = A(!1), d = A(), f = de(), c = re();
|
|
255
|
-
function T(m, a) {
|
|
256
|
-
p.value = m, d.value = a ?? null;
|
|
257
|
-
}
|
|
258
|
-
const g = P(() => {
|
|
259
|
-
var m, a;
|
|
260
|
-
return Z(
|
|
261
|
-
((a = d.value) == null ? void 0 : a.expiryAmount.reduce(
|
|
262
|
-
(e, l) => e + l.amount,
|
|
263
|
-
((m = d.value) == null ? void 0 : m.amount) ?? 0
|
|
264
|
-
)) ?? 0,
|
|
265
|
-
2
|
|
266
|
-
);
|
|
267
|
-
}), R = P(() => {
|
|
268
|
-
var m, a, e, l, r;
|
|
269
|
-
return d.value ? [
|
|
270
|
-
{
|
|
271
|
-
label: "Transaction ID",
|
|
272
|
-
value: (m = d.value) == null ? void 0 : m._id
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
label: "Date/Time",
|
|
276
|
-
value: D(B(d.value._id.toString())).format(
|
|
277
|
-
"D MMM YYYY, hh:mmA"
|
|
278
|
-
)
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
label: "Amount",
|
|
282
|
-
component: () => s(
|
|
283
|
-
"span",
|
|
284
|
-
{
|
|
285
|
-
class: [
|
|
286
|
-
"pr-2",
|
|
287
|
-
+g.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
288
|
-
]
|
|
289
|
-
},
|
|
290
|
-
g.value
|
|
291
|
-
)
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
label: "Type",
|
|
295
|
-
value: M.formattedType(d.value)
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
label: "Source",
|
|
299
|
-
value: G(M.getReason(d.value.source))
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
label: "User",
|
|
303
|
-
value: (e = (a = d.value) == null ? void 0 : a.pf_user) == null ? void 0 : e.name
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
label: "Phone Number",
|
|
307
|
-
value: (r = (l = d.value) == null ? void 0 : l.pf_user) == null ? void 0 : r.phoneNumber
|
|
308
|
-
}
|
|
309
|
-
] : [];
|
|
310
|
-
}), b = P(() => {
|
|
311
|
-
var l, r, v, h;
|
|
312
|
-
if (!d.value) return [];
|
|
313
|
-
const m = [], a = (l = d.value) == null ? void 0 : l.metadata, e = d.value;
|
|
314
|
-
if (a != null && a.campaign) {
|
|
315
|
-
const F = f.campaigns.all.find(
|
|
316
|
-
(N) => N._id === (a == null ? void 0 : a.campaign)
|
|
317
|
-
);
|
|
318
|
-
if (!F) return;
|
|
319
|
-
m.push({
|
|
320
|
-
label: "Campaign",
|
|
321
|
-
value: F.name
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
return a != null && a.remark && m.push({
|
|
325
|
-
label: "Remark",
|
|
326
|
-
value: a.remark
|
|
327
|
-
}), (r = d.value) != null && r.ref.startsWith("bill_") && m.push({
|
|
328
|
-
label: "Bill Number",
|
|
329
|
-
value: (v = d.value) == null ? void 0 : v.ref,
|
|
330
|
-
copy: () => {
|
|
331
|
-
var F;
|
|
332
|
-
return ae((F = d.value) == null ? void 0 : F.ref);
|
|
333
|
-
}
|
|
334
|
-
}), a != null && a.location && m.push({
|
|
335
|
-
label: "Location",
|
|
336
|
-
value: (h = c.locations.find(
|
|
337
|
-
(F) => F._id.toString() === (a == null ? void 0 : a.location)
|
|
338
|
-
)) == null ? void 0 : h.name
|
|
339
|
-
}), e.source === ne.enum.STORE && m.push({
|
|
340
|
-
label: "Store Transaction",
|
|
341
|
-
value: e.ref
|
|
342
|
-
}), a != null && a.originTransaction && m.push({
|
|
343
|
-
label: "Parent Transaction",
|
|
344
|
-
value: a.originTransaction
|
|
345
|
-
}), a != null && a.referral_count && m.push({
|
|
346
|
-
label: "Referral Count",
|
|
347
|
-
value: a.referral_count
|
|
348
|
-
}), e.refunded && m.push({
|
|
349
|
-
label: "Refunded From",
|
|
350
|
-
value: e.refundedFrom
|
|
351
|
-
}), m;
|
|
352
|
-
});
|
|
353
|
-
return y({
|
|
354
|
-
showSheet: T
|
|
355
|
-
}), (m, a) => {
|
|
356
|
-
const e = k("FmButton"), l = k("FmSideSheet");
|
|
357
|
-
return I(), Y(l, {
|
|
358
|
-
"max-width": 560,
|
|
359
|
-
modelValue: n(p),
|
|
360
|
-
"onUpdate:modelValue": a[1] || (a[1] = (r) => ve(p) ? p.value = r : null),
|
|
361
|
-
header: "Transaction Details"
|
|
362
|
-
}, {
|
|
363
|
-
"side-sheet-footer": U(() => [
|
|
364
|
-
w("div", Be, [
|
|
365
|
-
S(e, {
|
|
366
|
-
label: "Close",
|
|
367
|
-
onClick: a[0] || (a[0] = (r) => T(!1)),
|
|
368
|
-
variant: "tertiary"
|
|
369
|
-
})
|
|
370
|
-
])
|
|
371
|
-
]),
|
|
372
|
-
default: U(() => [
|
|
373
|
-
w("div", Ne, [
|
|
374
|
-
w("div", Ve, [
|
|
375
|
-
(I(!0), E(H, null, Q(n(R), (r) => (I(), E("div", {
|
|
376
|
-
key: r.label,
|
|
377
|
-
class: "flex flex-col gap-4"
|
|
378
|
-
}, [
|
|
379
|
-
w("div", Pe, V(r.label), 1),
|
|
380
|
-
w("div", {
|
|
381
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
382
|
-
onClick: r.copy
|
|
383
|
-
}, [
|
|
384
|
-
he(V(r.accessorFn ? r.accessorFn() : r.value) + " ", 1),
|
|
385
|
-
(I(), Y(be(r.component)))
|
|
386
|
-
], 8, Ye),
|
|
387
|
-
a[2] || (a[2] = w("hr", { class: "mt-3" }, null, -1))
|
|
388
|
-
]))), 128)),
|
|
389
|
-
(I(!0), E(H, null, Q(n(b), (r) => (I(), E("div", {
|
|
390
|
-
key: r.label,
|
|
391
|
-
class: "flex flex-col gap-4"
|
|
392
|
-
}, [
|
|
393
|
-
w("div", Ue, V(r.label), 1),
|
|
394
|
-
w("div", {
|
|
395
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
396
|
-
onClick: r.copy
|
|
397
|
-
}, V(r.accessorFn ? r.accessorFn() : r.value), 9, $e),
|
|
398
|
-
a[3] || (a[3] = w("hr", { class: "mt-3" }, null, -1))
|
|
399
|
-
]))), 128))
|
|
400
|
-
])
|
|
401
|
-
])
|
|
402
|
-
]),
|
|
403
|
-
_: 1
|
|
404
|
-
}, 8, ["modelValue"]);
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
}), ze = { class: "hidden xs:flex items-center justify-end" }, je = { class: "flex items-center justify-between" }, qe = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, Ke = { class: "xs:hidden" }, St = /* @__PURE__ */ L({
|
|
408
|
-
__name: "CollectionTransactions",
|
|
409
|
-
props: {
|
|
410
|
-
user: {
|
|
411
|
-
type: String
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
setup(u) {
|
|
415
|
-
const y = re(), p = de(), d = Te(), f = u, c = A(!1), T = [
|
|
416
|
-
{
|
|
417
|
-
header: "Transaction ID",
|
|
418
|
-
accessorKey: "_id",
|
|
419
|
-
meta: {
|
|
420
|
-
maxWidth: "100px"
|
|
421
|
-
},
|
|
422
|
-
cell(o) {
|
|
423
|
-
return s("div", { class: "flex items-center" }, [
|
|
424
|
-
s(C.FmIcon, {
|
|
425
|
-
name: "content_copy",
|
|
426
|
-
outline: !0,
|
|
427
|
-
size: "sm",
|
|
428
|
-
class: "cursor-pointer mr-4",
|
|
429
|
-
onClick: (t) => {
|
|
430
|
-
t.preventDefault(), t.stopPropagation(), ae(o.row.original._id.toString());
|
|
431
|
-
}
|
|
432
|
-
}),
|
|
433
|
-
s(
|
|
434
|
-
"div",
|
|
435
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
436
|
-
o.row.original._id.toString()
|
|
437
|
-
)
|
|
438
|
-
]);
|
|
439
|
-
},
|
|
440
|
-
enableSorting: !1
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
header: "Created at",
|
|
444
|
-
accessorKey: "_id",
|
|
445
|
-
accessorFn: (o) => D(B(o._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
446
|
-
enableSorting: !0
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
header: "Amount",
|
|
450
|
-
// accessorKey: 'totalAmount',
|
|
451
|
-
enableSorting: !1,
|
|
452
|
-
cell(o) {
|
|
453
|
-
var x, i, O, $;
|
|
454
|
-
const t = Z(
|
|
455
|
-
o.row.original.expiryAmount.reduce(
|
|
456
|
-
(z, j) => z + j.amount,
|
|
457
|
-
o.row.original.amount ?? 0
|
|
458
|
-
),
|
|
459
|
-
2
|
|
460
|
-
), _ = (i = (x = o.row.original.expiryAmount) == null ? void 0 : x[0]) != null && i.expiredAt ? D(($ = (O = o.row.original.expiryAmount) == null ? void 0 : O[0]) == null ? void 0 : $.expiredAt).format(
|
|
461
|
-
"D MMM YYYY"
|
|
462
|
-
) : "";
|
|
463
|
-
return s("div", { class: "flex items-center" }, [
|
|
464
|
-
s(
|
|
465
|
-
"div",
|
|
466
|
-
{
|
|
467
|
-
class: [
|
|
468
|
-
"pr-2",
|
|
469
|
-
+t > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
470
|
-
]
|
|
471
|
-
},
|
|
472
|
-
t
|
|
473
|
-
),
|
|
474
|
-
s("div", { class: "flex items-center" }, [
|
|
475
|
-
o.row.original.expiryAmount.length > 0 ? s(
|
|
476
|
-
C.FmTooltip,
|
|
477
|
-
{
|
|
478
|
-
content: `Expired on ${_}`
|
|
479
|
-
},
|
|
480
|
-
[
|
|
481
|
-
s(C.FmIcon, {
|
|
482
|
-
name: "info",
|
|
483
|
-
outline: !0,
|
|
484
|
-
size: "sm"
|
|
485
|
-
})
|
|
486
|
-
]
|
|
487
|
-
) : s("div")
|
|
488
|
-
])
|
|
489
|
-
]);
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
header: "Type",
|
|
494
|
-
accessorKey: "pf_collectible.type",
|
|
495
|
-
accessorFn: (o) => M.formattedType(o),
|
|
496
|
-
meta: {
|
|
497
|
-
maxWidth: "200px"
|
|
498
|
-
},
|
|
499
|
-
cell(o) {
|
|
500
|
-
const t = M.formattedType(o.row.original);
|
|
501
|
-
return s("div", { class: "flex items-center" }, [
|
|
502
|
-
s("div", { class: "truncate text-ellipsis" }, t),
|
|
503
|
-
t.length > 20 ? s(
|
|
504
|
-
C.FmTooltip,
|
|
505
|
-
{
|
|
506
|
-
content: t
|
|
507
|
-
},
|
|
508
|
-
[
|
|
509
|
-
s(C.FmIcon, {
|
|
510
|
-
name: "info",
|
|
511
|
-
color: "primary",
|
|
512
|
-
outline: !0,
|
|
513
|
-
size: "sm"
|
|
514
|
-
})
|
|
515
|
-
]
|
|
516
|
-
) : null
|
|
517
|
-
]);
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
header: "Source",
|
|
522
|
-
accessorKey: "source",
|
|
523
|
-
cell(o) {
|
|
524
|
-
var t;
|
|
525
|
-
return s("div", { class: "flex items-center gap-4" }, [
|
|
526
|
-
s(
|
|
527
|
-
"div",
|
|
528
|
-
{ class: "truncate text-ellipsis" },
|
|
529
|
-
G(M.getReason(o.row.original.source))
|
|
530
|
-
),
|
|
531
|
-
...(t = o.row.original.metadata) != null && t.campaign ? [
|
|
532
|
-
s(
|
|
533
|
-
C.FmTooltip,
|
|
534
|
-
{
|
|
535
|
-
get content() {
|
|
536
|
-
var _;
|
|
537
|
-
return (_ = p.campaigns.all.find(
|
|
538
|
-
(x) => {
|
|
539
|
-
var i;
|
|
540
|
-
return x._id === ((i = o.row.original.metadata) == null ? void 0 : i.campaign);
|
|
541
|
-
}
|
|
542
|
-
)) == null ? void 0 : _.name;
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
[
|
|
546
|
-
s(C.FmIcon, {
|
|
547
|
-
name: "info",
|
|
548
|
-
color: "primary",
|
|
549
|
-
size: "sm",
|
|
550
|
-
onClick: async (_) => {
|
|
551
|
-
_.preventDefault(), _.stopPropagation();
|
|
552
|
-
const x = p.campaigns.all.find(
|
|
553
|
-
(i) => {
|
|
554
|
-
var O;
|
|
555
|
-
return i._id === ((O = o.row.original.metadata) == null ? void 0 : O.campaign);
|
|
556
|
-
}
|
|
557
|
-
);
|
|
558
|
-
if (x)
|
|
559
|
-
switch (x.type) {
|
|
560
|
-
case "VOUCHER":
|
|
561
|
-
case "PROMOTION":
|
|
562
|
-
case "BROADCAST":
|
|
563
|
-
await d.push({
|
|
564
|
-
name: q[`$connect-CAMPAIGN_${x.type}`]
|
|
565
|
-
});
|
|
566
|
-
break;
|
|
567
|
-
case "GAME":
|
|
568
|
-
case "CREDIT":
|
|
569
|
-
case "MISSION":
|
|
570
|
-
await d.push({
|
|
571
|
-
name: q[`$connect-PROGRAM_${x.type}`]
|
|
572
|
-
});
|
|
573
|
-
break;
|
|
574
|
-
case "POINT":
|
|
575
|
-
await d.push({
|
|
576
|
-
name: q["$connect-PROGRAM_EXPERIENCE"]
|
|
577
|
-
});
|
|
578
|
-
break;
|
|
579
|
-
case "COIN":
|
|
580
|
-
await d.push({
|
|
581
|
-
name: q["$connect-PROGRAM_POINT"]
|
|
582
|
-
});
|
|
583
|
-
break;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
})
|
|
587
|
-
]
|
|
588
|
-
)
|
|
589
|
-
] : []
|
|
590
|
-
]);
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
header: "User",
|
|
595
|
-
accessorKey: "pf_user.name",
|
|
596
|
-
cell(o) {
|
|
597
|
-
return ie(o.row.original.pf_user);
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
header: "Phone No.",
|
|
602
|
-
accessorKey: "pf_user.phoneNumber",
|
|
603
|
-
accessorFn: (o) => {
|
|
604
|
-
var t;
|
|
605
|
-
return ((t = o == null ? void 0 : o.pf_user) == null ? void 0 : t.phoneNumber) || "";
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
accessorFn: (o) => o.ref,
|
|
610
|
-
header: "References",
|
|
611
|
-
accessorKey: "ref",
|
|
612
|
-
cell(o) {
|
|
613
|
-
var t, _;
|
|
614
|
-
return s("div", { class: "flex items-center justify-between gap-4" }, [
|
|
615
|
-
s("div", { class: "flex items-center" }, [
|
|
616
|
-
(t = o.row.original.metadata) != null && t.remark ? s(
|
|
617
|
-
C.FmTooltip,
|
|
618
|
-
{
|
|
619
|
-
content: (_ = o.row.original.metadata) == null ? void 0 : _.remark
|
|
620
|
-
},
|
|
621
|
-
[
|
|
622
|
-
s(C.FmIcon, {
|
|
623
|
-
name: "info",
|
|
624
|
-
class: "pl-2",
|
|
625
|
-
outline: !0,
|
|
626
|
-
size: "sm"
|
|
627
|
-
})
|
|
628
|
-
]
|
|
629
|
-
) : s("div")
|
|
630
|
-
]),
|
|
631
|
-
s("div", { class: "flex-1" }, o.row.original.ref)
|
|
632
|
-
]);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
], g = A({
|
|
636
|
-
search: "",
|
|
637
|
-
"pf_collectible.type": [],
|
|
638
|
-
"metadata.location": [],
|
|
639
|
-
dateRange: {
|
|
640
|
-
startDate: D().subtract(7, "day").toISOString(),
|
|
641
|
-
endDate: D().endOf("day").toISOString()
|
|
642
|
-
},
|
|
643
|
-
source: []
|
|
644
|
-
}), { tableMeta: R, rowData: b, onSort: m, debouncedFetchData: a, onSearch: e } = le(async (o) => {
|
|
645
|
-
const t = {
|
|
646
|
-
...g.value,
|
|
647
|
-
user: f.user,
|
|
648
|
-
dateRange: {
|
|
649
|
-
start: new Date(g.value.dateRange.startDate).toISOString(),
|
|
650
|
-
end: new Date(g.value.dateRange.endDate).toISOString()
|
|
651
|
-
}
|
|
652
|
-
}, _ = await W.readAll(o, t);
|
|
653
|
-
return {
|
|
654
|
-
resources: _.resources.map((x) => {
|
|
655
|
-
const i = l.value.find((O) => O._id === x.ref);
|
|
656
|
-
return { ...x, ref: (i == null ? void 0 : i.seqNumber) || x.ref };
|
|
657
|
-
}),
|
|
658
|
-
meta: _.meta
|
|
659
|
-
};
|
|
660
|
-
}), l = A([]), r = ne.options.map((o) => ({ label: G(M.getReason(o)), value: o })), v = y.locations.map((o) => ({ label: o.name, value: o._id }));
|
|
661
|
-
te(
|
|
662
|
-
g,
|
|
663
|
-
() => {
|
|
664
|
-
a();
|
|
665
|
-
},
|
|
666
|
-
{ deep: !0 }
|
|
667
|
-
);
|
|
668
|
-
async function h() {
|
|
669
|
-
try {
|
|
670
|
-
c.value = !0;
|
|
671
|
-
const o = {
|
|
672
|
-
...g.value,
|
|
673
|
-
user: f.user,
|
|
674
|
-
dateRange: {
|
|
675
|
-
start: new Date(g.value.dateRange.startDate).toISOString(),
|
|
676
|
-
end: new Date(g.value.dateRange.endDate).toISOString()
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
await ce({
|
|
680
|
-
exporter: new Ee(),
|
|
681
|
-
readFunction: (t) => W.readAll(t, o),
|
|
682
|
-
transformRecord: (t) => {
|
|
683
|
-
var _, x, i, O, $, z, j;
|
|
684
|
-
return {
|
|
685
|
-
TransactionID: t._id,
|
|
686
|
-
CreatedAt: D(B(t._id.toString())).format(
|
|
687
|
-
"D MMM YYYY, hh:mmA"
|
|
688
|
-
),
|
|
689
|
-
Amount: Z(
|
|
690
|
-
t.expiryAmount.reduce(
|
|
691
|
-
(pe, fe) => pe + fe.amount,
|
|
692
|
-
t.amount ?? 0
|
|
693
|
-
),
|
|
694
|
-
2
|
|
695
|
-
),
|
|
696
|
-
ExpiredAt: (x = (_ = t.expiryAmount) == null ? void 0 : _[0]) != null && x.expiredAt ? D((O = (i = t.expiryAmount) == null ? void 0 : i[0]) == null ? void 0 : O.expiredAt).format("D MMM YYYY") : "",
|
|
697
|
-
Type: M.formattedType(t),
|
|
698
|
-
Source: G(M.getReason(t.source)),
|
|
699
|
-
User: (($ = t.pf_user) == null ? void 0 : $.name) || "",
|
|
700
|
-
"Phone No.": ((z = t.pf_user) == null ? void 0 : z.phoneNumber) || "",
|
|
701
|
-
References: t.ref,
|
|
702
|
-
Remark: ((j = t.metadata) == null ? void 0 : j.remark) || ""
|
|
703
|
-
};
|
|
704
|
-
},
|
|
705
|
-
filename: "transactions"
|
|
706
|
-
});
|
|
707
|
-
} catch (o) {
|
|
708
|
-
console.error(o);
|
|
709
|
-
} finally {
|
|
710
|
-
c.value = !1;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
const F = A(null);
|
|
714
|
-
function N(o) {
|
|
715
|
-
var t;
|
|
716
|
-
console.log(o), (t = F.value) == null || t.showSheet(!0, o.original);
|
|
717
|
-
}
|
|
718
|
-
return _e(async () => {
|
|
719
|
-
await y.readLocations(), await p.read(), await a();
|
|
720
|
-
}), (o, t) => {
|
|
721
|
-
const _ = k("FmSearch"), x = k("FmButton");
|
|
722
|
-
return I(), E(H, null, [
|
|
723
|
-
w("div", null, [
|
|
724
|
-
w("div", ze, [
|
|
725
|
-
S(_, {
|
|
726
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
727
|
-
modelValue: n(g).search,
|
|
728
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => n(g).search = i),
|
|
729
|
-
placeholder: "Search",
|
|
730
|
-
collapsible: ""
|
|
731
|
-
}, null, 8, ["modelValue"]),
|
|
732
|
-
S(x, {
|
|
733
|
-
icon: "ios_share",
|
|
734
|
-
variant: "tertiary",
|
|
735
|
-
onClick: h
|
|
736
|
-
})
|
|
737
|
-
]),
|
|
738
|
-
w("div", je, [
|
|
739
|
-
w("div", qe, [
|
|
740
|
-
S(J, {
|
|
741
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
742
|
-
"right-icon": "keyboard_arrow_down",
|
|
743
|
-
modelValue: n(g)["metadata.location"],
|
|
744
|
-
"onUpdate:modelValue": t[1] || (t[1] = (i) => n(g)["metadata.location"] = i),
|
|
745
|
-
icon: "storefront",
|
|
746
|
-
"show-item-label": !0,
|
|
747
|
-
items: n(v)
|
|
748
|
-
}, null, 8, ["modelValue", "items"]),
|
|
749
|
-
S(J, {
|
|
750
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
751
|
-
"right-icon": "keyboard_arrow_down",
|
|
752
|
-
modelValue: n(g)["pf_collectible.type"],
|
|
753
|
-
"onUpdate:modelValue": t[2] || (t[2] = (i) => n(g)["pf_collectible.type"] = i),
|
|
754
|
-
label: "Type: ",
|
|
755
|
-
"show-item-label": !0,
|
|
756
|
-
items: [
|
|
757
|
-
{ label: "Point", value: "COIN" },
|
|
758
|
-
{ label: "Credit", value: "CREDIT" },
|
|
759
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
760
|
-
{ label: "Experience", value: "POINT" },
|
|
761
|
-
{ label: "Tier", value: "TIER" },
|
|
762
|
-
{ label: "Title", value: "TITLE" },
|
|
763
|
-
{ label: "Game", value: "GAME" },
|
|
764
|
-
{ label: "Stamp", value: "STAMP" }
|
|
765
|
-
]
|
|
766
|
-
}, null, 8, ["modelValue"]),
|
|
767
|
-
S(J, {
|
|
768
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
769
|
-
"right-icon": "keyboard_arrow_down",
|
|
770
|
-
modelValue: n(g).source,
|
|
771
|
-
"onUpdate:modelValue": t[3] || (t[3] = (i) => n(g).source = i),
|
|
772
|
-
label: "Source: ",
|
|
773
|
-
"show-item-label": !0,
|
|
774
|
-
items: n(r)
|
|
775
|
-
}, null, 8, ["modelValue", "items"]),
|
|
776
|
-
S(me, {
|
|
777
|
-
"model-value": {
|
|
778
|
-
startDate: n(g).dateRange.startDate,
|
|
779
|
-
endDate: n(g).dateRange.endDate
|
|
780
|
-
},
|
|
781
|
-
"onUpdate:modelValue": t[4] || (t[4] = (i) => n(g).dateRange = {
|
|
782
|
-
startDate: n(D)(i.startDate).startOf("d").toISOString(),
|
|
783
|
-
endDate: n(D)(i.endDate).endOf("d").toISOString()
|
|
784
|
-
})
|
|
785
|
-
}, null, 8, ["model-value"])
|
|
786
|
-
]),
|
|
787
|
-
S(_, {
|
|
788
|
-
class: "xs:hidden",
|
|
789
|
-
modelValue: n(g).search,
|
|
790
|
-
"onUpdate:modelValue": t[5] || (t[5] = (i) => n(g).search = i),
|
|
791
|
-
placeholder: "Search",
|
|
792
|
-
collapsible: ""
|
|
793
|
-
}, null, 8, ["modelValue"]),
|
|
794
|
-
w("div", Ke, [
|
|
795
|
-
S(x, {
|
|
796
|
-
icon: "ios_share",
|
|
797
|
-
variant: "tertiary",
|
|
798
|
-
onClick: h
|
|
799
|
-
})
|
|
800
|
-
])
|
|
801
|
-
]),
|
|
802
|
-
S(se, {
|
|
803
|
-
loading: n(R).isLoading,
|
|
804
|
-
"row-data": n(b),
|
|
805
|
-
"row-count": n(R).totalRows,
|
|
806
|
-
"column-defs": T.filter(
|
|
807
|
-
(i) => !f.user || i.header !== "User" && i.header !== "Phone No."
|
|
808
|
-
),
|
|
809
|
-
"page-count": n(R).pageCount,
|
|
810
|
-
"page-index": n(R).pageIndex,
|
|
811
|
-
"page-size": n(R).pageSize,
|
|
812
|
-
"shrink-at": !1,
|
|
813
|
-
onSortChange: n(m),
|
|
814
|
-
onPageChange: t[6] || (t[6] = (i) => n(a)({
|
|
815
|
-
pageSize: i.pageSize,
|
|
816
|
-
pageIndex: i.pageIndex
|
|
817
|
-
})),
|
|
818
|
-
onRowClick: N
|
|
819
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
820
|
-
]),
|
|
821
|
-
S(Le, {
|
|
822
|
-
ref_key: "transactionDetailSheet",
|
|
823
|
-
ref: F
|
|
824
|
-
}, null, 512)
|
|
825
|
-
], 64);
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
});
|
|
829
|
-
class Ge extends ue {
|
|
830
|
-
}
|
|
831
|
-
const He = { class: "flex items-center justify-between" }, We = { class: "flex gap-8 items-center" }, Xe = { class: "flex gap-8 items-center xs:hidden" }, wt = /* @__PURE__ */ L({
|
|
832
|
-
__name: "StoreTransactions",
|
|
833
|
-
props: {
|
|
834
|
-
user: {
|
|
835
|
-
type: String
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
setup(u) {
|
|
839
|
-
const y = u, { minor: p } = Re;
|
|
840
|
-
xe();
|
|
841
|
-
const d = [
|
|
842
|
-
{
|
|
843
|
-
header: "Transaction ID",
|
|
844
|
-
meta: {
|
|
845
|
-
maxWidth: "150px"
|
|
846
|
-
},
|
|
847
|
-
cell(e) {
|
|
848
|
-
return s("div", { class: "flex items-center" }, [
|
|
849
|
-
s(C.FmIcon, {
|
|
850
|
-
name: "content_copy",
|
|
851
|
-
outline: !0,
|
|
852
|
-
size: "sm",
|
|
853
|
-
class: "cursor-pointer mr-4 shrink-0",
|
|
854
|
-
onClick: (l) => {
|
|
855
|
-
l.preventDefault(), l.stopPropagation(), ae(e.row.original._id.toString());
|
|
856
|
-
}
|
|
857
|
-
}),
|
|
858
|
-
s("div", { class: "truncate" }, e.row.original._id.toString())
|
|
859
|
-
]);
|
|
860
|
-
}
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
header: "Created at",
|
|
864
|
-
accessorFn: (e) => D(B(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
865
|
-
enableSorting: !0
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
header: "Bundle",
|
|
869
|
-
accessorFn: (e) => e.bundle.name
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
header: "Location",
|
|
873
|
-
accessorFn: (e) => e.location ? e.pf_location.name : "Online Store"
|
|
874
|
-
},
|
|
875
|
-
{
|
|
876
|
-
header: "Payment Type",
|
|
877
|
-
accessorFn: (e) => {
|
|
878
|
-
var l;
|
|
879
|
-
return ((l = e.paymentType) == null ? void 0 : l.type) ?? "N/A";
|
|
880
|
-
},
|
|
881
|
-
cell(e) {
|
|
882
|
-
var l, r;
|
|
883
|
-
return s("div", { class: "flex items-center gap-4" }, [
|
|
884
|
-
s("div", { class: "flex items-center" }, [
|
|
885
|
-
((l = e.row.original.paymentType) == null ? void 0 : l.type) == "ONLINE" && e.row.original.paymentType.extra ? s(
|
|
886
|
-
C.FmTooltip,
|
|
887
|
-
{
|
|
888
|
-
content: e.row.original.paymentType.extra
|
|
889
|
-
},
|
|
890
|
-
[
|
|
891
|
-
s(C.FmIcon, {
|
|
892
|
-
name: "info",
|
|
893
|
-
outline: !0,
|
|
894
|
-
size: "sm"
|
|
895
|
-
})
|
|
896
|
-
]
|
|
897
|
-
) : s("div")
|
|
898
|
-
]),
|
|
899
|
-
s(
|
|
900
|
-
"div",
|
|
901
|
-
{ class: "flex-1" },
|
|
902
|
-
((r = e.row.original.paymentType) == null ? void 0 : r.type) ?? "N/A"
|
|
903
|
-
)
|
|
904
|
-
]);
|
|
905
|
-
}
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
header: "User",
|
|
909
|
-
cell: (e) => ie(e.row.original.pf_member)
|
|
910
|
-
},
|
|
911
|
-
{
|
|
912
|
-
header: "Phone No.",
|
|
913
|
-
accessorFn: (e) => e.pf_member.phoneNumber
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
header: "Status",
|
|
917
|
-
// accessorFn: (u) => u.status,
|
|
918
|
-
cell(e) {
|
|
919
|
-
var l, r, v, h;
|
|
920
|
-
return s("div", { class: "flex items-center" }, [
|
|
921
|
-
s("div", Se.title(e.row.original.status)),
|
|
922
|
-
s("div", { class: "flex items-center" }, [
|
|
923
|
-
(r = (l = e.row.original) == null ? void 0 : l.refund) != null && r.reason ? s(
|
|
924
|
-
C.FmTooltip,
|
|
925
|
-
{
|
|
926
|
-
content: (h = (v = e.row.original) == null ? void 0 : v.refund) == null ? void 0 : h.reason
|
|
927
|
-
},
|
|
928
|
-
[
|
|
929
|
-
s(C.FmIcon, {
|
|
930
|
-
name: "info",
|
|
931
|
-
color: "primary",
|
|
932
|
-
outline: !0,
|
|
933
|
-
size: "sm",
|
|
934
|
-
class: "pl-2"
|
|
935
|
-
})
|
|
936
|
-
]
|
|
937
|
-
) : s("div")
|
|
938
|
-
])
|
|
939
|
-
]);
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
header: "Source",
|
|
944
|
-
accessorFn: (e) => e.source
|
|
945
|
-
},
|
|
946
|
-
{
|
|
947
|
-
header: "Ref",
|
|
948
|
-
accessorFn: (e) => e.ref
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
id: "action",
|
|
952
|
-
cell(e) {
|
|
953
|
-
const l = e.row.original, r = l.status === "COMPLETED" && !l.refund;
|
|
954
|
-
return r ? s(
|
|
955
|
-
C.FmMenu,
|
|
956
|
-
{
|
|
957
|
-
placement: "bottom-end",
|
|
958
|
-
onClick: (v) => {
|
|
959
|
-
v.stopPropagation();
|
|
960
|
-
}
|
|
961
|
-
},
|
|
962
|
-
{
|
|
963
|
-
"menu-button": () => s(C.FmButton, {
|
|
964
|
-
icon: "settings",
|
|
965
|
-
variant: "tertiary",
|
|
966
|
-
if: r
|
|
967
|
-
}),
|
|
968
|
-
default: () => [
|
|
969
|
-
s(C.FmMenuItem, {
|
|
970
|
-
label: "Refund",
|
|
971
|
-
sublabel: "Refund this transaction",
|
|
972
|
-
onClick: async (v) => {
|
|
973
|
-
v.stopPropagation(), await m(l);
|
|
974
|
-
}
|
|
975
|
-
})
|
|
976
|
-
]
|
|
977
|
-
}
|
|
978
|
-
) : s("div");
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
], f = A({
|
|
982
|
-
searchValue: "",
|
|
983
|
-
dateRange: {
|
|
984
|
-
startDate: D().subtract(7, "day").toISOString(),
|
|
985
|
-
endDate: D().toISOString()
|
|
986
|
-
}
|
|
987
|
-
}), { tableMeta: c, rowData: T, onSort: g, debouncedFetchData: R, onSearch: b } = le(async (e) => {
|
|
988
|
-
const l = {
|
|
989
|
-
...f.value.dateRange,
|
|
990
|
-
user: y.user
|
|
991
|
-
};
|
|
992
|
-
return await W.readStoreTransactions(e, l);
|
|
993
|
-
});
|
|
994
|
-
async function m(e) {
|
|
995
|
-
await we.confirm(
|
|
996
|
-
"Are you sure you want to refund this transaction?",
|
|
997
|
-
"Refund Store Transaction",
|
|
998
|
-
"Confirm",
|
|
999
|
-
"Cancel"
|
|
1000
|
-
) && await p(
|
|
1001
|
-
async () => {
|
|
1002
|
-
var r;
|
|
1003
|
-
await Ie.refundStoreTransaction({
|
|
1004
|
-
id: e._id,
|
|
1005
|
-
reason: `ADMIN:${(r = Fe().sessionUser) == null ? void 0 : r.name}`
|
|
1006
|
-
}), await R();
|
|
1007
|
-
},
|
|
1008
|
-
{
|
|
1009
|
-
message: "Refunding transaction...",
|
|
1010
|
-
successMessage: "Transaction refunded successfully"
|
|
1011
|
-
}
|
|
1012
|
-
);
|
|
1013
|
-
}
|
|
1014
|
-
te(
|
|
1015
|
-
f,
|
|
1016
|
-
() => {
|
|
1017
|
-
R();
|
|
1018
|
-
},
|
|
1019
|
-
{ deep: !0 }
|
|
1020
|
-
), ee(async () => {
|
|
1021
|
-
await R();
|
|
1022
|
-
});
|
|
1023
|
-
const a = async () => ce({
|
|
1024
|
-
exporter: new Ge(),
|
|
1025
|
-
readFunction: (e) => W.readStoreTransactions(e, {
|
|
1026
|
-
...f.value.dateRange,
|
|
1027
|
-
user: y.user
|
|
1028
|
-
}),
|
|
1029
|
-
transformRecord: (e) => {
|
|
1030
|
-
var l, r, v, h, F, N;
|
|
1031
|
-
return {
|
|
1032
|
-
TransactionId: ((l = e._id) == null ? void 0 : l.toString()) || "",
|
|
1033
|
-
CreatedAt: D(B(e._id.toString())).format(
|
|
1034
|
-
"DD/MM/YYYY HH:mm:ss"
|
|
1035
|
-
),
|
|
1036
|
-
Bundle: e.bundle.name || "",
|
|
1037
|
-
Location: e.location ? e.pf_location.name : "Online Store",
|
|
1038
|
-
PaymentType: ((r = e.paymentType) == null ? void 0 : r.type) || "N/A",
|
|
1039
|
-
PaymentExtra: ((v = e.paymentType) == null ? void 0 : v.extra) || "",
|
|
1040
|
-
User: ((h = e.pf_member) == null ? void 0 : h.name) || "",
|
|
1041
|
-
PhoneNumber: ((F = e.pf_member) == null ? void 0 : F.phoneNumber) || "",
|
|
1042
|
-
Status: e.status || "",
|
|
1043
|
-
RefundReason: ((N = e == null ? void 0 : e.refund) == null ? void 0 : N.reason) || ""
|
|
1044
|
-
};
|
|
1045
|
-
},
|
|
1046
|
-
filename: "store-transactions"
|
|
1047
|
-
});
|
|
1048
|
-
return (e, l) => {
|
|
1049
|
-
const r = k("FmSearch"), v = k("FmButton");
|
|
1050
|
-
return I(), E("div", null, [
|
|
1051
|
-
w("div", He, [
|
|
1052
|
-
w("div", We, [
|
|
1053
|
-
S(me, {
|
|
1054
|
-
modelValue: n(f).dateRange,
|
|
1055
|
-
"onUpdate:modelValue": l[0] || (l[0] = (h) => n(f).dateRange = h)
|
|
1056
|
-
}, null, 8, ["modelValue"])
|
|
1057
|
-
]),
|
|
1058
|
-
w("div", Xe, [
|
|
1059
|
-
S(r, {
|
|
1060
|
-
modelValue: n(c).searchValue,
|
|
1061
|
-
"onUpdate:modelValue": [
|
|
1062
|
-
l[1] || (l[1] = (h) => n(c).searchValue = h),
|
|
1063
|
-
n(b)
|
|
1064
|
-
],
|
|
1065
|
-
placeholder: "Search",
|
|
1066
|
-
collapsible: ""
|
|
1067
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1068
|
-
S(v, {
|
|
1069
|
-
icon: "ios_share",
|
|
1070
|
-
variant: "tertiary",
|
|
1071
|
-
onClick: a
|
|
1072
|
-
})
|
|
1073
|
-
])
|
|
1074
|
-
]),
|
|
1075
|
-
S(se, {
|
|
1076
|
-
loading: n(c).isLoading,
|
|
1077
|
-
"row-data": n(T),
|
|
1078
|
-
"row-count": n(c).totalRows,
|
|
1079
|
-
"column-defs": d.filter(
|
|
1080
|
-
(h) => !y.user || h.header !== "User" && h.header !== "Phone No."
|
|
1081
|
-
),
|
|
1082
|
-
"page-count": n(c).pageCount,
|
|
1083
|
-
"page-index": n(c).pageIndex,
|
|
1084
|
-
"page-size": n(c).pageSize,
|
|
1085
|
-
"shrink-at": !1,
|
|
1086
|
-
onSortChange: n(g),
|
|
1087
|
-
onPageChange: l[2] || (l[2] = (h) => n(R)({
|
|
1088
|
-
pageSize: h.pageSize,
|
|
1089
|
-
pageIndex: h.pageIndex
|
|
1090
|
-
}))
|
|
1091
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1092
|
-
]);
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
});
|
|
1096
|
-
export {
|
|
1097
|
-
St as _,
|
|
1098
|
-
wt as a
|
|
1099
|
-
};
|