@chevre/domain 24.1.0-alpha.7 → 24.1.0-alpha.9

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.
@@ -455,41 +455,41 @@ function CREATE_MONGO_CONDITIONS(params) {
455
455
  }
456
456
  });
457
457
  }
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
- }
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
+ // }
493
493
  /* istanbul ignore else */
494
494
  if (params.underName !== undefined) {
495
495
  /* istanbul ignore else */
@@ -606,49 +606,49 @@ function CREATE_MONGO_CONDITIONS(params) {
606
606
  });
607
607
  }
608
608
  }
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
- }
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
+ // }
652
652
  }
653
653
  /* istanbul ignore else */
654
654
  if (typeof params.attended === 'boolean') {
@@ -662,66 +662,67 @@ function CREATE_MONGO_CONDITIONS(params) {
662
662
  checkedIn: params.checkedIn
663
663
  });
664
664
  }
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 = params.programMembershipUsed?.issuedThrough?.serviceType?.codeValue?.$eq;
709
- if (typeof programMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
710
- andConditions.push({
711
- 'programMembershipUsed.issuedThrough.serviceType.codeValue': {
712
- $exists: true,
713
- $eq: programMembershipUsedIssuedThroughServiceTypeCodeValueEq
714
- }
715
- });
716
- }
717
- const appliesToMovieTicketIdentifierEq = params.price?.priceComponent?.appliesToMovieTicket?.identifier?.$eq;
718
- if (typeof appliesToMovieTicketIdentifierEq === 'string') {
719
- andConditions.push({
720
- 'price.priceComponent.appliesToMovieTicket.identifier': {
721
- $exists: true,
722
- $eq: appliesToMovieTicketIdentifierEq
723
- }
724
- });
725
- }
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
+ // }
726
727
  return andConditions;
727
728
  }
@@ -59,15 +59,15 @@ const indexes = [
59
59
  { 'project.id': 1, orderDate: -1 },
60
60
  { name: 'searchByProjectId-v20220721' }
61
61
  ],
62
- [
63
- { identifier: 1, orderDate: -1 },
64
- {
65
- name: 'searchByIdentifier',
66
- partialFilterExpression: {
67
- identifier: { $exists: true }
68
- }
69
- }
70
- ],
62
+ // [
63
+ // { identifier: 1, orderDate: -1 },
64
+ // {
65
+ // name: 'searchByIdentifier',
66
+ // partialFilterExpression: {
67
+ // identifier: { $exists: true }
68
+ // }
69
+ // }
70
+ // ],
71
71
  [
72
72
  // 注文番号はユニークなはず
73
73
  { orderNumber: 1 },
@@ -76,15 +76,15 @@ const indexes = [
76
76
  name: 'uniqueOrderNumber'
77
77
  }
78
78
  ],
79
- [
80
- { 'seller.typeOf': 1, orderDate: -1 },
81
- {
82
- name: 'searchBySellerTypeOf',
83
- partialFilterExpression: {
84
- 'seller.typeOf': { $exists: true }
85
- }
86
- }
87
- ],
79
+ // [
80
+ // { 'seller.typeOf': 1, orderDate: -1 },
81
+ // {
82
+ // name: 'searchBySellerTypeOf',
83
+ // partialFilterExpression: {
84
+ // 'seller.typeOf': { $exists: true }
85
+ // }
86
+ // }
87
+ // ],
88
88
  [
89
89
  { 'seller.id': 1, orderDate: -1 },
90
90
  {
@@ -151,24 +151,24 @@ const indexes = [
151
151
  }
152
152
  }
153
153
  ],
154
- [
155
- { 'customer.additionalProperty': 1, orderDate: -1 },
156
- {
157
- name: 'searchByCustomerAdditionalProperty',
158
- partialFilterExpression: {
159
- 'customer.additionalProperty': { $exists: true }
160
- }
161
- }
162
- ],
163
- [
164
- { 'customer.memberOf.membershipNumber': 1, orderDate: -1 },
165
- {
166
- name: 'searchByCustomerMemberhipNumberAndOrderDate',
167
- partialFilterExpression: {
168
- 'customer.memberOf.membershipNumber': { $exists: true }
169
- }
170
- }
171
- ],
154
+ // [
155
+ // { 'customer.additionalProperty': 1, orderDate: -1 },
156
+ // {
157
+ // name: 'searchByCustomerAdditionalProperty',
158
+ // partialFilterExpression: {
159
+ // 'customer.additionalProperty': { $exists: true }
160
+ // }
161
+ // }
162
+ // ],
163
+ // [
164
+ // { 'customer.memberOf.membershipNumber': 1, orderDate: -1 },
165
+ // {
166
+ // name: 'searchByCustomerMemberhipNumberAndOrderDate',
167
+ // partialFilterExpression: {
168
+ // 'customer.memberOf.membershipNumber': { $exists: true }
169
+ // }
170
+ // }
171
+ // ],
172
172
  [
173
173
  { 'customer.givenName': 1, orderDate: -1 },
174
174
  {
@@ -232,15 +232,15 @@ const indexes = [
232
232
  }
233
233
  }
234
234
  ],
