@chevre/domain 24.1.0-alpha.3 → 24.1.0-alpha.30

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.
Files changed (105) hide show
  1. package/README.md +0 -2
  2. package/lib/chevre/repo/acceptedOffer.d.ts +14 -13
  3. package/lib/chevre/repo/acceptedOffer.js +135 -51
  4. package/lib/chevre/repo/acceptedOfferInReserve.d.ts +30 -0
  5. package/lib/chevre/repo/acceptedOfferInReserve.js +78 -0
  6. package/lib/chevre/repo/accountingReport.d.ts +9 -2
  7. package/lib/chevre/repo/accountingReport.js +6 -34
  8. package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
  9. package/lib/chevre/repo/assetTransaction/reserve.d.ts +0 -1
  10. package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
  11. package/lib/chevre/repo/event.js +12 -8
  12. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +7 -0
  13. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +74 -0
  14. package/lib/chevre/repo/factory/reservation/createMongoConditions.js +155 -180
  15. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
  16. package/lib/chevre/repo/mongoose/schemas/order.js +108 -108
  17. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
  18. package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
  19. package/lib/chevre/repo/order.d.ts +2 -83
  20. package/lib/chevre/repo/order.js +171 -364
  21. package/lib/chevre/repo/orderInTransaction.d.ts +39 -3
  22. package/lib/chevre/repo/orderInTransaction.js +43 -1
  23. package/lib/chevre/repo/reservation.d.ts +20 -7
  24. package/lib/chevre/repo/reservation.js +14 -10
  25. package/lib/chevre/repo/role.d.ts +1 -15
  26. package/lib/chevre/repo/role.js +7 -14
  27. package/lib/chevre/repo/transaction.d.ts +6 -6
  28. package/lib/chevre/service/aggregation/event/aggregateOffers.js +22 -26
  29. package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
  30. package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
  31. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
  32. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +0 -12
  33. package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
  34. package/lib/chevre/service/delivery/factory.d.ts +6 -1
  35. package/lib/chevre/service/delivery/factory.js +1 -1
  36. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
  37. package/lib/chevre/service/delivery/reservation/factory.js +0 -17
  38. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +1 -1
  39. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +1 -1
  40. package/lib/chevre/service/offer/any.d.ts +6 -1
  41. package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
  42. package/lib/chevre/service/offer/event/authorize/factory.js +4 -7
  43. package/lib/chevre/service/offer/event/authorize.d.ts +6 -0
  44. package/lib/chevre/service/offer/event/authorize.js +11 -3
  45. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -3
  46. package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -3
  47. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +67 -72
  48. package/lib/chevre/service/order/deleteOrder.js +21 -44
  49. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
  50. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
  51. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  52. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
  53. package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
  54. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
  55. package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
  56. package/lib/chevre/service/order/sendOrder.js +2 -4
  57. package/lib/chevre/service/payment/creditCard/authorize.js +3 -3
  58. package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
  59. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
  60. package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
  61. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  62. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
  63. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
  64. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
  65. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
  66. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
  67. package/lib/chevre/service/reserve/confirmReservation.js +7 -7
  68. package/lib/chevre/service/reserve/factory.js +2 -1
  69. package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
  70. package/lib/chevre/service/reserve/findByCode.js +2 -1
  71. package/lib/chevre/service/reserve/findReservations.d.ts +4 -4
  72. package/lib/chevre/service/reserve/findReservations.js +16 -26
  73. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
  74. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -9
  75. package/lib/chevre/service/reserve/searchByOrder.js +8 -3
  76. package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
  77. package/lib/chevre/service/reserve/useReservation.js +20 -24
  78. package/lib/chevre/service/task/acceptCOAOffer.js +2 -2
  79. package/lib/chevre/service/task/authorizePayment.js +1 -1
  80. package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
  81. package/lib/chevre/service/task/checkMovieTicket.js +1 -1
  82. package/lib/chevre/service/task/confirmReserveTransaction.js +3 -2
  83. package/lib/chevre/service/task/createAccountingReport.js +7 -9
  84. package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +1 -1
  85. package/lib/chevre/service/task/importEventsFromCOA.js +1 -1
  86. package/lib/chevre/service/task/importOffersFromCOA.js +1 -1
  87. package/lib/chevre/service/task/pay.js +1 -1
  88. package/lib/chevre/service/task/payment/payByTask.js +3 -2
  89. package/lib/chevre/service/task/refund.js +1 -1
  90. package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
  91. package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
  92. package/lib/chevre/service/task/useReservation.d.ts +2 -2
  93. package/lib/chevre/service/task/useReservation.js +6 -18
  94. package/lib/chevre/service/task/voidPayment.js +1 -1
  95. package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
  96. package/lib/chevre/service/taskHandler.js +1 -0
  97. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
  98. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
  99. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
  100. package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -2
  101. package/lib/chevre/service/transaction/returnOrder/preStart.js +2 -4
  102. package/lib/chevre/service/validation/validateOrder.js +5 -79
  103. package/lib/chevre/settings.d.ts +15 -16
  104. package/lib/chevre/settings.js +53 -19
  105. package/package.json +2 -2
