@feedmepos/mf-connect 0.1.98-beta.21 → 0.1.98-beta.22
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-B3f8GWoR.js → App-DkvPrOD_.js} +10 -9
- package/dist/{AuditLogs-LRHzzpqj.js → AuditLogs-CWYsiJmS.js} +9 -9
- package/dist/{Bin-Y761Ua4-.js → Bin-BeuBpKQM.js} +8 -8
- package/dist/{Broadcast-CdRuG42N.js → Broadcast-Dm-HdR4q.js} +13 -12
- package/dist/CampaignAnalytic-DipDONF1.js +1656 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsULDH9l.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4wbIGp6.js} +6 -5
- package/dist/{Card-GZ3ZLnBl.js → Card-i5EhYfDp.js} +18 -18
- package/dist/{Collections-B59fL-oS.js → Collections-B4lpotjz.js} +14 -13
- package/dist/{Credit-DJxzXBam.js → Credit-DbK_BdJJ.js} +119 -93
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C3d8frgZ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-B8Soqc5E.js} +34 -30
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DKUFvacX.js → EffectSheet.vue_vue_type_style_index_0_lang-DzdJH_eS.js} +6 -6
- package/dist/{Experience-lzpvYFPP.js → Experience-W3vkkzi6.js} +112 -86
- package/dist/{FileSaver.min-BXoEv5ve.js → FileSaver.min-BI4NzqgX.js} +1 -1
- package/dist/Game-fftjNIOx.js +356 -0
- package/dist/{Grab-BQgS104D.js → Grab-CMQ8P4g9.js} +32 -31
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Cz9iB9ox.js → ImageInput.vue_vue_type_script_setup_true_lang-DUi11pWY.js} +1 -1
- package/dist/{Index-B5UTBbUy.js → Index-Cnztjepd.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CLLhy4-v.js → LocationPicker.vue_vue_type_script_setup_true_lang-Dy8WW9eT.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BiIqs4zW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DTHvv2lB.js} +1 -1
- package/dist/LoyaltyDashboard-1gKZWq0g.js +1339 -0
- package/dist/{MainLayout-AvQ4_-oT.js → MainLayout-CfKJ6l-r.js} +1 -1
- package/dist/{Marketing-Bn1ygF8d.js → Marketing-Dk_nSJuC.js} +4 -4
- package/dist/{MarketingMaterialEdit-Cw-VPVqE.js → MarketingMaterialEdit-DnO9DNuB.js} +6 -6
- package/dist/{Member-CpEXFHIF.js → Member-CpXKw34e.js} +11 -11
- package/dist/{MemberList-gSEw_idJ.js → MemberList-8ppDIsaQ.js} +36 -35
- package/dist/{MemberTransactions-DEMzj9-y.js → MemberTransactions-B52DV6hR.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B4Y5KPpw.js → MessageInput.vue_vue_type_script_setup_true_lang-Di0tBK7t.js} +4400 -4431
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-B1Yj3odA.js +38 -0
- package/dist/Mission-dT284_xH.js +360 -0
- package/dist/{Overview-CMudFYOc.js → Overview-CUXmQ5AN.js} +3 -3
- package/dist/{Overview-DjNcF88f.js → Overview-CePgs6nV.js} +18 -18
- package/dist/Point-BLr01-Fi.js +288 -0
- package/dist/Promotion-BJUWwJir.js +423 -0
- package/dist/{Queue-BjoAJoVe.js → Queue-DpjzPA9X.js} +16 -16
- package/dist/{Record-CfZFuwy_.js → Record-D5iz3VhQ.js} +9 -9
- package/dist/{Review-pIAxbjVU.js → Review-BIDSfZ-d.js} +2 -2
- package/dist/{ReviewFacebookCallback-BRW4T-5-.js → ReviewFacebookCallback-Cl4apd5U.js} +5 -5
- package/dist/{ReviewGoogleCallback-B-6EojXR.js → ReviewGoogleCallback-CxQ3jv5Z.js} +5 -5
- package/dist/{Reward-_pdE2XZp.js → Reward-FhUo0v2c.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-S5dh0IGc.js → RewardGroup.vue_vue_type_script_setup_true_lang-9Fdl4-Zk.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-C9B7NmF0.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bh1rez91.js} +16 -15
- package/dist/{Segment-B1EMe-LZ.js → Segment-XrwahyNZ.js} +39 -37
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DAmjk8b3.js → SelectItems.vue_vue_type_script_setup_true_lang-Bd_O16Eo.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7sgPf8l.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CB0bY0pg.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVYTZr_E.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B1-fwLJq.js} +4 -4
- package/dist/{Setting-CQQ6zacB.js → Setting-Cs5abyWq.js} +40 -40
- package/dist/{SettingAdvertisements-9Wl9VWbM.js → SettingAdvertisements-C0NbeiB9.js} +12 -12
- package/dist/{Settings-Bvj2ChDR.js → Settings-xdy_sV8_.js} +5 -5
- package/dist/{Store-BdUZ22g6.js → Store-BVn4DGJN.js} +21 -21
- package/dist/{StoreRewards-DsUS_Lu1.js → StoreRewards-BnEDugiP.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Zw-lIDCN.js → StoreTransactions.vue_vue_type_script_setup_true_lang-B63UqQ0d.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BECp3eqQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BOIUqr5c.js} +2 -2
- package/dist/{Tier-2-mJ3SNK.js → Tier-BdyyZ6S8.js} +36 -34
- package/dist/{Title-BjeEDjxl.js → Title-Y7GfS9n5.js} +39 -37
- package/dist/{Transaction--U_kJKec.js → Transaction-DF217QY1.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BkLyvjA5.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-QrbU0JEl.js} +6 -6
- package/dist/{Voucher-INa3N_6V.js → Voucher-q9JMtbmK.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-4Quzmc7-.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Cm040eE9.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CPCnBExY.js → ZodTextField.vue_vue_type_script_setup_true_lang-DibJzz40.js} +2 -2
- package/dist/{app-Dlqr-LX4.js → app-BZJkvDm7.js} +3279 -3135
- package/dist/app.js +1 -1
- package/dist/{business-DWrfGEe_.js → business-akMhlJ-M.js} +1 -1
- package/dist/{campaign-DtNt-BqN.js → campaign-BDXIKhhi.js} +74 -96
- package/dist/campaign-hm_reShF.js +100 -0
- package/dist/{campaign.enum-B9-ZpK0C.js → campaign.enum-Dx-Zo68Q.js} +1 -1
- package/dist/{campaign.fn-COxaWmi_.js → campaign.fn-BFI2Flc_.js} +126 -126
- package/dist/{collectible.enum-CF0VF-r7.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/collection.fn-RUGxb2Zd.js +26 -0
- package/dist/{duplicateCampaign-8ciT68QF.js → duplicateCampaign-DsGtbLbP.js} +2 -2
- package/dist/{effect-CaSn-84h.js → effect-8iyz8Uq4.js} +1 -1
- package/dist/{email-addresses-BiMQ8xIx.js → email-addresses-gyl-C-R_.js} +2 -2
- package/dist/{export-BwBNgCo5.js → export-wupBk3du.js} +3 -3
- package/dist/{helper-CajV_0CM.js → helper-CaxDAXPt.js} +1 -1
- package/dist/{index-CQIciFrH.js → index-BMin5EVt.js} +1 -1
- package/dist/{index-CQj9BQlQ.js → index-BO9SkdZr.js} +105 -123
- package/dist/index-BOcaalDh.js +146 -0
- package/dist/{index-B6ldAC8Y.js → index-BQmxPtoj.js} +1 -1
- package/dist/{index-B6tm_U_M.js → index-Bic6MeUk.js} +18 -17
- package/dist/{index-D1vhLY7l.js → index-C4drX0Ls.js} +1 -1
- package/dist/index-C8cXXcLk.js +45 -0
- package/dist/{index-DBUTFa2h.js → index-CG66mIC4.js} +2 -2
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-Bqcfsd4p.js → index-Cw-UC5sx.js} +8 -7
- package/dist/{index-D1--K-QL.js → index-D4BfoKjK.js} +1 -1
- package/dist/{index-DWBKko92.js → index-DhQlBP7P.js} +6 -6
- package/dist/{index-J8pSZ3WO.js → index-Dvf0YXyw.js} +1 -1
- package/dist/{index-BP5rdioN.js → index-J3y4ZPL5.js} +8027 -10766
- package/dist/{index-CjW6Mj-1.js → index-bZhlsMWI.js} +1 -1
- package/dist/{index-B0ohh62P.js → index-xGCLj50g.js} +230 -351
- package/dist/{index-D90p28Hr.js → index-yYZu6iPh.js} +205 -229
- package/dist/{index.esm2017-QlPanYiW.js → index.esm2017-DgAjf49-.js} +1 -1
- package/dist/{loading-CqqkzWSm.js → loading-DIme5B41.js} +1 -1
- package/dist/{lodash-DmbW2QhA.js → lodash-ssnk3xgl.js} +1 -1
- package/dist/{membership-Dcwyu-rr.js → membership-CNHGvM-v.js} +3 -3
- package/dist/{money-DWr1gi--.js → money-CxE1yyP-.js} +1 -1
- package/dist/{number-CHhHAd1q.js → number-MuiSu5EH.js} +1 -1
- package/dist/{objectid-BsiuHVH8.js → objectid-BKst2tcL.js} +9 -9
- package/dist/{plugins-BxmMI8fo.js → plugins-J8P61v6q.js} +3 -3
- package/dist/{reward-DX0FjsNT.js → reward-CvyDLx6u.js} +1 -1
- package/dist/{rule-DDLcqiHH.js → rule-CidUfHRV.js} +3 -3
- package/dist/rule-builder-CzSwZHFX.js +126 -0
- package/dist/{template-C0lF82yv.js → template-DDFGgRca.js} +6 -6
- package/dist/timezone-C55-EXUa.js +20 -0
- package/dist/{trigger-CsJcg_RY.js → trigger-BHmznST2.js} +5 -5
- package/dist/{useMarketingMaterialActions-B0iV6YzB.js → useMarketingMaterialActions-CRGy07Kl.js} +3 -3
- package/dist/{usePagination-4EISkyGW.js → usePagination-nKd3ToBL.js} +1 -1
- package/dist/{user-DZuSeqRY.js → user-CxxLM4oI.js} +1 -1
- package/dist/{vue-i18n-BKcwYlp1.js → vue-i18n-BIqCnVyc.js} +300 -300
- package/dist/{xlsx-C-7dia55.js → xlsx-CUqEhJg1.js} +1 -1
- package/dist/{zod-DPxXVSRw.js → zod-B3g-tD-1.js} +1 -1
- package/package.json +1 -1
- package/dist/Game-KCxIpXEC.js +0 -330
- package/dist/LoyaltyDashboard-DPHWpaNJ.js +0 -1082
- package/dist/Mission-DMtpauNQ.js +0 -334
- package/dist/Point-CgdTrgXc.js +0 -262
- package/dist/Promotion-DDQodFDb.js +0 -397
- package/dist/campaign-un9Ji1KF.js +0 -219
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as w, resolveComponent as d, openBlock as f, createBlock as S, unref as a, isRef as te, withCtx as k, createElementVNode as i, createVNode as c, computed as ne, h as I, onMounted as ae, createElementBlock as L, Fragment as B, renderList as se, resolveDynamicComponent as ie, toDisplayString as h } from "vue";
|
|
2
|
-
import { _ as re } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as le, components as N } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as $ } from "./plugins-BxmMI8fo.js";
|
|
5
|
-
import { u as ce } from "./loading-CqqkzWSm.js";
|
|
6
|
-
import { u as me } from "./business-DWrfGEe_.js";
|
|
7
|
-
import { c as y, u as ue } from "./campaign-un9Ji1KF.js";
|
|
8
|
-
import { u as de } from "./vue-i18n-BKcwYlp1.js";
|
|
9
|
-
import { g as j, a as pe, b as q } from "./campaign-DtNt-BqN.js";
|
|
10
|
-
import { c as fe, p as ye } from "./duplicateCampaign-8ciT68QF.js";
|
|
11
|
-
import { e as K } from "./effect-CaSn-84h.js";
|
|
12
|
-
import { c as U } from "./string-Gcy5IM_H.js";
|
|
13
|
-
import { _ as ge } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C3d8frgZ.js";
|
|
14
|
-
import { u as he } from "./template-C0lF82yv.js";
|
|
15
|
-
import { _ as E } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
16
|
-
const _e = { class: "space-y-8" }, be = /* @__PURE__ */ Q({
|
|
17
|
-
__name: "QueueSheet",
|
|
18
|
-
emits: ["update:model-value"],
|
|
19
|
-
setup(H, { expose: n, emit: R }) {
|
|
20
|
-
const p = w(!1), _ = w([]);
|
|
21
|
-
async function P() {
|
|
22
|
-
p.value = !0;
|
|
23
|
-
const r = await y.getPromotionQueue();
|
|
24
|
-
console.log(r, "jobs"), _.value = r;
|
|
25
|
-
}
|
|
26
|
-
const v = [
|
|
27
|
-
{
|
|
28
|
-
header: "Started At",
|
|
29
|
-
accessorFn: (r) => r.createdAt,
|
|
30
|
-
enableSorting: !0
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
header: "Campaigns",
|
|
34
|
-
accessorFn: (r) => r.campaigns
|
|
35
|
-
// cell(props) {
|
|
36
|
-
// const r = props.row.original;
|
|
37
|
-
// return h('div', {
|
|
38
|
-
// innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
|
|
39
|
-
// });
|
|
40
|
-
// },
|
|
41
|
-
}
|
|
42
|
-
];
|
|
43
|
-
return n({
|
|
44
|
-
showSheet: P
|
|
45
|
-
}), (r, u) => {
|
|
46
|
-
const b = d("FmTable"), T = d("FmSideSheet");
|
|
47
|
-
return f(), S(T, {
|
|
48
|
-
"max-width": 550,
|
|
49
|
-
header: "Promotion Sync Queue",
|
|
50
|
-
modelValue: a(p),
|
|
51
|
-
"onUpdate:modelValue": [
|
|
52
|
-
u[1] || (u[1] = (s) => te(p) ? p.value = s : null),
|
|
53
|
-
u[2] || (u[2] = (s) => p.value = s)
|
|
54
|
-
]
|
|
55
|
-
}, {
|
|
56
|
-
default: k(() => [
|
|
57
|
-
i("div", _e, [
|
|
58
|
-
u[3] || (u[3] = i("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
|
|
59
|
-
c(b, {
|
|
60
|
-
modelValue: r.tableRef,
|
|
61
|
-
"onUpdate:modelValue": u[0] || (u[0] = (s) => r.tableRef = s),
|
|
62
|
-
"column-filter": r.jobFilters,
|
|
63
|
-
"column-defs": v,
|
|
64
|
-
"row-data": a(_),
|
|
65
|
-
"hide-footer": a(_).length <= 10
|
|
66
|
-
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
|
|
67
|
-
])
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
}, 8, ["modelValue"]);
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}), we = { class: "px-24 flex flex-col gap-y-16" }, ve = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, xe = { class: "space-y-8" }, Fe = { class: "flex w-full gap-4 items-center" }, Se = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "flex items-center gap-8" }, Oe = { class: "flex flex-col gap-16 text-center" }, Ie = { class: "fm-typo-en-title-sm-800" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = /* @__PURE__ */ Q({
|
|
74
|
-
__name: "Promotion",
|
|
75
|
-
setup(H) {
|
|
76
|
-
const { t: n } = de(), R = {
|
|
77
|
-
label: n("connect.promotion.createCampaign"),
|
|
78
|
-
value: "create",
|
|
79
|
-
isPrimary: !0,
|
|
80
|
-
prependIcon: "add"
|
|
81
|
-
}, p = {
|
|
82
|
-
label: "Force sync",
|
|
83
|
-
value: "sync",
|
|
84
|
-
isPrimary: !1,
|
|
85
|
-
prependIcon: "refresh"
|
|
86
|
-
}, _ = {
|
|
87
|
-
label: "Queue",
|
|
88
|
-
value: "queue",
|
|
89
|
-
isPrimary: !1,
|
|
90
|
-
prependIcon: "work_history"
|
|
91
|
-
}, P = he("PROMOTION", le()), v = me(), r = ue(), { global: u, minor: b } = ce, T = [
|
|
92
|
-
{
|
|
93
|
-
label: "Bill promotion",
|
|
94
|
-
value: "BILL"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: "Item promotion",
|
|
98
|
-
value: "ITEM"
|
|
99
|
-
}
|
|
100
|
-
], s = w({
|
|
101
|
-
searchKey: "",
|
|
102
|
-
location: [],
|
|
103
|
-
effectType: []
|
|
104
|
-
});
|
|
105
|
-
function z(e) {
|
|
106
|
-
const o = s.value.location;
|
|
107
|
-
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((m) => {
|
|
108
|
-
var l;
|
|
109
|
-
return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(m);
|
|
110
|
-
}) : e.targetLocation.includes(o);
|
|
111
|
-
}
|
|
112
|
-
function G(e) {
|
|
113
|
-
var l, x;
|
|
114
|
-
const o = s.value.effectType;
|
|
115
|
-
if (!o || o.length === 0) return !0;
|
|
116
|
-
const m = (x = (l = e.effect) == null ? void 0 : l.options) == null ? void 0 : x.target;
|
|
117
|
-
return o.includes(m);
|
|
118
|
-
}
|
|
119
|
-
const g = ne(
|
|
120
|
-
() => r.campaigns.promotion.filter(
|
|
121
|
-
(e) => z(e) && G(e)
|
|
122
|
-
)
|
|
123
|
-
), J = [
|
|
124
|
-
{
|
|
125
|
-
header: n("connect.promotion.promotionTitle"),
|
|
126
|
-
accessorFn: (e) => e.name
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
header: n("connect.promotion.campaignDate"),
|
|
130
|
-
accessorFn: (e) => j(e)
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
header: n("connect.promotion.status"),
|
|
134
|
-
accessorFn: (e) => pe(e),
|
|
135
|
-
cell(e) {
|
|
136
|
-
return q(e.row.original);
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
header: n("connect.promotion.type"),
|
|
141
|
-
accessorFn: (e) => `${U.title(e.effect.options.target)} promotion`
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
header: n("connect.promotion.summary"),
|
|
145
|
-
accessorFn: (e) => K(e.effect)
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
header: n("connect.promotion.actions"),
|
|
149
|
-
cell(e) {
|
|
150
|
-
return I("div", { class: "flex items-center gap-8 justify-end" }, [
|
|
151
|
-
I(N.FmButton, {
|
|
152
|
-
variant: "tertiary",
|
|
153
|
-
icon: "content_copy",
|
|
154
|
-
iconColor: "neutral-gray-400",
|
|
155
|
-
onClick: async (o) => {
|
|
156
|
-
o.stopPropagation(), await M(e.row.original);
|
|
157
|
-
}
|
|
158
|
-
}),
|
|
159
|
-
I(N.FmButton, {
|
|
160
|
-
variant: "tertiary",
|
|
161
|
-
icon: "delete",
|
|
162
|
-
iconColor: "neutral-gray-400",
|
|
163
|
-
onClick: (o) => {
|
|
164
|
-
o.stopPropagation(), D(e.row.original);
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
]);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
], V = w(), A = w();
|
|
171
|
-
async function D(e) {
|
|
172
|
-
await $.remove(
|
|
173
|
-
n("connect.promotion.confirmRemove", { name: e.name })
|
|
174
|
-
) && await b(
|
|
175
|
-
async () => {
|
|
176
|
-
await y.delete(e._id), await r.read("PROMOTION");
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
message: n("connect.promotion.removing", { name: e.name }),
|
|
180
|
-
successMessage: n("connect.promotion.removedSuccessfully", {
|
|
181
|
-
name: e.name
|
|
182
|
-
})
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
async function C(e) {
|
|
187
|
-
e ? await o() : P.open(async (m) => {
|
|
188
|
-
await o(m);
|
|
189
|
-
});
|
|
190
|
-
async function o(m) {
|
|
191
|
-
var l;
|
|
192
|
-
(l = V.value) == null || l.showSheet(
|
|
193
|
-
!0,
|
|
194
|
-
"PROMOTION",
|
|
195
|
-
e ? await y.readById(e._id) : void 0,
|
|
196
|
-
m
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
async function M(e) {
|
|
201
|
-
var l;
|
|
202
|
-
if (!await fe(e.name))
|
|
203
|
-
return;
|
|
204
|
-
const o = await y.readById(e._id), m = ye(o);
|
|
205
|
-
(l = V.value) == null || l.showSheet(
|
|
206
|
-
!0,
|
|
207
|
-
"PROMOTION",
|
|
208
|
-
m,
|
|
209
|
-
o.template
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
async function W(e) {
|
|
213
|
-
await b(
|
|
214
|
-
async () => {
|
|
215
|
-
e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await r.read("PROMOTION");
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
message: n(
|
|
219
|
-
e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
|
|
220
|
-
),
|
|
221
|
-
successMessage: n(
|
|
222
|
-
e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
|
|
223
|
-
)
|
|
224
|
-
}
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
async function X(e) {
|
|
228
|
-
var o;
|
|
229
|
-
switch (e) {
|
|
230
|
-
case "create":
|
|
231
|
-
C();
|
|
232
|
-
break;
|
|
233
|
-
case "sync":
|
|
234
|
-
await $.confirm(
|
|
235
|
-
"Are you sure you want to synchronize all promotions to POS?",
|
|
236
|
-
"Force sync"
|
|
237
|
-
) && b(
|
|
238
|
-
async () => {
|
|
239
|
-
await y.syncAllPromotion();
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
message: "Syncing promotions...",
|
|
243
|
-
successMessage: "All promotions synced"
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
break;
|
|
247
|
-
case "queue":
|
|
248
|
-
(o = A.value) == null || o.showSheet();
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return ae(async () => {
|
|
253
|
-
await u(async () => {
|
|
254
|
-
await v.readLocations(), await r.read("PROMOTION");
|
|
255
|
-
});
|
|
256
|
-
}), (e, o) => {
|
|
257
|
-
const m = d("FmPageHead"), l = d("FmSearch"), x = d("FmTable"), Y = d("FmChip"), O = d("FmButton"), Z = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
|
|
258
|
-
return f(), L(B, null, [
|
|
259
|
-
c(m, {
|
|
260
|
-
title: a(n)("connect.promotion.title"),
|
|
261
|
-
actions: a(g).length > 0 ? [R, p, _] : [],
|
|
262
|
-
"onClick:action": X
|
|
263
|
-
}, null, 8, ["title", "actions"]),
|
|
264
|
-
i("div", we, [
|
|
265
|
-
c(l, {
|
|
266
|
-
modelValue: s.value.searchKey,
|
|
267
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
|
|
268
|
-
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
269
|
-
placeholder: a(n)("connect.promotion.search"),
|
|
270
|
-
collapsible: ""
|
|
271
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
272
|
-
a(g) && a(g).length > 0 ? (f(), L(B, { key: 0 }, [
|
|
273
|
-
i("div", ve, [
|
|
274
|
-
i("div", Ce, [
|
|
275
|
-
c(E, {
|
|
276
|
-
label: `${a(n)("connect.common.location")}: `,
|
|
277
|
-
"right-icon": "keyboard_arrow_down",
|
|
278
|
-
modelValue: s.value.location,
|
|
279
|
-
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
|
|
280
|
-
icon: "storefront",
|
|
281
|
-
"show-item-label": !0,
|
|
282
|
-
items: a(v).locationOptions
|
|
283
|
-
}, null, 8, ["label", "modelValue", "items"]),
|
|
284
|
-
c(E, {
|
|
285
|
-
label: "Type:",
|
|
286
|
-
"right-icon": "keyboard_arrow_down",
|
|
287
|
-
modelValue: s.value.effectType,
|
|
288
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
|
|
289
|
-
icon: "filter_list",
|
|
290
|
-
"show-item-label": !0,
|
|
291
|
-
items: T
|
|
292
|
-
}, null, 8, ["modelValue"])
|
|
293
|
-
]),
|
|
294
|
-
c(l, {
|
|
295
|
-
modelValue: s.value.searchKey,
|
|
296
|
-
"onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
|
|
297
|
-
class: "xs:hidden sm:hidden",
|
|
298
|
-
placeholder: "search",
|
|
299
|
-
collapsible: ""
|
|
300
|
-
}, null, 8, ["modelValue"])
|
|
301
|
-
]),
|
|
302
|
-
c(x, {
|
|
303
|
-
class: "xs:hidden sm:hidden",
|
|
304
|
-
"row-data": a(g),
|
|
305
|
-
"column-defs": J,
|
|
306
|
-
"search-value": s.value.searchKey,
|
|
307
|
-
"column-filter": [],
|
|
308
|
-
onRowClick: o[4] || (o[4] = (t) => C(t.original)),
|
|
309
|
-
"hide-footer": a(g).length < 10
|
|
310
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
311
|
-
c(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
312
|
-
default: k(() => [
|
|
313
|
-
(f(!0), L(B, null, se(a(g).filter(
|
|
314
|
-
(t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
|
|
315
|
-
), (t) => (f(), S(Z, {
|
|
316
|
-
key: t._id.toString(),
|
|
317
|
-
onClick: (F) => C(t),
|
|
318
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
319
|
-
}, {
|
|
320
|
-
default: k(() => [
|
|
321
|
-
i("div", xe, [
|
|
322
|
-
i("div", Fe, [
|
|
323
|
-
(f(), S(ie(a(q)(t)))),
|
|
324
|
-
c(Y, {
|
|
325
|
-
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
326
|
-
compact: !0,
|
|
327
|
-
label: `${a(U).title(t.effect.options.target)} promotion`
|
|
328
|
-
}, null, 8, ["label"])
|
|
329
|
-
]),
|
|
330
|
-
i("div", Se, [
|
|
331
|
-
i("div", ke, h(t.name), 1),
|
|
332
|
-
i("div", Pe, h(a(K)(t.effect)), 1),
|
|
333
|
-
i("div", Te, h(a(n)("connect.promotion.campaignDate")) + ": " + h(a(j)(t)), 1)
|
|
334
|
-
])
|
|
335
|
-
]),
|
|
336
|
-
i("div", Ve, [
|
|
337
|
-
c(O, {
|
|
338
|
-
icon: "content_copy",
|
|
339
|
-
"icon-color": "neutral-gray-400",
|
|
340
|
-
variant: "tertiary",
|
|
341
|
-
onClick: async (F) => {
|
|
342
|
-
F.stopPropagation(), await M(t);
|
|
343
|
-
}
|
|
344
|
-
}, null, 8, ["onClick"]),
|
|
345
|
-
c(O, {
|
|
346
|
-
icon: "delete",
|
|
347
|
-
"icon-color": "neutral-gray-400",
|
|
348
|
-
variant: "tertiary",
|
|
349
|
-
onClick: (F) => (F.stopPropagation(), D(t))
|
|
350
|
-
}, null, 8, ["onClick"])
|
|
351
|
-
])
|
|
352
|
-
]),
|
|
353
|
-
_: 2
|
|
354
|
-
}, 1032, ["onClick"]))), 128))
|
|
355
|
-
]),
|
|
356
|
-
_: 1
|
|
357
|
-
})
|
|
358
|
-
], 64)) : (f(), S(oe, {
|
|
359
|
-
key: 1,
|
|
360
|
-
variant: "outlined",
|
|
361
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
362
|
-
}, {
|
|
363
|
-
default: k(() => [
|
|
364
|
-
o[6] || (o[6] = i("img", {
|
|
365
|
-
src: re,
|
|
366
|
-
class: "aspect-square w-[150px]"
|
|
367
|
-
}, null, -1)),
|
|
368
|
-
i("div", Oe, [
|
|
369
|
-
i("div", Ie, h(a(n)("connect.promotion.createPromotionCampaign")), 1),
|
|
370
|
-
i("div", Le, h(a(n)("connect.promotion.description")), 1)
|
|
371
|
-
]),
|
|
372
|
-
c(O, {
|
|
373
|
-
variant: "primary",
|
|
374
|
-
label: a(n)("connect.promotion.createPromotionCampaign"),
|
|
375
|
-
icon: "add",
|
|
376
|
-
onClick: o[5] || (o[5] = (t) => C())
|
|
377
|
-
}, null, 8, ["label"])
|
|
378
|
-
]),
|
|
379
|
-
_: 1
|
|
380
|
-
}))
|
|
381
|
-
]),
|
|
382
|
-
c(ge, {
|
|
383
|
-
ref_key: "sheetRef",
|
|
384
|
-
ref: V,
|
|
385
|
-
"onSubmit:modelValue": W
|
|
386
|
-
}, null, 512),
|
|
387
|
-
c(be, {
|
|
388
|
-
ref_key: "queueSheetRef",
|
|
389
|
-
ref: A
|
|
390
|
-
}, null, 512)
|
|
391
|
-
], 64);
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
export {
|
|
396
|
-
Ge as default
|
|
397
|
-
};
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { defineStore as w } from "pinia";
|
|
2
|
-
import { reactive as I, onMounted as b, ref as o } from "vue";
|
|
3
|
-
import { g as a, S as l, b as d } from "./index-DBUTFa2h.js";
|
|
4
|
-
const s = () => {
|
|
5
|
-
const e = l.getBusinessId();
|
|
6
|
-
if (!e) throw new Error("Invalid business ID");
|
|
7
|
-
return d(`businesses/${e}/campaigns`, {
|
|
8
|
-
// url: 'http://localhost:3000/portal/',
|
|
9
|
-
});
|
|
10
|
-
}, u = {
|
|
11
|
-
async readAllGrouped(e) {
|
|
12
|
-
const t = a(
|
|
13
|
-
await s().get("grouped", { params: e })
|
|
14
|
-
);
|
|
15
|
-
return {
|
|
16
|
-
meta: t.meta,
|
|
17
|
-
resources: t.resources
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
async readAll(e, t) {
|
|
21
|
-
const n = a(
|
|
22
|
-
await s().get("", {
|
|
23
|
-
params: { ...e, ...t }
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
return {
|
|
27
|
-
meta: n.meta,
|
|
28
|
-
resources: n.resources
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
async readById(e) {
|
|
32
|
-
return a(await s().get(`/${e}`));
|
|
33
|
-
},
|
|
34
|
-
async create(e) {
|
|
35
|
-
return a(await s().post("", e));
|
|
36
|
-
},
|
|
37
|
-
async update(e, t) {
|
|
38
|
-
return a(await s().put(e, t));
|
|
39
|
-
},
|
|
40
|
-
async delete(e) {
|
|
41
|
-
return a(await s().delete(e));
|
|
42
|
-
},
|
|
43
|
-
async readCollectionsByCampaignId(e, t) {
|
|
44
|
-
const n = a(
|
|
45
|
-
await s().get(`/${e}/collections`, {
|
|
46
|
-
params: t
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
return {
|
|
50
|
-
meta: n.meta,
|
|
51
|
-
resources: n.resources
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
async readTransactions(e) {
|
|
55
|
-
return a(
|
|
56
|
-
await s().get(
|
|
57
|
-
`/${e}/collections/transactions`
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
},
|
|
61
|
-
async createCollectionByCampaignId(e, t) {
|
|
62
|
-
return a(
|
|
63
|
-
await s().post(`/${e}/collections`, t)
|
|
64
|
-
);
|
|
65
|
-
},
|
|
66
|
-
async readGroups() {
|
|
67
|
-
return a(await s().get("/groups")) ?? [];
|
|
68
|
-
},
|
|
69
|
-
async readStats(e) {
|
|
70
|
-
return a(
|
|
71
|
-
await s().get("/stats", { params: e })
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
async createGroup(e) {
|
|
75
|
-
return a(await s().post("/groups", e));
|
|
76
|
-
},
|
|
77
|
-
async updateGroup(e, t) {
|
|
78
|
-
return a(
|
|
79
|
-
await s().put(`/groups/${e}`, t)
|
|
80
|
-
);
|
|
81
|
-
},
|
|
82
|
-
async deleteGroup(e) {
|
|
83
|
-
return a(await s().delete(`/groups/${e}`));
|
|
84
|
-
},
|
|
85
|
-
async sendCollection(e, t) {
|
|
86
|
-
return a(
|
|
87
|
-
await s().post(
|
|
88
|
-
`/${e}/collections/send`,
|
|
89
|
-
t
|
|
90
|
-
)
|
|
91
|
-
);
|
|
92
|
-
},
|
|
93
|
-
async sendStamp(e, t) {
|
|
94
|
-
return a(
|
|
95
|
-
await s().post(
|
|
96
|
-
`/${e}/collections/send-stamp`,
|
|
97
|
-
t
|
|
98
|
-
)
|
|
99
|
-
);
|
|
100
|
-
},
|
|
101
|
-
async syncAllPromotion() {
|
|
102
|
-
return a(await s().post("/promotion/sync"));
|
|
103
|
-
},
|
|
104
|
-
async readAllDeleted(e, t) {
|
|
105
|
-
const n = a(
|
|
106
|
-
await s().get("/bin", {
|
|
107
|
-
params: { ...e, ...t }
|
|
108
|
-
})
|
|
109
|
-
);
|
|
110
|
-
return {
|
|
111
|
-
meta: n.meta,
|
|
112
|
-
resources: n.resources
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
async restore(e) {
|
|
116
|
-
return a(
|
|
117
|
-
await s().post(`/${e}/restore`)
|
|
118
|
-
);
|
|
119
|
-
},
|
|
120
|
-
async getPromotionQueue() {
|
|
121
|
-
return a(await s().get("/promotion/queue"));
|
|
122
|
-
}
|
|
123
|
-
}, p = () => {
|
|
124
|
-
const e = l.getBusinessId();
|
|
125
|
-
if (!e) throw new Error("Invalid business ID");
|
|
126
|
-
return d(`businesses/${e}/campaigns`, {
|
|
127
|
-
noIdRequired: !0
|
|
128
|
-
});
|
|
129
|
-
}, f = {
|
|
130
|
-
async readAll() {
|
|
131
|
-
return a(await p().get("templates"));
|
|
132
|
-
},
|
|
133
|
-
async readById(e) {
|
|
134
|
-
return a(
|
|
135
|
-
await p().get(`templates/${e}`)
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
}, E = w("mf-connect-campaign", () => {
|
|
139
|
-
const e = I({
|
|
140
|
-
promotion: [],
|
|
141
|
-
voucher: [],
|
|
142
|
-
broadcast: [],
|
|
143
|
-
experience: [],
|
|
144
|
-
point: [],
|
|
145
|
-
credit: [],
|
|
146
|
-
token: [],
|
|
147
|
-
mission: [],
|
|
148
|
-
grab: [],
|
|
149
|
-
all: []
|
|
150
|
-
});
|
|
151
|
-
b(() => {
|
|
152
|
-
console.log("🔧 CampaignStore Installed");
|
|
153
|
-
});
|
|
154
|
-
const t = o([]), n = o([]), c = o([]);
|
|
155
|
-
async function m(h) {
|
|
156
|
-
const i = await u.readAll({
|
|
157
|
-
limit: 1e3,
|
|
158
|
-
skip: 0,
|
|
159
|
-
sortBy: "_id",
|
|
160
|
-
descending: !0
|
|
161
|
-
});
|
|
162
|
-
Object.keys(e).forEach((r) => {
|
|
163
|
-
e[r] = [];
|
|
164
|
-
}), e.all = i.resources.filter(
|
|
165
|
-
(r) => r.type !== "MEMBERSHIP"
|
|
166
|
-
);
|
|
167
|
-
for (const r of i.resources)
|
|
168
|
-
switch (r.type) {
|
|
169
|
-
case "PROMOTION":
|
|
170
|
-
e.promotion.push(r);
|
|
171
|
-
break;
|
|
172
|
-
case "VOUCHER":
|
|
173
|
-
e.voucher.push(r), c.value.push(r);
|
|
174
|
-
break;
|
|
175
|
-
case "BROADCAST":
|
|
176
|
-
["SCHEDULE", "FEEDBACK"].includes(r.event.type) && e.broadcast.push(r);
|
|
177
|
-
break;
|
|
178
|
-
case "POINT":
|
|
179
|
-
e.experience.push(r);
|
|
180
|
-
break;
|
|
181
|
-
case "COIN":
|
|
182
|
-
e.point.push(r);
|
|
183
|
-
break;
|
|
184
|
-
case "CREDIT":
|
|
185
|
-
e.credit.push(r);
|
|
186
|
-
break;
|
|
187
|
-
case "GAME":
|
|
188
|
-
e.token.push(r);
|
|
189
|
-
break;
|
|
190
|
-
case "MISSION":
|
|
191
|
-
e.mission.push(r);
|
|
192
|
-
break;
|
|
193
|
-
case "GRAB":
|
|
194
|
-
e.grab.push(r);
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async function g() {
|
|
199
|
-
n.value = await u.readGroups();
|
|
200
|
-
}
|
|
201
|
-
async function y() {
|
|
202
|
-
t.value = await f.readAll();
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
// State
|
|
206
|
-
campaigns: e,
|
|
207
|
-
templates: t,
|
|
208
|
-
groups: n,
|
|
209
|
-
voucher: c,
|
|
210
|
-
// Actions
|
|
211
|
-
read: m,
|
|
212
|
-
readGroups: g,
|
|
213
|
-
readTemplates: y
|
|
214
|
-
};
|
|
215
|
-
});
|
|
216
|
-
export {
|
|
217
|
-
u as c,
|
|
218
|
-
E as u
|
|
219
|
-
};
|