@chevre/domain 21.9.0-alpha.9 → 21.10.0

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 (32) hide show
  1. package/README.md +4 -35
  2. package/example/src/chevre/createManyEventsIfNotExist.ts +2 -2
  3. package/example/src/chevre/searchAvaialbleAppliesToMovieTicketByOfferCatalogId.ts +4 -1
  4. package/example/src/chevre/searchOfferCatalogItemAvailability.ts +38 -0
  5. package/example/src/chevre/searchOfferCatalogItems.ts +41 -26
  6. package/example/src/chevre/searchOffers.ts +16 -4
  7. package/example/src/chevre/searchOrders.ts +18 -14
  8. package/example/src/chevre/syncCatalogs2aggregateOffers.ts +23 -21
  9. package/lib/chevre/repo/aggregateOffer.d.ts +19 -3
  10. package/lib/chevre/repo/aggregateOffer.js +227 -27
  11. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +45 -45
  12. package/lib/chevre/repo/offer.d.ts +17 -13
  13. package/lib/chevre/repo/offer.js +122 -42
  14. package/lib/chevre/repo/offerCatalog.d.ts +11 -0
  15. package/lib/chevre/repo/offerCatalog.js +30 -1
  16. package/lib/chevre/repo/offerCatalogItem.d.ts +20 -1
  17. package/lib/chevre/repo/offerCatalogItem.js +67 -23
  18. package/lib/chevre/repo/order.js +19 -11
  19. package/lib/chevre/repo/task.d.ts +1 -1
  20. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +52 -1
  21. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +124 -6
  22. package/lib/chevre/service/offer/event.d.ts +2 -2
  23. package/lib/chevre/service/offer/event.js +3 -1
  24. package/lib/chevre/service/offer/product/searchProductOffers.js +3 -3
  25. package/lib/chevre/service/offer/product.js +3 -30
  26. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +3 -3
  27. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +20 -0
  28. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +28 -0
  29. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +15 -5
  30. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +45 -33
  31. package/lib/chevre/service/task/onResourceUpdated.js +2 -2
  32. package/package.json +3 -3
@@ -494,7 +494,7 @@ class MongoRepository {
494
494
  typeOf: 'OfferCatalog'
495
495
  };
496
496
  });
497
- let result = yield this.aggregateOfferModel.updateMany({
497
+ const result = yield this.aggregateOfferModel.updateMany({
498
498
  'project.id': { $eq: params.project.id },
499
499
  _id: { $in: params.id.$in },
500
500
  // includedInDataCatalogのユニークネスを保証する
@@ -511,24 +511,28 @@ class MongoRepository {
511
511
  })
512
512
  .exec();
513
513
  debug('result', result);
514
- // offersにもpush
515
- result = yield this.aggregateOfferModel.updateMany({
516
- 'project.id': { $eq: params.project.id },
517
- _id: { $in: params.id.$in }
518
- }, {
519
- $push: {
520
- 'offers.$[offer].includedInDataCatalog': {
521
- $each: newIncludedInDataCatalogs
522
- }
523
- }
524
- }, {
525
- // includedInDataCatalogのユニークネスを保証する
526
- arrayFilters: [
527
- { 'offer.includedInDataCatalog.id': { $nin: pushIncludedInDataCatalogIds } }
528
- ]
529
- })
530
- .exec();
531
- debug('result', result);
514
+ // offersにもpush(ひとまず廃止)
515
+ // result = await this.aggregateOfferModel.updateMany(
516
+ // {
517
+ // 'project.id': { $eq: params.project.id },
518
+ // _id: { $in: params.id.$in }
519
+ // },
520
+ // {
521
+ // $push: {
522
+ // 'offers.$[offer].includedInDataCatalog': {
523
+ // $each: newIncludedInDataCatalogs
524
+ // }
525
+ // }
526
+ // },
527
+ // {
528
+ // // includedInDataCatalogのユニークネスを保証する
529
+ // arrayFilters: [
530
+ // { 'offer.includedInDataCatalog.id': { $nin: pushIncludedInDataCatalogIds } }
531
+ // ]
532
+ // }
533
+ // )
534
+ // .exec();
535
+ // debug('result', result);
532
536
  });
533
537
  }