@@ -12,54 +12,6 @@ class ReserveTransactionRepo {
12
12
  constructor(connection) {
13
13
  this.transactionModel = connection.model(assetTransaction_1.modelName, (0, assetTransaction_1.createSchema)());
14
14
  }
15
- // /**
16
- // * 予約取引から予約を検索する
17
- // */
18
- // public async findSubReservationsByReservationNumber(
19
- // params: {
20
- // reservationNumber: string;
21
- // }
22
- // ): Promise<ISubReservationAsFindResult[]> {
23
- // const aggregate = this.transactionModel.aggregate<ISubReservationAsFindResult>([
24
- // {
25
- // $match: {
26
- // typeOf: { $eq: factory.assetTransactionType.Reserve },
27
- // transactionNumber: { $eq: params.reservationNumber }
28
- // }
29
- // },
30
- // {
31
- // $unwind: {
32
- // path: '$object.subReservation'
33
- // // includeArrayIndex: 'elementIndex'
34
- // }
35
- // },
36
- // // {
37
- // // $match: {
38
- // // typeOf: { $eq: factory.assetTransactionType.Reserve },
39
- // // transactionNumber: { $eq: params.reservationNumber }
40
- // // }
41
- // // },
42
- // {
43
- // $project: {
44
- // _id: 0,
45
- // id: '$object.subReservation.id',
46
- // price: '$object.subReservation.price',
47
- // underName: '$object.underName',
48
- // reservedTicket: {
49
- // ticketType: '$object.subReservation.reservedTicket.ticketType',
50
- // }
51
- // }
52
- // }
53
- // ]);
54
- // // if (typeof filter.limit === 'number' && filter.limit > 0) {
55
- // // const page: number = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
56
- // // aggregate.limit(filter.limit * page)
57
- // // .skip(filter.limit * (page - 1));
58
- // // }
59
- // return aggregate
60
- // .option({ maxTimeMS: MONGO_MAX_TIME_MS })
61
- // .exec();
62
- // }
63
15
  /**
64
16
  * 予約取引から予約を検索する
65
17
  * limitはしない
@@ -91,12 +43,14 @@ class ReserveTransactionRepo {
91
43
  $project: {
92
44
  _id: 0,
93
45
  id: '$object.subReservation.id',
94
- price: '$object.subReservation.price',
95
46
  underName: '$object.underName',
96
47
  reservationFor: '$object.reservationFor',
97
48
  reservedTicket: {
98
49
  ticketType: '$object.subReservation.reservedTicket.ticketType',
99
- }
50
+ },
51
+ // numSeats: '$object.subReservation.numSeats',
52
+ // price: '$object.subReservation.price',
53
+ // issuedThrough: '$object.issuedThrough',
100
54
  }
101
55
  }
102
56
  ]);
@@ -798,22 +798,26 @@ class EventRepo {
798
798
  .sort({ startDate: factory_1.factory.sortType.Descending })
799
799
  .cursor();
800
800
  }
801
- // public async addAvailableAtOrFrom(params: {
801
+ // /**
802
+ // * アプリケーションオファー廃止用のメソッド
803
+ // */
804
+ // public async removeAvailableAtOrFrom(params: {
802
805
  // id: string;
803
806
  // offers: {
804
807
  // seller: {
805
- // makesOffer: factory.event.screeningEvent.ISellerMakesOffer;
808
+ // makesOffer: Pick<factory.event.screeningEvent.ISellerMakesOffer, 'availableAtOrFrom'>;
806
809
  // };
807
810
  // };
808
- // }): Promise<void> {
809
- // await this.eventModel.updateOne(
811
+ // }) {
812
+ // return this.eventModel.updateOne(
810
813
  // { _id: { $eq: params.id } },
811
814
  // {
812
- // $push: {
813
- // 'offers.seller.makesOffer': params.offers.seller.makesOffer
815
+ // $pull: {
816
+ // 'offers.seller.makesOffer': {
817
+ // 'availableAtOrFrom.id': { $eq: params.offers.seller.makesOffer.availableAtOrFrom.id }
818
+ // }
814
819
  // }
815
- // },
816
- // { includeResultMetadata: true }
820
+ // }
817
821
  // )
818
822
  // .exec();
819
823
  // }
@@ -0,0 +1,7 @@
1
+ import { factory } from '../../../factory';
2
+ type IAcceptedOfferByReserveTransaction = Pick<factory.order.IOptimizedAcceptedOffer, 'itemOffered' | 'priceSpecification'>;
3
+ /**
4
+ * 予約取引を注文のitemOfferedへ変換する
5
+ */
6
+ declare function reserveTransaction2itemOffered(params: Pick<factory.assetTransaction.reserve.ITransaction, 'object'>): IAcceptedOfferByReserveTransaction[];
7
+ export { IAcceptedOfferByReserveTransaction, reserveTransaction2itemOffered };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reserveTransaction2itemOffered = reserveTransaction2itemOffered;
4
+ function createReservationFor(reservationFor) {
5
+ const { superEvent, ...reservationForWithoutSuperEvent } = reservationFor;
6
+ const { workPerformed, ...superEventWithoutMovie } = superEvent;
7
+ const workPerformedInOrder = {
8
+ typeOf: workPerformed.typeOf,
9
+ id: workPerformed.id,
10
+ identifier: workPerformed.identifier,
11
+ name: workPerformed.name,
12
+ ...((typeof workPerformed.duration === 'string') && { duration: workPerformed.duration })
13
+ };
14
+ const superEventInOrder = {
15
+ ...superEventWithoutMovie,
16
+ workPerformed: workPerformedInOrder
17
+ };
18
+ return {
19
+ ...reservationForWithoutSuperEvent,
20
+ superEvent: superEventInOrder
21
+ };
22
+ }
23
+ function createReservedTicket(reservedTicket) {
24
+ const { issuedBy: _issuedBy, dateIssued: _dateIssued, dateUsed: _dateUsed, ticketToken: _ticketToken, ticketType, ticketNumber: _ticketNumber, ...reservedTicket4order } = reservedTicket;
25
+ const ticketTypeInOrder = {
26
+ typeOf: ticketType.typeOf,
27
+ id: ticketType.id,
28
+ identifier: ticketType.identifier,
29
+ name: ticketType.name,
30
+ ...((ticketType.description !== undefined) && { description: ticketType.description }),
31
+ ...((ticketType.additionalProperty !== undefined) && { additionalProperty: ticketType.additionalProperty }),
32
+ };
33
+ return {
34
+ ...reservedTicket4order,
35
+ ticketType: ticketTypeInOrder
36
+ };
37
+ }
38
+ /**
39
+ * 予約取引を注文のitemOfferedへ変換する
40
+ */
41
+ function reserveTransaction2itemOffered(params) {
42
+ const { object } = params;
43
+ // subReservationは配列のはず
44
+ if (!Array.isArray(object.subReservation)) {
45
+ return [];
46
+ }
47
+ // reservationForは存在するはず
48
+ if (object.reservationFor === undefined) {
49
+ return [];
50
+ }
51
+ const { reservationNumber, issuedThrough } = object;
52
+ // イベントを注文用に生成
53
+ const reservationFor = createReservationFor(object.reservationFor);
54
+ return object.subReservation.map((subReservationReserveTransaction) => {
55
+ const { additionalProperty, additionalTicketText, id, programMembershipUsed, typeOf, price } = subReservationReserveTransaction;
56
+ // チケットを注文用に生成
57
+ const reservedTicket = createReservedTicket(subReservationReserveTransaction.reservedTicket);
58
+ const reservationByReserveTransaction = {
59
+ additionalProperty,
60
+ id,
61
+ typeOf,
62
+ reservedTicket,
63
+ reservationNumber,
64
+ issuedThrough,
65
+ reservationFor,
66
+ ...((typeof additionalTicketText === 'string') && { additionalTicketText }),
67
+ ...((typeof programMembershipUsed?.identifier === 'string') && { programMembershipUsed }),
68
+ };
69
+ return {
70
+ itemOffered: reservationByReserveTransaction,
71
+ ...((price !== undefined) && { priceSpecification: price })
72
+ };
73
+ });
74
+ }
@@ -390,47 +390,21 @@ function CREATE_MONGO_CONDITIONS(params) {
390
390
  }
391
391
  /* istanbul ignore else */
392
392
  if (params.reservedTicket !== undefined) {
393
- /* istanbul ignore else */
394
- if (params.reservedTicket.ticketType !== undefined) {
395
- /* istanbul ignore else */
396
- if (Array.isArray(params.reservedTicket.ticketType.ids)) {
397
- andConditions.push({
398
- 'reservedTicket.ticketType.id': {
399
- $exists: true,
400
- $in: params.reservedTicket.ticketType.ids
401
- }
402
- });
403
- }
404
- // 単価オファーカテゴリーでの検索は廃止(2026-04-02~)
405
- // /* istanbul ignore else */
406
- // if (params.reservedTicket.ticketType.category !== undefined) {
407
- // /* istanbul ignore else */
408
- // if (Array.isArray(params.reservedTicket.ticketType.category.ids)) {
409
- // andConditions.push(
410
- // {
411
- // 'reservedTicket.ticketType.category.id': {
412
- // $exists: true,
413
- // $in: params.reservedTicket.ticketType.category.ids
414
- // }
415
- // }
416
- // );
417
- // }
418
- // /* istanbul ignore else */
419
- // if (params.reservedTicket.ticketType.category.codeValue !== undefined
420
- // && params.reservedTicket.ticketType.category !== null) {
421
- // if (Array.isArray(params.reservedTicket.ticketType.category.codeValue.$in)) {
422
- // andConditions.push(
423
- // {
424
- // 'reservedTicket.ticketType.category.codeValue': {
425
- // $exists: true,
426
- // $in: params.reservedTicket.ticketType.category.codeValue.$in
427
- // }
428
- // }
429
- // );
430
- // }
431
- // }
432
- // }
433
- }
393
+ // discontinue ticketType(2026-05-06~)
394
+ // /* istanbul ignore else */
395
+ // if (params.reservedTicket.ticketType !== undefined) {
396
+ // /* istanbul ignore else */
397
+ // if (Array.isArray(params.reservedTicket.ticketType.ids)) {
398
+ // andConditions.push(
399
+ // {
400
+ // 'reservedTicket.ticketType.id': {
401
+ // $exists: true,
402
+ // $in: params.reservedTicket.ticketType.ids
403
+ // }
404
+ // }
405
+ // );
406
+ // }
407
+ // }
434
408
  /* istanbul ignore else */
435
409
  if (params.reservedTicket.ticketedSeat !== undefined) {
436
410
  /* istanbul ignore else */
@@ -481,41 +455,41 @@ function CREATE_MONGO_CONDITIONS(params) {
481
455
  }
482
456
  });
483
457
  }
