@questwork/q-store-model 0.1.29 → 0.1.31
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/index.min.cjs +78 -12
- package/dist/index.min.js +259 -136
- package/package.json +2 -3
package/dist/index.min.cjs
CHANGED
|
@@ -253,25 +253,93 @@ class Amount {
|
|
|
253
253
|
|
|
254
254
|
;// external "lodash"
|
|
255
255
|
const external_lodash_namespaceObject = require("lodash");
|
|
256
|
-
;// external "@questwork/utilities/lib/stringHelper/index.js"
|
|
257
|
-
const index_js_namespaceObject = require("@questwork/utilities/lib/stringHelper/index.js");
|
|
258
256
|
;// ./lib/helpers/stringHelper/stringHelper.js
|
|
257
|
+
function baseXEncode(num, base = 34) {
|
|
258
|
+
const charset = getBaseCharset(base)
|
|
259
|
+
return encode(num, charset)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function encode(int, charset) {
|
|
263
|
+
let byCode = charset.byCode;
|
|
264
|
+
if (int === 0) {
|
|
265
|
+
return byCode[0];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
var res = "",
|
|
269
|
+
max = charset.length;
|
|
270
|
+
while (int > 0) {
|
|
271
|
+
res = byCode[int % max] + res;
|
|
272
|
+
int = Math.floor(int / max);
|
|
273
|
+
}
|
|
274
|
+
return res;
|
|
275
|
+
}
|
|
259
276
|
|
|
277
|
+
function getBaseCharset(base) {
|
|
278
|
+
let charset = '9876543210ABCDEFGHJKLMNPQRSTUVWXYZ'
|
|
279
|
+
if (base === 58) {
|
|
280
|
+
charset = '9876543210ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz'
|
|
281
|
+
}
|
|
282
|
+
return indexCharset(charset)
|
|
283
|
+
}
|
|
260
284
|
|
|
285
|
+
function indexCharset(str) {
|
|
286
|
+
var byCode = {},
|
|
287
|
+
byChar = {},
|
|
288
|
+
length = str.length,
|
|
289
|
+
i, char;
|
|
290
|
+
for (i = 0; i < length; i++) {
|
|
291
|
+
char = str[i];
|
|
292
|
+
byCode[i] = char;
|
|
293
|
+
byChar[char] = i;
|
|
294
|
+
}
|
|
295
|
+
return { byCode: byCode, byChar: byChar, length: length };
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function randomString({ len = 16, pattern = 'a1' } = {}) {
|
|
299
|
+
const A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
300
|
+
const a = 'abcdefghijklmnopqrstuvwxyz'
|
|
301
|
+
const num = '1234567890'
|
|
302
|
+
const mark = '~!@#$%^&*_+-='
|
|
303
|
+
let str = ''
|
|
304
|
+
if (pattern.includes('A')) {
|
|
305
|
+
str += A
|
|
306
|
+
}
|
|
307
|
+
if (pattern.includes('a')) {
|
|
308
|
+
str += a
|
|
309
|
+
}
|
|
310
|
+
if (pattern.includes('1')) {
|
|
311
|
+
str += num
|
|
312
|
+
}
|
|
313
|
+
if (pattern.includes('#')) {
|
|
314
|
+
str += mark
|
|
315
|
+
}
|
|
316
|
+
const chars = [...str]
|
|
317
|
+
return [...Array(len)].map(i => {
|
|
318
|
+
return chars[(Math.random() * chars.length) | 0]
|
|
319
|
+
}).join``
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function reverse(str) {
|
|
323
|
+
if (typeof str !== 'string') {
|
|
324
|
+
str = str.toString()
|
|
325
|
+
}
|
|
326
|
+
const splitString = str.split('')
|
|
327
|
+
const reverseArray = splitString.reverse()
|
|
328
|
+
return reverseArray.join('')
|
|
329
|
+
}
|
|
261
330
|
|
|
262
331
|
function setCode(base = 34) {
|
|
263
332
|
const now = (new Date()).valueOf()
|
|
264
|
-
const random =
|
|
333
|
+
const random = randomString({
|
|
265
334
|
len: 8,
|
|
266
335
|
pattern: '1'
|
|
267
336
|
})
|
|
268
|
-
const str =
|
|
337
|
+
const str = reverse(`${now}${random}`)
|
|
269
338
|
// const str = `${now}${random}`
|
|
270
|
-
return
|
|
339
|
+
return baseXEncode(str, base)
|
|
271
340
|
}
|
|
272
341
|
|
|
273
342
|
const stringHelper = {
|
|
274
|
-
...index_js_namespaceObject.stringHelper,
|
|
275
343
|
setCode
|
|
276
344
|
}
|
|
277
345
|
|
|
@@ -6479,8 +6547,6 @@ function makePaymentResultService({ repo }) {
|
|
|
6479
6547
|
|
|
6480
6548
|
|
|
6481
6549
|
|
|
6482
|
-
;// external "@questwork/utilities/lib/lodashHelper"
|
|
6483
|
-
const lodashHelper_namespaceObject = require("@questwork/utilities/lib/lodashHelper");
|
|
6484
6550
|
;// ./lib/helpers/corHelper/chain.js
|
|
6485
6551
|
|
|
6486
6552
|
class Chain {
|
|
@@ -6600,8 +6666,6 @@ class Chain {
|
|
|
6600
6666
|
|
|
6601
6667
|
|
|
6602
6668
|
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
6669
|
;// ./lib/eventManager/chains/chainCategoryLimit.js
|
|
6606
6670
|
|
|
6607
6671
|
|
|
@@ -6695,6 +6759,7 @@ function calculateUsed(updatedItem, balance, count) {
|
|
|
6695
6759
|
;// ./lib/eventManager/chains/chainGetPrice.js
|
|
6696
6760
|
|
|
6697
6761
|
|
|
6762
|
+
|
|
6698
6763
|
class ChainGetPrice extends Chain {
|
|
6699
6764
|
constructor(options = {}) {
|
|
6700
6765
|
super(options)
|
|
@@ -6708,7 +6773,7 @@ class ChainGetPrice extends Chain {
|
|
|
6708
6773
|
try {
|
|
6709
6774
|
const { lines, user } = chainTarget
|
|
6710
6775
|
// const entitlements = JSON.parse(JSON.stringify(this.entitlements))
|
|
6711
|
-
const entitlements =
|
|
6776
|
+
const entitlements = external_lodash_namespaceObject.cloneDeep(this.entitlements)
|
|
6712
6777
|
lines.forEach((line) => {
|
|
6713
6778
|
const prices = getPricesByTime(line, this.dateTime)
|
|
6714
6779
|
const priceStrategies = getStrategiesByRestrictions(prices, line, user)
|
|
@@ -6937,6 +7002,7 @@ function getStrategiesByRestrictions(prices, line, user) {
|
|
|
6937
7002
|
;// ./lib/eventManager/chains/ChainGetPriceForGroup.js
|
|
6938
7003
|
|
|
6939
7004
|
|
|
7005
|
+
|
|
6940
7006
|
class ChainGetPriceForGroup extends Chain {
|
|
6941
7007
|
constructor(options = {}) {
|
|
6942
7008
|
super(options)
|
|
@@ -6949,7 +7015,7 @@ class ChainGetPriceForGroup extends Chain {
|
|
|
6949
7015
|
async handleRequest(chainTarget) {
|
|
6950
7016
|
try {
|
|
6951
7017
|
const { lines, user } = chainTarget
|
|
6952
|
-
const entitlements =
|
|
7018
|
+
const entitlements = external_lodash_namespaceObject.cloneDeep(this.entitlements)
|
|
6953
7019
|
|
|
6954
7020
|
lines.forEach((line) => {
|
|
6955
7021
|
const prices = ChainGetPriceForGroup_getPricesByTime(line, this.dateTime)
|
package/dist/index.min.js
CHANGED
|
@@ -1,123 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
define([], factory);
|
|
6
|
-
else {
|
|
7
|
-
var a = factory();
|
|
8
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
-
}
|
|
10
|
-
})(this, () => {
|
|
11
|
-
return /******/ (() => { // webpackBootstrap
|
|
12
|
-
/******/ "use strict";
|
|
13
|
-
/******/ // The require scope
|
|
14
|
-
/******/ var __webpack_require__ = {};
|
|
15
|
-
/******/
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
|
|
2
|
+
/******/ // The require scope
|
|
3
|
+
/******/ var __webpack_require__ = {};
|
|
4
|
+
/******/
|
|
16
5
|
/************************************************************************/
|
|
17
|
-
/******/
|
|
18
|
-
/******/
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/ }
|
|
6
|
+
/******/ /* webpack/runtime/define property getters */
|
|
7
|
+
/******/ (() => {
|
|
8
|
+
/******/ // define getter functions for harmony exports
|
|
9
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
10
|
+
/******/ for(var key in definition) {
|
|
11
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
12
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
25
13
|
/******/ }
|
|
26
|
-
/******/ }
|
|
27
|
-
/******/ }
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/
|
|
32
|
-
/******/
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/ }
|
|
41
|
-
/******/
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/ }
|
|
44
|
-
/******/
|
|
14
|
+
/******/ }
|
|
15
|
+
/******/ };
|
|
16
|
+
/******/ })();
|
|
17
|
+
/******/
|
|
18
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
19
|
+
/******/ (() => {
|
|
20
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define __esModule on exports
|
|
26
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
27
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
28
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
29
|
+
/******/ }
|
|
30
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
31
|
+
/******/ };
|
|
32
|
+
/******/ })();
|
|
33
|
+
/******/
|
|
45
34
|
/************************************************************************/
|
|
46
35
|
var __webpack_exports__ = {};
|
|
47
|
-
// ESM COMPAT FLAG
|
|
48
|
-
__webpack_require__.r(__webpack_exports__);
|
|
49
36
|
|
|
50
37
|
// EXPORTS
|
|
51
38
|
__webpack_require__.d(__webpack_exports__, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
39
|
+
J0: () => (/* reexport */ Amount),
|
|
40
|
+
Z3: () => (/* reexport */ Cart),
|
|
41
|
+
m6: () => (/* reexport */ CartItem),
|
|
42
|
+
tR: () => (/* reexport */ CartRepo),
|
|
43
|
+
b7: () => (/* reexport */ category_Category),
|
|
44
|
+
lW: () => (/* reexport */ categoryRepo_CategoryRepo),
|
|
45
|
+
sW: () => (/* reexport */ Chain),
|
|
46
|
+
RU: () => (/* reexport */ ChainManager),
|
|
47
|
+
n$: () => (/* reexport */ ChainManagerFactory),
|
|
48
|
+
FH: () => (/* reexport */ ChainTarget),
|
|
49
|
+
cT: () => (/* reexport */ creditNote_CreditNote),
|
|
50
|
+
w0: () => (/* reexport */ CreditNoteLine),
|
|
51
|
+
Kj: () => (/* reexport */ CreditNoteLineRepo),
|
|
52
|
+
iY: () => (/* reexport */ CreditNoteRepo),
|
|
53
|
+
Sj: () => (/* reexport */ currency_Currency),
|
|
54
|
+
gm: () => (/* reexport */ CurrencyRepo),
|
|
55
|
+
qO: () => (/* reexport */ Invoice),
|
|
56
|
+
cY: () => (/* reexport */ InvoiceLine),
|
|
57
|
+
GV: () => (/* reexport */ InvoiceLineRepo),
|
|
58
|
+
QV: () => (/* reexport */ InvoiceRepo),
|
|
59
|
+
Yc: () => (/* reexport */ KeyValueObject),
|
|
60
|
+
So: () => (/* reexport */ Merchandise),
|
|
61
|
+
Il: () => (/* reexport */ MerchandiseRepo),
|
|
62
|
+
Zg: () => (/* reexport */ paymentGateway_PaymentGateway),
|
|
63
|
+
pq: () => (/* reexport */ PaymentGatewayRepo),
|
|
64
|
+
gp: () => (/* reexport */ PaymentResult),
|
|
65
|
+
m0: () => (/* reexport */ PaymentResultRepo),
|
|
66
|
+
P0: () => (/* reexport */ Price),
|
|
67
|
+
X0: () => (/* reexport */ PriceStrategy),
|
|
68
|
+
Yt: () => (/* reexport */ Product),
|
|
69
|
+
cX: () => (/* reexport */ ProductRepo),
|
|
70
|
+
nW: () => (/* reexport */ Status),
|
|
71
|
+
ZX: () => (/* reexport */ Transaction),
|
|
72
|
+
h3: () => (/* reexport */ TransactionRepo),
|
|
73
|
+
vU: () => (/* reexport */ WalletItem),
|
|
74
|
+
hx: () => (/* reexport */ WalletItemRepo),
|
|
75
|
+
Do: () => (/* reexport */ adminSettle),
|
|
76
|
+
Jw: () => (/* reexport */ calculator),
|
|
77
|
+
C6: () => (/* reexport */ checkDuplicate),
|
|
78
|
+
S0: () => (/* reexport */ convertTimestampToString),
|
|
79
|
+
G3: () => (/* reexport */ defaultComparator),
|
|
80
|
+
AG: () => (/* reexport */ defaultSort),
|
|
81
|
+
RC: () => (/* reexport */ eleInArrayComparator),
|
|
82
|
+
F4: () => (/* reexport */ firstLetterToLower),
|
|
83
|
+
al: () => (/* reexport */ getFakeClass),
|
|
84
|
+
xy: () => (/* reexport */ getSubClass),
|
|
85
|
+
Nc: () => (/* reexport */ handlerOrderList),
|
|
86
|
+
M1: () => (/* reexport */ isAllEqual),
|
|
87
|
+
zv: () => (/* reexport */ isDescendingOrder),
|
|
88
|
+
uU: () => (/* reexport */ makeCartService),
|
|
89
|
+
MA: () => (/* reexport */ makeCategoryService),
|
|
90
|
+
PS: () => (/* reexport */ makeCreditNoteLineService),
|
|
91
|
+
NI: () => (/* reexport */ makeCreditNoteService),
|
|
92
|
+
Hw: () => (/* reexport */ makeCurrencyService),
|
|
93
|
+
pH: () => (/* reexport */ makeInvoiceLineService),
|
|
94
|
+
V: () => (/* reexport */ makeInvoiceService),
|
|
95
|
+
LV: () => (/* reexport */ makeMerchandiseService),
|
|
96
|
+
c0: () => (/* reexport */ makePaymentGatewayService),
|
|
97
|
+
vj: () => (/* reexport */ makePaymentResultService),
|
|
98
|
+
fN: () => (/* reexport */ makeProductService),
|
|
99
|
+
gP: () => (/* reexport */ makeResponseHelper),
|
|
100
|
+
YT: () => (/* reexport */ makeTransactionService),
|
|
101
|
+
_k: () => (/* reexport */ makeWalletItemService),
|
|
102
|
+
Jn: () => (/* reexport */ models),
|
|
103
|
+
pJ: () => (/* reexport */ objectAllInArrayComparator),
|
|
104
|
+
aL: () => (/* reexport */ objectComparator),
|
|
105
|
+
il: () => (/* reexport */ objectOrderInArrayComparator),
|
|
106
|
+
NY: () => (/* reexport */ setQuery),
|
|
107
|
+
yO: () => (/* reexport */ stringHelper)
|
|
121
108
|
});
|
|
122
109
|
|
|
123
110
|
// NAMESPACE OBJECT: ./lib/models/index.js
|
|
@@ -252,26 +239,98 @@ class Amount {
|
|
|
252
239
|
|
|
253
240
|
|
|
254
241
|
;// external "lodash"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
242
|
+
var x = (y) => {
|
|
243
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
244
|
+
}
|
|
245
|
+
var y = (x) => (() => (x))
|
|
246
|
+
const external_lodash_namespaceObject = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash__["default"]) });
|
|
258
247
|
;// ./lib/helpers/stringHelper/stringHelper.js
|
|
248
|
+
function baseXEncode(num, base = 34) {
|
|
249
|
+
const charset = getBaseCharset(base)
|
|
250
|
+
return encode(num, charset)
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function encode(int, charset) {
|
|
254
|
+
let byCode = charset.byCode;
|
|
255
|
+
if (int === 0) {
|
|
256
|
+
return byCode[0];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
var res = "",
|
|
260
|
+
max = charset.length;
|
|
261
|
+
while (int > 0) {
|
|
262
|
+
res = byCode[int % max] + res;
|
|
263
|
+
int = Math.floor(int / max);
|
|
264
|
+
}
|
|
265
|
+
return res;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function getBaseCharset(base) {
|
|
269
|
+
let charset = '9876543210ABCDEFGHJKLMNPQRSTUVWXYZ'
|
|
270
|
+
if (base === 58) {
|
|
271
|
+
charset = '9876543210ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz'
|
|
272
|
+
}
|
|
273
|
+
return indexCharset(charset)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function indexCharset(str) {
|
|
277
|
+
var byCode = {},
|
|
278
|
+
byChar = {},
|
|
279
|
+
length = str.length,
|
|
280
|
+
i, char;
|
|
281
|
+
for (i = 0; i < length; i++) {
|
|
282
|
+
char = str[i];
|
|
283
|
+
byCode[i] = char;
|
|
284
|
+
byChar[char] = i;
|
|
285
|
+
}
|
|
286
|
+
return { byCode: byCode, byChar: byChar, length: length };
|
|
287
|
+
}
|
|
259
288
|
|
|
289
|
+
function randomString({ len = 16, pattern = 'a1' } = {}) {
|
|
290
|
+
const A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
291
|
+
const a = 'abcdefghijklmnopqrstuvwxyz'
|
|
292
|
+
const num = '1234567890'
|
|
293
|
+
const mark = '~!@#$%^&*_+-='
|
|
294
|
+
let str = ''
|
|
295
|
+
if (pattern.includes('A')) {
|
|
296
|
+
str += A
|
|
297
|
+
}
|
|
298
|
+
if (pattern.includes('a')) {
|
|
299
|
+
str += a
|
|
300
|
+
}
|
|
301
|
+
if (pattern.includes('1')) {
|
|
302
|
+
str += num
|
|
303
|
+
}
|
|
304
|
+
if (pattern.includes('#')) {
|
|
305
|
+
str += mark
|
|
306
|
+
}
|
|
307
|
+
const chars = [...str]
|
|
308
|
+
return [...Array(len)].map(i => {
|
|
309
|
+
return chars[(Math.random() * chars.length) | 0]
|
|
310
|
+
}).join``
|
|
311
|
+
}
|
|
260
312
|
|
|
313
|
+
function reverse(str) {
|
|
314
|
+
if (typeof str !== 'string') {
|
|
315
|
+
str = str.toString()
|
|
316
|
+
}
|
|
317
|
+
const splitString = str.split('')
|
|
318
|
+
const reverseArray = splitString.reverse()
|
|
319
|
+
return reverseArray.join('')
|
|
320
|
+
}
|
|
261
321
|
|
|
262
322
|
function setCode(base = 34) {
|
|
263
323
|
const now = (new Date()).valueOf()
|
|
264
|
-
const random =
|
|
324
|
+
const random = randomString({
|
|
265
325
|
len: 8,
|
|
266
326
|
pattern: '1'
|
|
267
327
|
})
|
|
268
|
-
const str =
|
|
328
|
+
const str = reverse(`${now}${random}`)
|
|
269
329
|
// const str = `${now}${random}`
|
|
270
|
-
return
|
|
330
|
+
return baseXEncode(str, base)
|
|
271
331
|
}
|
|
272
332
|
|
|
273
333
|
const stringHelper = {
|
|
274
|
-
...index_js_namespaceObject.stringHelper,
|
|
275
334
|
setCode
|
|
276
335
|
}
|
|
277
336
|
|
|
@@ -658,11 +717,11 @@ function mergeDuplicateCartItems(cartItems, array = []) {
|
|
|
658
717
|
}
|
|
659
718
|
if (cartItem.merchandiseCode === item.merchandiseCode && cartItem.itemOptionFillIns.length === item.itemOptionFillIns.length) {
|
|
660
719
|
const { itemOptionFillIns } = item
|
|
661
|
-
const arr = external_lodash_namespaceObject.intersectionWith(itemOptionFillIns, cartItem.itemOptionFillIns, (obj1, obj2) => {
|
|
720
|
+
const arr = external_lodash_namespaceObject["default"].intersectionWith(itemOptionFillIns, cartItem.itemOptionFillIns, (obj1, obj2) => {
|
|
662
721
|
return obj1.target === obj2.target
|
|
663
722
|
&& obj1.targetCode === obj2.targetCode
|
|
664
723
|
&& obj1.key === obj2.key
|
|
665
|
-
&& external_lodash_namespaceObject.intersection(obj1.value, obj2.value).length === obj1.value.length
|
|
724
|
+
&& external_lodash_namespaceObject["default"].intersection(obj1.value, obj2.value).length === obj1.value.length
|
|
666
725
|
})
|
|
667
726
|
if (arr.length === itemOptionFillIns.length) {
|
|
668
727
|
acc.matched = item
|
|
@@ -700,7 +759,7 @@ function cartItem_setCode(options, key) {
|
|
|
700
759
|
;// ./lib/helpers/utilHelper/calculator.js
|
|
701
760
|
|
|
702
761
|
|
|
703
|
-
const lodash = external_lodash_namespaceObject.noConflict()
|
|
762
|
+
const lodash = external_lodash_namespaceObject["default"].noConflict()
|
|
704
763
|
|
|
705
764
|
function calculator(qty, rules) {
|
|
706
765
|
const groupRules = _getArrayCombination(rules)
|
|
@@ -792,7 +851,7 @@ function _getArrayCombination(input = []) {
|
|
|
792
851
|
;// ./lib/helpers/utilHelper/checkDuplicateHelper.js
|
|
793
852
|
|
|
794
853
|
|
|
795
|
-
const checkDuplicateHelper_lodash = external_lodash_namespaceObject.noConflict()
|
|
854
|
+
const checkDuplicateHelper_lodash = external_lodash_namespaceObject["default"].noConflict()
|
|
796
855
|
|
|
797
856
|
function checkDuplicate(target, compare, options) {
|
|
798
857
|
options = options || {}
|
|
@@ -1510,7 +1569,7 @@ class PriceStrategy {
|
|
|
1510
1569
|
|
|
1511
1570
|
function matchAnd(key, value, payload) {
|
|
1512
1571
|
return Object.keys(value).reduce((acc, path) => {
|
|
1513
|
-
const val = external_lodash_namespaceObject.get(payload[key], path)
|
|
1572
|
+
const val = external_lodash_namespaceObject["default"].get(payload[key], path)
|
|
1514
1573
|
acc = acc && matcher(val, value[path])
|
|
1515
1574
|
return acc
|
|
1516
1575
|
}, true)
|
|
@@ -1533,7 +1592,7 @@ function matcher(val, formula = {}) {
|
|
|
1533
1592
|
}).length > 0
|
|
1534
1593
|
})
|
|
1535
1594
|
case '$eq':
|
|
1536
|
-
return external_lodash_namespaceObject.isEqual(val, formulaValue)
|
|
1595
|
+
return external_lodash_namespaceObject["default"].isEqual(val, formulaValue)
|
|
1537
1596
|
case '$in':
|
|
1538
1597
|
return formulaValue.includes(val)
|
|
1539
1598
|
case '$keyValue':
|
|
@@ -6479,8 +6538,6 @@ function makePaymentResultService({ repo }) {
|
|
|
6479
6538
|
|
|
6480
6539
|
|
|
6481
6540
|
|
|
6482
|
-
;// external "@questwork/utilities/lib/lodashHelper"
|
|
6483
|
-
const lodashHelper_namespaceObject = require("@questwork/utilities/lib/lodashHelper");
|
|
6484
6541
|
;// ./lib/helpers/corHelper/chain.js
|
|
6485
6542
|
|
|
6486
6543
|
class Chain {
|
|
@@ -6600,8 +6657,6 @@ class Chain {
|
|
|
6600
6657
|
|
|
6601
6658
|
|
|
6602
6659
|
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
6660
|
;// ./lib/eventManager/chains/chainCategoryLimit.js
|
|
6606
6661
|
|
|
6607
6662
|
|
|
@@ -6695,6 +6750,7 @@ function calculateUsed(updatedItem, balance, count) {
|
|
|
6695
6750
|
;// ./lib/eventManager/chains/chainGetPrice.js
|
|
6696
6751
|
|
|
6697
6752
|
|
|
6753
|
+
|
|
6698
6754
|
class ChainGetPrice extends Chain {
|
|
6699
6755
|
constructor(options = {}) {
|
|
6700
6756
|
super(options)
|
|
@@ -6708,7 +6764,7 @@ class ChainGetPrice extends Chain {
|
|
|
6708
6764
|
try {
|
|
6709
6765
|
const { lines, user } = chainTarget
|
|
6710
6766
|
// const entitlements = JSON.parse(JSON.stringify(this.entitlements))
|
|
6711
|
-
const entitlements =
|
|
6767
|
+
const entitlements = external_lodash_namespaceObject["default"].cloneDeep(this.entitlements)
|
|
6712
6768
|
lines.forEach((line) => {
|
|
6713
6769
|
const prices = getPricesByTime(line, this.dateTime)
|
|
6714
6770
|
const priceStrategies = getStrategiesByRestrictions(prices, line, user)
|
|
@@ -6937,6 +6993,7 @@ function getStrategiesByRestrictions(prices, line, user) {
|
|
|
6937
6993
|
;// ./lib/eventManager/chains/ChainGetPriceForGroup.js
|
|
6938
6994
|
|
|
6939
6995
|
|
|
6996
|
+
|
|
6940
6997
|
class ChainGetPriceForGroup extends Chain {
|
|
6941
6998
|
constructor(options = {}) {
|
|
6942
6999
|
super(options)
|
|
@@ -6949,7 +7006,7 @@ class ChainGetPriceForGroup extends Chain {
|
|
|
6949
7006
|
async handleRequest(chainTarget) {
|
|
6950
7007
|
try {
|
|
6951
7008
|
const { lines, user } = chainTarget
|
|
6952
|
-
const entitlements =
|
|
7009
|
+
const entitlements = external_lodash_namespaceObject["default"].cloneDeep(this.entitlements)
|
|
6953
7010
|
|
|
6954
7011
|
lines.forEach((line) => {
|
|
6955
7012
|
const prices = ChainGetPriceForGroup_getPricesByTime(line, this.dateTime)
|
|
@@ -8245,7 +8302,73 @@ const models = models_namespaceObject
|
|
|
8245
8302
|
;// ./index.js
|
|
8246
8303
|
|
|
8247
8304
|
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
;
|
|
8251
|
-
|
|
8305
|
+
var __webpack_exports__Amount = __webpack_exports__.J0;
|
|
8306
|
+
var __webpack_exports__Cart = __webpack_exports__.Z3;
|
|
8307
|
+
var __webpack_exports__CartItem = __webpack_exports__.m6;
|
|
8308
|
+
var __webpack_exports__CartRepo = __webpack_exports__.tR;
|
|
8309
|
+
var __webpack_exports__Category = __webpack_exports__.b7;
|
|
8310
|
+
var __webpack_exports__CategoryRepo = __webpack_exports__.lW;
|
|
8311
|
+
var __webpack_exports__Chain = __webpack_exports__.sW;
|
|
8312
|
+
var __webpack_exports__ChainManager = __webpack_exports__.RU;
|
|
8313
|
+
var __webpack_exports__ChainManagerFactory = __webpack_exports__.n$;
|
|
8314
|
+
var __webpack_exports__ChainTarget = __webpack_exports__.FH;
|
|
8315
|
+
var __webpack_exports__CreditNote = __webpack_exports__.cT;
|
|
8316
|
+
var __webpack_exports__CreditNoteLine = __webpack_exports__.w0;
|
|
8317
|
+
var __webpack_exports__CreditNoteLineRepo = __webpack_exports__.Kj;
|
|
8318
|
+
var __webpack_exports__CreditNoteRepo = __webpack_exports__.iY;
|
|
8319
|
+
var __webpack_exports__Currency = __webpack_exports__.Sj;
|
|
8320
|
+
var __webpack_exports__CurrencyRepo = __webpack_exports__.gm;
|
|
8321
|
+
var __webpack_exports__Invoice = __webpack_exports__.qO;
|
|
8322
|
+
var __webpack_exports__InvoiceLine = __webpack_exports__.cY;
|
|
8323
|
+
var __webpack_exports__InvoiceLineRepo = __webpack_exports__.GV;
|
|
8324
|
+
var __webpack_exports__InvoiceRepo = __webpack_exports__.QV;
|
|
8325
|
+
var __webpack_exports__KeyValueObject = __webpack_exports__.Yc;
|
|
8326
|
+
var __webpack_exports__Merchandise = __webpack_exports__.So;
|
|
8327
|
+
var __webpack_exports__MerchandiseRepo = __webpack_exports__.Il;
|
|
8328
|
+
var __webpack_exports__PaymentGateway = __webpack_exports__.Zg;
|
|
8329
|
+
var __webpack_exports__PaymentGatewayRepo = __webpack_exports__.pq;
|
|
8330
|
+
var __webpack_exports__PaymentResult = __webpack_exports__.gp;
|
|
8331
|
+
var __webpack_exports__PaymentResultRepo = __webpack_exports__.m0;
|
|
8332
|
+
var __webpack_exports__Price = __webpack_exports__.P0;
|
|
8333
|
+
var __webpack_exports__PriceStrategy = __webpack_exports__.X0;
|
|
8334
|
+
var __webpack_exports__Product = __webpack_exports__.Yt;
|
|
8335
|
+
var __webpack_exports__ProductRepo = __webpack_exports__.cX;
|
|
8336
|
+
var __webpack_exports__Status = __webpack_exports__.nW;
|
|
8337
|
+
var __webpack_exports__Transaction = __webpack_exports__.ZX;
|
|
8338
|
+
var __webpack_exports__TransactionRepo = __webpack_exports__.h3;
|
|
8339
|
+
var __webpack_exports__WalletItem = __webpack_exports__.vU;
|
|
8340
|
+
var __webpack_exports__WalletItemRepo = __webpack_exports__.hx;
|
|
8341
|
+
var __webpack_exports__adminSettle = __webpack_exports__.Do;
|
|
8342
|
+
var __webpack_exports__calculator = __webpack_exports__.Jw;
|
|
8343
|
+
var __webpack_exports__checkDuplicate = __webpack_exports__.C6;
|
|
8344
|
+
var __webpack_exports__convertTimestampToString = __webpack_exports__.S0;
|
|
8345
|
+
var __webpack_exports__defaultComparator = __webpack_exports__.G3;
|
|
8346
|
+
var __webpack_exports__defaultSort = __webpack_exports__.AG;
|
|
8347
|
+
var __webpack_exports__eleInArrayComparator = __webpack_exports__.RC;
|
|
8348
|
+
var __webpack_exports__firstLetterToLower = __webpack_exports__.F4;
|
|
8349
|
+
var __webpack_exports__getFakeClass = __webpack_exports__.al;
|
|
8350
|
+
var __webpack_exports__getSubClass = __webpack_exports__.xy;
|
|
8351
|
+
var __webpack_exports__handlerOrderList = __webpack_exports__.Nc;
|
|
8352
|
+
var __webpack_exports__isAllEqual = __webpack_exports__.M1;
|
|
8353
|
+
var __webpack_exports__isDescendingOrder = __webpack_exports__.zv;
|
|
8354
|
+
var __webpack_exports__makeCartService = __webpack_exports__.uU;
|
|
8355
|
+
var __webpack_exports__makeCategoryService = __webpack_exports__.MA;
|
|
8356
|
+
var __webpack_exports__makeCreditNoteLineService = __webpack_exports__.PS;
|
|
8357
|
+
var __webpack_exports__makeCreditNoteService = __webpack_exports__.NI;
|
|
8358
|
+
var __webpack_exports__makeCurrencyService = __webpack_exports__.Hw;
|
|
8359
|
+
var __webpack_exports__makeInvoiceLineService = __webpack_exports__.pH;
|
|
8360
|
+
var __webpack_exports__makeInvoiceService = __webpack_exports__.V;
|
|
8361
|
+
var __webpack_exports__makeMerchandiseService = __webpack_exports__.LV;
|
|
8362
|
+
var __webpack_exports__makePaymentGatewayService = __webpack_exports__.c0;
|
|
8363
|
+
var __webpack_exports__makePaymentResultService = __webpack_exports__.vj;
|
|
8364
|
+
var __webpack_exports__makeProductService = __webpack_exports__.fN;
|
|
8365
|
+
var __webpack_exports__makeResponseHelper = __webpack_exports__.gP;
|
|
8366
|
+
var __webpack_exports__makeTransactionService = __webpack_exports__.YT;
|
|
8367
|
+
var __webpack_exports__makeWalletItemService = __webpack_exports__._k;
|
|
8368
|
+
var __webpack_exports__models = __webpack_exports__.Jn;
|
|
8369
|
+
var __webpack_exports__objectAllInArrayComparator = __webpack_exports__.pJ;
|
|
8370
|
+
var __webpack_exports__objectComparator = __webpack_exports__.aL;
|
|
8371
|
+
var __webpack_exports__objectOrderInArrayComparator = __webpack_exports__.il;
|
|
8372
|
+
var __webpack_exports__setQuery = __webpack_exports__.NY;
|
|
8373
|
+
var __webpack_exports__stringHelper = __webpack_exports__.yO;
|
|
8374
|
+
export { __webpack_exports__Amount as Amount, __webpack_exports__Cart as Cart, __webpack_exports__CartItem as CartItem, __webpack_exports__CartRepo as CartRepo, __webpack_exports__Category as Category, __webpack_exports__CategoryRepo as CategoryRepo, __webpack_exports__Chain as Chain, __webpack_exports__ChainManager as ChainManager, __webpack_exports__ChainManagerFactory as ChainManagerFactory, __webpack_exports__ChainTarget as ChainTarget, __webpack_exports__CreditNote as CreditNote, __webpack_exports__CreditNoteLine as CreditNoteLine, __webpack_exports__CreditNoteLineRepo as CreditNoteLineRepo, __webpack_exports__CreditNoteRepo as CreditNoteRepo, __webpack_exports__Currency as Currency, __webpack_exports__CurrencyRepo as CurrencyRepo, __webpack_exports__Invoice as Invoice, __webpack_exports__InvoiceLine as InvoiceLine, __webpack_exports__InvoiceLineRepo as InvoiceLineRepo, __webpack_exports__InvoiceRepo as InvoiceRepo, __webpack_exports__KeyValueObject as KeyValueObject, __webpack_exports__Merchandise as Merchandise, __webpack_exports__MerchandiseRepo as MerchandiseRepo, __webpack_exports__PaymentGateway as PaymentGateway, __webpack_exports__PaymentGatewayRepo as PaymentGatewayRepo, __webpack_exports__PaymentResult as PaymentResult, __webpack_exports__PaymentResultRepo as PaymentResultRepo, __webpack_exports__Price as Price, __webpack_exports__PriceStrategy as PriceStrategy, __webpack_exports__Product as Product, __webpack_exports__ProductRepo as ProductRepo, __webpack_exports__Status as Status, __webpack_exports__Transaction as Transaction, __webpack_exports__TransactionRepo as TransactionRepo, __webpack_exports__WalletItem as WalletItem, __webpack_exports__WalletItemRepo as WalletItemRepo, __webpack_exports__adminSettle as adminSettle, __webpack_exports__calculator as calculator, __webpack_exports__checkDuplicate as checkDuplicate, __webpack_exports__convertTimestampToString as convertTimestampToString, __webpack_exports__defaultComparator as defaultComparator, __webpack_exports__defaultSort as defaultSort, __webpack_exports__eleInArrayComparator as eleInArrayComparator, __webpack_exports__firstLetterToLower as firstLetterToLower, __webpack_exports__getFakeClass as getFakeClass, __webpack_exports__getSubClass as getSubClass, __webpack_exports__handlerOrderList as handlerOrderList, __webpack_exports__isAllEqual as isAllEqual, __webpack_exports__isDescendingOrder as isDescendingOrder, __webpack_exports__makeCartService as makeCartService, __webpack_exports__makeCategoryService as makeCategoryService, __webpack_exports__makeCreditNoteLineService as makeCreditNoteLineService, __webpack_exports__makeCreditNoteService as makeCreditNoteService, __webpack_exports__makeCurrencyService as makeCurrencyService, __webpack_exports__makeInvoiceLineService as makeInvoiceLineService, __webpack_exports__makeInvoiceService as makeInvoiceService, __webpack_exports__makeMerchandiseService as makeMerchandiseService, __webpack_exports__makePaymentGatewayService as makePaymentGatewayService, __webpack_exports__makePaymentResultService as makePaymentResultService, __webpack_exports__makeProductService as makeProductService, __webpack_exports__makeResponseHelper as makeResponseHelper, __webpack_exports__makeTransactionService as makeTransactionService, __webpack_exports__makeWalletItemService as makeWalletItemService, __webpack_exports__models as models, __webpack_exports__objectAllInArrayComparator as objectAllInArrayComparator, __webpack_exports__objectComparator as objectComparator, __webpack_exports__objectOrderInArrayComparator as objectOrderInArrayComparator, __webpack_exports__setQuery as setQuery, __webpack_exports__stringHelper as stringHelper };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@questwork/q-store-model",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "Questwork QStore Model",
|
|
5
5
|
"main": "dist/index.min.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,13 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@questwork/utilities": "^0.1.51",
|
|
21
20
|
"lodash": "^4.17.21"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
23
|
"@babel/core": "^7.17.8",
|
|
25
24
|
"@babel/eslint-parser": "^7.17.0",
|
|
26
|
-
"@questwork/utilities": "^0.1.51",
|
|
27
25
|
"babel-loader": "^8.2.4",
|
|
28
26
|
"babel-plugin-component": "^1.1.1",
|
|
29
27
|
"chai": "^4.3.6",
|
|
@@ -48,6 +46,7 @@
|
|
|
48
46
|
},
|
|
49
47
|
"scripts": {
|
|
50
48
|
"build": "cross-env NODE_ENV=production minimize=false gulp",
|
|
49
|
+
"build:esm": "cross-env NODE_ENV=production minimize=false gulp esm",
|
|
51
50
|
"lint": "eslint .",
|
|
52
51
|
"test:models": "NODE_ENV=test mocha --exit 'lib/models/test.setup.js' 'lib/models/**/*.spec.js'"
|
|
53
52
|
}
|