534
538
  /**
@@ -547,14 +551,210 @@ class MongoRepository {
547
551
  }
548
552
  })
549
553
  .exec();
550
- // 全offersからもpull
551
- yield this.aggregateOfferModel.updateMany(Object.assign({ 'project.id': { $eq: params.project.id }, 'offers.includedInDataCatalog.id': { $exists: true, $eq: pullingCatalogId } }, (Array.isArray(idNin)) ? { _id: { $nin: idNin } } : undefined), {
552
- $pull: {
553
- 'offers.$[].includedInDataCatalog': {
554
- id: { $eq: pullingCatalogId }
555
- }
556
- }
557
- })
554
+ });
555
+ }
556
+ // public async pushIncludedInOfferCatalogItem(params: {
557
+ // project: { id: string };
558
+ // id: { $in: string[] };
559
+ // $push: {
560
+ // includedInOfferCatalogItem: {
561
+ // /**
562
+ // * サブカタログID
563
+ // */
564
+ // id: { $eq: string };
565
+ // includedInDataCatalog: {
566
+ // /**
567
+ // * カタログID
568
+ // */
569
+ // id: { $eq: string };
570
+ // };
571
+ // };
572
+ // };
573
+ // }): Promise<void> {
574
+ // if (!Array.isArray(params.id.$in) || params.id.$in.length === 0) {
575
+ // return;
576
+ // }
577
+ // const newIncludedInOfferCatalogItem: {
578
+ // /**
579
+ // * サブカタログID
580
+ // */
581
+ // id: string;
582
+ // typeOf: 'OfferCatalog';
583
+ // includedInDataCatalog: {
584
+ // /**
585
+ // * カタログID
586
+ // */
587
+ // id: string;
588
+ // typeOf: 'OfferCatalog';
589
+ // };
590
+ // } = {
591
+ // id: params.$push.includedInOfferCatalogItem.id.$eq,
592
+ // typeOf: 'OfferCatalog',
593
+ // includedInDataCatalog: { id: params.$push.includedInOfferCatalogItem.includedInDataCatalog.id.$eq, typeOf: 'OfferCatalog' }
594
+ // };
595
+ // const result = await this.aggregateOfferModel.updateMany(
596
+ // {
597
+ // 'project.id': { $eq: params.project.id },
598
+ // _id: { $in: params.id.$in }
599
+ // },
600
+ // {
601
+ // // newIncludedInOfferCatalogItemsのユニークネスを保証する
602
+ // $addToSet: { 'offers.$[].includedInOfferCatalogItem': newIncludedInOfferCatalogItem }
603
+ // }
604
+ // )
605
+ // .exec();
606
+ // debug('result', result);
607
+ // }
608
+ /**
609
+ * サブカタログを含み、かつ、新しいカタログに含まれない集計オファーからサブカタログを除外
610
+ */
611
+ // public async pullIncludedInOfferCatalogItem(params: {
612
+ // project: { id: string };
613
+ // id?: { $nin?: string[] };
614
+ // $pull: {
615
+ // includedInOfferCatalogItem: {
616
+ // $elemMatch: {
617
+ // /**
618
+ // * サブカタログID
619
+ // */
620
+ // id: { $eq: string };
621
+ // includedInDataCatalog: {
622
+ // /**
623
+ // * カタログID
624
+ // */
625
+ // id: { $eq: string };
626
+ // };
627
+ // };
628
+ // };
629
+ // };
630
+ // }) {
631
+ // const idNin = params.id?.$nin;
632
+ // await this.aggregateOfferModel.updateMany(
633
+ // {
634
+ // 'project.id': { $eq: params.project.id },
635
+ // 'offers.includedInOfferCatalogItem': {
636
+ // $elemMatch: {
637
+ // id: { $exists: true, $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.id.$eq },
638
+ // 'includedInDataCatalog.id': {
639
+ // $exists: true,
640
+ // $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.includedInDataCatalog.id.$eq
641
+ // }
642
+ // }
643
+ // },
644
+ // ...(Array.isArray(idNin)) ? { _id: { $nin: idNin } } : undefined
645
+ // },
646
+ // {
647
+ // $pull: {
648
+ // 'offers.$[].includedInOfferCatalogItem': {
649
+ // id: { $exists: true, $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.id.$eq },
650
+ // 'includedInDataCatalog.id': {
651
+ // $exists: true,
652
+ // $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.includedInDataCatalog.id.$eq
653
+ // }
654
+ // }
655
+ // }
656
+ // }
657
+ // )
658
+ // .exec();
659
+ // }
660
+ /**
661
+ * カタログに属するサブカタログを全て除外する
662
+ */
663
+ // public async pullIncludedInOfferCatalogItemByCatalogId(params: {
664
+ // project: { id: string };
665
+ // $pull: {
666
+ // includedInOfferCatalogItem: {
667
+ // $elemMatch: {
668
+ // /**
669
+ // * サブカタログID除外リスト
670
+ // */
671
+ // id?: { $nin: string[] };
672
+ // includedInDataCatalog: {
673
+ // /**
674
+ // * カタログID
675
+ // */
676
+ // id: { $eq: string };
677
+ // };
678
+ // };
679
+ // };
680
+ // };
681
+ // }) {
682
+ // const offerCatalogItemIdNin = params.$pull.includedInOfferCatalogItem.$elemMatch.id?.$nin;
683
+ // await this.aggregateOfferModel.updateMany(
684
+ // {
685
+ // 'project.id': { $eq: params.project.id },
686
+ // 'offers.includedInOfferCatalogItem': {
687
+ // $elemMatch: {
688
+ // 'includedInDataCatalog.id': {
689
+ // $exists: true,
690
+ // $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.includedInDataCatalog.id.$eq
691
+ // }
692
+ // }
693
+ // }
694
+ // },
695
+ // {
696
+ // $pull: {
697
+ // 'offers.$[].includedInOfferCatalogItem': {
698
+ // 'includedInDataCatalog.id': {
699
+ // $exists: true,
700
+ // $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.includedInDataCatalog.id.$eq
701
+ // },
702
+ // ...(Array.isArray(offerCatalogItemIdNin))
703
+ // ? { id: { $nin: offerCatalogItemIdNin } } // // 指定サブカタログを除外する
704
+ // : undefined
705
+ // }
706
+ // }
707
+ // }
708
+ // )
709
+ // .exec();
710
+ // }
711
+ /**
712
+ * サブカタログに属するサブカタログを全て除外する
713
+ */
714
+ // public async pullIncludedInOfferCatalogItemByCatalogItemId(params: {
715
+ // project: { id: string };
716
+ // $pull: {
717
+ // includedInOfferCatalogItem: {
718
+ // $elemMatch: {
719
+ // /**
720
+ // * サブカタログID
721
+ // */
722
+ // id: { $eq: string };
723
+ // };
724
+ // };
725
+ // };
726
+ // }) {
727
+ // await this.aggregateOfferModel.updateMany(
728
+ // {
729
+ // 'project.id': { $eq: params.project.id },
730
+ // 'offers.includedInOfferCatalogItem': {
731
+ // $elemMatch: {
732
+ // id: {
733
+ // $exists: true,
734
+ // $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.id.$eq
735
+ // }
736
+ // }
737
+ // }
738
+ // },
739
+ // {
740
+ // $pull: {
741
+ // 'offers.$[].includedInOfferCatalogItem': {
742
+ // id: {
743
+ // $exists: true,
744
+ // $eq: params.$pull.includedInOfferCatalogItem.$elemMatch.id.$eq
745
+ // }
746
+ // }
747
+ // }
748
+ // }
749
+ // )
750
+ // .exec();
751
+ // }
752
+ deleteById(params) {
753
+ return __awaiter(this, void 0, void 0, function* () {
754
+ yield this.aggregateOfferModel.findOneAndRemove({
755
+ _id: { $eq: params.id },
756
+ 'project.id': { $eq: params.project.id }
757
+ }, { projection: { _id: 1 } })
558
758
  .exec();
559
759
  });
560
760
  }