484
- const brokerIdentifierAll = params.broker?.identifier?.$all;
485
- if (Array.isArray(brokerIdentifierAll)) {
486
- andConditions.push({
487
- 'broker.identifier': {
488
- $exists: true,
489
- $all: brokerIdentifierAll
490
- }
491
- });
492
- }
493
- const brokerIdentifierIn = params.broker?.identifier?.$in;
494
- if (Array.isArray(brokerIdentifierIn)) {
495
- andConditions.push({
496
- 'broker.identifier': {
497
- $exists: true,
498
- $in: brokerIdentifierIn
499
- }
500
- });
501
- }
502
- const brokerIdentifierNin = params.broker?.identifier?.$nin;
503
- if (Array.isArray(brokerIdentifierNin)) {
504
- andConditions.push({
505
- 'broker.identifier': {
506
- $nin: brokerIdentifierNin
507
- }
508
- });
509
- }
510
- const brokerIdentifierElemMatch = params.broker?.identifier?.$elemMatch;
511
- if (brokerIdentifierElemMatch !== undefined && brokerIdentifierElemMatch !== null) {
512
- andConditions.push({
513
- 'broker.identifier': {
514
- $exists: true,
515
- $elemMatch: brokerIdentifierElemMatch
516
- }
517
- });
518
- }
458
+ // const brokerIdentifierAll = params.broker?.identifier?.$all;
459
+ // if (Array.isArray(brokerIdentifierAll)) {
460
+ // andConditions.push({
461
+ // 'broker.identifier': {
462
+ // $exists: true,
463
+ // $all: brokerIdentifierAll
464
+ // }
465
+ // });
466
+ // }
467
+ // const brokerIdentifierIn = params.broker?.identifier?.$in;
468
+ // if (Array.isArray(brokerIdentifierIn)) {
469
+ // andConditions.push({
470
+ // 'broker.identifier': {
471
+ // $exists: true,
472
+ // $in: brokerIdentifierIn
473
+ // }
474
+ // });
475
+ // }
476
+ // const brokerIdentifierNin = params.broker?.identifier?.$nin;
477
+ // if (Array.isArray(brokerIdentifierNin)) {
478
+ // andConditions.push({
479
+ // 'broker.identifier': {
480
+ // $nin: brokerIdentifierNin
481
+ // }
482
+ // });
483
+ // }
484
+ // const brokerIdentifierElemMatch = params.broker?.identifier?.$elemMatch;
485
+ // if (brokerIdentifierElemMatch !== undefined && brokerIdentifierElemMatch !== null) {
486
+ // andConditions.push({
487
+ // 'broker.identifier': {
488
+ // $exists: true,
489
+ // $elemMatch: brokerIdentifierElemMatch
490
+ // }
491
+ // });
492
+ // }
519
493
  /* istanbul ignore else */