235
- [
236
- { 'paymentMethods.typeOf': 1, orderDate: -1 },
237
- {
238
- name: 'searchByPaymentMethodTypeAndOrderDate',
239
- partialFilterExpression: {
240
- 'paymentMethods.typeOf': { $exists: true }
241
- }
242
- }
243
- ],
235
+ // [
236
+ // { 'paymentMethods.typeOf': 1, orderDate: -1 },
237
+ // {
238
+ // name: 'searchByPaymentMethodTypeAndOrderDate',
239
+ // partialFilterExpression: {
240
+ // 'paymentMethods.typeOf': { $exists: true }
241
+ // }
242
+ // }
243
+ // ],
244
244
  [
245
245
  { 'paymentMethods.paymentMethod.identifier': 1, orderDate: -1 },
246
246
  {
@@ -259,24 +259,24 @@ const indexes = [
259
259
  }
260
260
  }
261
261
  ],
262
- [
263
- { 'acceptedOffers.itemOffered.typeOf': 1, orderDate: -1 },
264
- {
265
- name: 'searchByItemOfferedTypeOf',
266
- partialFilterExpression: {
267
- 'acceptedOffers.itemOffered.typeOf': { $exists: true }
268
- }
269
- }
270
- ],
271
- [
272
- { 'acceptedOffers.itemOffered.identifier': 1, orderDate: -1 },
273
- {
274
- name: 'searchByItemOfferedIdentifier',
275
- partialFilterExpression: {
276
- 'acceptedOffers.itemOffered.identifier': { $exists: true }
277
- }
278
- }
279
- ],
262
+ // [
263
+ // { 'acceptedOffers.itemOffered.typeOf': 1, orderDate: -1 },
264
+ // {
265
+ // name: 'searchByItemOfferedTypeOf',
266
+ // partialFilterExpression: {
267
+ // 'acceptedOffers.itemOffered.typeOf': { $exists: true }
268
+ // }
269
+ // }
270
+ // ],
271
+ // [
272
+ // { 'acceptedOffers.itemOffered.identifier': 1, orderDate: -1 },
273
+ // {
274
+ // name: 'searchByItemOfferedIdentifier',
275
+ // partialFilterExpression: {
276
+ // 'acceptedOffers.itemOffered.identifier': { $exists: true }
277
+ // }
278
+ // }
279
+ // ],
280
280
  [
281
281
  { 'acceptedOffers.itemOffered.id': 1, orderDate: -1 },
282
282
  {
@@ -286,42 +286,42 @@ const indexes = [
286
286
  }
287
287
  }
288
288
  ],
