@feedmepos/mf-connect 0.1.0-beta.30 → 0.1.0-beta.32
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-DLez3H4H.js → Analytic-DkxpZxXF.js} +8 -8
- package/dist/{App-dkNRyYLR.js → App-cFnyNJX5.js} +6 -6
- package/dist/{Broadcast-DlAaBitD.js → Broadcast-VrvwW11m.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BtpiGQEs.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DK8-e535.js} +7 -8
- package/dist/{Card-JpWEjzjP.js → Card-BRCliaB_.js} +17 -18
- package/dist/{Collections-D5hUfDJo.js → Collections-BBd3RN2S.js} +4 -4
- package/dist/{Credit-v3KdCFwT.js → Credit-BiRfftdO.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CE2Ar-Ll.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BTST01U2.js} +26 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C12m8EXP.js → EffectSheet.vue_vue_type_style_index_0_lang-Bx_t1yPZ.js} +6 -6
- package/dist/{Experience-9A41fyZO.js → Experience-C7aYCLot.js} +8 -8
- package/dist/{Game-l1tUsePJ.js → Game-CCTRHFCs.js} +8 -8
- package/dist/{Index-rF6OzGw_.js → Index-yMSFQ15g.js} +9 -9
- package/dist/{Marketing-6zS-6CS3.js → Marketing-BIWD_Zpv.js} +5 -5
- package/dist/{Member-B5jPh0DM.js → Member-B5VamwfR.js} +4 -4
- package/dist/{MemberList-c2P1lToO.js → MemberList-CWkmf_WZ.js} +18 -19
- package/dist/{MemberTransactions-BiwAZyCP.js → MemberTransactions-9xDEJ3qi.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CYVOCazs.js → MessageInput.vue_vue_type_script_setup_true_lang-CKBwCP0l.js} +2 -2
- package/dist/{Mission-BM7abR6J.js → Mission-Ck54cctg.js} +8 -8
- package/dist/{Overview-Drjb4oAW.js → Overview-DbuRGVWJ.js} +19 -20
- package/dist/{Point-BP9YezdW.js → Point-C1EkvSWh.js} +8 -8
- package/dist/{Promotion-DiqlNOWk.js → Promotion-B74-3O-2.js} +9 -9
- package/dist/{Record-DJ2A1L-C.js → Record-CFRaQ1sc.js} +5 -5
- package/dist/{Reward-DN6z6LXf.js → Reward-u4hM8gJX.js} +12 -12
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CcbzCFUg.js → RewardGroup.vue_vue_type_script_setup_true_lang-C2iKpUoP.js} +13 -14
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CFD10xnG.js → RuleGroup.vue_vue_type_script_setup_true_lang-CqqHClbc.js} +15 -16
- package/dist/{Segment-Cm48eZrS.js → Segment-DLHcW3Mm.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-6XokSm7W.js → SelectItems.vue_vue_type_script_setup_true_lang-BsrLR3Ry.js} +2 -2
- package/dist/{Setting-3jXUi2cS.js → Setting-2fI8Ejy-.js} +8 -8
- package/dist/{Store-Csditfe8.js → Store-Ca9krNoR.js} +20 -21
- package/dist/{StoreRewards-DOMxpeaj.js → StoreRewards-B8e61zol.js} +12 -12
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bfx9iTzD.js +1132 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C8UhKTgD.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BNPKgK6S.js} +1 -1
- package/dist/{Tier-BmhQYaPz.js → Tier-JLf0R2xU.js} +214 -217
- package/dist/{Title-BJV4yLCu.js → Title-CPBVpQgP.js} +21 -22
- package/dist/{Transaction-DB81PNYL.js → Transaction-D138QUn6.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-wyCBPQRj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D2LKgS7h.js} +6 -6
- package/dist/{Voucher-B8nnAIUZ.js → Voucher-haa-zTdM.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B4zIOBh0.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BfYFnnl-.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DvfcNsj9.js → ZodTextField.vue_vue_type_script_setup_true_lang-DasKXslL.js} +1 -1
- package/dist/{app-BYTkNtdY.js → app-C2HTy1nv.js} +1 -1
- package/dist/{app-sD3N1iqR.js → app-C4fjdQtp.js} +28 -28
- package/dist/app.js +1 -1
- package/dist/{business-B6OFKNz4.js → business-BTNYs-U5.js} +1 -1
- package/dist/{campaign-DhumfBC6.js → campaign-BK4EhzMc.js} +2 -2
- package/dist/{collectible.enum-4Gywgj__.js → collectible.enum-UDFRfReI.js} +1 -1
- package/dist/{collection.fn-D-uexOQL.js → collection.fn-BAqSI3np.js} +2 -2
- package/dist/{dto-b9jcbMWA.js → dto-BrNbKS-b.js} +75 -75
- package/dist/{effect-CBN4vtSi.js → effect-BtvuGYY8.js} +1 -1
- package/dist/{email-addresses-BqgJVUoG.js → email-addresses-CIg74qiD.js} +1 -1
- package/dist/{export-D1kS_vMc.js → export-BvHWTvqK.js} +3 -3
- package/dist/{helper-SbkTJZDm.js → helper-gL8_tR2G.js} +1 -1
- package/dist/{index-Hhxoo_Eg.js → index-856h6bc0.js} +19 -20
- package/dist/{index-DgJVPeks.js → index-B6sy9Hsd.js} +1 -1
- package/dist/{index-wJ5e3mQa.js → index-BJ4yupx3.js} +1 -1
- package/dist/{index-CBwwTcb5.js → index-BV2Ej5X-.js} +1 -1
- package/dist/{index-OCIxZJKd.js → index-BmgMTm44.js} +1 -1
- package/dist/{index-CxBG7i3n.js → index-BuE8NeSd.js} +9 -10
- package/dist/{index-Cd94xjeo.js → index-CC1h5CUP.js} +1 -1
- package/dist/{index-DtX7V_mF.js → index-CIdcR8xz.js} +4 -4
- package/dist/{index-BIs-Ed1-.js → index-CagyPdIB.js} +3 -3
- package/dist/{index-Cehc8dyz.js → index-CdAIjFbl.js} +989 -787
- package/dist/{index-Dp-5hs3q.js → index-IxRs9X0k.js} +1 -1
- package/dist/{index-BBBSm4kr.js → index-YFt66ce1.js} +3 -3
- package/dist/{index.esm2017-Bl1OPd9N.js → index.esm2017-StebtCHT.js} +1 -1
- package/dist/{loading-BghJIv3w.js → loading-DbB9x1Ds.js} +4 -4
- package/dist/{membership-D532uzUJ.js → membership-CyhUGayb.js} +3 -3
- package/dist/{money-BJmDeENN.js → money-BHQxTQaH.js} +1 -1
- package/dist/{number-E_LdkU9a.js → number-DzEEwzMx.js} +1 -1
- package/dist/{objectid-DSB8jlsT.js → objectid-BPMkce_-.js} +10 -10
- package/dist/{reward-CiTzAsCd.js → reward-DZVkyjr0.js} +1 -1
- package/dist/{rule-0MEHUef9.js → rule-BSKwXrMD.js} +3 -3
- package/dist/{rule-builder-BQZN0Bi4.js → rule-builder-SPJUHKuA.js} +1 -1
- package/dist/{template-2xDKWfij.js → template-CdZQFxGi.js} +4 -4
- package/dist/{trigger-BFmJQkCL.js → trigger-BjdUQ1EH.js} +4 -4
- package/dist/{user-B_diJ-ER.js → user--ig8oGw2.js} +1 -1
- package/dist/{vue-i18n-D0S05G9j.js → vue-i18n-gHmu9x4p.js} +408 -408
- package/dist/{xlsx-9pjTnN_k.js → xlsx-DClThkyy.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Csoobxol.js +0 -957
- package/dist/index-CHg2swyg.js +0 -210
|
@@ -1,957 +0,0 @@
|
|
|
1
|
-
import { defineComponent as z, ref as k, computed as K, onMounted as G, resolveComponent as T, openBlock as O, createBlock as U, unref as n, withCtx as Y, createVNode as v, normalizeClass as L, createCommentVNode as ue, createElementVNode as F, toDisplayString as X, createElementBlock as H, Fragment as de, renderList as me, mergeModels as J, useModel as pe, watch as W, onBeforeMount as fe, h as r } from "vue";
|
|
2
|
-
import { components as w, useDialog as ge } from "@feedmepos/ui-library";
|
|
3
|
-
import { f as ye } from "./index-CHg2swyg.js";
|
|
4
|
-
import { a as te, c as be, p as he, u as ve } from "./loading-BghJIv3w.js";
|
|
5
|
-
import { s as we } from "./index-Dbd4WA4r.js";
|
|
6
|
-
import { h as _ } from "./moment-BWErdI6_.js";
|
|
7
|
-
import { s as j } from "./index-CsaQJMAR.js";
|
|
8
|
-
import { f as Q } from "./number-E_LdkU9a.js";
|
|
9
|
-
import { u as _e } from "./business-B6OFKNz4.js";
|
|
10
|
-
import { u as ae, _ as ne } from "./usePagination-BeF5K3M7.js";
|
|
11
|
-
import { g as re } from "./user-B_diJ-ER.js";
|
|
12
|
-
import { B as oe, a as se } from "./export-D1kS_vMc.js";
|
|
13
|
-
import { u as Se } from "./campaign-DhumfBC6.js";
|
|
14
|
-
import "./index-wJ5e3mQa.js";
|
|
15
|
-
import { useRouter as xe } from "vue-router";
|
|
16
|
-
import { R as V } from "./app-sD3N1iqR.js";
|
|
17
|
-
import { o as $ } from "./objectId-dwaoBfJX.js";
|
|
18
|
-
import { useCoreStore as Re } from "@feedmepos/mf-common";
|
|
19
|
-
import { g as Z, a as Ce, S as Ie, b as De } from "./index-BIs-Ed1-.js";
|
|
20
|
-
import { m as Te } from "./index-DgJVPeks.js";
|
|
21
|
-
function Fe(o) {
|
|
22
|
-
let u = "";
|
|
23
|
-
switch (o) {
|
|
24
|
-
case "PORTAL":
|
|
25
|
-
u = "ADMIN";
|
|
26
|
-
break;
|
|
27
|
-
case "BENEFIT":
|
|
28
|
-
u = "MEMBERSHIP";
|
|
29
|
-
break;
|
|
30
|
-
case "ORDER":
|
|
31
|
-
u = "ORDER";
|
|
32
|
-
break;
|
|
33
|
-
case "BILL":
|
|
34
|
-
u = "SPENDING";
|
|
35
|
-
break;
|
|
36
|
-
case "CASHBACK":
|
|
37
|
-
u = "CASHBACK";
|
|
38
|
-
break;
|
|
39
|
-
case "CYCLE":
|
|
40
|
-
u = "EXPIRED";
|
|
41
|
-
break;
|
|
42
|
-
case "COUNTER_CONSUME":
|
|
43
|
-
u = "COUNTER REDEEM";
|
|
44
|
-
break;
|
|
45
|
-
default:
|
|
46
|
-
u = o;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
return u;
|
|
50
|
-
}
|
|
51
|
-
function Oe(o) {
|
|
52
|
-
var u, i, S, d, c, R;
|
|
53
|
-
switch ((u = o == null ? void 0 : o.pf_collectible) == null ? void 0 : u.type) {
|
|
54
|
-
case "VOUCHER":
|
|
55
|
-
return `${(i = o.pf_collectible) == null ? void 0 : i.type} (${(S = o.pf_collectible) == null ? void 0 : S.name})`;
|
|
56
|
-
case "TITLE":
|
|
57
|
-
return `${(d = o.pf_collectible) == null ? void 0 : d.type} (${(c = o.pf_collectible) == null ? void 0 : c.name})`;
|
|
58
|
-
case "POINT":
|
|
59
|
-
return "Experience";
|
|
60
|
-
case "COIN":
|
|
61
|
-
return "Point";
|
|
62
|
-
default:
|
|
63
|
-
return we((R = o == null ? void 0 : o.pf_collectible) == null ? void 0 : R.type);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function Ae(o) {
|
|
67
|
-
switch (o) {
|
|
68
|
-
case "ONLINE":
|
|
69
|
-
return "Online";
|
|
70
|
-
case "COIN":
|
|
71
|
-
return "Point";
|
|
72
|
-
default:
|
|
73
|
-
return o;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
const A = {
|
|
77
|
-
getReason: Fe,
|
|
78
|
-
formattedType: Oe,
|
|
79
|
-
formattedPaymentType: Ae
|
|
80
|
-
}, ke = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, q = /* @__PURE__ */ z({
|
|
81
|
-
__name: "FilterChip",
|
|
82
|
-
props: {
|
|
83
|
-
modelValue: {
|
|
84
|
-
type: Array,
|
|
85
|
-
required: !1
|
|
86
|
-
},
|
|
87
|
-
label: {
|
|
88
|
-
type: String,
|
|
89
|
-
required: !1,
|
|
90
|
-
default: ""
|
|
91
|
-
},
|
|
92
|
-
showItemLabel: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
default: !1
|
|
95
|
-
},
|
|
96
|
-
placement: {
|
|
97
|
-
type: String,
|
|
98
|
-
required: !1,
|
|
99
|
-
default: "bottom-end"
|
|
100
|
-
},
|
|
101
|
-
class: {
|
|
102
|
-
type: String,
|
|
103
|
-
required: !1
|
|
104
|
-
},
|
|
105
|
-
disabled: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
required: !1
|
|
108
|
-
},
|
|
109
|
-
items: {
|
|
110
|
-
type: Array,
|
|
111
|
-
required: !0
|
|
112
|
-
},
|
|
113
|
-
icon: {
|
|
114
|
-
type: String,
|
|
115
|
-
required: !1
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
emits: ["update:model-value"],
|
|
119
|
-
setup(o, { emit: u }) {
|
|
120
|
-
const i = o, S = u, d = k(!1), c = k({}), R = K(() => {
|
|
121
|
-
if (!c.value || Object.keys(c.value).length == i.items.length)
|
|
122
|
-
return "All";
|
|
123
|
-
{
|
|
124
|
-
const g = Object.keys(c.value).length;
|
|
125
|
-
return `${g > 0 ? g : "None"} selected`;
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
function m(g) {
|
|
129
|
-
c.value[g] ? delete c.value[g] : c.value[g] = !0, S("update:model-value", Object.keys(c.value));
|
|
130
|
-
}
|
|
131
|
-
function x() {
|
|
132
|
-
Object.keys(c.value).length > 0 ? c.value = {} : c.value = i.items.reduce((g, C) => (g[C.value] = !0, g), {}), S("update:model-value", Object.keys(c.value));
|
|
133
|
-
}
|
|
134
|
-
return G(() => {
|
|
135
|
-
c.value = i.modelValue.reduce(
|
|
136
|
-
(g, C) => (g[C] = !0, g),
|
|
137
|
-
{}
|
|
138
|
-
), i.modelValue.length == 0;
|
|
139
|
-
}), (g, C) => {
|
|
140
|
-
const I = T("FmIcon"), e = T("FmChip"), s = T("FmMenuItem"), f = T("FmMenu");
|
|
141
|
-
return O(), U(f, {
|
|
142
|
-
placement: o.placement || "bottom-end",
|
|
143
|
-
disabled: o.disabled == !0,
|
|
144
|
-
"model-value": n(d),
|
|
145
|
-
onMenuChanged: C[0] || (C[0] = (p) => d.value = p),
|
|
146
|
-
"close-on-click": !1
|
|
147
|
-
}, {
|
|
148
|
-
"menu-button": Y(() => [
|
|
149
|
-
v(e, {
|
|
150
|
-
label: o.label,
|
|
151
|
-
class: L(i.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
152
|
-
}, {
|
|
153
|
-
default: Y(() => [
|
|
154
|
-
i.icon ? (O(), U(I, {
|
|
155
|
-
key: 0,
|
|
156
|
-
name: i.icon,
|
|
157
|
-
class: L(i.class),
|
|
158
|
-
outline: "",
|
|
159
|
-
size: "sm"
|
|
160
|
-
}, null, 8, ["name", "class"])) : ue("", !0),
|
|
161
|
-
F("div", ke, X(i.label) + " " + X(o.showItemLabel ? n(R) : ""), 1),
|
|
162
|
-
v(I, {
|
|
163
|
-
name: n(d) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
164
|
-
class: L(i.class),
|
|
165
|
-
outline: "",
|
|
166
|
-
size: "sm"
|
|
167
|
-
}, null, 8, ["name", "class"])
|
|
168
|
-
]),
|
|
169
|
-
_: 1
|
|
170
|
-
}, 8, ["label", "class"])
|
|
171
|
-
]),
|
|
172
|
-
default: Y(() => [
|
|
173
|
-
v(s, {
|
|
174
|
-
"model-value": Object.keys(n(c)).length === i.items.length,
|
|
175
|
-
label: "All",
|
|
176
|
-
"has-checkbox": !0,
|
|
177
|
-
indeterminate: !0,
|
|
178
|
-
onClick: x
|
|
179
|
-
}, null, 8, ["model-value"]),
|
|
180
|
-
(O(!0), H(de, null, me(i.items ?? [], (p) => (O(), U(s, {
|
|
181
|
-
key: p.value,
|
|
182
|
-
value: p.value,
|
|
183
|
-
label: p.label,
|
|
184
|
-
"has-checkbox": !0,
|
|
185
|
-
"model-value": n(c)[p.value],
|
|
186
|
-
"onUpdate:modelValue": (y) => m(p.value)
|
|
187
|
-
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
188
|
-
]),
|
|
189
|
-
_: 1
|
|
190
|
-
}, 8, ["placement", "disabled", "model-value"]);
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
}), P = "YYYY-MM-DD", le = /* @__PURE__ */ z({
|
|
194
|
-
__name: "DateRangeChip",
|
|
195
|
-
props: /* @__PURE__ */ J({
|
|
196
|
-
modelValue: {
|
|
197
|
-
type: Object,
|
|
198
|
-
required: !0
|
|
199
|
-
}
|
|
200
|
-
}, {
|
|
201
|
-
dateRange: {
|
|
202
|
-
type: Object,
|
|
203
|
-
default: () => ({
|
|
204
|
-
startDate: _().subtract(7, "day").format(P),
|
|
205
|
-
endDate: _().endOf("day").format(P)
|
|
206
|
-
})
|
|
207
|
-
},
|
|
208
|
-
dateRangeModifiers: {}
|
|
209
|
-
}),
|
|
210
|
-
emits: /* @__PURE__ */ J(["update:model-value"], ["update:dateRange"]),
|
|
211
|
-
setup(o, { emit: u }) {
|
|
212
|
-
const i = o, S = u, d = pe(o, "dateRange"), c = K(() => d.value ? `${R.value.startDate ?? "Start"} - ${R.value.endDate ?? "End"}` : "No dates selected."), R = K(() => ({
|
|
213
|
-
startDate: d.value.startDate ? _(d.value.startDate).format(P) : void 0,
|
|
214
|
-
endDate: d.value.endDate ? _(d.value.endDate).format(P) : void 0
|
|
215
|
-
}));
|
|
216
|
-
return G(() => {
|
|
217
|
-
d.value = i.modelValue;
|
|
218
|
-
}), W(
|
|
219
|
-
() => d.value,
|
|
220
|
-
() => {
|
|
221
|
-
S("update:model-value", R.value);
|
|
222
|
-
}
|
|
223
|
-
), (m, x) => {
|
|
224
|
-
const g = T("FmChip"), C = T("FmDateRangePicker");
|
|
225
|
-
return O(), U(C, {
|
|
226
|
-
modelValue: d.value,
|
|
227
|
-
"onUpdate:modelValue": x[0] || (x[0] = (I) => d.value = I),
|
|
228
|
-
"show-predefined-range": ""
|
|
229
|
-
}, {
|
|
230
|
-
"trigger-button": Y(() => [
|
|
231
|
-
v(g, {
|
|
232
|
-
label: n(c),
|
|
233
|
-
icon: "calendar_month",
|
|
234
|
-
"right-icon": "keyboard_arrow_down",
|
|
235
|
-
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
236
|
-
}, null, 8, ["label"])
|
|
237
|
-
]),
|
|
238
|
-
_: 1
|
|
239
|
-
}, 8, ["modelValue"]);
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
class Ee extends oe {
|
|
244
|
-
}
|
|
245
|
-
const ee = () => {
|
|
246
|
-
const o = Ie.getBusinessId();
|
|
247
|
-
if (!o) throw new Error("Invalid business ID");
|
|
248
|
-
return De(`businesses/${o}/transactions`, {
|
|
249
|
-
noIdRequired: !0
|
|
250
|
-
});
|
|
251
|
-
}, B = {
|
|
252
|
-
async readAll(o, u) {
|
|
253
|
-
const i = Z(
|
|
254
|
-
await ee().get("", {
|
|
255
|
-
params: { ...o, ...u }
|
|
256
|
-
})
|
|
257
|
-
);
|
|
258
|
-
return {
|
|
259
|
-
meta: i.meta,
|
|
260
|
-
resources: i.resources
|
|
261
|
-
};
|
|
262
|
-
},
|
|
263
|
-
async readStoreTransactions(o, u) {
|
|
264
|
-
const i = Z(
|
|
265
|
-
await ee().get("/store", {
|
|
266
|
-
params: { ...o, ...u }
|
|
267
|
-
})
|
|
268
|
-
);
|
|
269
|
-
return {
|
|
270
|
-
meta: i.meta,
|
|
271
|
-
resources: i.resources
|
|
272
|
-
};
|
|
273
|
-
},
|
|
274
|
-
async readBills(o, u, i) {
|
|
275
|
-
return (await Ce("").get(`/restaurants/${o}/receipt?start=${u}&end=${i}`)).data;
|
|
276
|
-
}
|
|
277
|
-
}, Me = { class: "hidden xs:flex items-center justify-end" }, Ne = { class: "flex items-center justify-between" }, Ve = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, Pe = { class: "xs:hidden" }, it = /* @__PURE__ */ z({
|
|
278
|
-
__name: "CollectionTransactions",
|
|
279
|
-
props: {
|
|
280
|
-
user: {
|
|
281
|
-
type: String
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
setup(o) {
|
|
285
|
-
const u = _e(), i = Se(), S = xe(), d = o, c = k(!1), R = [
|
|
286
|
-
{
|
|
287
|
-
header: "Transaction ID",
|
|
288
|
-
accessorKey: "_id",
|
|
289
|
-
meta: {
|
|
290
|
-
maxWidth: "100px"
|
|
291
|
-
},
|
|
292
|
-
cell(a) {
|
|
293
|
-
return r("div", { class: "flex items-center" }, [
|
|
294
|
-
r(w.FmIcon, {
|
|
295
|
-
name: "content_copy",
|
|
296
|
-
outline: !0,
|
|
297
|
-
size: "sm",
|
|
298
|
-
class: "cursor-pointer mr-4",
|
|
299
|
-
onClick: (t) => {
|
|
300
|
-
t.preventDefault(), t.stopPropagation(), te(a.row.original._id.toString());
|
|
301
|
-
}
|
|
302
|
-
}),
|
|
303
|
-
r(
|
|
304
|
-
"div",
|
|
305
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
306
|
-
a.row.original._id.toString()
|
|
307
|
-
)
|
|
308
|
-
]);
|
|
309
|
-
},
|
|
310
|
-
enableSorting: !1
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
header: "Created at",
|
|
314
|
-
accessorKey: "_id",
|
|
315
|
-
accessorFn: (a) => _($(a._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
316
|
-
enableSorting: !0
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
header: "Amount",
|
|
320
|
-
// accessorKey: 'totalAmount',
|
|
321
|
-
enableSorting: !1,
|
|
322
|
-
cell(a) {
|
|
323
|
-
var h, l, D, E;
|
|
324
|
-
const t = Q(
|
|
325
|
-
a.row.original.expiryAmount.reduce(
|
|
326
|
-
(M, N) => M + N.amount,
|
|
327
|
-
a.row.original.amount ?? 0
|
|
328
|
-
),
|
|
329
|
-
2
|
|
330
|
-
), b = (l = (h = a.row.original.expiryAmount) == null ? void 0 : h[0]) != null && l.expiredAt ? _((E = (D = a.row.original.expiryAmount) == null ? void 0 : D[0]) == null ? void 0 : E.expiredAt).format(
|
|
331
|
-
"D MMM YYYY"
|
|
332
|
-
) : "";
|
|
333
|
-
return r("div", { class: "flex items-center" }, [
|
|
334
|
-
r(
|
|
335
|
-
"div",
|
|
336
|
-
{
|
|
337
|
-
class: [
|
|
338
|
-
"pr-2",
|
|
339
|
-
+t > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
340
|
-
]
|
|
341
|
-
},
|
|
342
|
-
t
|
|
343
|
-
),
|
|
344
|
-
r("div", { class: "flex items-center" }, [
|
|
345
|
-
a.row.original.expiryAmount.length > 0 ? r(
|
|
346
|
-
w.FmTooltip,
|
|
347
|
-
{
|
|
348
|
-
content: `Expired on ${b}`
|
|
349
|
-
},
|
|
350
|
-
[
|
|
351
|
-
r(w.FmIcon, {
|
|
352
|
-
name: "info",
|
|
353
|
-
outline: !0,
|
|
354
|
-
size: "sm"
|
|
355
|
-
})
|
|
356
|
-
]
|
|
357
|
-
) : r("div")
|
|
358
|
-
])
|
|
359
|
-
]);
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
header: "Type",
|
|
364
|
-
accessorKey: "pf_collectible.type",
|
|
365
|
-
accessorFn: (a) => A.formattedType(a),
|
|
366
|
-
meta: {
|
|
367
|
-
maxWidth: "200px"
|
|
368
|
-
},
|
|
369
|
-
cell(a) {
|
|
370
|
-
const t = A.formattedType(a.row.original);
|
|
371
|
-
return r("div", { class: "flex items-center" }, [
|
|
372
|
-
r("div", { class: "truncate text-ellipsis" }, t),
|
|
373
|
-
t.length > 20 ? r(
|
|
374
|
-
w.FmTooltip,
|
|
375
|
-
{
|
|
376
|
-
content: t
|
|
377
|
-
},
|
|
378
|
-
[
|
|
379
|
-
r(w.FmIcon, {
|
|
380
|
-
name: "info",
|
|
381
|
-
color: "primary",
|
|
382
|
-
outline: !0,
|
|
383
|
-
size: "sm"
|
|
384
|
-
})
|
|
385
|
-
]
|
|
386
|
-
) : null
|
|
387
|
-
]);
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
header: "Source",
|
|
392
|
-
accessorKey: "source",
|
|
393
|
-
cell(a) {
|
|
394
|
-
var t;
|
|
395
|
-
return r("div", { class: "flex items-center gap-4" }, [
|
|
396
|
-
r(
|
|
397
|
-
"div",
|
|
398
|
-
{ class: "truncate text-ellipsis" },
|
|
399
|
-
j(A.getReason(a.row.original.source))
|
|
400
|
-
),
|
|
401
|
-
...(t = a.row.original.metadata) != null && t.campaign ? [
|
|
402
|
-
r(
|
|
403
|
-
w.FmTooltip,
|
|
404
|
-
{
|
|
405
|
-
get content() {
|
|
406
|
-
var b;
|
|
407
|
-
return (b = i.campaigns.all.find(
|
|
408
|
-
(h) => {
|
|
409
|
-
var l;
|
|
410
|
-
return h._id === ((l = a.row.original.metadata) == null ? void 0 : l.campaign);
|
|
411
|
-
}
|
|
412
|
-
)) == null ? void 0 : b.name;
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
[
|
|
416
|
-
r(w.FmIcon, {
|
|
417
|
-
name: "info",
|
|
418
|
-
color: "primary",
|
|
419
|
-
size: "sm",
|
|
420
|
-
onClick: async (b) => {
|
|
421
|
-
b.preventDefault(), b.stopPropagation();
|
|
422
|
-
const h = i.campaigns.all.find(
|
|
423
|
-
(l) => {
|
|
424
|
-
var D;
|
|
425
|
-
return l._id === ((D = a.row.original.metadata) == null ? void 0 : D.campaign);
|
|
426
|
-
}
|
|
427
|
-
);
|
|
428
|
-
if (h)
|
|
429
|
-
switch (h.type) {
|
|
430
|
-
case "VOUCHER":
|
|
431
|
-
case "PROMOTION":
|
|
432
|
-
case "BROADCAST":
|
|
433
|
-
await S.push({
|
|
434
|
-
name: V[`$connect-CAMPAIGN_${h.type}`]
|
|
435
|
-
});
|
|
436
|
-
break;
|
|
437
|
-
case "GAME":
|
|
438
|
-
case "CREDIT":
|
|
439
|
-
case "MISSION":
|
|
440
|
-
await S.push({
|
|
441
|
-
name: V[`$connect-PROGRAM_${h.type}`]
|
|
442
|
-
});
|
|
443
|
-
break;
|
|
444
|
-
case "POINT":
|
|
445
|
-
await S.push({
|
|
446
|
-
name: V["$connect-PROGRAM_EXPERIENCE"]
|
|
447
|
-
});
|
|
448
|
-
break;
|
|
449
|
-
case "COIN":
|
|
450
|
-
await S.push({
|
|
451
|
-
name: V["$connect-PROGRAM_POINT"]
|
|
452
|
-
});
|
|
453
|
-
break;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
})
|
|
457
|
-
]
|
|
458
|
-
)
|
|
459
|
-
] : []
|
|
460
|
-
]);
|
|
461
|
-
}
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
header: "User",
|
|
465
|
-
accessorKey: "pf_user.name",
|
|
466
|
-
cell(a) {
|
|
467
|
-
return re(a.row.original.pf_user);
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
header: "Phone No.",
|
|
472
|
-
accessorKey: "pf_user.phoneNumber",
|
|
473
|
-
accessorFn: (a) => {
|
|
474
|
-
var t;
|
|
475
|
-
return ((t = a == null ? void 0 : a.pf_user) == null ? void 0 : t.phoneNumber) || "";
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
accessorFn: (a) => a.ref,
|
|
480
|
-
header: "References",
|
|
481
|
-
accessorKey: "ref",
|
|
482
|
-
cell(a) {
|
|
483
|
-
var t, b;
|
|
484
|
-
return r("div", { class: "flex items-center justify-between gap-4" }, [
|
|
485
|
-
r("div", { class: "flex items-center" }, [
|
|
486
|
-
(t = a.row.original.metadata) != null && t.remark ? r(
|
|
487
|
-
w.FmTooltip,
|
|
488
|
-
{
|
|
489
|
-
content: (b = a.row.original.metadata) == null ? void 0 : b.remark
|
|
490
|
-
},
|
|
491
|
-
[
|
|
492
|
-
r(w.FmIcon, {
|
|
493
|
-
name: "info",
|
|
494
|
-
class: "pl-2",
|
|
495
|
-
outline: !0,
|
|
496
|
-
size: "sm"
|
|
497
|
-
})
|
|
498
|
-
]
|
|
499
|
-
) : r("div")
|
|
500
|
-
]),
|
|
501
|
-
r("div", { class: "flex-1" }, a.row.original.ref)
|
|
502
|
-
]);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
], m = k({
|
|
506
|
-
search: "",
|
|
507
|
-
"pf_collectible.type": [],
|
|
508
|
-
"metadata.location": [],
|
|
509
|
-
dateRange: {
|
|
510
|
-
startDate: _().subtract(7, "day").toISOString(),
|
|
511
|
-
endDate: _().endOf("day").toISOString()
|
|
512
|
-
},
|
|
513
|
-
source: []
|
|
514
|
-
}), { tableMeta: x, rowData: g, onSort: C, debouncedFetchData: I, onSearch: e } = ae(async (a) => {
|
|
515
|
-
const t = {
|
|
516
|
-
...m.value,
|
|
517
|
-
user: d.user,
|
|
518
|
-
dateRange: {
|
|
519
|
-
start: new Date(m.value.dateRange.startDate).toISOString(),
|
|
520
|
-
end: new Date(m.value.dateRange.endDate).toISOString()
|
|
521
|
-
}
|
|
522
|
-
}, b = await B.readAll(a, t);
|
|
523
|
-
return {
|
|
524
|
-
resources: b.resources.map((h) => {
|
|
525
|
-
const l = s.value.find((D) => D._id === h.ref);
|
|
526
|
-
return { ...h, ref: (l == null ? void 0 : l.seqNumber) || h.ref };
|
|
527
|
-
}),
|
|
528
|
-
meta: b.meta
|
|
529
|
-
};
|
|
530
|
-
}), s = k([]), f = ye.options.map((a) => ({ label: j(A.getReason(a)), value: a })), p = u.locations.map((a) => ({ label: a.name, value: a._id }));
|
|
531
|
-
W(
|
|
532
|
-
m,
|
|
533
|
-
() => {
|
|
534
|
-
I();
|
|
535
|
-
},
|
|
536
|
-
{ deep: !0 }
|
|
537
|
-
);
|
|
538
|
-
async function y() {
|
|
539
|
-
try {
|
|
540
|
-
c.value = !0;
|
|
541
|
-
const a = {
|
|
542
|
-
...m.value,
|
|
543
|
-
user: d.user,
|
|
544
|
-
dateRange: {
|
|
545
|
-
start: new Date(m.value.dateRange.startDate).toISOString(),
|
|
546
|
-
end: new Date(m.value.dateRange.endDate).toISOString()
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
await se({
|
|
550
|
-
exporter: new Ee(),
|
|
551
|
-
readFunction: (t) => B.readAll(t, a),
|
|
552
|
-
transformRecord: (t) => {
|
|
553
|
-
var b, h, l, D, E, M, N;
|
|
554
|
-
return {
|
|
555
|
-
TransactionID: t._id,
|
|
556
|
-
CreatedAt: _($(t._id.toString())).format(
|
|
557
|
-
"D MMM YYYY, hh:mmA"
|
|
558
|
-
),
|
|
559
|
-
Amount: Q(
|
|
560
|
-
t.expiryAmount.reduce(
|
|
561
|
-
(ie, ce) => ie + ce.amount,
|
|
562
|
-
t.amount ?? 0
|
|
563
|
-
),
|
|
564
|
-
2
|
|
565
|
-
),
|
|
566
|
-
ExpiredAt: (h = (b = t.expiryAmount) == null ? void 0 : b[0]) != null && h.expiredAt ? _((D = (l = t.expiryAmount) == null ? void 0 : l[0]) == null ? void 0 : D.expiredAt).format("D MMM YYYY") : "",
|
|
567
|
-
Type: A.formattedType(t),
|
|
568
|
-
Source: j(A.getReason(t.source)),
|
|
569
|
-
User: ((E = t.pf_user) == null ? void 0 : E.name) || "",
|
|
570
|
-
"Phone No.": ((M = t.pf_user) == null ? void 0 : M.phoneNumber) || "",
|
|
571
|
-
References: t.ref,
|
|
572
|
-
Remark: ((N = t.metadata) == null ? void 0 : N.remark) || ""
|
|
573
|
-
};
|
|
574
|
-
},
|
|
575
|
-
filename: "transactions"
|
|
576
|
-
});
|
|
577
|
-
} catch (a) {
|
|
578
|
-
console.error(a);
|
|
579
|
-
} finally {
|
|
580
|
-
c.value = !1;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return fe(async () => {
|
|
584
|
-
await u.readLocations(), await i.read(), await I();
|
|
585
|
-
}), (a, t) => {
|
|
586
|
-
const b = T("FmSearch"), h = T("FmButton");
|
|
587
|
-
return O(), H("div", null, [
|
|
588
|
-
F("div", Me, [
|
|
589
|
-
v(b, {
|
|
590
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
591
|
-
modelValue: n(m).search,
|
|
592
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) => n(m).search = l),
|
|
593
|
-
placeholder: "Search",
|
|
594
|
-
collapsible: ""
|
|
595
|
-
}, null, 8, ["modelValue"]),
|
|
596
|
-
v(h, {
|
|
597
|
-
icon: "ios_share",
|
|
598
|
-
variant: "tertiary",
|
|
599
|
-
onClick: y
|
|
600
|
-
})
|
|
601
|
-
]),
|
|
602
|
-
F("div", Ne, [
|
|
603
|
-
F("div", Ve, [
|
|
604
|
-
v(q, {
|
|
605
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
606
|
-
"right-icon": "keyboard_arrow_down",
|
|
607
|
-
modelValue: n(m)["metadata.location"],
|
|
608
|
-
"onUpdate:modelValue": t[1] || (t[1] = (l) => n(m)["metadata.location"] = l),
|
|
609
|
-
icon: "storefront",
|
|
610
|
-
"show-item-label": !0,
|
|
611
|
-
items: n(p)
|
|
612
|
-
}, null, 8, ["modelValue", "items"]),
|
|
613
|
-
v(q, {
|
|
614
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
615
|
-
"right-icon": "keyboard_arrow_down",
|
|
616
|
-
modelValue: n(m)["pf_collectible.type"],
|
|
617
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) => n(m)["pf_collectible.type"] = l),
|
|
618
|
-
label: "Type: ",
|
|
619
|
-
"show-item-label": !0,
|
|
620
|
-
items: [
|
|
621
|
-
{ label: "Point", value: "COIN" },
|
|
622
|
-
{ label: "Credit", value: "CREDIT" },
|
|
623
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
624
|
-
{ label: "Experience", value: "POINT" },
|
|
625
|
-
{ label: "Tier", value: "TIER" },
|
|
626
|
-
{ label: "Title", value: "TITLE" },
|
|
627
|
-
{ label: "Game", value: "GAME" },
|
|
628
|
-
{ label: "Stamp", value: "STAMP" }
|
|
629
|
-
]
|
|
630
|
-
}, null, 8, ["modelValue"]),
|
|
631
|
-
v(q, {
|
|
632
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
633
|
-
"right-icon": "keyboard_arrow_down",
|
|
634
|
-
modelValue: n(m).source,
|
|
635
|
-
"onUpdate:modelValue": t[3] || (t[3] = (l) => n(m).source = l),
|
|
636
|
-
label: "Source: ",
|
|
637
|
-
"show-item-label": !0,
|
|
638
|
-
items: n(f)
|
|
639
|
-
}, null, 8, ["modelValue", "items"]),
|
|
640
|
-
v(le, {
|
|
641
|
-
"model-value": {
|
|
642
|
-
startDate: n(m).dateRange.startDate,
|
|
643
|
-
endDate: n(m).dateRange.endDate
|
|
644
|
-
},
|
|
645
|
-
"onUpdate:modelValue": t[4] || (t[4] = (l) => n(m).dateRange = {
|
|
646
|
-
startDate: n(_)(l.startDate).startOf("d").toISOString(),
|
|
647
|
-
endDate: n(_)(l.endDate).endOf("d").toISOString()
|
|
648
|
-
})
|
|
649
|
-
}, null, 8, ["model-value"])
|
|
650
|
-
]),
|
|
651
|
-
v(b, {
|
|
652
|
-
class: "xs:hidden",
|
|
653
|
-
modelValue: n(m).search,
|
|
654
|
-
"onUpdate:modelValue": t[5] || (t[5] = (l) => n(m).search = l),
|
|
655
|
-
placeholder: "Search",
|
|
656
|
-
collapsible: ""
|
|
657
|
-
}, null, 8, ["modelValue"]),
|
|
658
|
-
F("div", Pe, [
|
|
659
|
-
v(h, {
|
|
660
|
-
icon: "ios_share",
|
|
661
|
-
variant: "tertiary",
|
|
662
|
-
onClick: y
|
|
663
|
-
})
|
|
664
|
-
])
|
|
665
|
-
]),
|
|
666
|
-
v(ne, {
|
|
667
|
-
loading: n(x).isLoading,
|
|
668
|
-
"row-data": n(g),
|
|
669
|
-
"row-count": n(x).totalRows,
|
|
670
|
-
"column-defs": R.filter(
|
|
671
|
-
(l) => !d.user || l.header !== "User" && l.header !== "Phone No."
|
|
672
|
-
),
|
|
673
|
-
"page-count": n(x).pageCount,
|
|
674
|
-
"page-index": n(x).pageIndex,
|
|
675
|
-
"page-size": n(x).pageSize,
|
|
676
|
-
"shrink-at": !1,
|
|
677
|
-
onSortChange: n(C),
|
|
678
|
-
onPageChange: t[6] || (t[6] = (l) => n(I)({
|
|
679
|
-
pageSize: l.pageSize,
|
|
680
|
-
pageIndex: l.pageIndex
|
|
681
|
-
}))
|
|
682
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
683
|
-
]);
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
});
|
|
687
|
-
class Ue extends oe {
|
|
688
|
-
}
|
|
689
|
-
const Ye = { class: "flex items-center justify-between" }, $e = { class: "flex gap-8 items-center" }, Be = { class: "flex gap-8 items-center xs:hidden" }, ct = /* @__PURE__ */ z({
|
|
690
|
-
__name: "StoreTransactions",
|
|
691
|
-
props: {
|
|
692
|
-
user: {
|
|
693
|
-
type: String
|
|
694
|
-
}
|
|
695
|
-
},
|
|
696
|
-
setup(o) {
|
|
697
|
-
const u = o, { minor: i } = ve;
|
|
698
|
-
ge();
|
|
699
|
-
const S = [
|
|
700
|
-
{
|
|
701
|
-
header: "Transaction ID",
|
|
702
|
-
meta: {
|
|
703
|
-
maxWidth: "150px"
|
|
704
|
-
},
|
|
705
|
-
cell(e) {
|
|
706
|
-
return r("div", { class: "flex items-center" }, [
|
|
707
|
-
r(w.FmIcon, {
|
|
708
|
-
name: "content_copy",
|
|
709
|
-
outline: !0,
|
|
710
|
-
size: "sm",
|
|
711
|
-
class: "cursor-pointer mr-4 shrink-0",
|
|
712
|
-
onClick: (s) => {
|
|
713
|
-
s.preventDefault(), s.stopPropagation(), te(e.row.original._id.toString());
|
|
714
|
-
}
|
|
715
|
-
}),
|
|
716
|
-
r("div", { class: "truncate" }, e.row.original._id.toString())
|
|
717
|
-
]);
|
|
718
|
-
}
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
header: "Created at",
|
|
722
|
-
accessorFn: (e) => _($(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
723
|
-
enableSorting: !0
|
|
724
|
-
},
|
|
725
|
-
{
|
|
726
|
-
header: "Bundle",
|
|
727
|
-
accessorFn: (e) => e.bundle.name
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
header: "Location",
|
|
731
|
-
accessorFn: (e) => e.location ? e.pf_location.name : "Online Store"
|
|
732
|
-
},
|
|
733
|
-
{
|
|
734
|
-
header: "Payment Type",
|
|
735
|
-
accessorFn: (e) => {
|
|
736
|
-
var s;
|
|
737
|
-
return ((s = e.paymentType) == null ? void 0 : s.type) ?? "N/A";
|
|
738
|
-
},
|
|
739
|
-
cell(e) {
|
|
740
|
-
var s, f;
|
|
741
|
-
return r("div", { class: "flex items-center gap-4" }, [
|
|
742
|
-
r("div", { class: "flex items-center" }, [
|
|
743
|
-
((s = e.row.original.paymentType) == null ? void 0 : s.type) == "ONLINE" && e.row.original.paymentType.extra ? r(
|
|
744
|
-
w.FmTooltip,
|
|
745
|
-
{
|
|
746
|
-
content: e.row.original.paymentType.extra
|
|
747
|
-
},
|
|
748
|
-
[
|
|
749
|
-
r(w.FmIcon, {
|
|
750
|
-
name: "info",
|
|
751
|
-
outline: !0,
|
|
752
|
-
size: "sm"
|
|
753
|
-
})
|
|
754
|
-
]
|
|
755
|
-
) : r("div")
|
|
756
|
-
]),
|
|
757
|
-
r(
|
|
758
|
-
"div",
|
|
759
|
-
{ class: "flex-1" },
|
|
760
|
-
((f = e.row.original.paymentType) == null ? void 0 : f.type) ?? "N/A"
|
|
761
|
-
)
|
|
762
|
-
]);
|
|
763
|
-
}
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
header: "User",
|
|
767
|
-
cell: (e) => re(e.row.original.pf_member)
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
header: "Phone No.",
|
|
771
|
-
accessorFn: (e) => e.pf_member.phoneNumber
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
header: "Status",
|
|
775
|
-
// accessorFn: (u) => u.status,
|
|
776
|
-
cell(e) {
|
|
777
|
-
var s, f, p, y;
|
|
778
|
-
return r("div", { class: "flex items-center" }, [
|
|
779
|
-
r("div", be.title(e.row.original.status)),
|
|
780
|
-
r("div", { class: "flex items-center" }, [
|
|
781
|
-
(f = (s = e.row.original) == null ? void 0 : s.refund) != null && f.reason ? r(
|
|
782
|
-
w.FmTooltip,
|
|
783
|
-
{
|
|
784
|
-
content: (y = (p = e.row.original) == null ? void 0 : p.refund) == null ? void 0 : y.reason
|
|
785
|
-
},
|
|
786
|
-
[
|
|
787
|
-
r(w.FmIcon, {
|
|
788
|
-
name: "info",
|
|
789
|
-
color: "primary",
|
|
790
|
-
outline: !0,
|
|
791
|
-
size: "sm",
|
|
792
|
-
class: "pl-2"
|
|
793
|
-
})
|
|
794
|
-
]
|
|
795
|
-
) : r("div")
|
|
796
|
-
])
|
|
797
|
-
]);
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
header: "Source",
|
|
802
|
-
accessorFn: (e) => e.source
|
|
803
|
-
},
|
|
804
|
-
{
|
|
805
|
-
header: "Ref",
|
|
806
|
-
accessorFn: (e) => e.ref
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
id: "action",
|
|
810
|
-
cell(e) {
|
|
811
|
-
const s = e.row.original, f = s.status === "COMPLETED" && !s.refund;
|
|
812
|
-
return f ? r(
|
|
813
|
-
w.FmMenu,
|
|
814
|
-
{
|
|
815
|
-
placement: "bottom-end",
|
|
816
|
-
onClick: (p) => {
|
|
817
|
-
p.stopPropagation();
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
{
|
|
821
|
-
"menu-button": () => r(w.FmButton, {
|
|
822
|
-
icon: "settings",
|
|
823
|
-
variant: "tertiary",
|
|
824
|
-
if: f
|
|
825
|
-
}),
|
|
826
|
-
default: () => [
|
|
827
|
-
r(w.FmMenuItem, {
|
|
828
|
-
label: "Refund",
|
|
829
|
-
sublabel: "Refund this transaction",
|
|
830
|
-
onClick: async (p) => {
|
|
831
|
-
p.stopPropagation(), await C(s);
|
|
832
|
-
}
|
|
833
|
-
})
|
|
834
|
-
]
|
|
835
|
-
}
|
|
836
|
-
) : r("div");
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
], d = k({
|
|
840
|
-
searchValue: "",
|
|
841
|
-
dateRange: {
|
|
842
|
-
startDate: _().subtract(7, "day").toISOString(),
|
|
843
|
-
endDate: _().toISOString()
|
|
844
|
-
}
|
|
845
|
-
}), { tableMeta: c, rowData: R, onSort: m, debouncedFetchData: x, onSearch: g } = ae(async (e) => {
|
|
846
|
-
const s = {
|
|
847
|
-
...d.value.dateRange,
|
|
848
|
-
user: u.user
|
|
849
|
-
};
|
|
850
|
-
return await B.readStoreTransactions(e, s);
|
|
851
|
-
});
|
|
852
|
-
async function C(e) {
|
|
853
|
-
await he.confirm(
|
|
854
|
-
"Are you sure you want to refund this transaction?",
|
|
855
|
-
"Refund Store Transaction",
|
|
856
|
-
"Confirm",
|
|
857
|
-
"Cancel"
|
|
858
|
-
) && await i(
|
|
859
|
-
async () => {
|
|
860
|
-
var f;
|
|
861
|
-
await Te.refundStoreTransaction({
|
|
862
|
-
id: e._id,
|
|
863
|
-
reason: `ADMIN:${(f = Re().sessionUser) == null ? void 0 : f.name}`
|
|
864
|
-
}), await x();
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
message: "Refunding transaction...",
|
|
868
|
-
successMessage: "Transaction refunded successfully"
|
|
869
|
-
}
|
|
870
|
-
);
|
|
871
|
-
}
|
|
872
|
-
W(
|
|
873
|
-
d,
|
|
874
|
-
() => {
|
|
875
|
-
x();
|
|
876
|
-
},
|
|
877
|
-
{ deep: !0 }
|
|
878
|
-
), G(async () => {
|
|
879
|
-
await x();
|
|
880
|
-
});
|
|
881
|
-
const I = async () => se({
|
|
882
|
-
exporter: new Ue(),
|
|
883
|
-
readFunction: (e) => B.readStoreTransactions(e, {
|
|
884
|
-
...d.value.dateRange,
|
|
885
|
-
user: u.user
|
|
886
|
-
}),
|
|
887
|
-
transformRecord: (e) => {
|
|
888
|
-
var s, f, p, y, a, t;
|
|
889
|
-
return {
|
|
890
|
-
TransactionId: ((s = e._id) == null ? void 0 : s.toString()) || "",
|
|
891
|
-
CreatedAt: _($(e._id.toString())).format(
|
|
892
|
-
"DD/MM/YYYY HH:mm:ss"
|
|
893
|
-
),
|
|
894
|
-
Bundle: e.bundle.name || "",
|
|
895
|
-
Location: e.location ? e.pf_location.name : "Online Store",
|
|
896
|
-
PaymentType: ((f = e.paymentType) == null ? void 0 : f.type) || "N/A",
|
|
897
|
-
PaymentExtra: ((p = e.paymentType) == null ? void 0 : p.extra) || "",
|
|
898
|
-
User: ((y = e.pf_member) == null ? void 0 : y.name) || "",
|
|
899
|
-
PhoneNumber: ((a = e.pf_member) == null ? void 0 : a.phoneNumber) || "",
|
|
900
|
-
Status: e.status || "",
|
|
901
|
-
RefundReason: ((t = e == null ? void 0 : e.refund) == null ? void 0 : t.reason) || ""
|
|
902
|
-
};
|
|
903
|
-
},
|
|
904
|
-
filename: "store-transactions"
|
|
905
|
-
});
|
|
906
|
-
return (e, s) => {
|
|
907
|
-
const f = T("FmSearch"), p = T("FmButton");
|
|
908
|
-
return O(), H("div", null, [
|
|
909
|
-
F("div", Ye, [
|
|
910
|
-
F("div", $e, [
|
|
911
|
-
v(le, {
|
|
912
|
-
modelValue: n(d).dateRange,
|
|
913
|
-
"onUpdate:modelValue": s[0] || (s[0] = (y) => n(d).dateRange = y)
|
|
914
|
-
}, null, 8, ["modelValue"])
|
|
915
|
-
]),
|
|
916
|
-
F("div", Be, [
|
|
917
|
-
v(f, {
|
|
918
|
-
modelValue: n(c).searchValue,
|
|
919
|
-
"onUpdate:modelValue": [
|
|
920
|
-
s[1] || (s[1] = (y) => n(c).searchValue = y),
|
|
921
|
-
n(g)
|
|
922
|
-
],
|
|
923
|
-
placeholder: "Search",
|
|
924
|
-
collapsible: ""
|
|
925
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
926
|
-
v(p, {
|
|
927
|
-
icon: "ios_share",
|
|
928
|
-
variant: "tertiary",
|
|
929
|
-
onClick: I
|
|
930
|
-
})
|
|
931
|
-
])
|
|
932
|
-
]),
|
|
933
|
-
v(ne, {
|
|
934
|
-
loading: n(c).isLoading,
|
|
935
|
-
"row-data": n(R),
|
|
936
|
-
"row-count": n(c).totalRows,
|
|
937
|
-
"column-defs": S.filter(
|
|
938
|
-
(y) => !u.user || y.header !== "User" && y.header !== "Phone No."
|
|
939
|
-
),
|
|
940
|
-
"page-count": n(c).pageCount,
|
|
941
|
-
"page-index": n(c).pageIndex,
|
|
942
|
-
"page-size": n(c).pageSize,
|
|
943
|
-
"shrink-at": !1,
|
|
944
|
-
onSortChange: n(m),
|
|
945
|
-
onPageChange: s[2] || (s[2] = (y) => n(x)({
|
|
946
|
-
pageSize: y.pageSize,
|
|
947
|
-
pageIndex: y.pageIndex
|
|
948
|
-
}))
|
|
949
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
950
|
-
]);
|
|
951
|
-
};
|
|
952
|
-
}
|
|
953
|
-
});
|
|
954
|
-
export {
|
|
955
|
-
it as _,
|
|
956
|
-
ct as a
|
|
957
|
-
};
|