520
494
  if (params.underName !== undefined) {
521
495
  /* istanbul ignore else */
@@ -632,49 +606,49 @@ function CREATE_MONGO_CONDITIONS(params) {
632
606
  });
633
607
  }
634
608
  }
635
- /* istanbul ignore else */
636
- if (params.underName.identifier !== undefined) {
637
- if (Array.isArray(params.underName.identifier.$all)) {
638
- andConditions.push({
639
- 'underName.identifier': {
640
- $exists: true,
641
- $all: params.underName.identifier.$all
642
- }
643
- });
644
- }
645
- if (Array.isArray(params.underName.identifier.$in)) {
646
- andConditions.push({
647
- 'underName.identifier': {
648
- $exists: true,
649
- $in: params.underName.identifier.$in
650
- }
651
- });
652
- }
653
- if (Array.isArray(params.underName.identifier.$nin)) {
654
- andConditions.push({
655
- 'underName.identifier': {
656
- $nin: params.underName.identifier.$nin
657
- }
658
- });
659
- }
660
- if (params.underName.identifier.$elemMatch !== undefined) {
661
- andConditions.push({
662
- 'underName.identifier': {
663
- $exists: true,
664
- $elemMatch: params.underName.identifier.$elemMatch
665
- }
666
- });
667
- }
668
- }
669
- /* istanbul ignore else */
670
- if (Array.isArray(params.underName.identifiers)) {
671
- andConditions.push({
672
- 'underName.identifier': {
673
- $exists: true,
674
- $in: params.underName.identifiers
675
- }
676
- });
677
- }
609
+ // /* istanbul ignore else */
610
+ // if (params.underName.identifier !== undefined) {
611
+ // if (Array.isArray(params.underName.identifier.$all)) {
612
+ // andConditions.push({
613
+ // 'underName.identifier': {
614
+ // $exists: true,
615
+ // $all: params.underName.identifier.$all
616
+ // }
617
+ // });
618
+ // }
619
+ // if (Array.isArray(params.underName.identifier.$in)) {
620
+ // andConditions.push({
621
+ // 'underName.identifier': {
622
+ // $exists: true,
623
+ // $in: params.underName.identifier.$in
624
+ // }
625
+ // });
626
+ // }
627
+ // if (Array.isArray(params.underName.identifier.$nin)) {
628
+ // andConditions.push({
629
+ // 'underName.identifier': {
630
+ // $nin: params.underName.identifier.$nin
631
+ // }
632
+ // });
633
+ // }
634
+ // if (params.underName.identifier.$elemMatch !== undefined) {
635
+ // andConditions.push({
636
+ // 'underName.identifier': {
637
+ // $exists: true,
638
+ // $elemMatch: params.underName.identifier.$elemMatch
639
+ // }
640
+ // });
641
+ // }
642
+ // }
643
+ // /* istanbul ignore else */
644
+ // if (Array.isArray(params.underName.identifiers)) {
645
+ // andConditions.push({
646
+ // 'underName.identifier': {
647
+ // $exists: true,
648
+ // $in: params.underName.identifiers
649
+ // }
650
+ // });
651
+ // }
678
652
  }
