@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-DEQUEGlq.js +427 -0
- package/dist/{App-DalxIjTu.js → App-CcoU2SAx.js} +445 -420
- package/dist/AuditLogs-CiB6u06w.js +1886 -0
- package/dist/Bin-C2_1m5RT.js +166 -0
- package/dist/{Broadcast-uMAvsC--.js → Broadcast-TotIXDuJ.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CixQu3Pr.js} +6 -8
- package/dist/Card-Ce-_xMgS.js +896 -0
- package/dist/Collections-DKva6Doi.js +459 -0
- package/dist/{Credit-QlnatflM.js → Credit-BVUxIJ6C.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKEumoan.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-ah4bz-qR.js} +49 -49
- package/dist/{Experience-Czy41ifp.js → Experience-DV3384o0.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/Game-DY83ti52.js +278 -0
- package/dist/Index-DEIaZ-2H.js +259 -0
- package/dist/Marketing-C2RwIlrg.js +20071 -0
- package/dist/Member-D4fc-wzd.js +333 -0
- package/dist/MemberList-DSMI6t_D.js +1598 -0
- package/dist/MemberTransactions-wXUlbbRq.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-DYS0klKm.js} +135 -120
- package/dist/Mission-P_KLDEpg.js +296 -0
- package/dist/Overview-8vc0f1D7.js +1078 -0
- package/dist/{Point-By6ogYy_.js → Point-B4Y0Pq60.js} +55 -53
- package/dist/{Promotion-DKcBr-RI.js → Promotion-C1CbesgZ.js} +65 -57
- package/dist/Queue-BlPA7PNH.js +244 -0
- package/dist/Record-Cl1qXSSk.js +340 -0
- package/dist/Reward-jy6-W1Eh.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-d5JNNNHf.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DYul_Nu8.js +1640 -0
- package/dist/Segment-B36Nrvxs.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-jN0xUFNR.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLFTNooB.js +186 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-H_Sehhgf.js +147 -0
- package/dist/Setting-AgQf2X4W.js +1931 -0
- package/dist/Store-D3Mm0pan.js +1841 -0
- package/dist/StoreRewards-L0VLWz8l.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Zl_cXXSD.js +1028 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b4mfueTj.js} +1 -1
- package/dist/{Tier-DvAs0-yx.js → Tier-DQq-375x.js} +327 -318
- package/dist/{Title-B_Trr39o.js → Title-OJxuBvaa.js} +224 -209
- package/dist/{Transaction-DCJw-b3H.js → Transaction-vgsYRfD7.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Cwi0mvC3.js +130 -0
- package/dist/Voucher-BFwLaoxe.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DNUBaNtJ.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-ms40eptZ.js} +1 -1
- package/dist/app-BQFTJ_hE.js +33357 -0
- package/dist/app-D7C3Fxfi.js +7077 -0
- package/dist/app.js +1 -1
- package/dist/{business-BC4-i1cU.js → business-vzpvmTdG.js} +1 -1
- package/dist/{campaign--0_yMbMV.js → campaign-BkxTDfsK.js} +2 -2
- package/dist/campaign-UQ8kMVeC.js +1810 -0
- package/dist/campaign.enum-BdT-e9h9.js +20 -0
- package/dist/campaign.fn-lc4ZhFCU.js +758 -0
- package/dist/collectible.enum-C8kd17Tz.js +19 -0
- package/dist/{collection.fn-3TwPe7aF.js → collection.fn-BIw1Y_tv.js} +2 -2
- package/dist/dto-CwzAhB8x.js +214 -0
- package/dist/{effect-BeR0LK61.js → effect-CJcvLlKG.js} +33 -16
- package/dist/email-addresses-BCJTQPT0.js +705 -0
- package/dist/{export-xeLLhqvh.js → export-URRwle1z.js} +5 -5
- package/dist/{helper-B5iqfKh8.js → helper-DccnE6zn.js} +1 -1
- package/dist/index-BiIZ7X6d.js +29556 -0
- package/dist/{index-CyKZ-SsN.js → index-BsRJ4kVb.js} +1 -1
- package/dist/{index-CU_d8jjU.js → index-C3lpXz_P.js} +1 -1
- package/dist/{index-Ct_wR519.js → index-CFA3EqId.js} +24 -21
- package/dist/{index-DP-dGMJC.js → index-CPRN3irj.js} +2230 -871
- package/dist/index-CaxFS90M.js +56 -0
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/index-D4MX9e5q.js +115 -0
- package/dist/index-DrE9VkxR.js +32 -0
- package/dist/index-EOPRlB9V.js +54 -0
- package/dist/{index-CAn5heDe.js → index-FcxOGFKj.js} +48 -4
- package/dist/{index-Bh-uaaBG.js → index-OScGm4mF.js} +1506 -1480
- package/dist/{index-BOdtpNkP.js → index-ghSGvG-m.js} +266 -173
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CE1CQHrP.js} +121 -121
- package/dist/loading-B8zghYbj.js +71 -0
- package/dist/{membership-D0nqqWNZ.js → membership-DoJMF2T6.js} +54 -46
- package/dist/money-CTR0rXZw.js +15 -0
- package/dist/number-Bhgz9eFP.js +12 -0
- package/dist/objectid-DdVJrRBw.js +145 -0
- package/dist/{loading-C-JDVajU.js → plugins-B5mQ7CHT.js} +3871 -3943
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-DicsEEHe.js +36 -0
- package/dist/{rule-builder-BXt29Es4.js → rule-builder-BWb4JTrd.js} +1 -1
- package/dist/{rule-Dn_GgBCe.js → rule-s8siRar1.js} +185 -178
- package/dist/style.css +1 -1
- package/dist/{template-D2Oi3dxP.js → template-Qb5ozfLa.js} +5 -5
- package/dist/trigger-Bsb3Kj35.js +144 -0
- package/dist/user-DJ8aHRaM.js +54 -0
- package/dist/{vue-i18n-Dud8fvmw.js → vue-i18n-BG2U7GtN.js} +282 -282
- package/dist/{xlsx-CCRCidY2.js → xlsx-2QxyDFwt.js} +1 -1
- package/package.json +11 -7
- package/dist/Analytic-BMpS6jWb.js +0 -622
- package/dist/Card-DV8-g69L.js +0 -825
- package/dist/Collections-DRafEHT1.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
- package/dist/Game-CD3zSitz.js +0 -255
- package/dist/Marketing-NNes8z6Q.js +0 -316
- package/dist/Member-CTqBgYuV.js +0 -69
- package/dist/MemberList-B99tS5ce.js +0 -1733
- package/dist/MemberTransactions-D1YCXPOg.js +0 -38
- package/dist/Mission-XbBVKBiE.js +0 -261
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
- package/dist/Segment-B8cszL-F.js +0 -437
- package/dist/Setting-aZYABlMW.js +0 -1901
- package/dist/Store-Bx2tyJwe.js +0 -1511
- package/dist/StoreRewards-DTp9G6gw.js +0 -401
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
- package/dist/Voucher-jqv3ji90.js +0 -490
- package/dist/app-WlcUVbFb.js +0 -5764
- package/dist/app-_w0hjM7u.js +0 -53428
- package/dist/dto-Ns2dLn1B.js +0 -2770
- package/dist/index-BWb9vRCi.js +0 -29193
- package/dist/index-CpU9aqyW.js +0 -206
- package/dist/index-CqO_ZvtD.js +0 -99
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DsNsA2uX.js +0 -298
- package/dist/index-WAMr3npT.js +0 -762
- package/dist/money-hdbrblud.js +0 -15
- package/dist/number-CRWGOZaW.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z as e } from "./plugins-B5mQ7CHT.js";
|
|
2
|
+
const E = e.enum([
|
|
3
|
+
"VOUCHER",
|
|
4
|
+
"CREDIT",
|
|
5
|
+
"POINT",
|
|
6
|
+
"COIN",
|
|
7
|
+
"TIER",
|
|
8
|
+
"TITLE",
|
|
9
|
+
"COIN",
|
|
10
|
+
"GAME",
|
|
11
|
+
"STAMP",
|
|
12
|
+
"REFERRAL"
|
|
13
|
+
]);
|
|
14
|
+
E.enum.VOUCHER + "", E.enum.CREDIT + "", E.enum.POINT + "", E.enum.COIN + "", E.enum.TIER + "", E.enum.TITLE + "", E.enum.GAME + "", E.enum.STAMP + "", E.enum.REFERRAL + "";
|
|
15
|
+
const R = e.enum(["FORTUNE_WHEEL", "ROCK_PAPER_SCISSORS"]);
|
|
16
|
+
export {
|
|
17
|
+
E as F,
|
|
18
|
+
R as a
|
|
19
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { F as i, z as t } from "./plugins-B5mQ7CHT.js";
|
|
2
|
+
import { y as C, a as r, z as h } from "./index-CPRN3irj.js";
|
|
3
|
+
import { F as u } from "./index-OScGm4mF.js";
|
|
4
|
+
import { i as I, R as d } from "./rule-builder-BWb4JTrd.js";
|
|
5
|
+
function N(a, e) {
|
|
6
|
+
var c, l;
|
|
7
|
+
if (!a) return;
|
|
8
|
+
const n = a.campaign;
|
|
9
|
+
if (!n) return;
|
|
10
|
+
const o = n.event.rule;
|
|
11
|
+
if (!o || !I(o)) {
|
|
12
|
+
e.addIssue({
|
|
13
|
+
code: "custom",
|
|
14
|
+
path: ["campaign", "event", "rule"],
|
|
15
|
+
params: {
|
|
16
|
+
i18n: { key: "zodCustom.campaign.rule_required", values: { type: n.event.type } }
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
switch (n.type) {
|
|
22
|
+
case "MISSION": {
|
|
23
|
+
n.earningOption.amount > n.mission.end && e.addIssue({
|
|
24
|
+
code: "custom",
|
|
25
|
+
path: ["campaign", "earningOption"],
|
|
26
|
+
params: {
|
|
27
|
+
i18n: { key: "zodCustom.campaign.earning_amount_exceed", values: { max: n.mission.end } }
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
case "CREDIT": {
|
|
33
|
+
const p = (c = n.config) == null ? void 0 : c.validityOption;
|
|
34
|
+
(!p || ["validForDay", "validBefore"].every((g) => p[g] == null)) && e.addIssue({
|
|
35
|
+
code: "custom",
|
|
36
|
+
path: ["campaign", "config", "validityOption"],
|
|
37
|
+
params: {
|
|
38
|
+
i18n: { key: "zodCustom.campaign.credit_validity_required" }
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
switch (n.event.type) {
|
|
44
|
+
case "BILL_COMPLETED":
|
|
45
|
+
n.type === "MISSION" && n.rewards.length && (n.rewards.forEach((p, m) => {
|
|
46
|
+
(p.threshold < 0 || p.threshold > n.mission.end) && e.addIssue({
|
|
47
|
+
code: "custom",
|
|
48
|
+
path: ["campaign", "rewards", m, "threshold"],
|
|
49
|
+
params: {
|
|
50
|
+
i18n: { key: "zodCustom.campaign.reward_threshold_range" }
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}), (l = n.config) != null && l.validityOption.followFirstReceive || e.addIssue({
|
|
54
|
+
code: "custom",
|
|
55
|
+
path: ["campaign", "config", "validityOption"],
|
|
56
|
+
params: {
|
|
57
|
+
i18n: { key: "zodCustom.campaign.mission_first_receive" }
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
break;
|
|
61
|
+
case "SCHEDULE": {
|
|
62
|
+
if (!o.rules.g_schedule) {
|
|
63
|
+
e.addIssue({
|
|
64
|
+
code: "custom",
|
|
65
|
+
path: ["campaign", "event", "rule"],
|
|
66
|
+
params: {
|
|
67
|
+
i18n: { key: "zodCustom.campaign.schedule_period_required" }
|
|
68
|
+
},
|
|
69
|
+
fatal: !0
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const p = d.getRules(
|
|
74
|
+
o.rules.g_schedule
|
|
75
|
+
), m = [
|
|
76
|
+
{
|
|
77
|
+
property: "trigger.date",
|
|
78
|
+
operator: ["_isOnDate", "_rrule"]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
property: "trigger.time",
|
|
82
|
+
operator: ["_isOnTime"]
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
m.length == p.length && m.every((O) => p.some((y) => {
|
|
86
|
+
const f = d.simplify(y);
|
|
87
|
+
return f.property === O.property && O.operator.includes(f.operator);
|
|
88
|
+
})) || e.addIssue({
|
|
89
|
+
code: "custom",
|
|
90
|
+
path: ["campaign", "event", "rule"],
|
|
91
|
+
params: {
|
|
92
|
+
i18n: { key: "zodCustom.campaign.active_period_invalid" }
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
default: {
|
|
98
|
+
"earningOption" in n && n.earningOption.type != "FIXED" && e.addIssue({
|
|
99
|
+
code: "custom",
|
|
100
|
+
path: ["campaign", "earningOption"],
|
|
101
|
+
params: {
|
|
102
|
+
i18n: { key: "zodCustom.campaign.fixed_earning_required" }
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function D(a) {
|
|
110
|
+
var n;
|
|
111
|
+
if (a.campaign.type === "VOUCHER" && "configs" in a) {
|
|
112
|
+
const o = a.configs;
|
|
113
|
+
o.extras.targetLocation = a.campaign.targetLocation;
|
|
114
|
+
const c = Math.max(
|
|
115
|
+
a.campaign.earningOption.amount,
|
|
116
|
+
o.options.maxUse ?? 1
|
|
117
|
+
);
|
|
118
|
+
a.campaign.earningOption.amount = c, o.options.maxUse = c, a.campaign.earningOption = {
|
|
119
|
+
type: "FIXED",
|
|
120
|
+
amount: 1
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (a.campaign.type == "MISSION" && "configs" in a) {
|
|
124
|
+
const o = a.configs;
|
|
125
|
+
o.options.validityOption = (n = a.campaign.config) == null ? void 0 : n.validityOption;
|
|
126
|
+
}
|
|
127
|
+
const e = a.campaign.event;
|
|
128
|
+
return e.type != "BILL_COMPLETED" && e.rule && I(e.rule) && (e.rule = d.removeEntry(e.rule, "g_bill"), a.campaign.event = e), a;
|
|
129
|
+
}
|
|
130
|
+
function s(a) {
|
|
131
|
+
const e = h.optionsMap.get(a).extend({
|
|
132
|
+
_id: i.optional(),
|
|
133
|
+
collectible: t.string().nullish()
|
|
134
|
+
});
|
|
135
|
+
switch (a) {
|
|
136
|
+
case "VOUCHER":
|
|
137
|
+
return t.object({
|
|
138
|
+
campaign: e,
|
|
139
|
+
templateId: i,
|
|
140
|
+
configs: u,
|
|
141
|
+
updateCollections: t.boolean().optional(),
|
|
142
|
+
code: t.string().optional()
|
|
143
|
+
});
|
|
144
|
+
case "PROMOTION":
|
|
145
|
+
return t.object({
|
|
146
|
+
campaign: e,
|
|
147
|
+
templateId: i
|
|
148
|
+
});
|
|
149
|
+
case "POINT":
|
|
150
|
+
return t.object({
|
|
151
|
+
campaign: e,
|
|
152
|
+
templateId: i
|
|
153
|
+
});
|
|
154
|
+
case "CREDIT":
|
|
155
|
+
return t.object({
|
|
156
|
+
campaign: e,
|
|
157
|
+
templateId: i
|
|
158
|
+
});
|
|
159
|
+
case "BROADCAST":
|
|
160
|
+
return t.object({
|
|
161
|
+
campaign: e,
|
|
162
|
+
templateId: i
|
|
163
|
+
});
|
|
164
|
+
case "COIN":
|
|
165
|
+
return t.object({
|
|
166
|
+
campaign: e,
|
|
167
|
+
templateId: i
|
|
168
|
+
});
|
|
169
|
+
case "REWARD_POOL":
|
|
170
|
+
return t.object({
|
|
171
|
+
campaign: e,
|
|
172
|
+
templateId: i,
|
|
173
|
+
updateCollections: t.boolean().optional()
|
|
174
|
+
});
|
|
175
|
+
case "GAME":
|
|
176
|
+
return t.object({
|
|
177
|
+
campaign: e,
|
|
178
|
+
configs: u,
|
|
179
|
+
templateId: i,
|
|
180
|
+
updateCollections: t.boolean().optional()
|
|
181
|
+
});
|
|
182
|
+
case "MISSION":
|
|
183
|
+
return t.object({
|
|
184
|
+
campaign: e,
|
|
185
|
+
configs: u,
|
|
186
|
+
templateId: i,
|
|
187
|
+
updateCollections: t.boolean().optional()
|
|
188
|
+
});
|
|
189
|
+
default:
|
|
190
|
+
throw new Error("Not implemented");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const T = C.extend({
|
|
194
|
+
_id: i.optional(),
|
|
195
|
+
name: t.string().min(1).max(300),
|
|
196
|
+
business: i.optional(),
|
|
197
|
+
campaigns: t.array(i).optional()
|
|
198
|
+
}), A = {
|
|
199
|
+
[r.enum.VOUCHER]: s("VOUCHER"),
|
|
200
|
+
[r.enum.PROMOTION]: s("PROMOTION"),
|
|
201
|
+
[r.enum.POINT]: s("POINT"),
|
|
202
|
+
[r.enum.CREDIT]: s("CREDIT"),
|
|
203
|
+
[r.enum.BROADCAST]: s("BROADCAST"),
|
|
204
|
+
[r.enum.COIN]: s("COIN"),
|
|
205
|
+
[r.enum.REWARD_POOL]: s("REWARD_POOL"),
|
|
206
|
+
[r.enum.GAME]: s("GAME"),
|
|
207
|
+
[r.enum.MISSION]: s("MISSION")
|
|
208
|
+
};
|
|
209
|
+
export {
|
|
210
|
+
A as C,
|
|
211
|
+
T as F,
|
|
212
|
+
D as a,
|
|
213
|
+
N as c
|
|
214
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { c as r } from "./index-BiIZ7X6d.js";
|
|
2
|
+
function m(e) {
|
|
3
3
|
if (!e)
|
|
4
4
|
return null;
|
|
5
|
-
const
|
|
5
|
+
const o = r.Config.getCountry().currency.symbol;
|
|
6
6
|
function s(t) {
|
|
7
|
-
const
|
|
7
|
+
const n = r.Dinero.fromFdoDecimal({ decimal: t.adjustment.amount });
|
|
8
8
|
switch (t.adjustment.type) {
|
|
9
9
|
case "BY_PERCENTAGE":
|
|
10
|
-
return `${
|
|
10
|
+
return `${n.toObject().amount}% discount`;
|
|
11
11
|
case "BY_AMOUNT":
|
|
12
|
-
return `${
|
|
12
|
+
return `${o}${n.toUnit()} discount`;
|
|
13
13
|
case "TO_AMOUNT":
|
|
14
|
-
return `to ${
|
|
14
|
+
return `to ${o}${n.toUnit()}`;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function u(t) {
|
|
18
18
|
switch (t.options.target) {
|
|
19
19
|
case "BILL":
|
|
20
20
|
return "Bill Discount";
|
|
@@ -36,26 +36,43 @@ function a(e) {
|
|
|
36
36
|
throw new Error("Invalid effect target");
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function a(t) {
|
|
40
40
|
if (t.options.target === "BILL" || t.options.target === "PAYMENT") {
|
|
41
|
-
const
|
|
41
|
+
const n = r.Dinero.fromFdoDecimal({
|
|
42
|
+
decimal: t.options.minPurchase
|
|
43
|
+
});
|
|
44
|
+
return n.toUnit() > 0 ? `min spend ${o}${n.toUnit()}` : "no min spend";
|
|
45
|
+
}
|
|
46
|
+
if (t.options.target === "ITEM" && t.options.minPurchase) {
|
|
47
|
+
const n = r.Dinero.fromFdoDecimal({
|
|
42
48
|
decimal: t.options.minPurchase
|
|
43
49
|
});
|
|
44
|
-
return
|
|
50
|
+
return n.toUnit() > 0 ? `min spend ${o}${n.toUnit()}` : "no min spend";
|
|
45
51
|
}
|
|
46
52
|
return "no min spend";
|
|
47
53
|
}
|
|
54
|
+
function c(t) {
|
|
55
|
+
var n;
|
|
56
|
+
if (((n = t.adjustmentRule) == null ? void 0 : n.type) == "CAPPED_AT") {
|
|
57
|
+
const i = r.Dinero.fromFdoDecimal({
|
|
58
|
+
decimal: t.adjustmentRule.amount
|
|
59
|
+
}).toPositive();
|
|
60
|
+
return i.toUnit() > 0 ? `cap at ${o}${i.toUnit()}` : null;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
48
64
|
return {
|
|
49
|
-
type:
|
|
65
|
+
type: u(e),
|
|
50
66
|
adjustment: s(e),
|
|
51
|
-
requirements:
|
|
67
|
+
requirements: a(e),
|
|
68
|
+
maxCap: c(e)
|
|
52
69
|
};
|
|
53
70
|
}
|
|
54
71
|
function f(e) {
|
|
55
|
-
const
|
|
56
|
-
return !e || !
|
|
72
|
+
const o = m(e);
|
|
73
|
+
return !e || !o ? null : Object.values(o).filter(Boolean).join(" | ");
|
|
57
74
|
}
|
|
58
75
|
export {
|
|
59
76
|
f as e,
|
|
60
|
-
|
|
77
|
+
m as s
|
|
61
78
|
};
|