@chevre/domain 20.1.0-alpha.2 → 20.1.0-alpha.4
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/lib/chevre/repo/action.js +42 -31
- package/lib/chevre/repo/mongoose/model/action.js +9 -1
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged.js +2 -2
- package/lib/chevre/service/order/placeOrder.js +4 -2
- package/lib/chevre/service/order/sendOrder.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +2 -1
- package/package.json +3 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.d.ts +0 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.js +0 -187
|
@@ -22,7 +22,7 @@ class MongoRepository {
|
|
|
22
22
|
}
|
|
23
23
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
24
24
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50;
|
|
26
26
|
const andConditions = [];
|
|
27
27
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
28
28
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -54,7 +54,18 @@ class MongoRepository {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const locationIdEq = (_h = (_g = params.location) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$eq;
|
|
58
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
59
|
+
/* istanbul ignore else */
|
|
60
|
+
if (typeof locationIdEq === 'string') {
|
|
61
|
+
andConditions.push({
|
|
62
|
+
'location.id': {
|
|
63
|
+
$exists: true,
|
|
64
|
+
$eq: locationIdEq
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const locationIdentifierEq = (_k = (_j = params.location) === null || _j === void 0 ? void 0 : _j.identifier) === null || _k === void 0 ? void 0 : _k.$eq;
|
|
58
69
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
59
70
|
/* istanbul ignore else */
|
|
60
71
|
if (typeof locationIdentifierEq === 'string') {
|
|
@@ -67,7 +78,7 @@ class MongoRepository {
|
|
|
67
78
|
}
|
|
68
79
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
69
80
|
/* istanbul ignore else */
|
|
70
|
-
const objectPaymentMethodIdEq = (
|
|
81
|
+
const objectPaymentMethodIdEq = (_m = (_l = params.object) === null || _l === void 0 ? void 0 : _l.paymentMethodId) === null || _m === void 0 ? void 0 : _m.$eq;
|
|
71
82
|
if (typeof objectPaymentMethodIdEq === 'string') {
|
|
72
83
|
andConditions.push({
|
|
73
84
|
'object.paymentMethodId': {
|
|
@@ -76,7 +87,7 @@ class MongoRepository {
|
|
|
76
87
|
}
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
|
-
const objectObjectPaymentMethodIdEq = (
|
|
90
|
+
const objectObjectPaymentMethodIdEq = (_q = (_p = (_o = params.object) === null || _o === void 0 ? void 0 : _o.object) === null || _p === void 0 ? void 0 : _p.paymentMethodId) === null || _q === void 0 ? void 0 : _q.$eq;
|
|
80
91
|
if (typeof objectObjectPaymentMethodIdEq === 'string') {
|
|
81
92
|
andConditions.push({
|
|
82
93
|
'object.object.paymentMethodId': {
|
|
@@ -85,7 +96,7 @@ class MongoRepository {
|
|
|
85
96
|
}
|
|
86
97
|
});
|
|
87
98
|
}
|
|
88
|
-
const objectReservationForIdEq = (
|
|
99
|
+
const objectReservationForIdEq = (_t = (_s = (_r = params.object) === null || _r === void 0 ? void 0 : _r.reservationFor) === null || _s === void 0 ? void 0 : _s.id) === null || _t === void 0 ? void 0 : _t.$eq;
|
|
89
100
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
90
101
|
/* istanbul ignore else */
|
|
91
102
|
if (typeof objectReservationForIdEq === 'string') {
|
|
@@ -96,7 +107,7 @@ class MongoRepository {
|
|
|
96
107
|
}
|
|
97
108
|
});
|
|
98
109
|
}
|
|
99
|
-
const objectPaymentMethodAccountIdEq = (
|
|
110
|
+
const objectPaymentMethodAccountIdEq = (_w = (_v = (_u = params.object) === null || _u === void 0 ? void 0 : _u.paymentMethod) === null || _v === void 0 ? void 0 : _v.accountId) === null || _w === void 0 ? void 0 : _w.$eq;
|
|
100
111
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
101
112
|
/* istanbul ignore else */
|
|
102
113
|
if (typeof objectPaymentMethodAccountIdEq === 'string') {
|
|
@@ -107,7 +118,7 @@ class MongoRepository {
|
|
|
107
118
|
}
|
|
108
119
|
});
|
|
109
120
|
}
|
|
110
|
-
const objectPaymentMethodPaymentMethodIdEq = (
|
|
121
|
+
const objectPaymentMethodPaymentMethodIdEq = (_z = (_y = (_x = params.object) === null || _x === void 0 ? void 0 : _x.paymentMethod) === null || _y === void 0 ? void 0 : _y.paymentMethodId) === null || _z === void 0 ? void 0 : _z.$eq;
|
|
111
122
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
112
123
|
/* istanbul ignore else */
|
|
113
124
|
if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
|
|
@@ -118,7 +129,7 @@ class MongoRepository {
|
|
|
118
129
|
}
|
|
119
130
|
});
|
|
120
131
|
}
|
|
121
|
-
const objectPaymentMethodPaymentMethodIdIn = (
|
|
132
|
+
const objectPaymentMethodPaymentMethodIdIn = (_2 = (_1 = (_0 = params.object) === null || _0 === void 0 ? void 0 : _0.paymentMethod) === null || _1 === void 0 ? void 0 : _1.paymentMethodId) === null || _2 === void 0 ? void 0 : _2.$in;
|
|
122
133
|
if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
|
|
123
134
|
andConditions.push({
|
|
124
135
|
'object.paymentMethod.paymentMethodId': {
|
|
@@ -127,7 +138,7 @@ class MongoRepository {
|
|
|
127
138
|
}
|
|
128
139
|
});
|
|
129
140
|
}
|
|
130
|
-
const objectPaymentMethodTypeOfEq = (
|
|
141
|
+
const objectPaymentMethodTypeOfEq = (_5 = (_4 = (_3 = params.object) === null || _3 === void 0 ? void 0 : _3.paymentMethod) === null || _4 === void 0 ? void 0 : _4.typeOf) === null || _5 === void 0 ? void 0 : _5.$eq;
|
|
131
142
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
132
143
|
/* istanbul ignore else */
|
|
133
144
|
if (typeof objectPaymentMethodTypeOfEq === 'string') {
|
|
@@ -138,7 +149,7 @@ class MongoRepository {
|
|
|
138
149
|
}
|
|
139
150
|
});
|
|
140
151
|
}
|
|
141
|
-
const objectTypeOfEq = (
|
|
152
|
+
const objectTypeOfEq = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$eq;
|
|
142
153
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
143
154
|
/* istanbul ignore else */
|
|
144
155
|
if (typeof objectTypeOfEq === 'string') {
|
|
@@ -149,7 +160,7 @@ class MongoRepository {
|
|
|
149
160
|
}
|
|
150
161
|
});
|
|
151
162
|
}
|
|
152
|
-
const objectTypeOfIn = (
|
|
163
|
+
const objectTypeOfIn = (_9 = (_8 = params.object) === null || _8 === void 0 ? void 0 : _8.typeOf) === null || _9 === void 0 ? void 0 : _9.$in;
|
|
153
164
|
if (Array.isArray(objectTypeOfIn)) {
|
|
154
165
|
andConditions.push({
|
|
155
166
|
'object.typeOf': {
|
|
@@ -158,7 +169,7 @@ class MongoRepository {
|
|
|
158
169
|
}
|
|
159
170
|
});
|
|
160
171
|
}
|
|
161
|
-
const objectIdEq = (
|
|
172
|
+
const objectIdEq = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.id) === null || _11 === void 0 ? void 0 : _11.$eq;
|
|
162
173
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
163
174
|
/* istanbul ignore else */
|
|
164
175
|
if (typeof objectIdEq === 'string') {
|
|
@@ -169,7 +180,7 @@ class MongoRepository {
|
|
|
169
180
|
}
|
|
170
181
|
});
|
|
171
182
|
}
|
|
172
|
-
const objectIdIn = (
|
|
183
|
+
const objectIdIn = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.id) === null || _13 === void 0 ? void 0 : _13.$in;
|
|
173
184
|
if (Array.isArray(objectIdIn)) {
|
|
174
185
|
andConditions.push({
|
|
175
186
|
'object.id': {
|
|
@@ -178,7 +189,7 @@ class MongoRepository {
|
|
|
178
189
|
}
|
|
179
190
|
});
|
|
180
191
|
}
|
|
181
|
-
const objectOrderNumberIn = (
|
|
192
|
+
const objectOrderNumberIn = (_15 = (_14 = params.object) === null || _14 === void 0 ? void 0 : _14.orderNumber) === null || _15 === void 0 ? void 0 : _15.$in;
|
|
182
193
|
if (Array.isArray(objectOrderNumberIn)) {
|
|
183
194
|
andConditions.push({
|
|
184
195
|
'object.orderNumber': {
|
|
@@ -187,7 +198,7 @@ class MongoRepository {
|
|
|
187
198
|
}
|
|
188
199
|
});
|
|
189
200
|
}
|
|
190
|
-
const objectEventIdIn = (
|
|
201
|
+
const objectEventIdIn = (_18 = (_17 = (_16 = params.object) === null || _16 === void 0 ? void 0 : _16.event) === null || _17 === void 0 ? void 0 : _17.id) === null || _18 === void 0 ? void 0 : _18.$in;
|
|
191
202
|
if (Array.isArray(objectEventIdIn)) {
|
|
192
203
|
andConditions.push({
|
|
193
204
|
'object.event.id': {
|
|
@@ -196,7 +207,7 @@ class MongoRepository {
|
|
|
196
207
|
}
|
|
197
208
|
});
|
|
198
209
|
}
|
|
199
|
-
const objectAcceptedOfferSeatNumberIn = (
|
|
210
|
+
const objectAcceptedOfferSeatNumberIn = (_22 = (_21 = (_20 = (_19 = params.object) === null || _19 === void 0 ? void 0 : _19.acceptedOffer) === null || _20 === void 0 ? void 0 : _20.ticketedSeat) === null || _21 === void 0 ? void 0 : _21.seatNumber) === null || _22 === void 0 ? void 0 : _22.$in;
|
|
200
211
|
if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
|
|
201
212
|
andConditions.push({
|
|
202
213
|
'object.acceptedOffer.ticketedSeat.seatNumber': {
|
|
@@ -213,7 +224,7 @@ class MongoRepository {
|
|
|
213
224
|
});
|
|
214
225
|
}
|
|
215
226
|
else {
|
|
216
|
-
const typeOfEq = (
|
|
227
|
+
const typeOfEq = (_23 = params.typeOf) === null || _23 === void 0 ? void 0 : _23.$eq;
|
|
217
228
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
218
229
|
/* istanbul ignore else */
|
|
219
230
|
if (typeof typeOfEq === 'string') {
|
|
@@ -222,7 +233,7 @@ class MongoRepository {
|
|
|
222
233
|
});
|
|
223
234
|
}
|
|
224
235
|
}
|
|
225
|
-
const actionStatusIn = (
|
|
236
|
+
const actionStatusIn = (_24 = params.actionStatus) === null || _24 === void 0 ? void 0 : _24.$in;
|
|
226
237
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
227
238
|
/* istanbul ignore else */
|
|
228
239
|
if (Array.isArray(actionStatusIn)) {
|
|
@@ -253,7 +264,7 @@ class MongoRepository {
|
|
|
253
264
|
startDate: { $lte: startDateLte }
|
|
254
265
|
});
|
|
255
266
|
}
|
|
256
|
-
const fromLocationTypeOfIn = (
|
|
267
|
+
const fromLocationTypeOfIn = (_26 = (_25 = params.fromLocation) === null || _25 === void 0 ? void 0 : _25.typeOf) === null || _26 === void 0 ? void 0 : _26.$in;
|
|
257
268
|
if (Array.isArray(fromLocationTypeOfIn)) {
|
|
258
269
|
andConditions.push({
|
|
259
270
|
'fromLocation.typeOf': {
|
|
@@ -262,7 +273,7 @@ class MongoRepository {
|
|
|
262
273
|
}
|
|
263
274
|
});
|
|
264
275
|
}
|
|
265
|
-
const fromLocationAccountNumberIn = (
|
|
276
|
+
const fromLocationAccountNumberIn = (_28 = (_27 = params.fromLocation) === null || _27 === void 0 ? void 0 : _27.accountNumber) === null || _28 === void 0 ? void 0 : _28.$in;
|
|
266
277
|
if (Array.isArray(fromLocationAccountNumberIn)) {
|
|
267
278
|
andConditions.push({
|
|
268
279
|
'fromLocation.accountNumber': {
|
|
@@ -271,7 +282,7 @@ class MongoRepository {
|
|
|
271
282
|
}
|
|
272
283
|
});
|
|
273
284
|
}
|
|
274
|
-
const fromLocationAccountTypeIn = (
|
|
285
|
+
const fromLocationAccountTypeIn = (_30 = (_29 = params.fromLocation) === null || _29 === void 0 ? void 0 : _29.accountType) === null || _30 === void 0 ? void 0 : _30.$in;
|
|
275
286
|
if (Array.isArray(fromLocationAccountTypeIn)) {
|
|
276
287
|
andConditions.push({
|
|
277
288
|
'fromLocation.accountType': {
|
|
@@ -280,7 +291,7 @@ class MongoRepository {
|
|
|
280
291
|
}
|
|
281
292
|
});
|
|
282
293
|
}
|
|
283
|
-
const toLocationTypeOfIn = (
|
|
294
|
+
const toLocationTypeOfIn = (_32 = (_31 = params.toLocation) === null || _31 === void 0 ? void 0 : _31.typeOf) === null || _32 === void 0 ? void 0 : _32.$in;
|
|
284
295
|
if (Array.isArray(toLocationTypeOfIn)) {
|
|
285
296
|
andConditions.push({
|
|
286
297
|
'toLocation.typeOf': {
|
|
@@ -289,7 +300,7 @@ class MongoRepository {
|
|
|
289
300
|
}
|
|
290
301
|
});
|
|
291
302
|
}
|
|
292
|
-
const toLocationAccountNumberIn = (
|
|
303
|
+
const toLocationAccountNumberIn = (_34 = (_33 = params.toLocation) === null || _33 === void 0 ? void 0 : _33.accountNumber) === null || _34 === void 0 ? void 0 : _34.$in;
|
|
293
304
|
if (Array.isArray(toLocationAccountNumberIn)) {
|
|
294
305
|
andConditions.push({
|
|
295
306
|
'toLocation.accountNumber': {
|
|
@@ -298,7 +309,7 @@ class MongoRepository {
|
|
|
298
309
|
}
|
|
299
310
|
});
|
|
300
311
|
}
|
|
301
|
-
const toLocationAccountTypeIn = (
|
|
312
|
+
const toLocationAccountTypeIn = (_36 = (_35 = params.toLocation) === null || _35 === void 0 ? void 0 : _35.accountType) === null || _36 === void 0 ? void 0 : _36.$in;
|
|
302
313
|
if (Array.isArray(toLocationAccountTypeIn)) {
|
|
303
314
|
andConditions.push({
|
|
304
315
|
'toLocation.accountType': {
|
|
@@ -307,7 +318,7 @@ class MongoRepository {
|
|
|
307
318
|
}
|
|
308
319
|
});
|
|
309
320
|
}
|
|
310
|
-
const purposeTypeOfIn = (
|
|
321
|
+
const purposeTypeOfIn = (_38 = (_37 = params.purpose) === null || _37 === void 0 ? void 0 : _37.typeOf) === null || _38 === void 0 ? void 0 : _38.$in;
|
|
311
322
|
if (Array.isArray(purposeTypeOfIn)) {
|
|
312
323
|
andConditions.push({
|
|
313
324
|
'purpose.typeOf': {
|
|
@@ -316,7 +327,7 @@ class MongoRepository {
|
|
|
316
327
|
}
|
|
317
328
|
});
|
|
318
329
|
}
|
|
319
|
-
const purposeIdIn = (
|
|
330
|
+
const purposeIdIn = (_40 = (_39 = params.purpose) === null || _39 === void 0 ? void 0 : _39.id) === null || _40 === void 0 ? void 0 : _40.$in;
|
|
320
331
|
if (Array.isArray(purposeIdIn)) {
|
|
321
332
|
andConditions.push({
|
|
322
333
|
'purpose.id': {
|
|
@@ -325,7 +336,7 @@ class MongoRepository {
|
|
|
325
336
|
}
|
|
326
337
|
});
|
|
327
338
|
}
|
|
328
|
-
const purposeOrderNumberIn = (
|
|
339
|
+
const purposeOrderNumberIn = (_42 = (_41 = params.purpose) === null || _41 === void 0 ? void 0 : _41.orderNumber) === null || _42 === void 0 ? void 0 : _42.$in;
|
|
329
340
|
if (Array.isArray(purposeOrderNumberIn)) {
|
|
330
341
|
andConditions.push({
|
|
331
342
|
'purpose.orderNumber': {
|
|
@@ -334,7 +345,7 @@ class MongoRepository {
|
|
|
334
345
|
}
|
|
335
346
|
});
|
|
336
347
|
}
|
|
337
|
-
const resultTypeOfIn = (
|
|
348
|
+
const resultTypeOfIn = (_44 = (_43 = params.result) === null || _43 === void 0 ? void 0 : _43.typeOf) === null || _44 === void 0 ? void 0 : _44.$in;
|
|
338
349
|
if (Array.isArray(resultTypeOfIn)) {
|
|
339
350
|
andConditions.push({
|
|
340
351
|
'result.typeOf': {
|
|
@@ -343,7 +354,7 @@ class MongoRepository {
|
|
|
343
354
|
}
|
|
344
355
|
});
|
|
345
356
|
}
|
|
346
|
-
const resultIdIn = (
|
|
357
|
+
const resultIdIn = (_46 = (_45 = params.result) === null || _45 === void 0 ? void 0 : _45.id) === null || _46 === void 0 ? void 0 : _46.$in;
|
|
347
358
|
if (Array.isArray(resultIdIn)) {
|
|
348
359
|
andConditions.push({
|
|
349
360
|
'result.id': {
|
|
@@ -352,7 +363,7 @@ class MongoRepository {
|
|
|
352
363
|
}
|
|
353
364
|
});
|
|
354
365
|
}
|
|
355
|
-
const resultOrderNumberIn = (
|
|
366
|
+
const resultOrderNumberIn = (_48 = (_47 = params.result) === null || _47 === void 0 ? void 0 : _47.orderNumber) === null || _48 === void 0 ? void 0 : _48.$in;
|
|
356
367
|
if (Array.isArray(resultOrderNumberIn)) {
|
|
357
368
|
andConditions.push({
|
|
358
369
|
'result.orderNumber': {
|
|
@@ -361,7 +372,7 @@ class MongoRepository {
|
|
|
361
372
|
}
|
|
362
373
|
});
|
|
363
374
|
}
|
|
364
|
-
const resultCodeIn = (
|
|
375
|
+
const resultCodeIn = (_50 = (_49 = params.result) === null || _49 === void 0 ? void 0 : _49.code) === null || _50 === void 0 ? void 0 : _50.$in;
|
|
365
376
|
if (Array.isArray(resultCodeIn)) {
|
|
366
377
|
andConditions.push({
|
|
367
378
|
'result.code': {
|
|
@@ -12,6 +12,7 @@ const schema = new mongoose.Schema({
|
|
|
12
12
|
project: mongoose.SchemaTypes.Mixed,
|
|
13
13
|
actionStatus: String,
|
|
14
14
|
typeOf: String,
|
|
15
|
+
description: String,
|
|
15
16
|
agent: mongoose.SchemaTypes.Mixed,
|
|
16
17
|
recipient: mongoose.SchemaTypes.Mixed,
|
|
17
18
|
result: mongoose.SchemaTypes.Mixed,
|
|
@@ -32,7 +33,8 @@ const schema = new mongoose.Schema({
|
|
|
32
33
|
id: true,
|
|
33
34
|
read: 'primaryPreferred',
|
|
34
35
|
writeConcern: writeConcern,
|
|
35
|
-
|
|
36
|
+
// true化(2022-11-12~)
|
|
37
|
+
strict: true,
|
|
36
38
|
useNestedStrict: true,
|
|
37
39
|
timestamps: {
|
|
38
40
|
createdAt: 'createdAt',
|
|
@@ -66,6 +68,12 @@ schema.index({ endDate: -1, startDate: -1 }, {
|
|
|
66
68
|
endDate: { $exists: true }
|
|
67
69
|
}
|
|
68
70
|
});
|
|
71
|
+
schema.index({ 'location.id': 1, startDate: -1 }, {
|
|
72
|
+
name: 'searchByLocationId',
|
|
73
|
+
partialFilterExpression: {
|
|
74
|
+
'location.id': { $exists: true }
|
|
75
|
+
}
|
|
76
|
+
});
|
|
69
77
|
schema.index({ 'location.identifier': 1, startDate: -1 }, {
|
|
70
78
|
name: 'searchByLocationIdentifier',
|
|
71
79
|
partialFilterExpression: {
|
|
@@ -10,12 +10,13 @@ function createPayActions(params) {
|
|
|
10
10
|
const payObject = createPayObject(params);
|
|
11
11
|
const informPaymentActions = createInformPaymentActions(params);
|
|
12
12
|
if (payObject !== undefined) {
|
|
13
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
13
14
|
const simpleOrder = {
|
|
14
15
|
// project: params.order.project,
|
|
15
16
|
typeOf: params.order.typeOf,
|
|
16
17
|
seller: params.order.seller,
|
|
17
18
|
// mask
|
|
18
|
-
customer:
|
|
19
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
19
20
|
confirmationNumber: params.order.confirmationNumber,
|
|
20
21
|
orderNumber: params.order.orderNumber,
|
|
21
22
|
price: params.order.price,
|
|
@@ -24,11 +24,11 @@ const TOKEN_EXPIRES_IN = 604800;
|
|
|
24
24
|
function onOrderStatusChanged(params) {
|
|
25
25
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
let tasks = [];
|
|
27
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
27
28
|
const simpleOrder = {
|
|
28
|
-
// project: params.order.project,
|
|
29
29
|
typeOf: params.order.typeOf,
|
|
30
30
|
seller: params.order.seller,
|
|
31
|
-
customer:
|
|
31
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
32
32
|
confirmationNumber: params.order.confirmationNumber,
|
|
33
33
|
orderNumber: params.order.orderNumber,
|
|
34
34
|
price: params.order.price,
|
|
@@ -89,11 +89,12 @@ function placeOrderWithoutTransaction(params) {
|
|
|
89
89
|
// orderNumber: params.object.orderNumber
|
|
90
90
|
// })({ transaction: repos.transaction });
|
|
91
91
|
// アクションを作成する(2022-04-11~)
|
|
92
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
92
93
|
const simpleOrder = {
|
|
93
94
|
// project: order.project,
|
|
94
95
|
typeOf: order.typeOf,
|
|
95
96
|
seller: order.seller,
|
|
96
|
-
customer:
|
|
97
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
97
98
|
confirmationNumber: order.confirmationNumber,
|
|
98
99
|
orderNumber: order.orderNumber,
|
|
99
100
|
price: order.price,
|
|
@@ -148,11 +149,12 @@ function placeOrder(params) {
|
|
|
148
149
|
orderNumber: params.object.orderNumber
|
|
149
150
|
})({ transaction: repos.transaction });
|
|
150
151
|
// アクションを作成する(2022-04-11~)
|
|
152
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
151
153
|
const simpleOrder = {
|
|
152
154
|
// project: order.project,
|
|
153
155
|
typeOf: order.typeOf,
|
|
154
156
|
seller: order.seller,
|
|
155
|
-
customer:
|
|
157
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
156
158
|
confirmationNumber: order.confirmationNumber,
|
|
157
159
|
orderNumber: order.orderNumber,
|
|
158
160
|
price: order.price,
|
|
@@ -42,11 +42,12 @@ function sendOrder(params) {
|
|
|
42
42
|
}
|
|
43
43
|
// SendOrderアクションを作成する
|
|
44
44
|
// minimizeする(2022-04-18~)
|
|
45
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
45
46
|
const simpleOrder = {
|
|
46
47
|
// project: order.project,
|
|
47
48
|
typeOf: order.typeOf,
|
|
48
49
|
seller: order.seller,
|
|
49
|
-
customer:
|
|
50
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
50
51
|
confirmationNumber: order.confirmationNumber,
|
|
51
52
|
orderNumber: order.orderNumber,
|
|
52
53
|
price: order.price,
|
|
@@ -34,12 +34,13 @@ function createPotentialActions(params) {
|
|
|
34
34
|
const givePointAwardActions = yield (0, givePointAward_1.createGivePointAwardActions)(params);
|
|
35
35
|
// 注文配送メール送信設定
|
|
36
36
|
const sendEmailMessageActions = yield (0, sendEmailMessage_1.createSendEmailMessageActions)(params);
|
|
37
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
37
38
|
const simpleOrder = {
|
|
38
39
|
// project: params.order.project,
|
|
39
40
|
typeOf: params.order.typeOf,
|
|
40
41
|
seller: params.order.seller,
|
|
41
42
|
// mask
|
|
42
|
-
customer:
|
|
43
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
43
44
|
confirmationNumber: params.order.confirmationNumber,
|
|
44
45
|
orderNumber: params.order.orderNumber,
|
|
45
46
|
price: params.order.price,
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.
|
|
13
|
-
"@cinerino/sdk": "3.132.0
|
|
12
|
+
"@chevre/factory": "4.277.0-alpha.0",
|
|
13
|
+
"@cinerino/sdk": "3.132.0",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "20.1.0-alpha.
|
|
123
|
+
"version": "20.1.0-alpha.4"
|
|
124
124
|
}
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../../factory';
|
|
2
|
-
export declare type IAuthorizeSeatReservationOffer = factory.action.authorize.offer.seatReservation.IAction<factory.service.webAPI.Identifier>;
|
|
3
|
-
/**
|
|
4
|
-
* 予約確定アクションを作成する
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 予約確定オブジェクトを作成する
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 予約確定オブジェクトを作成する
|
|
11
|
-
*/
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import { PhoneNumberFormat, PhoneNumberUtil } from 'google-libphonenumber';
|
|
3
|
-
// import { format } from 'util';
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
/**
|
|
6
|
-
* 予約確定アクションを作成する
|
|
7
|
-
*/
|
|
8
|
-
// export async function createConfirmReservationActions(params: {
|
|
9
|
-
// order: factory.order.IOrder;
|
|
10
|
-
// transaction: factory.transaction.placeOrder.ITransaction;
|
|
11
|
-
// createConfirmReserveActions: boolean;
|
|
12
|
-
// }): Promise<factory.action.interact.confirm.reservation.IAttributes<factory.service.webAPI.Identifier>[]> {
|
|
13
|
-
// const confirmReservationActions: factory.action.interact.confirm.reservation.IAttributes<factory.service.webAPI.Identifier>[] = [];
|
|
14
|
-
// const seatReservationAuthorizeActions = <IAuthorizeSeatReservationOffer[]>
|
|
15
|
-
// params.transaction.object.authorizeActions
|
|
16
|
-
// .filter((a) => a.actionStatus === factory.actionStatusType.CompletedActionStatus)
|
|
17
|
-
// .filter((a) => a.object.typeOf === factory.action.authorize.offer.seatReservation.ObjectType.SeatReservation);
|
|
18
|
-
// const purpose: factory.order.ISimpleOrder = createPurpose({ order: params.order });
|
|
19
|
-
// seatReservationAuthorizeActions.forEach((a) => {
|
|
20
|
-
// const actionResult = a.result;
|
|
21
|
-
// if (a.instrument === undefined) {
|
|
22
|
-
// a.instrument = {
|
|
23
|
-
// typeOf: 'WebAPI',
|
|
24
|
-
// identifier: factory.service.webAPI.Identifier.Chevre
|
|
25
|
-
// };
|
|
26
|
-
// }
|
|
27
|
-
// if (actionResult !== undefined) {
|
|
28
|
-
// const responseBody = actionResult.responseBody;
|
|
29
|
-
// let confirmReservationObject: factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.Chevre>
|
|
30
|
-
// | factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.COA>;
|
|
31
|
-
// switch (a.instrument.identifier) {
|
|
32
|
-
// case factory.service.webAPI.Identifier.COA:
|
|
33
|
-
// confirmReservationObject = createConfirmReservationActionObject4COA({
|
|
34
|
-
// order: params.order,
|
|
35
|
-
// // tslint:disable-next-line:max-line-length
|
|
36
|
-
// tslint:disable-next-line:max-line-length
|
|
37
|
-
// reserveTransaction: <factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.COA>>responseBody,
|
|
38
|
-
// requestBody: actionResult.requestBody,
|
|
39
|
-
// price: Number(actionResult.price),
|
|
40
|
-
// acceptedOffers: <factory.action.authorize.offer.seatReservation.IAcceptedOffer4COA[]>a.object.acceptedOffer
|
|
41
|
-
// });
|
|
42
|
-
// break;
|
|
43
|
-
// default:
|
|
44
|
-
// const reserveTransactionNumber = a.object.pendingTransaction?.transactionNumber;
|
|
45
|
-
// if (typeof reserveTransactionNumber !== 'string') {
|
|
46
|
-
// throw new factory.errors.NotFound('AuthorizaAction.object.pendingTransaction.transactionNumber');
|
|
47
|
-
// }
|
|
48
|
-
// confirmReservationObject = createConfirmReservationActionObject({
|
|
49
|
-
// order: params.order,
|
|
50
|
-
// // transaction: params.transaction,
|
|
51
|
-
// // tslint:disable-next-line:max-line-length
|
|
52
|
-
// tslint:disable-next-line:max-line-length
|
|
53
|
-
// // reserveTransaction: <factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.Chevre>>responseBody,
|
|
54
|
-
// reserveTransactionNumber
|
|
55
|
-
// });
|
|
56
|
-
// }
|
|
57
|
-
// if (params.createConfirmReserveActions) {
|
|
58
|
-
// confirmReservationActions.push({
|
|
59
|
-
// project: params.transaction.project,
|
|
60
|
-
// typeOf: <factory.actionType.ConfirmAction>factory.actionType.ConfirmAction,
|
|
61
|
-
// object: confirmReservationObject,
|
|
62
|
-
// // agent: Projectに統一(2022-05-16~)
|
|
63
|
-
// agent: params.transaction.project,
|
|
64
|
-
// // agent: params.transaction.agent,
|
|
65
|
-
// purpose: purpose,
|
|
66
|
-
// instrument: a.instrument
|
|
67
|
-
// });
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// });
|
|
71
|
-
// return confirmReservationActions;
|
|
72
|
-
// }
|
|
73
|
-
// function createPurpose(params: {
|
|
74
|
-
// order: factory.order.IOrder;
|
|
75
|
-
// }): factory.order.ISimpleOrder {
|
|
76
|
-
// return {
|
|
77
|
-
// project: params.order.project,
|
|
78
|
-
// typeOf: params.order.typeOf,
|
|
79
|
-
// seller: params.order.seller,
|
|
80
|
-
// // mask
|
|
81
|
-
// customer: createMaskedCustomer(params.order),
|
|
82
|
-
// confirmationNumber: params.order.confirmationNumber,
|
|
83
|
-
// orderNumber: params.order.orderNumber,
|
|
84
|
-
// price: params.order.price,
|
|
85
|
-
// priceCurrency: params.order.priceCurrency,
|
|
86
|
-
// orderDate: params.order.orderDate
|
|
87
|
-
// };
|
|
88
|
-
// }
|
|
89
|
-
/**
|
|
90
|
-
* 予約確定オブジェクトを作成する
|
|
91
|
-
*/
|
|
92
|
-
// function createConfirmReservationActionObject4COA(params: {
|
|
93
|
-
// order: factory.order.IOrder;
|
|
94
|
-
// reserveTransaction: factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.COA>;
|
|
95
|
-
// requestBody: any;
|
|
96
|
-
// price: number;
|
|
97
|
-
// acceptedOffers: factory.action.authorize.offer.seatReservation.IAcceptedOffer4COA[];
|
|
98
|
-
// }): factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.COA> {
|
|
99
|
-
// const price = params.price;
|
|
100
|
-
// const customer = params.order.customer;
|
|
101
|
-
// const updTmpReserveSeatArgs = params.requestBody;
|
|
102
|
-
// const updTmpReserveSeatResult = params.reserveTransaction;
|
|
103
|
-
// // 電話番号のフォーマットを日本人にリーダブルに調整(COAではこのフォーマットで扱うので)
|
|
104
|
-
// const phoneUtil = PhoneNumberUtil.getInstance();
|
|
105
|
-
// const phoneNumber = phoneUtil.parse(customer.telephone, 'JP');
|
|
106
|
-
// let telNum = phoneUtil.format(phoneNumber, PhoneNumberFormat.NATIONAL);
|
|
107
|
-
// // COAでは数字のみ受け付けるので数字以外を除去
|
|
108
|
-
// telNum = telNum.replace(/[^\d]/g, '');
|
|
109
|
-
// const mailAddr = customer.email;
|
|
110
|
-
// if (mailAddr === undefined) {
|
|
111
|
-
// throw new factory.errors.Argument('order', 'order.customer.email undefined');
|
|
112
|
-
// }
|
|
113
|
-
// return {
|
|
114
|
-
// theaterCode: updTmpReserveSeatArgs.theaterCode,
|
|
115
|
-
// dateJouei: updTmpReserveSeatArgs.dateJouei,
|
|
116
|
-
// titleCode: updTmpReserveSeatArgs.titleCode,
|
|
117
|
-
// titleBranchNum: updTmpReserveSeatArgs.titleBranchNum,
|
|
118
|
-
// timeBegin: updTmpReserveSeatArgs.timeBegin,
|
|
119
|
-
// tmpReserveNum: updTmpReserveSeatResult.tmpReserveNum,
|
|
120
|
-
// tslint:disable-next-line:no-irregular-whitespace
|
|
121
|
-
// reserveName: format('%s %s', customer.familyName, customer.givenName),
|
|
122
|
-
// tslint:disable-next-line:no-irregular-whitespace
|
|
123
|
-
// reserveNameJkana: format('%s %s', customer.familyName, customer.givenName),
|
|
124
|
-
// telNum: telNum,
|
|
125
|
-
// mailAddr: mailAddr,
|
|
126
|
-
// reserveAmount: price, // デフォルトのpriceCurrencyがJPYなのでこれでよし
|
|
127
|
-
// listTicket: params.acceptedOffers.map((o) => o.ticketInfo),
|
|
128
|
-
// transactionNumber: String(updTmpReserveSeatResult.tmpReserveNum),
|
|
129
|
-
// typeOf: 'COAReserveTransaction'
|
|
130
|
-
// };
|
|
131
|
-
// }
|
|
132
|
-
/**
|
|
133
|
-
* 予約確定オブジェクトを作成する
|
|
134
|
-
*/
|
|
135
|
-
// function createConfirmReservationActionObject(params: {
|
|
136
|
-
// order: factory.order.IOrder;
|
|
137
|
-
// reserveTransactionNumber: string;
|
|
138
|
-
// }): factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.Chevre> {
|
|
139
|
-
// return {
|
|
140
|
-
// typeOf: factory.assetTransactionType.Reserve,
|
|
141
|
-
// transactionNumber: params.reserveTransactionNumber,
|
|
142
|
-
// potentialActions: {
|
|
143
|
-
// reserve: {
|
|
144
|
-
// purpose: {
|
|
145
|
-
// confirmationNumber: params.order.confirmationNumber,
|
|
146
|
-
// orderNumber: params.order.orderNumber,
|
|
147
|
-
// typeOf: params.order.typeOf
|
|
148
|
-
// }
|
|
149
|
-
// }
|
|
150
|
-
// }
|
|
151
|
-
// };
|
|
152
|
-
// }
|
|
153
|
-
// function createReservationUnderNameIdentifier(params: {
|
|
154
|
-
// order: factory.order.IOrder;
|
|
155
|
-
// transaction: factory.transaction.placeOrder.ITransaction;
|
|
156
|
-
// }): factory.propertyValue.IPropertyValue<string>[] {
|
|
157
|
-
// const order = params.order;
|
|
158
|
-
// const customer = order.customer;
|
|
159
|
-
// // 予約のunderName.identifierを決定する
|
|
160
|
-
// return [
|
|
161
|
-
// { name: 'orderNumber', value: order.orderNumber },
|
|
162
|
-
// // 不要なので廃止(2022-05-24~)
|
|
163
|
-
// // { name: 'transaction', value: params.transaction.id },
|
|
164
|
-
// // ↓legacy-reservationの印刷アウトプットで使用(2022-02-09廃止)
|
|
165
|
-
// // { name: 'paymentMethod', value: paymentMethodNames },
|
|
166
|
-
// ...(Array.isArray(customer.identifier)) ? customer.identifier : []
|
|
167
|
-
// ];
|
|
168
|
-
// }
|
|
169
|
-
// function createReservationUnderName(params: {
|
|
170
|
-
// order: factory.order.IOrder;
|
|
171
|
-
// identifier: factory.propertyValue.IPropertyValue<string>[];
|
|
172
|
-
// }): factory.reservation.IUnderName<factory.reservationType.EventReservation> {
|
|
173
|
-
// return {
|
|
174
|
-
// identifier: params.identifier,
|
|
175
|
-
// name: String(params.order.customer.name),
|
|
176
|
-
// typeOf: params.order.customer.typeOf,
|
|
177
|
-
// ...(typeof params.order.customer.address === 'string') ? { address: params.order.customer.address } : undefined,
|
|
178
|
-
// ...(typeof params.order.customer.age === 'string') ? { age: params.order.customer.age } : undefined,
|
|
179
|
-
// ...(typeof params.order.customer.email === 'string') ? { email: params.order.customer.email } : undefined,
|
|
180
|
-
// ...(typeof params.order.customer.familyName === 'string') ? { familyName: params.order.customer.familyName } : undefined,
|
|
181
|
-
// ...(typeof params.order.customer.gender === 'string') ? { gender: params.order.customer.gender } : undefined,
|
|
182
|
-
// ...(typeof params.order.customer.givenName === 'string') ? { givenName: params.order.customer.givenName } : undefined,
|
|
183
|
-
// ...(typeof params.order.customer.id === 'string') ? { id: params.order.customer.id } : undefined,
|
|
184
|
-
// ...(typeof params.order.customer.telephone === 'string') ? { telephone: params.order.customer.telephone } : undefined,
|
|
185
|
-
// ...(typeof params.order.customer.url === 'string') ? { url: params.order.customer.url } : undefined
|
|
186
|
-
// };
|
|
187
|
-
// }
|