679
653
  /* istanbul ignore else */
680
654
  if (typeof params.attended === 'boolean') {
@@ -688,66 +662,67 @@ function CREATE_MONGO_CONDITIONS(params) {
688
662
  checkedIn: params.checkedIn
689
663
  });
690
664
  }
691
- /* istanbul ignore else */
692
- if (params.additionalProperty !== undefined) {
693
- if (Array.isArray(params.additionalProperty.$all)) {
694
- andConditions.push({
695
- additionalProperty: {
696
- $exists: true,
697
- $all: params.additionalProperty.$all
698
- }
699
- });
700
- }
701
- if (Array.isArray(params.additionalProperty.$in)) {
702
- andConditions.push({
703
- additionalProperty: {
704
- $exists: true,
705
- $in: params.additionalProperty.$in
706
- }
707
- });
708
- }
709
- if (Array.isArray(params.additionalProperty.$nin)) {
710
- andConditions.push({
711
- additionalProperty: {
712
- $nin: params.additionalProperty.$nin
713
- }
714
- });
715
- }
716
- if (params.additionalProperty.$elemMatch !== undefined) {
717
- andConditions.push({
718
- additionalProperty: {
719
- $exists: true,
720
- $elemMatch: params.additionalProperty.$elemMatch
721
- }
722
- });
723
- }
724
- }
725
- const programMembershipUsedIdentifierEq = params.programMembershipUsed?.identifier?.$eq;
726
- if (typeof programMembershipUsedIdentifierEq === 'string') {
727
- andConditions.push({
728
- 'programMembershipUsed.identifier': {
729
- $exists: true,
730
- $eq: programMembershipUsedIdentifierEq
731
- }
732
- });
733
- }
734
- const programMembershipUsedIssuedThroughServiceTypeCodeValueEq = params.programMembershipUsed?.issuedThrough?.serviceType?.codeValue?.$eq;
735
- if (typeof programMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
736
- andConditions.push({
737
- 'programMembershipUsed.issuedThrough.serviceType.codeValue': {
738
- $exists: true,
739
- $eq: programMembershipUsedIssuedThroughServiceTypeCodeValueEq
740
- }
741
- });
742
- }
743
- const appliesToMovieTicketIdentifierEq = params.price?.priceComponent?.appliesToMovieTicket?.identifier?.$eq;
744
- if (typeof appliesToMovieTicketIdentifierEq === 'string') {
745
- andConditions.push({
746
- 'price.priceComponent.appliesToMovieTicket.identifier': {
747
- $exists: true,
748
- $eq: appliesToMovieTicketIdentifierEq
749
- }
750
- });
751
- }
665
+ // /* istanbul ignore else */
666
+ // if (params.additionalProperty !== undefined) {
667
+ // if (Array.isArray(params.additionalProperty.$all)) {
668
+ // andConditions.push({
669
+ // additionalProperty: {
670
+ // $exists: true,
671
+ // $all: params.additionalProperty.$all
672
+ // }
673
+ // });
674
+ // }
675
+ // if (Array.isArray(params.additionalProperty.$in)) {
676
+ // andConditions.push({
677
+ // additionalProperty: {
678
+ // $exists: true,
679
+ // $in: params.additionalProperty.$in
680
+ // }
681
+ // });
682
+ // }
683
+ // if (Array.isArray(params.additionalProperty.$nin)) {
684
+ // andConditions.push({
685
+ // additionalProperty: {
686
+ // $nin: params.additionalProperty.$nin
687
+ // }
688
+ // });
689
+ // }
690
+ // if (params.additionalProperty.$elemMatch !== undefined) {
691
+ // andConditions.push({
692
+ // additionalProperty: {
693
+ // $exists: true,
694
+ // $elemMatch: params.additionalProperty.$elemMatch
695
+ // }
696
+ // });
697
+ // }
698
+ // }
699
+ // const programMembershipUsedIdentifierEq = params.programMembershipUsed?.identifier?.$eq;
700
+ // if (typeof programMembershipUsedIdentifierEq === 'string') {
701
+ // andConditions.push({
702
+ // 'programMembershipUsed.identifier': {
703
+ // $exists: true,
704
+ // $eq: programMembershipUsedIdentifierEq
705
+ // }
706
+ // });
707
+ // }
708
+ // const programMembershipUsedIssuedThroughServiceTypeCodeValueEq =
709
+ // params.programMembershipUsed?.issuedThrough?.serviceType?.codeValue?.$eq;
710
+ // if (typeof programMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
711
+ // andConditions.push({
712
+ // 'programMembershipUsed.issuedThrough.serviceType.codeValue': {
713
+ // $exists: true,
714
+ // $eq: programMembershipUsedIssuedThroughServiceTypeCodeValueEq
715
+ // }
716
+ // });
717
+ // }
718
+ // const appliesToMovieTicketIdentifierEq = params.price?.priceComponent?.appliesToMovieTicket?.identifier?.$eq;
719
+ // if (typeof appliesToMovieTicketIdentifierEq === 'string') {
720
+ // andConditions.push({
721
+ // 'price.priceComponent.appliesToMovieTicket.identifier': {
722
+ // $exists: true,
723
+ // $eq: appliesToMovieTicketIdentifierEq
724
+ // }
725
+ // });
726
+ // }
752
727
  return andConditions;