289
- [
290
- { 'acceptedOffers.itemOffered.issuedThrough.typeOf': 1, orderDate: -1 },
291
- {
292
- name: 'searchByItemOfferedIssuedThroughTypeOf',
293
- partialFilterExpression: {
294
- 'acceptedOffers.itemOffered.issuedThrough.typeOf': { $exists: true }
295
- }
296
- }
297
- ],
298
- [
299
- { 'acceptedOffers.itemOffered.issuedThrough.id': 1, orderDate: -1 },
300
- {
301
- name: 'searchByItemOfferedIssuedThroughId',
302
- partialFilterExpression: {
303
- 'acceptedOffers.itemOffered.issuedThrough.id': { $exists: true }
304
- }
305
- }
306
- ],
307
- [
308
- { 'acceptedOffers.itemOffered.programMembershipUsed.identifier': 1, orderDate: -1 },
309
- {
310
- name: 'searchByItemOfferedProgramMembershipUsedIdentifier',
311
- partialFilterExpression: {
312
- 'acceptedOffers.itemOffered.programMembershipUsed.identifier': { $exists: true }
313
- }
314
- }
315
- ],
316
- [
317
- { 'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': 1, orderDate: -1 },
318
- {
319
- name: 'searchByItemOfferedMembershipUsedServiceType',
320
- partialFilterExpression: {
321
- 'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': { $exists: true }
322
- }
323
- }
324
- ],
289
+ // [
290
+ // { 'acceptedOffers.itemOffered.issuedThrough.typeOf': 1, orderDate: -1 },
291
+ // {
292
+ // name: 'searchByItemOfferedIssuedThroughTypeOf',
293
+ // partialFilterExpression: {
294
+ // 'acceptedOffers.itemOffered.issuedThrough.typeOf': { $exists: true }
295
+ // }
296
+ // }
297
+ // ],
298
+ // [
299
+ // { 'acceptedOffers.itemOffered.issuedThrough.id': 1, orderDate: -1 },
300
+ // {
301
+ // name: 'searchByItemOfferedIssuedThroughId',
302
+ // partialFilterExpression: {
303
+ // 'acceptedOffers.itemOffered.issuedThrough.id': { $exists: true }
304
+ // }
305
+ // }
306
+ // ],
307
+ // [
308
+ // { 'acceptedOffers.itemOffered.programMembershipUsed.identifier': 1, orderDate: -1 },
309
+ // {
310
+ // name: 'searchByItemOfferedProgramMembershipUsedIdentifier',
311
+ // partialFilterExpression: {
312
+ // 'acceptedOffers.itemOffered.programMembershipUsed.identifier': { $exists: true }
313
+ // }
314
+ // }
315
+ // ],
316
+ // [
317
+ // { 'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': 1, orderDate: -1 },
318
+ // {
319
+ // name: 'searchByItemOfferedMembershipUsedServiceType',
320
+ // partialFilterExpression: {
321
+ // 'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': { $exists: true }
322
+ // }
323
+ // }
324
+ // ],
325
325
  [
326
326
  { 'acceptedOffers.itemOffered.reservationNumber': 1, orderDate: -1 },
327
327
  {
@@ -340,24 +340,24 @@ const indexes = [
340
340
  }
341
341
  }
342
342
  ],
343
- [
344
- { 'acceptedOffers.itemOffered.reservationFor.identifier': 1, orderDate: -1 },
345
- {
346
- name: 'searchByItemOfferedReservationForIdentifierAndOrderDate',
347
- partialFilterExpression: {
348
- 'acceptedOffers.itemOffered.reservationFor.identifier': { $exists: true }
349
- }
350
- }
351
- ],
352
- [
353
- { 'acceptedOffers.itemOffered.reservationFor.name': 1, orderDate: -1 },
354
- {
355
- name: 'searchByItemOfferedReservationForNameAndOrderDate',
356
- partialFilterExpression: {
357
- 'acceptedOffers.itemOffered.reservationFor.name': { $exists: true }
358
- }
359
- }
360
- ],
343
+ // [
344
+ // { 'acceptedOffers.itemOffered.reservationFor.identifier': 1, orderDate: -1 },
345
+ // {
346
+ // name: 'searchByItemOfferedReservationForIdentifierAndOrderDate',
347
+ // partialFilterExpression: {
348
+ // 'acceptedOffers.itemOffered.reservationFor.identifier': { $exists: true }
349
+ // }
350
+ // }
351
+ // ],
352
+ // [
353
+ // { 'acceptedOffers.itemOffered.reservationFor.name': 1, orderDate: -1 },
354
+ // {
355
+ // name: 'searchByItemOfferedReservationForNameAndOrderDate',
356
+ // partialFilterExpression: {
357
+ // 'acceptedOffers.itemOffered.reservationFor.name': { $exists: true }
358
+ // }
359
+ // }
360
+ // ],
361
361
  [
362
362
  { 'acceptedOffers.itemOffered.reservationFor.endDate': 1, orderDate: -1 },
363
363
  {
@@ -5,6 +5,7 @@ type IDocType = (Omit<factory.reservation.eventReservation.IReservation, 'id'>)
5
5
  _id: string;
6
6
  bookingAgent?: any;
7
7
  previousReservationStatus?: factory.reservationStatusType;
8
+ priceCurrency?: factory.priceCurrency;
8
9
  };
9
10
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
10
11
  type ISchemaDefinition = SchemaDefinition<IDocType>;