@chevre/domain 20.1.0-alpha.1 → 20.1.0-alpha.3

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.
@@ -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 locationIdentifierEq = (_h = (_g = params.location) === null || _g === void 0 ? void 0 : _g.identifier) === null || _h === void 0 ? void 0 : _h.$eq;
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 = (_k = (_j = params.object) === null || _j === void 0 ? void 0 : _j.paymentMethodId) === null || _k === void 0 ? void 0 : _k.$eq;
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 = (_o = (_m = (_l = params.object) === null || _l === void 0 ? void 0 : _l.object) === null || _m === void 0 ? void 0 : _m.paymentMethodId) === null || _o === void 0 ? void 0 : _o.$eq;
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 = (_r = (_q = (_p = params.object) === null || _p === void 0 ? void 0 : _p.reservationFor) === null || _q === void 0 ? void 0 : _q.id) === null || _r === void 0 ? void 0 : _r.$eq;
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 = (_u = (_t = (_s = params.object) === null || _s === void 0 ? void 0 : _s.paymentMethod) === null || _t === void 0 ? void 0 : _t.accountId) === null || _u === void 0 ? void 0 : _u.$eq;
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 = (_x = (_w = (_v = params.object) === null || _v === void 0 ? void 0 : _v.paymentMethod) === null || _w === void 0 ? void 0 : _w.paymentMethodId) === null || _x === void 0 ? void 0 : _x.$eq;
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 = (_0 = (_z = (_y = params.object) === null || _y === void 0 ? void 0 : _y.paymentMethod) === null || _z === void 0 ? void 0 : _z.paymentMethodId) === null || _0 === void 0 ? void 0 : _0.$in;
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 = (_3 = (_2 = (_1 = params.object) === null || _1 === void 0 ? void 0 : _1.paymentMethod) === null || _2 === void 0 ? void 0 : _2.typeOf) === null || _3 === void 0 ? void 0 : _3.$eq;
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 = (_5 = (_4 = params.object) === null || _4 === void 0 ? void 0 : _4.typeOf) === null || _5 === void 0 ? void 0 : _5.$eq;
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 = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$in;
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 = (_9 = (_8 = params.object) === null || _8 === void 0 ? void 0 : _8.id) === null || _9 === void 0 ? void 0 : _9.$eq;
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 = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.id) === null || _11 === void 0 ? void 0 : _11.$in;
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 = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.orderNumber) === null || _13 === void 0 ? void 0 : _13.$in;
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 = (_16 = (_15 = (_14 = params.object) === null || _14 === void 0 ? void 0 : _14.event) === null || _15 === void 0 ? void 0 : _15.id) === null || _16 === void 0 ? void 0 : _16.$in;
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 = (_20 = (_19 = (_18 = (_17 = params.object) === null || _17 === void 0 ? void 0 : _17.acceptedOffer) === null || _18 === void 0 ? void 0 : _18.ticketedSeat) === null || _19 === void 0 ? void 0 : _19.seatNumber) === null || _20 === void 0 ? void 0 : _20.$in;
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 = (_21 = params.typeOf) === null || _21 === void 0 ? void 0 : _21.$eq;
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 = (_22 = params.actionStatus) === null || _22 === void 0 ? void 0 : _22.$in;
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 = (_24 = (_23 = params.fromLocation) === null || _23 === void 0 ? void 0 : _23.typeOf) === null || _24 === void 0 ? void 0 : _24.$in;
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 = (_26 = (_25 = params.fromLocation) === null || _25 === void 0 ? void 0 : _25.accountNumber) === null || _26 === void 0 ? void 0 : _26.$in;
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 = (_28 = (_27 = params.fromLocation) === null || _27 === void 0 ? void 0 : _27.accountType) === null || _28 === void 0 ? void 0 : _28.$in;
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 = (_30 = (_29 = params.toLocation) === null || _29 === void 0 ? void 0 : _29.typeOf) === null || _30 === void 0 ? void 0 : _30.$in;
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 = (_32 = (_31 = params.toLocation) === null || _31 === void 0 ? void 0 : _31.accountNumber) === null || _32 === void 0 ? void 0 : _32.$in;
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 = (_34 = (_33 = params.toLocation) === null || _33 === void 0 ? void 0 : _33.accountType) === null || _34 === void 0 ? void 0 : _34.$in;
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 = (_36 = (_35 = params.purpose) === null || _35 === void 0 ? void 0 : _35.typeOf) === null || _36 === void 0 ? void 0 : _36.$in;
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 = (_38 = (_37 = params.purpose) === null || _37 === void 0 ? void 0 : _37.id) === null || _38 === void 0 ? void 0 : _38.$in;
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 = (_40 = (_39 = params.purpose) === null || _39 === void 0 ? void 0 : _39.orderNumber) === null || _40 === void 0 ? void 0 : _40.$in;
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 = (_42 = (_41 = params.result) === null || _41 === void 0 ? void 0 : _41.typeOf) === null || _42 === void 0 ? void 0 : _42.$in;
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 = (_44 = (_43 = params.result) === null || _43 === void 0 ? void 0 : _43.id) === null || _44 === void 0 ? void 0 : _44.$in;
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 = (_46 = (_45 = params.result) === null || _45 === void 0 ? void 0 : _45.orderNumber) === null || _46 === void 0 ? void 0 : _46.$in;
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 = (_48 = (_47 = params.result) === null || _47 === void 0 ? void 0 : _47.code) === null || _48 === void 0 ? void 0 : _48.$in;
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
- strict: false,
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: {
@@ -5,12 +5,13 @@ const factory = require("../../../factory");
5
5
  const order_1 = require("../../../factory/order");
6
6
  const USE_NEW_PRICE_SPEC_ON_INFORM_PAY_ACTION = process.env.USE_NEW_PRICE_SPEC_ON_INFORM_PAY_ACTION === '1';
7
7
  function createPayActions(params) {
8
+ var _a;
8
9
  const payActions = [];
9
10
  const payObject = createPayObject(params);
10
11
  const informPaymentActions = createInformPaymentActions(params);
11
12
  if (payObject !== undefined) {
12
13
  const simpleOrder = {
13
- project: params.order.project,
14
+ // project: params.order.project,
14
15
  typeOf: params.order.typeOf,
15
16
  seller: params.order.seller,
16
17
  // mask
@@ -21,25 +22,16 @@ function createPayActions(params) {
21
22
  priceCurrency: params.order.priceCurrency,
22
23
  orderDate: params.order.orderDate
23
24
  };
24
- const payAction = {
25
- project: params.transaction.project,
26
- typeOf: factory.actionType.PayAction,
27
- object: [payObject],
28
- agent: params.transaction.project,
29
- potentialActions: {
25
+ const payAction = Object.assign({ project: params.transaction.project, typeOf: factory.actionType.PayAction, object: [payObject], agent: params.transaction.project, potentialActions: {
30
26
  add2report: true,
31
27
  informPayment: informPaymentActions
32
- },
33
- purpose: simpleOrder,
34
- recipient: {
28
+ }, purpose: simpleOrder, recipient: {
35
29
  id: params.transaction.recipient.id,
36
30
  name: params.transaction.recipient.name,
37
31
  typeOf: params.transaction.recipient.typeOf
38
- }
39
- // ...(params.potentialActions?.pay?.purpose !== undefined)
40
- // ? { purpose: params.potentialActions?.pay?.purpose }
41
- // : { purpose: { typeOf: transaction.typeOf, transactionNumber: transaction.transactionNumber, id: transaction.id } }
42
- };
32
+ } }, (typeof ((_a = params.transaction.location) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
33
+ ? { location: params.transaction.location }
34
+ : undefined);
43
35
  payActions.push(payAction);
44
36
  }
45
37
  return payActions;
@@ -46,7 +46,7 @@ function getOrderWithToken(params) {
46
46
  typeOf: params.order.seller.typeOf
47
47
  };
48
48
  const order4token = {
49
- project: params.order.project,
49
+ // project: params.order.project,
50
50
  typeOf: params.order.typeOf,
51
51
  seller: seller4orderToken,
52
52
  customer: customer4orderToken,
@@ -25,7 +25,7 @@ function onOrderStatusChanged(params) {
25
25
  return (repos) => __awaiter(this, void 0, void 0, function* () {
26
26
  let tasks = [];
27
27
  const simpleOrder = {
28
- project: params.order.project,
28
+ // project: params.order.project,
29
29
  typeOf: params.order.typeOf,
30
30
  seller: params.order.seller,
31
31
  customer: (0, order_1.createMaskedCustomer)(params.order),
@@ -90,7 +90,7 @@ function placeOrderWithoutTransaction(params) {
90
90
  // })({ transaction: repos.transaction });
91
91
  // アクションを作成する(2022-04-11~)
92
92
  const simpleOrder = {
93
- project: order.project,
93
+ // project: order.project,
94
94
  typeOf: order.typeOf,
95
95
  seller: order.seller,
96
96
  customer: (0, order_1.createMaskedCustomer)(order),
@@ -101,7 +101,7 @@ function placeOrderWithoutTransaction(params) {
101
101
  orderDate: order.orderDate
102
102
  };
103
103
  const orderActionAttributes = {
104
- agent: (typeof ((_a = params.agent) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.agent : simpleOrder.project,
104
+ agent: (typeof ((_a = params.agent) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.agent : order.project,
105
105
  object: simpleOrder,
106
106
  potentialActions: {},
107
107
  project: order.project,
@@ -149,7 +149,7 @@ function placeOrder(params) {
149
149
  })({ transaction: repos.transaction });
150
150
  // アクションを作成する(2022-04-11~)
151
151
  const simpleOrder = {
152
- project: order.project,
152
+ // project: order.project,
153
153
  typeOf: order.typeOf,
154
154
  seller: order.seller,
155
155
  customer: (0, order_1.createMaskedCustomer)(order),
@@ -160,7 +160,7 @@ function placeOrder(params) {
160
160
  orderDate: order.orderDate
161
161
  };
162
162
  const orderActionAttributes = {
163
- agent: (typeof ((_a = params.agent) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.agent : simpleOrder.project,
163
+ agent: (typeof ((_a = params.agent) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.agent : order.project,
164
164
  object: simpleOrder,
165
165
  potentialActions: {},
166
166
  project: order.project,
@@ -40,7 +40,7 @@ function returnOrder(params) {
40
40
  throw new factory.errors.NotFound(factory.transactionType.ReturnOrder);
41
41
  }
42
42
  const simpleOrder = {
43
- project: order.project,
43
+ // project: order.project,
44
44
  typeOf: order.typeOf,
45
45
  seller: order.seller,
46
46
  customer: (0, order_1.createMaskedCustomer)(order),
@@ -43,7 +43,7 @@ function sendOrder(params) {
43
43
  // SendOrderアクションを作成する
44
44
  // minimizeする(2022-04-18~)
45
45
  const simpleOrder = {
46
- project: order.project,
46
+ // project: order.project,
47
47
  typeOf: order.typeOf,
48
48
  seller: order.seller,
49
49
  customer: (0, order_1.createMaskedCustomer)(order),
@@ -54,7 +54,7 @@ function sendOrder(params) {
54
54
  orderDate: order.orderDate
55
55
  };
56
56
  const sendOrderActionAttributes = {
57
- agent: (typeof ((_a = params.agent) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.agent : simpleOrder.project,
57
+ agent: (typeof ((_a = params.agent) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.agent : order.project,
58
58
  object: simpleOrder,
59
59
  potentialActions: {
60
60
  // sendEmailMessage: undefined
@@ -43,7 +43,7 @@ function createGivePointAwardActions(params) {
43
43
  issuedThrough: { id: String((_h = (_g = (_f = givePointAwardParam.object) === null || _f === void 0 ? void 0 : _f.toLocation) === null || _g === void 0 ? void 0 : _g.issuedThrough) === null || _h === void 0 ? void 0 : _h.id) }
44
44
  }, description: (typeof description === 'string') ? description : '' }, (typeof pointAwardIdentifier === 'string') ? { identifier: pointAwardIdentifier } : undefined),
45
45
  purpose: {
46
- project: params.order.project,
46
+ // project: params.order.project,
47
47
  typeOf: params.order.typeOf,
48
48
  seller: params.order.seller,
49
49
  // mask
@@ -61,7 +61,7 @@ function createMoneyTransferActions(params) {
61
61
  // identifier: pendingTransaction.object.toLocation.identifier
62
62
  // },
63
63
  purpose: {
64
- project: params.order.project,
64
+ // project: params.order.project,
65
65
  typeOf: params.order.typeOf,
66
66
  seller: params.order.seller,
67
67
  // mask
@@ -46,7 +46,7 @@ function createRegisterServiceActions(params) {
46
46
  agent: params.transaction.project,
47
47
  // agent: params.transaction.agent,
48
48
  purpose: {
49
- project: params.order.project,
49
+ // project: params.order.project,
50
50
  typeOf: params.order.typeOf,
51
51
  seller: params.order.seller,
52
52
  // mask
@@ -20,7 +20,7 @@ function createSendEmailMessageActions(params) {
20
20
  const sendEmailMessageActions = [];
21
21
  const project = params.transaction.project;
22
22
  const sendActionPurpose = {
23
- project: params.order.project,
23
+ // project: params.order.project,
24
24
  typeOf: params.order.typeOf,
25
25
  seller: params.order.seller,
26
26
  // mask
@@ -35,7 +35,7 @@ function createPotentialActions(params) {
35
35
  // 注文配送メール送信設定
36
36
  const sendEmailMessageActions = yield (0, sendEmailMessage_1.createSendEmailMessageActions)(params);
37
37
  const simpleOrder = {
38
- project: params.order.project,
38
+ // project: params.order.project,
39
39
  typeOf: params.order.typeOf,
40
40
  seller: params.order.seller,
41
41
  // mask
@@ -18,7 +18,7 @@ function createReturnMoneyTransferActions(params) {
18
18
  const order = params.order;
19
19
  const returnMoneyTransferActions = [];
20
20
  const purpose = {
21
- project: order.project,
21
+ // project: order.project,
22
22
  typeOf: order.typeOf,
23
23
  seller: order.seller,
24
24
  // mask
@@ -40,7 +40,7 @@ function createReturnPaymentMethodPotentialActions(params) {
40
40
  email: emailCustomization
41
41
  });
42
42
  const sendActionPurpose = {
43
- project: order.project,
43
+ // project: order.project,
44
44
  typeOf: order.typeOf,
45
45
  seller: order.seller,
46
46
  // mask
@@ -104,7 +104,7 @@ function createReturnPaymentMethodActions(params) {
104
104
  name: String(order.customer.name)
105
105
  },
106
106
  purpose: {
107
- project: order.project,
107
+ // project: order.project,
108
108
  typeOf: order.typeOf,
109
109
  seller: order.seller,
110
110
  // mask
@@ -174,7 +174,7 @@ function createReturnPaymentMethodIssuedThroughMovieTicketActions(params) {
174
174
  name: String(order.customer.name)
175
175
  },
176
176
  purpose: {
177
- project: order.project,
177
+ // project: order.project,
178
178
  typeOf: order.typeOf,
179
179
  seller: order.seller,
180
180
  // mask
@@ -50,7 +50,7 @@ function createReturnPointAwardActions(params) {
50
50
  // const transaction = params.transaction;
51
51
  const order = params.order;
52
52
  const purpose = {
53
- project: order.project,
53
+ // project: order.project,
54
54
  typeOf: order.typeOf,
55
55
  seller: order.seller,
56
56
  // mask
@@ -18,7 +18,7 @@ function createSendEmailMessaegActionsOnReturn(params) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  const order = params.order;
20
20
  const sendActionPurpose = {
21
- project: order.project,
21
+ // project: order.project,
22
22
  typeOf: order.typeOf,
23
23
  seller: order.seller,
24
24
  // mask
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.276.0-alpha.1",
13
- "@cinerino/sdk": "3.132.0-alpha.0",
12
+ "@chevre/factory": "4.276.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.1"
123
+ "version": "20.1.0-alpha.3"
124
124
  }