@@ -42,7 +42,6 @@ exports.schema = schema;
42
42
  schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
43
43
  schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
44
44
  schema.index({ 'offers.priceSpecification.price': 1 }, { name: 'searchByOffersPriceSpecificationPrice' });
45
- schema.index({ 'project.id': 1, 'offers.priceSpecification.price': 1 }, { name: 'searchByProjectId' });
46
45
  // オファーIDはグローバルユニーク
47
46
  schema.index({ 'offers.id': 1 }, {
48
47
  name: 'uniqueOfferId',
@@ -59,130 +58,131 @@ schema.index({ 'includedInDataCatalog.id': 1 }, {
59
58
  'includedInDataCatalog.id': { $exists: true }
60
59
  }
61
60
  });
62
- schema.index({ 'offers.includedInDataCatalog.id': 1, 'offers.priceSpecification.price': 1 }, {
63
- name: 'searchByOffersIncludedInDataCatalogId',
61
+ schema.index({ 'offers.includedInDataCatalog.id': 1 }, {
62
+ name: 'searchByOffersIncludedInDataCatalogId-v2',
64
63
  partialFilterExpression: {
65
64
  'offers.includedInDataCatalog.id': { $exists: true }
66
65
  }
67
66
  });
68
- schema.index({ 'offers.availability': 1, 'offers.priceSpecification.price': 1 }, { name: 'searchByOffersAvailability' });
69
- schema.index({ 'offers.itemOffered.typeOf': 1, 'offers.priceSpecification.price': 1 }, { name: 'searchByOffersItemOfferedTypeOf' });
70
- schema.index({ 'offers.identifier': 1, 'offers.priceSpecification.price': 1 }, {
71
- name: 'searchByOffersIdentifier',
67
+ schema.index({ 'project.id': 1 }, { name: 'searchByProjectId-v2' });
68
+ schema.index({ 'offers.availability': 1 }, { name: 'searchByOffersAvailability-v2' });
69
+ schema.index({ 'offers.itemOffered.typeOf': 1 }, { name: 'searchByOffersItemOfferedTypeOf-v2' });
70
+ schema.index({ 'offers.identifier': 1 }, {
71
+ name: 'searchByOffersIdentifier-v2',
72
72
  partialFilterExpression: {
73
73
  'offers.identifier': { $exists: true }
74
74
  }
75
75
  });
76
- schema.index({ 'offers.priceSpecification.referenceQuantity.value': 1, 'offers.priceSpecification.price': 1 }, {
77
- name: 'searchByOffersPriceSpecificationReferenceQuantityValue',
76
+ schema.index({ 'offers.priceSpecification.referenceQuantity.value': 1 }, {
77
+ name: 'searchByOffersPriceSpecificationReferenceQuantityValue-v2',
78
78
  partialFilterExpression: {
79
79
  'offers.priceSpecification.referenceQuantity.value': { $exists: true }
80
80
  }
81
81
  });
82
- schema.index({ 'offers.priceSpecification.accounting.accountsReceivable': 1, 'offers.priceSpecification.price': 1 }, {
83
- name: 'searchByOffersPriceSpecificationAccountingAccountsReceivable',
82
+ schema.index({ 'offers.priceSpecification.accounting.accountsReceivable': 1 }, {
83
+ name: 'searchByOffersPriceSpecificationAccountingAccountsReceivable-v2',
84
84
  partialFilterExpression: {
85
85
  'offers.priceSpecification.accounting.accountsReceivable': { $exists: true }
86
86
  }
87
87
  });
88
- schema.index({ 'offers.priceSpecification.accounting.operatingRevenue.codeValue': 1, 'offers.priceSpecification.price': 1 }, {
89
- name: 'searchByOffersPriceSpecificationAccountingOperatingRevenueCodeValue',
88
+ schema.index({ 'offers.priceSpecification.accounting.operatingRevenue.codeValue': 1 }, {
89
+ name: 'searchByOffersPriceSpecificationAccountingOperatingRevenueCodeValue-v2',
90
90
  partialFilterExpression: {
91
91
  'offers.priceSpecification.accounting.operatingRevenue.codeValue': { $exists: true }
92
92
  }
93
93
  });
94
- schema.index({ 'offers.priceSpecification.appliesToMovieTicket.serviceType': 1, 'offers.priceSpecification.price': 1 }, {
95
- name: 'searchByOffersPriceSpecificationAppliesToMovieTicketServiceType',
94
+ schema.index({ 'offers.priceSpecification.appliesToMovieTicket.serviceType': 1 }, {
95
+ name: 'searchByOffersPriceSpecificationAppliesToMovieTicketServiceType-v2',
96
96
  partialFilterExpression: {
97
97
  'offers.priceSpecification.appliesToMovieTicket.serviceType': { $exists: true }
98
98
  }
99
99
  });
100
- schema.index({ 'offers.priceSpecification.appliesToMovieTicket.serviceOutput.typeOf': 1, 'offers.priceSpecification.price': 1 }, {
101
- name: 'searchByOffersPriceSpecificationAppliesToMovieTicketServiceOutputTypeOf',
100
+ schema.index({ 'offers.priceSpecification.appliesToMovieTicket.serviceOutput.typeOf': 1 }, {
101
+ name: 'searchByOffersPriceSpecificationAppliesToMovieTicketServiceOutputTypeOf-v2',
102
102
  partialFilterExpression: {
103
103
  'offers.priceSpecification.appliesToMovieTicket.serviceOutput.typeOf': { $exists: true }
104
104
  }
105
105
  });
106
- schema.index({ 'offers.name.ja': 1, 'offers.priceSpecification.price': 1 }, {
107
- name: 'searchByOffersNameJa',
106
+ schema.index({ 'offers.name.ja': 1 }, {
107
+ name: 'searchByOffersNameJa-v2',
108
108
  partialFilterExpression: {
109
109
  'offers.name.ja': { $exists: true }
110
110
  }
111
111
  });
112
- schema.index({ 'offers.name.en': 1, 'offers.priceSpecification.price': 1 }, {
113
- name: 'searchByOffersNameEn',
112
+ schema.index({ 'offers.name.en': 1 }, {
113
+ name: 'searchByOffersNameEn-v2',
114
114
  partialFilterExpression: {
115
115
  'offers.name.en': { $exists: true }
116
116
  }
117
117
  });
118
- schema.index({ 'offers.alternateName': 1, 'offers.priceSpecification.price': 1 }, {
119
- name: 'searchByOffersAlternateName',
118
+ schema.index({ 'offers.alternateName': 1 }, {
119
+ name: 'searchByOffersAlternateName-v2',
120
120
  partialFilterExpression: {
121
121
  'offers.alternateName': { $exists: true }
122
122
  }
123
123
  });
124
- schema.index({ 'offers.category.id': 1, 'offers.priceSpecification.price': 1 }, {
125
- name: 'searchOffersCategoryId',
124
+ schema.index({ 'offers.category.id': 1 }, {
125
+ name: 'searchOffersCategoryId-v2',
126
126
  partialFilterExpression: {
127
127
  'offers.category.id': { $exists: true }
128
128
  }
129
129
  });
130
- schema.index({ 'offers.category.codeValue': 1, 'offers.priceSpecification.price': 1 }, {
131
- name: 'searchByOffersCategoryCodeValue',
130
+ schema.index({ 'offers.category.codeValue': 1 }, {
131
+ name: 'searchByOffersCategoryCodeValue-v2',
132
132
  partialFilterExpression: {
133
133
  'offers.category.codeValue': { $exists: true }
134
134
  }
135
135
  });
136
- schema.index({ 'offers.availableAtOrFrom.id': 1, 'offers.priceSpecification.price': 1 }, {
137
- name: 'searchByOffersAvailableAtOrFromId',
136
+ schema.index({ 'offers.availableAtOrFrom.id': 1 }, {
137
+ name: 'searchByOffersAvailableAtOrFromId-v2',
138
138
  partialFilterExpression: {
139
139
  'offers.availableAtOrFrom.id': { $exists: true }
140
140
  }
141
141
  });
142
- schema.index({ 'offers.eligibleMembershipType.codeValue': 1, 'offers.priceSpecification.price': 1 }, {
143
- name: 'searchByOffersEligibleMembershipTypeCodeValue',
142
+ schema.index({ 'offers.eligibleMembershipType.codeValue': 1 }, {
143
+ name: 'searchByOffersEligibleMembershipTypeCodeValue-v2',
144
144
  partialFilterExpression: {
145
145
  'offers.eligibleMembershipType.codeValue': { $exists: true }
146
146
  }
147
147
  });
148
- schema.index({ 'offers.eligibleMonetaryAmount.currency': 1, 'offers.priceSpecification.price': 1 }, {
149
- name: 'searchByOffersEligibleMonetaryAmountCurrency',
148
+ schema.index({ 'offers.eligibleMonetaryAmount.currency': 1 }, {
149
+ name: 'searchByOffersEligibleMonetaryAmountCurrency-v2',
150
150
  partialFilterExpression: {
151
151
  'offers.eligibleMonetaryAmount.currency': { $exists: true }
152
152
  }
153
153
  });
154
- schema.index({ 'offers.eligibleSeatingType.codeValue': 1, 'offers.priceSpecification.price': 1 }, {
155
- name: 'searchByOffersEligibleSeatingTypeCodeValue',
154
+ schema.index({ 'offers.eligibleSeatingType.codeValue': 1 }, {
155
+ name: 'searchByOffersEligibleSeatingTypeCodeValue-v2',
156
156
  partialFilterExpression: {
157
157
  'offers.eligibleSeatingType.codeValue': { $exists: true }
158
158
  }
159
159
  });
160
- schema.index({ 'offers.addOn.itemOffered.id': 1, 'offers.priceSpecification.price': 1 }, {
161
- name: 'searchByOffersAddOnItemOfferedId',
160
+ schema.index({ 'offers.addOn.itemOffered.id': 1 }, {
161
+ name: 'searchByOffersAddOnItemOfferedId-v2',
162
162
  partialFilterExpression: {
163
163
  'offers.addOn.itemOffered.id': { $exists: true }
164
164
  }
165
165
  });
166
- schema.index({ 'offers.hasMerchantReturnPolicy.id': 1, 'offers.priceSpecification.price': 1 }, {
167
- name: 'searchByOffersHasMerchantReturnPolicyId',
166
+ schema.index({ 'offers.hasMerchantReturnPolicy.id': 1 }, {
167
+ name: 'searchByOffersHasMerchantReturnPolicyId-v2',
168
168
  partialFilterExpression: {
169
169
  'offers.hasMerchantReturnPolicy.id': { $exists: true }
170
170
  }
171
171
  });
172
- schema.index({ 'offers.additionalProperty': 1, 'offers.priceSpecification.price': 1 }, {
173
- name: 'searchByOffersAdditionalProperty',
172
+ schema.index({ 'offers.additionalProperty': 1 }, {
173
+ name: 'searchByOffersAdditionalProperty-v2',
174
174
  partialFilterExpression: {
175
175
  'offers.additionalProperty': { $exists: true }
176
176
  }
177
177
  });
178
- schema.index({ 'offers.validFrom': 1, 'offers.priceSpecification.price': 1 }, {
179
- name: 'searchByOffersValidFrom',
178
+ schema.index({ 'offers.validFrom': 1 }, {
179
+ name: 'searchByOffersValidFrom-v2',
180
180
  partialFilterExpression: {
181
181
  'offers.validFrom': { $exists: true }
182
182
  }
183
183
  });
184
- schema.index({ 'offers.validThrough': 1, 'offers.priceSpecification.price': 1 }, {
185
- name: 'searchByOffersValidThrough',
184
+ schema.index({ 'offers.validThrough': 1 }, {
185
+ name: 'searchByOffersValidThrough-v2',
186
186
  partialFilterExpression: {
187
187
  'offers.validThrough': { $exists: true }
188
188
  }
@@ -40,10 +40,10 @@ export declare class MongoRepository {
40
40
  offers: IUnitPriceOfferFromAggregateOffer[];
41
41
  }>;
42
42
  /**
43
- * 単価オファーIDとカタログIDで単価オファーを検索する
44
- * 必ずカタログデータから単価オファーIDを参照する
43
+ * 単価オファーIDとカタログIDで単価オファーを全て検索する
44
+ * 単価オファーIDを一定数指定する想定なのでpagingは不要
45
45
  */
46
- searchByIdsAndOfferCatalogId(params: {
46
+ searchAllByIdsAndOfferCatalogId(params: {
47
47
  /**
48
48
  * 指定したIDの単価オファーだけ取得
49
49
  */
@@ -61,8 +61,6 @@ export declare class MongoRepository {
61
61
  unacceptedPaymentMethod?: string[];
62
62
  excludeAppliesToMovieTicket: boolean;
63
63
  onlyValid?: boolean;
64
- limit?: number;
65
- page?: number;
66
64
  projection?: IProjection;
67
65
  }): Promise<{
68
66
  offers: IUnitPriceOfferFromAggregateOffer[];
@@ -109,22 +107,34 @@ export declare class MongoRepository {
109
107
  * サブカタログID
110
108
  */
111
109
  id: string;
110
+ isOfferCatalogItem: boolean;
112
111
  };
113
112
  availableAtOrFrom?: {
114
113
  id?: string;
115
114
  };
116
115
  unacceptedPaymentMethod?: string[];
117
116
  excludeAppliesToMovieTicket: boolean;
117
+ useIncludeInDataCatalog: boolean;
118
118
  onlyValid?: boolean;
119
119
  limit?: number;
120
120
  page?: number;
121
121
  }): Promise<Pick<factory.priceSpecification.unitPrice.IAppliesToMovieTicket, 'serviceOutput'>[]>;
122
- findAggregateOfferById(params: {
122
+ /**
123
+ * クライアントの利用可能カタログを検索する
124
+ */
125
+ searchAvailableCatalogs(params: {
123
126
  project: {
124
127
  id: string;
125
128
  };
129
+ includedInDataCatalog: {
130
+ id: string[];
131
+ };
132
+ availableAtOrFrom: {
133
+ id: string;
134
+ };
135
+ }): Promise<{
126
136
  id: string;
127
- }): Promise<factory.aggregateOffer.IAggregateOffer>;
137
+ }[]>;
128
138
  count(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
129
139
  search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IUnitPriceOfferFromAggregateOffer[]>;
130
140
  save(params: factory.unitPriceOffer.IUnitPriceOffer & {
@@ -152,12 +162,6 @@ export declare class MongoRepository {
152
162
  };
153
163
  };
154
164
  }): Promise<import("mongodb").UpdateResult | undefined>;
155
- deleteById(params: {
156
- project: {
157
- id: string;
158
- };
159
- id: string;
160
- }): Promise<void>;
161
165
  /**
162
166
  * サブカタログから集計オファーIDリストを検索する
163
167
  */