@chevre/domain 21.19.0-alpha.11 → 21.19.0-alpha.13

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.
@@ -28,6 +28,7 @@ async function main() {
28
28
  },
29
29
  priceSpecification: {
30
30
  appliesToMovieTicket: {
31
+ $size: 2,
31
32
  serviceOutput: {
32
33
  typeOf: {
33
34
  // $eq: '',
@@ -54,7 +55,7 @@ async function main() {
54
55
  // ]
55
56
  // }
56
57
  },
57
- { project: 1 }
58
+ { project: 1, name: 1 }
58
59
  );
59
60
  console.log(offers.map((offer) => {
60
61
  return `${offer.project?.id} ${offer.id} ${offer.parentOffer?.id} ${offer.identifier} ${offer.name?.ja}`;
@@ -22,7 +22,7 @@ class MongoRepository {
22
22
  }
23
23
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
24
24
  static CREATE_AGGREGATE_OFFERS_MATCH_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;
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;
26
26
  const matchStages = [];
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
  if (typeof projectIdEq === 'string') {
@@ -172,7 +172,13 @@ class MongoRepository {
172
172
  }
173
173
  });
174
174
  }
175
- const appliesToMovieTicketServiceTypeExist = (_w = (_v = (_u = params.priceSpecification) === null || _u === void 0 ? void 0 : _u.appliesToMovieTicket) === null || _v === void 0 ? void 0 : _v.serviceType) === null || _w === void 0 ? void 0 : _w.$exists;
175
+ const appliesToMovieTicketSize = (_v = (_u = params.priceSpecification) === null || _u === void 0 ? void 0 : _u.appliesToMovieTicket) === null || _v === void 0 ? void 0 : _v.$size;
176
+ if (typeof appliesToMovieTicketSize === 'number') {
177
+ matchStages.push({
178
+ $match: { 'offers.priceSpecification.appliesToMovieTicket': { $exists: true, $size: appliesToMovieTicketSize } }
179
+ });
180
+ }
181
+ const appliesToMovieTicketServiceTypeExist = (_y = (_x = (_w = params.priceSpecification) === null || _w === void 0 ? void 0 : _w.appliesToMovieTicket) === null || _x === void 0 ? void 0 : _x.serviceType) === null || _y === void 0 ? void 0 : _y.$exists;
176
182
  if (typeof appliesToMovieTicketServiceTypeExist === 'boolean') {
177
183
  matchStages.push({
178
184
  $match: {
@@ -182,7 +188,7 @@ class MongoRepository {
182
188
  }
183
189
  });
184
190
  }
185
- const appliesToMovieTicketServiceTypeEq = (_z = (_y = (_x = params.priceSpecification) === null || _x === void 0 ? void 0 : _x.appliesToMovieTicket) === null || _y === void 0 ? void 0 : _y.serviceType) === null || _z === void 0 ? void 0 : _z.$eq;
191
+ const appliesToMovieTicketServiceTypeEq = (_1 = (_0 = (_z = params.priceSpecification) === null || _z === void 0 ? void 0 : _z.appliesToMovieTicket) === null || _0 === void 0 ? void 0 : _0.serviceType) === null || _1 === void 0 ? void 0 : _1.$eq;
186
192
  if (typeof appliesToMovieTicketServiceTypeEq === 'string') {
187
193
  matchStages.push({
188
194
  $match: {
@@ -193,7 +199,7 @@ class MongoRepository {
193
199
  }
194
200
  });
195
201
  }
196
- const appliesToMovieTicketServiceOutputTypeOfEq = (_3 = (_2 = (_1 = (_0 = params.priceSpecification) === null || _0 === void 0 ? void 0 : _0.appliesToMovieTicket) === null || _1 === void 0 ? void 0 : _1.serviceOutput) === null || _2 === void 0 ? void 0 : _2.typeOf) === null || _3 === void 0 ? void 0 : _3.$eq;
202
+ const appliesToMovieTicketServiceOutputTypeOfEq = (_5 = (_4 = (_3 = (_2 = params.priceSpecification) === null || _2 === void 0 ? void 0 : _2.appliesToMovieTicket) === null || _3 === void 0 ? void 0 : _3.serviceOutput) === null || _4 === void 0 ? void 0 : _4.typeOf) === null || _5 === void 0 ? void 0 : _5.$eq;
197
203
  if (typeof appliesToMovieTicketServiceOutputTypeOfEq === 'string') {
198
204
  matchStages.push({
199
205
  $match: {
@@ -204,7 +210,7 @@ class MongoRepository {
204
210
  }
205
211
  });
206
212
  }
207
- const appliesToMovieTicketServiceOutputTypeOfAll = (_7 = (_6 = (_5 = (_4 = params.priceSpecification) === null || _4 === void 0 ? void 0 : _4.appliesToMovieTicket) === null || _5 === void 0 ? void 0 : _5.serviceOutput) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$all;
213
+ const appliesToMovieTicketServiceOutputTypeOfAll = (_9 = (_8 = (_7 = (_6 = params.priceSpecification) === null || _6 === void 0 ? void 0 : _6.appliesToMovieTicket) === null || _7 === void 0 ? void 0 : _7.serviceOutput) === null || _8 === void 0 ? void 0 : _8.typeOf) === null || _9 === void 0 ? void 0 : _9.$all;
208
214
  if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfAll)) {
209
215
  matchStages.push({
210
216
  $match: {
@@ -215,7 +221,7 @@ class MongoRepository {
215
221
  }
216
222
  });
217
223
  }
218
- const appliesToMovieTicketServiceOutputTypeOfNin = (_11 = (_10 = (_9 = (_8 = params.priceSpecification) === null || _8 === void 0 ? void 0 : _8.appliesToMovieTicket) === null || _9 === void 0 ? void 0 : _9.serviceOutput) === null || _10 === void 0 ? void 0 : _10.typeOf) === null || _11 === void 0 ? void 0 : _11.$nin;
224
+ const appliesToMovieTicketServiceOutputTypeOfNin = (_13 = (_12 = (_11 = (_10 = params.priceSpecification) === null || _10 === void 0 ? void 0 : _10.appliesToMovieTicket) === null || _11 === void 0 ? void 0 : _11.serviceOutput) === null || _12 === void 0 ? void 0 : _12.typeOf) === null || _13 === void 0 ? void 0 : _13.$nin;
219
225
  if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfNin)) {
220
226
  matchStages.push({
221
227
  $match: {
@@ -226,7 +232,7 @@ class MongoRepository {
226
232
  });
227
233
  }
228
234
  if (params.priceSpecification !== undefined && params.priceSpecification !== null) {
229
- const priceSpecificationPriceGte = (_12 = params.priceSpecification.price) === null || _12 === void 0 ? void 0 : _12.$gte;
235
+ const priceSpecificationPriceGte = (_14 = params.priceSpecification.price) === null || _14 === void 0 ? void 0 : _14.$gte;
230
236
  if (typeof priceSpecificationPriceGte === 'number') {
231
237
  matchStages.push({
232
238
  $match: {
@@ -237,7 +243,7 @@ class MongoRepository {
237
243
  }
238
244
  });
239
245
  }
240
- const priceSpecificationPriceLte = (_13 = params.priceSpecification.price) === null || _13 === void 0 ? void 0 : _13.$lte;
246
+ const priceSpecificationPriceLte = (_15 = params.priceSpecification.price) === null || _15 === void 0 ? void 0 : _15.$lte;
241
247
  if (typeof priceSpecificationPriceLte === 'number') {
242
248
  matchStages.push({
243
249
  $match: {
@@ -248,7 +254,7 @@ class MongoRepository {
248
254
  }
249
255
  });
250
256
  }
251
- const accountsReceivableGte = (_15 = (_14 = params.priceSpecification.accounting) === null || _14 === void 0 ? void 0 : _14.accountsReceivable) === null || _15 === void 0 ? void 0 : _15.$gte;
257
+ const accountsReceivableGte = (_17 = (_16 = params.priceSpecification.accounting) === null || _16 === void 0 ? void 0 : _16.accountsReceivable) === null || _17 === void 0 ? void 0 : _17.$gte;
252
258
  if (typeof accountsReceivableGte === 'number') {
253
259
  matchStages.push({
254
260
  $match: {
@@ -259,7 +265,7 @@ class MongoRepository {
259
265
  }
260
266
  });
261
267
  }
262
- const accountsReceivableLte = (_17 = (_16 = params.priceSpecification.accounting) === null || _16 === void 0 ? void 0 : _16.accountsReceivable) === null || _17 === void 0 ? void 0 : _17.$lte;
268
+ const accountsReceivableLte = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.accountsReceivable) === null || _19 === void 0 ? void 0 : _19.$lte;
263
269
  if (typeof accountsReceivableLte === 'number') {
264
270
  matchStages.push({
265
271
  $match: {
@@ -270,7 +276,7 @@ class MongoRepository {
270
276
  }
271
277
  });
272
278
  }
273
- const accountingCodeValueEq = (_20 = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.operatingRevenue) === null || _19 === void 0 ? void 0 : _19.codeValue) === null || _20 === void 0 ? void 0 : _20.$eq;
279
+ const accountingCodeValueEq = (_22 = (_21 = (_20 = params.priceSpecification.accounting) === null || _20 === void 0 ? void 0 : _20.operatingRevenue) === null || _21 === void 0 ? void 0 : _21.codeValue) === null || _22 === void 0 ? void 0 : _22.$eq;
274
280
  if (typeof accountingCodeValueEq === 'string') {
275
281
  matchStages.push({
276
282
  $match: {
@@ -281,7 +287,7 @@ class MongoRepository {
281
287
  }
282
288
  });
283
289
  }
284
- const accountingCodeValueIn = (_23 = (_22 = (_21 = params.priceSpecification.accounting) === null || _21 === void 0 ? void 0 : _21.operatingRevenue) === null || _22 === void 0 ? void 0 : _22.codeValue) === null || _23 === void 0 ? void 0 : _23.$in;
290
+ const accountingCodeValueIn = (_25 = (_24 = (_23 = params.priceSpecification.accounting) === null || _23 === void 0 ? void 0 : _23.operatingRevenue) === null || _24 === void 0 ? void 0 : _24.codeValue) === null || _25 === void 0 ? void 0 : _25.$in;
285
291
  if (Array.isArray(accountingCodeValueIn)) {
286
292
  matchStages.push({
287
293
  $match: {
@@ -292,7 +298,7 @@ class MongoRepository {
292
298
  }
293
299
  });
294
300
  }
295
- const referenceQuantityValueEq = (_25 = (_24 = params.priceSpecification.referenceQuantity) === null || _24 === void 0 ? void 0 : _24.value) === null || _25 === void 0 ? void 0 : _25.$eq;
301
+ const referenceQuantityValueEq = (_27 = (_26 = params.priceSpecification.referenceQuantity) === null || _26 === void 0 ? void 0 : _26.value) === null || _27 === void 0 ? void 0 : _27.$eq;
296
302
  if (typeof referenceQuantityValueEq === 'number') {
297
303
  matchStages.push({
298
304
  $match: {
@@ -304,7 +310,7 @@ class MongoRepository {
304
310
  });
305
311
  }
306
312
  }
307
- const availabilityEq = (_26 = params.availability) === null || _26 === void 0 ? void 0 : _26.$eq;
313
+ const availabilityEq = (_28 = params.availability) === null || _28 === void 0 ? void 0 : _28.$eq;
308
314
  if (typeof availabilityEq === 'string') {
309
315
  matchStages.push({
310
316
  $match: {
@@ -312,7 +318,7 @@ class MongoRepository {
312
318
  }
313
319
  });
314
320
  }
315
- const availableAtOrFromIdEq = (_28 = (_27 = params.availableAtOrFrom) === null || _27 === void 0 ? void 0 : _27.id) === null || _28 === void 0 ? void 0 : _28.$eq;
321
+ const availableAtOrFromIdEq = (_30 = (_29 = params.availableAtOrFrom) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$eq;
316
322
  if (typeof availableAtOrFromIdEq === 'string') {
317
323
  matchStages.push({
318
324
  $match: {
@@ -323,7 +329,7 @@ class MongoRepository {
323
329
  }
324
330
  });
325
331
  }
326
- const availableAtOrFromIdIn = (_30 = (_29 = params.availableAtOrFrom) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$in;
332
+ const availableAtOrFromIdIn = (_32 = (_31 = params.availableAtOrFrom) === null || _31 === void 0 ? void 0 : _31.id) === null || _32 === void 0 ? void 0 : _32.$in;
327
333
  if (Array.isArray(availableAtOrFromIdIn)) {
328
334
  matchStages.push({
329
335
  $match: {
@@ -334,7 +340,7 @@ class MongoRepository {
334
340
  }
335
341
  });
336
342
  }
337
- const addOnItemOfferedIdEq = (_33 = (_32 = (_31 = params.addOn) === null || _31 === void 0 ? void 0 : _31.itemOffered) === null || _32 === void 0 ? void 0 : _32.id) === null || _33 === void 0 ? void 0 : _33.$eq;
343
+ const addOnItemOfferedIdEq = (_35 = (_34 = (_33 = params.addOn) === null || _33 === void 0 ? void 0 : _33.itemOffered) === null || _34 === void 0 ? void 0 : _34.id) === null || _35 === void 0 ? void 0 : _35.$eq;
338
344
  if (typeof addOnItemOfferedIdEq === 'string') {
339
345
  matchStages.push({
340
346
  $match: {
@@ -342,7 +348,7 @@ class MongoRepository {
342
348
  }
343
349
  });
344
350
  }
345
- const addOnItemOfferedIdIn = (_36 = (_35 = (_34 = params.addOn) === null || _34 === void 0 ? void 0 : _34.itemOffered) === null || _35 === void 0 ? void 0 : _35.id) === null || _36 === void 0 ? void 0 : _36.$in;
351
+ const addOnItemOfferedIdIn = (_38 = (_37 = (_36 = params.addOn) === null || _36 === void 0 ? void 0 : _36.itemOffered) === null || _37 === void 0 ? void 0 : _37.id) === null || _38 === void 0 ? void 0 : _38.$in;
346
352
  if (Array.isArray(addOnItemOfferedIdIn)) {
347
353
  matchStages.push({
348
354
  $match: {
@@ -350,7 +356,7 @@ class MongoRepository {
350
356
  }
351
357
  });
352
358
  }
353
- const hasMerchantReturnPolicyIdEq = (_38 = (_37 = params.hasMerchantReturnPolicy) === null || _37 === void 0 ? void 0 : _37.id) === null || _38 === void 0 ? void 0 : _38.$eq;
359
+ const hasMerchantReturnPolicyIdEq = (_40 = (_39 = params.hasMerchantReturnPolicy) === null || _39 === void 0 ? void 0 : _39.id) === null || _40 === void 0 ? void 0 : _40.$eq;
354
360
  if (typeof hasMerchantReturnPolicyIdEq === 'string') {
355
361
  matchStages.push({
356
362
  $match: {
@@ -361,7 +367,7 @@ class MongoRepository {
361
367
  }
362
368
  });
363
369
  }
364
- const acceptedPaymentMethodIdentifierIn = (_40 = (_39 = params.acceptedPaymentMethod) === null || _39 === void 0 ? void 0 : _39.identifier) === null || _40 === void 0 ? void 0 : _40.$in;
370
+ const acceptedPaymentMethodIdentifierIn = (_42 = (_41 = params.acceptedPaymentMethod) === null || _41 === void 0 ? void 0 : _41.identifier) === null || _42 === void 0 ? void 0 : _42.$in;
365
371
  if (Array.isArray(acceptedPaymentMethodIdentifierIn)) {
366
372
  matchStages.push({
367
373
  $match: {
@@ -372,7 +378,7 @@ class MongoRepository {
372
378
  }
373
379
  });
374
380
  }
375
- const additionalPropertyAll = (_41 = params.additionalProperty) === null || _41 === void 0 ? void 0 : _41.$all;
381
+ const additionalPropertyAll = (_43 = params.additionalProperty) === null || _43 === void 0 ? void 0 : _43.$all;
376
382
  if (Array.isArray(additionalPropertyAll)) {
377
383
  matchStages.push({
378
384
  $match: {
@@ -383,7 +389,7 @@ class MongoRepository {
383
389
  }
384
390
  });
385
391
  }
386
- const additionalPropertyElemMatch = (_42 = params.additionalProperty) === null || _42 === void 0 ? void 0 : _42.$elemMatch;
392
+ const additionalPropertyElemMatch = (_44 = params.additionalProperty) === null || _44 === void 0 ? void 0 : _44.$elemMatch;
387
393
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
388
394
  matchStages.push({
389
395
  $match: {
@@ -40,7 +40,7 @@ class MongoRepository {
40
40
  }
41
41
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
42
42
  static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params) {
43
- 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;
43
+ 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;
44
44
  const matchStages = [];
45
45
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
46
46
  if (typeof projectIdEq === 'string') {
@@ -172,7 +172,13 @@ class MongoRepository {
172
172
  }
173
173
  });
174
174
  }
175
- const appliesToMovieTicketServiceTypeExist = (_0 = (_z = (_y = params.priceSpecification) === null || _y === void 0 ? void 0 : _y.appliesToMovieTicket) === null || _z === void 0 ? void 0 : _z.serviceType) === null || _0 === void 0 ? void 0 : _0.$exists;
175
+ const appliesToMovieTicketSize = (_z = (_y = params.priceSpecification) === null || _y === void 0 ? void 0 : _y.appliesToMovieTicket) === null || _z === void 0 ? void 0 : _z.$size;
176
+ if (typeof appliesToMovieTicketSize === 'number') {
177
+ matchStages.push({
178
+ $match: { 'offers.priceSpecification.appliesToMovieTicket': { $exists: true, $size: appliesToMovieTicketSize } }
179
+ });
180
+ }
181
+ const appliesToMovieTicketServiceTypeExist = (_2 = (_1 = (_0 = params.priceSpecification) === null || _0 === void 0 ? void 0 : _0.appliesToMovieTicket) === null || _1 === void 0 ? void 0 : _1.serviceType) === null || _2 === void 0 ? void 0 : _2.$exists;
176
182
  if (typeof appliesToMovieTicketServiceTypeExist === 'boolean') {
177
183
  matchStages.push({
178
184
  $match: {
@@ -182,7 +188,7 @@ class MongoRepository {
182
188
  }
183
189
  });
184
190
  }
185
- const appliesToMovieTicketServiceTypeEq = (_3 = (_2 = (_1 = params.priceSpecification) === null || _1 === void 0 ? void 0 : _1.appliesToMovieTicket) === null || _2 === void 0 ? void 0 : _2.serviceType) === null || _3 === void 0 ? void 0 : _3.$eq;
191
+ const appliesToMovieTicketServiceTypeEq = (_5 = (_4 = (_3 = params.priceSpecification) === null || _3 === void 0 ? void 0 : _3.appliesToMovieTicket) === null || _4 === void 0 ? void 0 : _4.serviceType) === null || _5 === void 0 ? void 0 : _5.$eq;
186
192
  if (typeof appliesToMovieTicketServiceTypeEq === 'string') {
187
193
  matchStages.push({
188
194
  $match: {
@@ -193,7 +199,7 @@ class MongoRepository {
193
199
  }
194
200
  });
195
201
  }
196
- const appliesToMovieTicketServiceOutputTypeOfEq = (_7 = (_6 = (_5 = (_4 = params.priceSpecification) === null || _4 === void 0 ? void 0 : _4.appliesToMovieTicket) === null || _5 === void 0 ? void 0 : _5.serviceOutput) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$eq;
202
+ const appliesToMovieTicketServiceOutputTypeOfEq = (_9 = (_8 = (_7 = (_6 = params.priceSpecification) === null || _6 === void 0 ? void 0 : _6.appliesToMovieTicket) === null || _7 === void 0 ? void 0 : _7.serviceOutput) === null || _8 === void 0 ? void 0 : _8.typeOf) === null || _9 === void 0 ? void 0 : _9.$eq;
197
203
  if (typeof appliesToMovieTicketServiceOutputTypeOfEq === 'string') {
198
204
  matchStages.push({
199
205
  $match: {
@@ -204,7 +210,7 @@ class MongoRepository {
204
210
  }
205
211
  });
206
212
  }
207
- const appliesToMovieTicketServiceOutputTypeOfAll = (_11 = (_10 = (_9 = (_8 = params.priceSpecification) === null || _8 === void 0 ? void 0 : _8.appliesToMovieTicket) === null || _9 === void 0 ? void 0 : _9.serviceOutput) === null || _10 === void 0 ? void 0 : _10.typeOf) === null || _11 === void 0 ? void 0 : _11.$all;
213
+ const appliesToMovieTicketServiceOutputTypeOfAll = (_13 = (_12 = (_11 = (_10 = params.priceSpecification) === null || _10 === void 0 ? void 0 : _10.appliesToMovieTicket) === null || _11 === void 0 ? void 0 : _11.serviceOutput) === null || _12 === void 0 ? void 0 : _12.typeOf) === null || _13 === void 0 ? void 0 : _13.$all;
208
214
  if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfAll)) {
209
215
  matchStages.push({
210
216
  $match: {
@@ -215,7 +221,7 @@ class MongoRepository {
215
221
  }
216
222
  });
217
223
  }
218
- const appliesToMovieTicketServiceOutputTypeOfNin = (_15 = (_14 = (_13 = (_12 = params.priceSpecification) === null || _12 === void 0 ? void 0 : _12.appliesToMovieTicket) === null || _13 === void 0 ? void 0 : _13.serviceOutput) === null || _14 === void 0 ? void 0 : _14.typeOf) === null || _15 === void 0 ? void 0 : _15.$nin;
224
+ const appliesToMovieTicketServiceOutputTypeOfNin = (_17 = (_16 = (_15 = (_14 = params.priceSpecification) === null || _14 === void 0 ? void 0 : _14.appliesToMovieTicket) === null || _15 === void 0 ? void 0 : _15.serviceOutput) === null || _16 === void 0 ? void 0 : _16.typeOf) === null || _17 === void 0 ? void 0 : _17.$nin;
219
225
  if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfNin)) {
220
226
  matchStages.push({
221
227
  $match: {
@@ -226,7 +232,7 @@ class MongoRepository {
226
232
  });
227
233
  }
228
234
  if (params.priceSpecification !== undefined && params.priceSpecification !== null) {
229
- const priceSpecificationPriceGte = (_16 = params.priceSpecification.price) === null || _16 === void 0 ? void 0 : _16.$gte;
235
+ const priceSpecificationPriceGte = (_18 = params.priceSpecification.price) === null || _18 === void 0 ? void 0 : _18.$gte;
230
236
  if (typeof priceSpecificationPriceGte === 'number') {
231
237
  matchStages.push({
232
238
  $match: {
@@ -237,7 +243,7 @@ class MongoRepository {
237
243
  }
238
244
  });
239
245
  }
240
- const priceSpecificationPriceLte = (_17 = params.priceSpecification.price) === null || _17 === void 0 ? void 0 : _17.$lte;
246
+ const priceSpecificationPriceLte = (_19 = params.priceSpecification.price) === null || _19 === void 0 ? void 0 : _19.$lte;
241
247
  if (typeof priceSpecificationPriceLte === 'number') {
242
248
  matchStages.push({
243
249
  $match: {
@@ -248,7 +254,7 @@ class MongoRepository {
248
254
  }
249
255
  });
250
256
  }
251
- const accountsReceivableGte = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.accountsReceivable) === null || _19 === void 0 ? void 0 : _19.$gte;
257
+ const accountsReceivableGte = (_21 = (_20 = params.priceSpecification.accounting) === null || _20 === void 0 ? void 0 : _20.accountsReceivable) === null || _21 === void 0 ? void 0 : _21.$gte;
252
258
  if (typeof accountsReceivableGte === 'number') {
253
259
  matchStages.push({
254
260
  $match: {
@@ -259,7 +265,7 @@ class MongoRepository {
259
265
  }
260
266
  });
261
267
  }
262
- const accountsReceivableLte = (_21 = (_20 = params.priceSpecification.accounting) === null || _20 === void 0 ? void 0 : _20.accountsReceivable) === null || _21 === void 0 ? void 0 : _21.$lte;
268
+ const accountsReceivableLte = (_23 = (_22 = params.priceSpecification.accounting) === null || _22 === void 0 ? void 0 : _22.accountsReceivable) === null || _23 === void 0 ? void 0 : _23.$lte;
263
269
  if (typeof accountsReceivableLte === 'number') {
264
270
  matchStages.push({
265
271
  $match: {
@@ -270,7 +276,7 @@ class MongoRepository {
270
276
  }
271
277
  });
272
278
  }
273
- const accountingCodeValueEq = (_24 = (_23 = (_22 = params.priceSpecification.accounting) === null || _22 === void 0 ? void 0 : _22.operatingRevenue) === null || _23 === void 0 ? void 0 : _23.codeValue) === null || _24 === void 0 ? void 0 : _24.$eq;
279
+ const accountingCodeValueEq = (_26 = (_25 = (_24 = params.priceSpecification.accounting) === null || _24 === void 0 ? void 0 : _24.operatingRevenue) === null || _25 === void 0 ? void 0 : _25.codeValue) === null || _26 === void 0 ? void 0 : _26.$eq;
274
280
  if (typeof accountingCodeValueEq === 'string') {
275
281
  matchStages.push({
276
282
  $match: {
@@ -281,7 +287,7 @@ class MongoRepository {
281
287
  }
282
288
  });
283
289
  }
284
- const accountingCodeValueIn = (_27 = (_26 = (_25 = params.priceSpecification.accounting) === null || _25 === void 0 ? void 0 : _25.operatingRevenue) === null || _26 === void 0 ? void 0 : _26.codeValue) === null || _27 === void 0 ? void 0 : _27.$in;
290
+ const accountingCodeValueIn = (_29 = (_28 = (_27 = params.priceSpecification.accounting) === null || _27 === void 0 ? void 0 : _27.operatingRevenue) === null || _28 === void 0 ? void 0 : _28.codeValue) === null || _29 === void 0 ? void 0 : _29.$in;
285
291
  if (Array.isArray(accountingCodeValueIn)) {
286
292
  matchStages.push({
287
293
  $match: {
@@ -292,7 +298,7 @@ class MongoRepository {
292
298
  }
293
299
  });
294
300
  }
295
- const referenceQuantityValueEq = (_29 = (_28 = params.priceSpecification.referenceQuantity) === null || _28 === void 0 ? void 0 : _28.value) === null || _29 === void 0 ? void 0 : _29.$eq;
301
+ const referenceQuantityValueEq = (_31 = (_30 = params.priceSpecification.referenceQuantity) === null || _30 === void 0 ? void 0 : _30.value) === null || _31 === void 0 ? void 0 : _31.$eq;
296
302
  if (typeof referenceQuantityValueEq === 'number') {
297
303
  matchStages.push({
298
304
  $match: {
@@ -304,7 +310,7 @@ class MongoRepository {
304
310
  });
305
311
  }
306
312
  }
307
- const availabilityEq = (_30 = params.availability) === null || _30 === void 0 ? void 0 : _30.$eq;
313
+ const availabilityEq = (_32 = params.availability) === null || _32 === void 0 ? void 0 : _32.$eq;
308
314
  if (typeof availabilityEq === 'string') {
309
315
  matchStages.push({
310
316
  $match: {
@@ -312,7 +318,7 @@ class MongoRepository {
312
318
  }
313
319
  });
314
320
  }
315
- const availableAtOrFromIdEq = (_32 = (_31 = params.availableAtOrFrom) === null || _31 === void 0 ? void 0 : _31.id) === null || _32 === void 0 ? void 0 : _32.$eq;
321
+ const availableAtOrFromIdEq = (_34 = (_33 = params.availableAtOrFrom) === null || _33 === void 0 ? void 0 : _33.id) === null || _34 === void 0 ? void 0 : _34.$eq;
316
322
  if (typeof availableAtOrFromIdEq === 'string') {
317
323
  matchStages.push({
318
324
  $match: {
@@ -323,7 +329,7 @@ class MongoRepository {
323
329
  }
324
330
  });
325
331
  }
326
- const availableAtOrFromIdIn = (_34 = (_33 = params.availableAtOrFrom) === null || _33 === void 0 ? void 0 : _33.id) === null || _34 === void 0 ? void 0 : _34.$in;
332
+ const availableAtOrFromIdIn = (_36 = (_35 = params.availableAtOrFrom) === null || _35 === void 0 ? void 0 : _35.id) === null || _36 === void 0 ? void 0 : _36.$in;
327
333
  if (Array.isArray(availableAtOrFromIdIn)) {
328
334
  matchStages.push({
329
335
  $match: {
@@ -334,7 +340,7 @@ class MongoRepository {
334
340
  }
335
341
  });
336
342
  }
337
- const addOnItemOfferedIdEq = (_37 = (_36 = (_35 = params.addOn) === null || _35 === void 0 ? void 0 : _35.itemOffered) === null || _36 === void 0 ? void 0 : _36.id) === null || _37 === void 0 ? void 0 : _37.$eq;
343
+ const addOnItemOfferedIdEq = (_39 = (_38 = (_37 = params.addOn) === null || _37 === void 0 ? void 0 : _37.itemOffered) === null || _38 === void 0 ? void 0 : _38.id) === null || _39 === void 0 ? void 0 : _39.$eq;
338
344
  if (typeof addOnItemOfferedIdEq === 'string') {
339
345
  matchStages.push({
340
346
  $match: {
@@ -342,7 +348,7 @@ class MongoRepository {
342
348
  }
343
349
  });
344
350
  }
345
- const addOnItemOfferedIdIn = (_40 = (_39 = (_38 = params.addOn) === null || _38 === void 0 ? void 0 : _38.itemOffered) === null || _39 === void 0 ? void 0 : _39.id) === null || _40 === void 0 ? void 0 : _40.$in;
351
+ const addOnItemOfferedIdIn = (_42 = (_41 = (_40 = params.addOn) === null || _40 === void 0 ? void 0 : _40.itemOffered) === null || _41 === void 0 ? void 0 : _41.id) === null || _42 === void 0 ? void 0 : _42.$in;
346
352
  if (Array.isArray(addOnItemOfferedIdIn)) {
347
353
  matchStages.push({
348
354
  $match: {
@@ -350,7 +356,7 @@ class MongoRepository {
350
356
  }
351
357
  });
352
358
  }
353
- const hasMerchantReturnPolicyIdEq = (_42 = (_41 = params.hasMerchantReturnPolicy) === null || _41 === void 0 ? void 0 : _41.id) === null || _42 === void 0 ? void 0 : _42.$eq;
359
+ const hasMerchantReturnPolicyIdEq = (_44 = (_43 = params.hasMerchantReturnPolicy) === null || _43 === void 0 ? void 0 : _43.id) === null || _44 === void 0 ? void 0 : _44.$eq;
354
360
  if (typeof hasMerchantReturnPolicyIdEq === 'string') {
355
361
  matchStages.push({
356
362
  $match: {
@@ -361,7 +367,7 @@ class MongoRepository {
361
367
  }
362
368
  });
363
369
  }
364
- const acceptedPaymentMethodIdentifierIn = (_44 = (_43 = params.acceptedPaymentMethod) === null || _43 === void 0 ? void 0 : _43.identifier) === null || _44 === void 0 ? void 0 : _44.$in;
370
+ const acceptedPaymentMethodIdentifierIn = (_46 = (_45 = params.acceptedPaymentMethod) === null || _45 === void 0 ? void 0 : _45.identifier) === null || _46 === void 0 ? void 0 : _46.$in;
365
371
  if (Array.isArray(acceptedPaymentMethodIdentifierIn)) {
366
372
  matchStages.push({
367
373
  $match: {
@@ -372,7 +378,7 @@ class MongoRepository {
372
378
  }
373
379
  });
374
380
  }
375
- const additionalPropertyAll = (_45 = params.additionalProperty) === null || _45 === void 0 ? void 0 : _45.$all;
381
+ const additionalPropertyAll = (_47 = params.additionalProperty) === null || _47 === void 0 ? void 0 : _47.$all;
376
382
  if (Array.isArray(additionalPropertyAll)) {
377
383
  matchStages.push({
378
384
  $match: {
@@ -383,7 +389,7 @@ class MongoRepository {
383
389
  }
384
390
  });
385
391
  }
386
- const additionalPropertyElemMatch = (_46 = params.additionalProperty) === null || _46 === void 0 ? void 0 : _46.$elemMatch;
392
+ const additionalPropertyElemMatch = (_48 = params.additionalProperty) === null || _48 === void 0 ? void 0 : _48.$elemMatch;
387
393
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
388
394
  matchStages.push({
389
395
  $match: {
@@ -165,20 +165,11 @@ class MongoRepository {
165
165
  switch (typeOf) {
166
166
  case factory.service.paymentService.PaymentServiceType.CreditCard:
167
167
  case factory.service.paymentService.PaymentServiceType.MovieTicket:
168
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
169
- doc = yield this.paymentServiceModel.findOneAndUpdate({
170
- _id: { $eq: params.id },
171
- typeOf: { $eq: typeOf }
172
- }, { $set: setFields }, { upsert: false, new: true, projection: { _id: 1 } })
173
- .exec();
174
- }
175
- else {
176
- doc = yield this.productModel.findOneAndUpdate({
177
- _id: { $eq: params.id },
178
- typeOf: { $eq: typeOf }
179
- }, { $set: setFields }, { upsert: false, new: true, projection: { _id: 1 } })
180
- .exec();
181
- }
168
+ doc = yield this.paymentServiceModel.findOneAndUpdate({
169
+ _id: { $eq: params.id },
170
+ typeOf: { $eq: typeOf }
171
+ }, { $set: setFields }, { upsert: false, new: true, projection: { _id: 1 } })
172
+ .exec();
182
173
  break;
183
174
  default:
184
175
  throw new factory.errors.NotImplemented(`${typeOf} not implemented`);
@@ -187,28 +178,14 @@ class MongoRepository {
187
178
  else {
188
179
  const _b = params.$set, { id } = _b, createParams = __rest(_b, ["id"]);
189
180
  if (params.createIfNotExist === true) {
190
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
191
- doc = yield this.paymentServiceModel.findOneAndUpdate({
192
- 'project.id': { $eq: createParams.project.id },
193
- typeOf: { $eq: createParams.typeOf }
194
- }, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
195
- .exec();
196
- }
197
- else {
198
- doc = yield this.productModel.findOneAndUpdate({
199
- 'project.id': { $eq: createParams.project.id },
200
- typeOf: { $eq: createParams.typeOf }
201
- }, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
202
- .exec();
203
- }
181
+ doc = yield this.paymentServiceModel.findOneAndUpdate({
182
+ 'project.id': { $eq: createParams.project.id },
183
+ typeOf: { $eq: createParams.typeOf }
184
+ }, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
185
+ .exec();
204
186
  }
205
187
  else {
206
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
207
- doc = yield this.paymentServiceModel.create(createParams);
208
- }
209
- else {
210
- doc = yield this.productModel.create(createParams);
211
- }
188
+ doc = yield this.paymentServiceModel.create(createParams);
212
189
  }
213
190
  }
214
191
  if (doc === null) {
@@ -224,15 +201,6 @@ class MongoRepository {
224
201
  var _a;
225
202
  return __awaiter(this, void 0, void 0, function* () {
226
203
  const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
227
- // 強制的にtypeOfを絞る
228
- andConditions.push({
229
- typeOf: {
230
- $in: [
231
- factory.service.paymentService.PaymentServiceType.CreditCard,
232
- factory.service.paymentService.PaymentServiceType.MovieTicket
233
- ]
234
- }
235
- });
236
204
  let projection = {};
237
205
  if (Array.isArray(inclusion) && inclusion.length > 0) {
238
206
  inclusion.forEach((field) => {
@@ -253,9 +221,7 @@ class MongoRepository {
253
221
  });
254
222
  }
255
223
  }
256
- const query = (settings_1.USE_PAYMENT_SERVICE_COLLECTION)
257
- ? this.paymentServiceModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection)
258
- : this.productModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
224
+ const query = this.paymentServiceModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
259
225
  if (typeof conditions.limit === 'number' && conditions.limit > 0) {
260
226
  const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
261
227
  query.limit(conditions.limit)
@@ -273,14 +239,8 @@ class MongoRepository {
273
239
  }
274
240
  deletePaymentServiceById(params) {
275
241
  return __awaiter(this, void 0, void 0, function* () {
276
- if (settings_1.USE_PAYMENT_SERVICE_COLLECTION) {
277
- yield this.paymentServiceModel.findOneAndDelete({ _id: params.id })
278
- .exec();
279
- }
280
- else {
281
- yield this.productModel.findOneAndDelete({ _id: params.id })
282
- .exec();
283
- }
242
+ yield this.paymentServiceModel.findOneAndDelete({ _id: params.id })
243
+ .exec();
284
244
  });
285
245
  }
286
246
  /**
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const mongoose_1 = require("mongoose");
14
14
  const paymentService_1 = require("./mongoose/schemas/paymentService");
15
- const product_1 = require("./mongoose/schemas/product");
16
15
  const factory = require("../factory");
17
16
  const settings_1 = require("../settings");
18
17
  /**
@@ -20,9 +19,7 @@ const settings_1 = require("../settings");
20
19
  */
21
20
  class MongoRepository {
22
21
  constructor(connection) {
23
- this.paymentServiceModel = (settings_1.USE_PAYMENT_SERVICE_COLLECTION)
24
- ? connection.model(paymentService_1.modelName, (0, paymentService_1.createSchema)())
25
- : connection.model(product_1.modelName, (0, product_1.createSchema)());
22
+ this.paymentServiceModel = connection.model(paymentService_1.modelName, (0, paymentService_1.createSchema)());
26
23
  }
27
24
  /**
28
25
  * 決済サービスプロバイダー検索
@@ -158,20 +158,6 @@ class MongoRepository {
158
158
  var _a;
159
159
  return __awaiter(this, void 0, void 0, function* () {
160
160
  const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
161
- // 強制的にtypeOfを絞る(2023-12-19~)
162
- if (settings_1.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY) {
163
- andConditions.push({
164
- typeOf: {
165
- $in: [
166
- factory.product.ProductType.EventService,
167
- factory.product.ProductType.MembershipService,
168
- factory.product.ProductType.PaymentCard,
169
- factory.product.ProductType.Product,
170
- factory.product.ProductType.Transportation
171
- ]
172
- }
173
- });
174
- }
175
161
  let projection = {};
176
162
  if (Array.isArray(inclusion) && inclusion.length > 0) {
177
163
  inclusion.forEach((field) => {
@@ -41,8 +41,6 @@ export declare const USE_ORDER_PAYMENT_DUE_ON_PLACED: boolean;
41
41
  export declare const USE_OPTIMIZE_TICKET_OFFER: boolean;
42
42
  export declare const USE_ORDER_PAYMENT_METHOD_TYPE_OF: boolean;
43
43
  export declare const USE_FETCH_API: boolean;
44
- export declare const USE_SEARCH_ONLY_PRODUCTS_FORCIBLY: boolean;
45
- export declare const USE_PAYMENT_SERVICE_COLLECTION: boolean;
46
44
  export declare const MONGO_MAX_TIME_MS: number;
47
45
  export declare const MONGO_READ_PREFERENCE: string;
48
46
  export declare const MONGO_AUTO_INDEX: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settings = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_PAYMENT_SERVICE_COLLECTION = exports.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY = exports.USE_FETCH_API = exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = exports.USE_OPTIMIZE_TICKET_OFFER = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.MAX_NUM_CREDIT_CARD_PAYMENT_METHOD = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
3
+ exports.settings = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_FETCH_API = exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = exports.USE_OPTIMIZE_TICKET_OFFER = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.MAX_NUM_CREDIT_CARD_PAYMENT_METHOD = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
4
4
  const factory = require("./factory");
5
5
  const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
6
6
  ? process.env.INFORM_TRANSACTION_URL.split(' ')
@@ -65,8 +65,6 @@ exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = process.env.USE_ORDER_PAYMENT_DUE_ON_P
65
65
  exports.USE_OPTIMIZE_TICKET_OFFER = process.env.USE_OPTIMIZE_TICKET_OFFER === '1';
66
66
  exports.USE_ORDER_PAYMENT_METHOD_TYPE_OF = process.env.USE_ORDER_PAYMENT_METHOD_TYPE_OF === '1';
67
67
  exports.USE_FETCH_API = process.env.USE_FETCH_API === '1';
68
- exports.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY = process.env.USE_SEARCH_ONLY_PRODUCTS_FORCIBLY === '1';
69
- exports.USE_PAYMENT_SERVICE_COLLECTION = process.env.USE_PAYMENT_SERVICE_COLLECTION === '1';
70
68
  exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
71
69
  ? Number(process.env.MONGO_MAX_TIME_MS)
72
70
  // tslint:disable-next-line:no-magic-numbers
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.349.0",
13
+ "@chevre/factory": "4.350.0",
14
14
  "@cinerino/sdk": "5.6.0",
15
15
  "@motionpicture/coa-service": "9.2.0",
16
16
  "@motionpicture/gmo-service": "5.2.0",
@@ -115,5 +115,5 @@
115
115
  "postversion": "git push origin --tags",
116
116
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
117
117
  },
118
- "version": "21.19.0-alpha.11"
118
+ "version": "21.19.0-alpha.13"
119
119
  }