753
728
  }
@@ -66,48 +66,48 @@ const indexes = [
66
66
  }
67
67
  }
68
68
  ],
69
- [
70
- { 'mainEntity.orderStatus': 1, 'mainEntity.orderDate': -1 },
71
- {
72
- name: 'searchByOrderStatus'
73
- }
74
- ],
75
- [
76
- { 'mainEntity.confirmationNumber': 1, 'mainEntity.orderDate': -1 },
77
- {
78
- name: 'searchByConfirmationNumber',
79
- partialFilterExpression: {
80
- 'mainEntity.confirmationNumber': { $exists: true }
81
- }
82
- }
83
- ],
84
- [
85
- { 'mainEntity.customer.id': 1, 'mainEntity.orderDate': -1 },
86
- {
87
- name: 'searchByCustomerId',
88
- partialFilterExpression: {
89
- 'mainEntity.customer.id': { $exists: true }
90
- }
91
- }
92
- ],
93
- [
94
- { 'mainEntity.paymentMethods.accountId': 1, 'mainEntity.orderDate': -1 },
95
- {
96
- name: 'searchByPaymentMethodsAccountId',
97
- partialFilterExpression: {
98
- 'mainEntity.paymentMethods.accountId': { $exists: true }
99
- }
100
- }
101
- ],
102
- [
103
- { 'mainEntity.paymentMethods.typeOf': 1, 'mainEntity.orderDate': -1 },
104
- {
105
- name: 'searchByPaymentMethodTypeOf',
106
- partialFilterExpression: {
107
- 'mainEntity.paymentMethods.typeOf': { $exists: true }
108
- }
109
- }
110
- ],
69
+ // [
70
+ // { 'mainEntity.orderStatus': 1, 'mainEntity.orderDate': -1 },
71
+ // {
72
+ // name: 'searchByOrderStatus'
73
+ // }
74
+ // ],
75
+ // [
76
+ // { 'mainEntity.confirmationNumber': 1, 'mainEntity.orderDate': -1 },
77
+ // {
78
+ // name: 'searchByConfirmationNumber',
79
+ // partialFilterExpression: {
80
+ // 'mainEntity.confirmationNumber': { $exists: true }
81
+ // }
82
+ // }
83
+ // ],
84
+ // [
85
+ // { 'mainEntity.customer.id': 1, 'mainEntity.orderDate': -1 },
86
+ // {
87
+ // name: 'searchByCustomerId',
88
+ // partialFilterExpression: {
89
+ // 'mainEntity.customer.id': { $exists: true }
90
+ // }
91
+ // }
92
+ // ],
93
+ // [
94
+ // { 'mainEntity.paymentMethods.accountId': 1, 'mainEntity.orderDate': -1 },
95
+ // {
96
+ // name: 'searchByPaymentMethodsAccountId',
97
+ // partialFilterExpression: {
98
+ // 'mainEntity.paymentMethods.accountId': { $exists: true }
99
+ // }
100
+ // }
101
+ // ],
102
+ // [
103
+ // { 'mainEntity.paymentMethods.typeOf': 1, 'mainEntity.orderDate': -1 },
104
+ // {
105
+ // name: 'searchByPaymentMethodTypeOf',
106
+ // partialFilterExpression: {
107
+ // 'mainEntity.paymentMethods.typeOf': { $exists: true }
108
+ // }
109
+ // }
110
+ // ],
111
111
  [
112
112
  { 'mainEntity.paymentMethods.paymentMethodId': 1, 'mainEntity.orderDate': -1 },
113
113
  {