@chevre/domain 21.8.0-alpha.9 → 21.8.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 (131) hide show
  1. package/example/src/chevre/countOffers.ts +32 -0
  2. package/example/src/chevre/findItemListElementByCatalogId.ts +30 -0
  3. package/example/src/chevre/importOffersFromCOA.ts +7 -1
  4. package/example/src/chevre/migrateOrderPaymentMethodIdentifier.ts +81 -0
  5. package/example/src/chevre/migratePayTransactionPaymentMethodId.ts +72 -0
  6. package/example/src/chevre/migratePayTransactionPaymentMethodIdentifier.ts +78 -0
  7. package/example/src/chevre/optimizeCatalogs.ts +54 -0
  8. package/example/src/chevre/processPay.ts +3 -4
  9. package/example/src/chevre/publishPermitOwnershipInfoToken.ts +56 -0
  10. package/example/src/chevre/pullAddOnsFromOffer.ts +26 -0
  11. package/example/src/chevre/pushIncludedInDataCatalog.ts +47 -0
  12. package/example/src/chevre/searchAggregateOffers.ts +48 -0
  13. package/example/src/chevre/searchEventTicketOffers.ts +5 -1
  14. package/example/src/chevre/searchEvents.ts +9 -7
  15. package/example/src/chevre/searchOfferCatalogs.ts +7 -3
  16. package/example/src/chevre/searchOffers.ts +5 -2
  17. package/example/src/chevre/searchOffersByCatalog.ts +15 -9
  18. package/example/src/chevre/searchOffersFromAggregateOffer.ts +168 -0
  19. package/example/src/chevre/searchOrders.ts +9 -7
  20. package/example/src/chevre/syncCatalogs2aggregateOffers.ts +85 -0
  21. package/lib/chevre/emailMessageBuilder.js +6 -5
  22. package/lib/chevre/repo/aggregateOffer.d.ts +62 -0
  23. package/lib/chevre/repo/aggregateOffer.js +562 -0
  24. package/lib/chevre/repo/assetTransaction.d.ts +16 -1
  25. package/lib/chevre/repo/assetTransaction.js +54 -2
  26. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +74 -0
  27. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +189 -0
  28. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +3 -3
  29. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +3 -3
  30. package/lib/chevre/repo/mongoose/schemas/event.d.ts +3 -3
  31. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +3 -0
  32. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +10 -1
  33. package/lib/chevre/repo/mongoose/schemas/order.d.ts +3 -0
  34. package/lib/chevre/repo/mongoose/schemas/order.js +7 -0
  35. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +9 -9
  36. package/lib/chevre/repo/mongoose/schemas/product.d.ts +3 -3
  37. package/lib/chevre/repo/mongoose/schemas/project.d.ts +3 -3
  38. package/lib/chevre/repo/mongoose/schemas/task.d.ts +3 -0
  39. package/lib/chevre/repo/mongoose/schemas/task.js +8 -0
  40. package/lib/chevre/repo/offer.d.ts +87 -51
  41. package/lib/chevre/repo/offer.js +513 -283
  42. package/lib/chevre/repo/offerCatalog.d.ts +32 -3
  43. package/lib/chevre/repo/offerCatalog.js +97 -10
  44. package/lib/chevre/repo/order.d.ts +15 -0
  45. package/lib/chevre/repo/order.js +58 -26
  46. package/lib/chevre/repo/task.d.ts +6 -2
  47. package/lib/chevre/repo/task.js +58 -4
  48. package/lib/chevre/repository.d.ts +3 -0
  49. package/lib/chevre/repository.js +5 -1
  50. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -41
  51. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +2 -0
  52. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +2 -40
  53. package/lib/chevre/service/aggregation/event/findEventOffers.d.ts +16 -0
  54. package/lib/chevre/service/aggregation/event/findEventOffers.js +58 -0
  55. package/lib/chevre/service/assetTransaction/pay/account/validation.js +2 -2
  56. package/lib/chevre/service/assetTransaction/pay/factory.js +26 -18
  57. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +3 -3
  58. package/lib/chevre/service/assetTransaction/pay.js +65 -46
  59. package/lib/chevre/service/assetTransaction/refund/factory.js +8 -2
  60. package/lib/chevre/service/assetTransaction/registerService.js +2 -1
  61. package/lib/chevre/service/assetTransaction/reserve.js +111 -35
  62. package/lib/chevre/service/offer/event/authorize.js +39 -35
  63. package/lib/chevre/service/offer/event/factory.d.ts +1 -1
  64. package/lib/chevre/service/offer/event/factory.js +8 -8
  65. package/lib/chevre/service/offer/event/importFromCOA.d.ts +2 -0
  66. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +3 -0
  67. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +48 -17
  68. package/lib/chevre/service/offer/event/voidTransaction.js +57 -36
  69. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -1
  70. package/lib/chevre/service/offer/eventServiceByCOA/factory.js +7 -11
  71. package/lib/chevre/service/offer/eventServiceByCOA.js +55 -27
  72. package/lib/chevre/service/offer/factory.d.ts +12 -4
  73. package/lib/chevre/service/offer/factory.js +9 -11
  74. package/lib/chevre/service/offer/product/searchProductOffers.d.ts +10 -1
  75. package/lib/chevre/service/offer/product/searchProductOffers.js +51 -12
  76. package/lib/chevre/service/offer/product.d.ts +2 -0
  77. package/lib/chevre/service/offer/product.js +3 -2
  78. package/lib/chevre/service/offer.d.ts +1 -0
  79. package/lib/chevre/service/offer.js +7 -1
  80. package/lib/chevre/service/order/confirmPayTransaction.d.ts +0 -2
  81. package/lib/chevre/service/order/confirmPayTransaction.js +20 -46
  82. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +27 -0
  83. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +226 -0
  84. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +8 -6
  85. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +80 -57
  86. package/lib/chevre/service/order/onOrderStatusChanged.js +49 -9
  87. package/lib/chevre/service/order/payOrder.js +4 -45
  88. package/lib/chevre/service/order/placeOrder.js +11 -24
  89. package/lib/chevre/service/order.d.ts +3 -1
  90. package/lib/chevre/service/order.js +6 -2
  91. package/lib/chevre/service/payment/any/factory.js +33 -8
  92. package/lib/chevre/service/payment/any.js +30 -21
  93. package/lib/chevre/service/payment/creditCard.js +12 -12
  94. package/lib/chevre/service/payment/movieTicket/validation.js +2 -2
  95. package/lib/chevre/service/payment/movieTicket.js +10 -11
  96. package/lib/chevre/service/payment/paymentCard.js +9 -12
  97. package/lib/chevre/service/project.js +1 -1
  98. package/lib/chevre/service/reserve/checkInReservation.d.ts +8 -0
  99. package/lib/chevre/service/reserve/checkInReservation.js +3 -2
  100. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +3 -0
  101. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +4 -5
  102. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +8 -0
  103. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +16 -11
  104. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -1
  105. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +3 -0
  106. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +3 -5
  107. package/lib/chevre/service/task/aggregateUseActionsOnEvent.js +2 -0
  108. package/lib/chevre/service/task/confirmPayTransaction.js +1 -3
  109. package/lib/chevre/service/task/importOffersFromCOA.js +3 -0
  110. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +6 -0
  111. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +37 -0
  112. package/lib/chevre/service/task/onAuthorizationCreated.js +5 -1
  113. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
  114. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -0
  115. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.d.ts +17 -0
  116. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +78 -0
  117. package/lib/chevre/service/task/onResourceUpdated.js +12 -0
  118. package/lib/chevre/service/task/returnPayTransaction.js +8 -3
  119. package/lib/chevre/service/transaction/placeOrderInProgress/result.js +32 -16
  120. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +13 -11
  121. package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +53 -17
  122. package/lib/chevre/service/transaction/placeOrderInProgress.js +4 -1
  123. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +7 -6
  124. package/lib/chevre/service/transaction/returnOrder.js +5 -1
  125. package/lib/chevre/settings.d.ts +3 -3
  126. package/lib/chevre/settings.js +4 -12
  127. package/package.json +3 -3
  128. package/example/src/chevre/migrateAuthorizePaymentActionResult.ts +0 -83
  129. package/example/src/chevre/migrateEventOrganizer.ts +0 -154
  130. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +0 -149
  131. package/lib/chevre/repo/mongoose/schemas/offer.js +0 -210
@@ -9,10 +9,13 @@ async function main() {
9
9
  const offerRepo = new chevre.repository.Offer(mongoose.connection);
10
10
 
11
11
  const offers = await offerRepo.search({
12
- limit: 1,
12
+ limit: 100,
13
13
  // page: 1,
14
14
  project: { id: { $eq: String(process.env.PROJECT_ID) } },
15
- availability: { $eq: chevre.factory.itemAvailability.InStock }
15
+ availability: { $eq: chevre.factory.itemAvailability.InStock },
16
+ parentOffer: {
17
+ },
18
+ includedInDataCatalog: { id: { $in: ['0001'] } }
16
19
  // additionalProperty: {
17
20
  // $all: [
18
21
  // {
@@ -5,22 +5,28 @@ import * as mongoose from 'mongoose';
5
5
  import { chevre } from '../../../lib/index';
6
6
 
7
7
  async function main() {
8
- await mongoose.connect(<string>process.env.MONGOLAB_URI);
8
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
9
9
 
10
10
  const offerRepo = new chevre.repository.Offer(mongoose.connection);
11
11
 
12
- const { offers } = await offerRepo.findOffersByOfferCatalogId({
13
- ids: ['al96nqj7z', 'xxx', '1001'],
14
- // ids: ['xx', 'xxx'],
15
- offerCatalog: {
16
- id: '0001'
17
- // id: 'xxx'
12
+ const { offers, sortedOfferIds } = await offerRepo.searchByOfferCatalogIdWithSortIndex({
13
+ limit: 10,
14
+ page: 1,
15
+ // ids: ['xx', 'xxx', '1001', '901'],
16
+ subOfferCatalog: {
17
+ id: 'xxx'
18
18
  },
19
19
  excludeAppliesToMovieTicket: false,
20
- sort: true
20
+ useIncludeInDataCatalog: true
21
21
  });
22
- console.log(offers.map((o) => o.id));
22
+ // console.log(offers);
23
+ console.log(offers.map((offer) => {
24
+ const sortIndex = sortedOfferIds.findIndex((s) => s === offer.id);
25
+
26
+ return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id} ${offer.offerIndex} ${sortIndex}`;
27
+ }));
23
28
  console.log(offers.length);
29
+ console.log('USE_AGGREGATE_OFFERS_AS_PRIMARY:', process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY);
24
30
  }
25
31
 
26
32
  main()
@@ -0,0 +1,168 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../lib/index';
5
+
6
+ // tslint:disable-next-line:max-func-body-length
7
+ async function main() {
8
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
9
+
10
+ const offerRepo = new chevre.repository.Offer(mongoose.connection);
11
+
12
+ const offers = await offerRepo.search(
13
+ {
14
+ limit: 10,
15
+ page: 1,
16
+ sort: {
17
+ 'priceSpecification.price': 1,
18
+ identifier: 1
19
+ },
20
+ project: { id: { $eq: String(process.env.PROJECT_ID) } },
21
+ availability: { $eq: chevre.factory.itemAvailability.InStock },
22
+ itemOffered: {
23
+ typeOf: {
24
+ // $eq: chevre.factory.product.ProductType.EventService
25
+ }
26
+ },
27
+ addOn: {
28
+ itemOffered: {
29
+ /**
30
+ * アドオンプロダクトID
31
+ */
32
+ id: {
33
+ // $eq: ''
34
+ }
35
+ }
36
+ },
37
+ availableAtOrFrom: {
38
+ id: {
39
+ // $eq: ''
40
+ // $in: string[]
41
+ }
42
+ },
43
+ eligibleMembershipType: {
44
+ /**
45
+ * 適用メンバーシップ区分
46
+ */
47
+ codeValue: {
48
+ // $eq: 'Permit'
49
+ }
50
+ },
51
+ eligibleMonetaryAmount: {
52
+ /**
53
+ * 適用通貨区分
54
+ */
55
+ currency: {
56
+ // $eq: 'Point'
57
+ }
58
+ },
59
+ eligibleSeatingType: {
60
+ /**
61
+ * 適用座席区分
62
+ */
63
+ codeValue: {
64
+ // $eq: ''
65
+ }
66
+ },
67
+ hasMerchantReturnPolicy: {
68
+ id: {
69
+ // $eq: ''
70
+ }
71
+ },
72
+ // parentOffer: { id: { $in: ['901'] } },
73
+ id: {
74
+ // $eq: '901'
75
+ // $in: string[];
76
+ },
77
+ identifier: {
78
+ // $eq: '1001'
79
+ // $in: string[];
80
+ // $regex: '003'
81
+ },
82
+ name: {
83
+ // $regex: ''
84
+ },
85
+ priceSpecification: {
86
+ appliesToMovieTicket: {
87
+ /**
88
+ * 適用決済カード区分
89
+ */
90
+ serviceType: {
91
+ /**
92
+ * 適用決済カード区分が存在するかどうか
93
+ */
94
+ // $exists: boolean;
95
+ // $eq: '01'
96
+ },
97
+ serviceOutput: {
98
+ /**
99
+ * 適用決済方法タイプ
100
+ */
101
+ typeOf: {
102
+ // $eq: ''
103
+ // $nin: string[];
104
+ }
105
+ }
106
+ },
107
+ price: {
108
+ // $gte: 2000,
109
+ // $lte: 2000
110
+ },
111
+ referenceQuantity: {
112
+ value: {
113
+ // $eq: 2
114
+ }
115
+ },
116
+ accounting: {
117
+ accountsReceivable: {
118
+ // $gte: 1800,
119
+ // $lte: 100
120
+ },
121
+ operatingRevenue: {
122
+ codeValue: {
123
+ // $eq: ''
124
+ // $in: string[];
125
+ }
126
+ }
127
+ }
128
+ },
129
+ category: {
130
+ codeValue: {
131
+ // $in: ['1']
132
+ }
133
+ }
134
+ /**
135
+ * 有効期間設定がない、あるいは、有効期間内
136
+ */
137
+ // onlyValid: true
138
+ // additionalProperty: {
139
+ // $all: [
140
+ // {
141
+ // $elemMatch: {
142
+ // name: { $eq: 'nameForPrinting' },
143
+ // value: { $in: ['General'] }
144
+ // }
145
+ // }
146
+ // ]
147
+ // }
148
+ },
149
+ {
150
+ id: 1,
151
+ identifier: 1,
152
+ name: 1,
153
+ alternateName: 1,
154
+ priceSpecification: 1,
155
+ project: 1
156
+ }
157
+ );
158
+ console.log(offers);
159
+ console.log(offers.map((offer) => {
160
+ return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id}`;
161
+ }));
162
+ console.log(offers.length);
163
+ console.log('USE_AGGREGATE_OFFERS_AS_PRIMARY:', process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY);
164
+ }
165
+
166
+ main()
167
+ .then(console.log)
168
+ .catch(console.error);
@@ -6,11 +6,12 @@ import { chevre } from '../../../lib/index';
6
6
  const project = { id: String(process.env.PROJECT_ID) };
7
7
 
8
8
  async function main() {
9
- await mongoose.connect(<string>process.env.MONGOLAB_URI);
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
10
10
 
11
11
  const orderRepo = new chevre.repository.Order(mongoose.connection);
12
12
 
13
13
  const orders = await orderRepo.search({
14
+ limit: 10,
14
15
  project: { id: { $eq: project.id } },
15
16
  // acceptedOffers: {
16
17
  // itemOffered: {
@@ -18,12 +19,13 @@ async function main() {
18
19
  // }
19
20
  // },
20
21
  paymentMethods: {
21
- additionalProperty: {
22
- $in: [
23
- { name: 'orderId', value: '0102022031518442020' },
24
- { name: 'orderId', value: '0102022031518423030' }
25
- ]
26
- }
22
+ paymentMethod: { identifier: { $in: ['Cash'] } }
23
+ // additionalProperty: {
24
+ // $in: [
25
+ // { name: 'orderId', value: '0102022031518442020' },
26
+ // { name: 'orderId', value: '0102022031518423030' }
27
+ // ]
28
+ // }
27
29
  }
28
30
  });
29
31
  console.log('orders found', orders);
@@ -0,0 +1,85 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../lib/index';
5
+
6
+ // const project = { id: String(process.env.PROJECT_ID) };
7
+ mongoose.Model.on('index', (...args) => {
8
+ console.error('******** index event emitted. ********\n', args);
9
+ });
10
+
11
+ // tslint:disable-next-line:max-func-body-length
12
+ async function main() {
13
+ const now = new Date();
14
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
15
+
16
+ const offerRepo = new chevre.repository.Offer(mongoose.connection);
17
+ const offerCatalogRepo = new chevre.repository.OfferCatalog(mongoose.connection);
18
+ const taskRepo = new chevre.repository.Task(mongoose.connection);
19
+
20
+ const cursor = offerCatalogRepo.getCursor(
21
+ {
22
+ // 'project.id': { $eq: project.id }
23
+ },
24
+ {
25
+ __v: 0,
26
+ createdAt: 0,
27
+ updatedAt: 0
28
+ }
29
+ );
30
+ console.log('catalogs found');
31
+
32
+ let i = 0;
33
+ let updateCount = 0;
34
+ await cursor.eachAsync(async (doc) => {
35
+ i += 1;
36
+ const { _id, ...offerCatalog } = <chevre.factory.offerCatalog.IOfferCatalog & { _id: string }>doc.toObject();
37
+ const aggregateOfferIds = offerCatalog.itemListElement.map((element) => element.id);
38
+
39
+ // 記載カタログの追加された単価オファーの存在を検証
40
+ const existingOffers = await offerRepo.search(
41
+ {
42
+ project: { id: { $eq: offerCatalog.project.id } },
43
+ // parentOffer: {},
44
+ includedInDataCatalog: { id: { $in: [String(offerCatalog.id)] } }
45
+ },
46
+ { id: 1 }
47
+ );
48
+ console.log(existingOffers.length, 'offers found', offerCatalog.project.id, offerCatalog.id, offerCatalog.identifier, i);
49
+ const alreadyMigrated = aggregateOfferIds.length === existingOffers.length;
50
+
51
+ if (alreadyMigrated) {
52
+ console.log('already synced.', offerCatalog.project.id, offerCatalog.id, offerCatalog.identifier, i);
53
+ } else {
54
+ console.log('creating task...', offerCatalog.project.id, offerCatalog.id, offerCatalog.identifier, i);
55
+ const syncTaskData: chevre.factory.task.onResourceUpdated.IData4common = {
56
+ typeOf: 'OfferCatalog',
57
+ id: [String(offerCatalog.id)],
58
+ isNew: false,
59
+ isDeleted: false,
60
+ project: { id: offerCatalog.project.id },
61
+ useInform: false
62
+ };
63
+ const syncTask: chevre.factory.task.IAttributes<chevre.factory.taskName.OnResourceUpdated> = {
64
+ data: syncTaskData,
65
+ executionResults: [],
66
+ name: chevre.factory.taskName.OnResourceUpdated,
67
+ numberOfTried: 0,
68
+ project: offerCatalog.project,
69
+ remainingNumberOfTries: 1,
70
+ runsAt: now,
71
+ status: chevre.factory.taskStatus.Ready
72
+ };
73
+ await taskRepo.saveMany([syncTask], { emitImmediately: false });
74
+ updateCount += 1;
75
+ console.log('task saved.', offerCatalog.project.id, offerCatalog.id, offerCatalog.identifier, i);
76
+ }
77
+ });
78
+
79
+ console.log(i, 'catalogs checked');
80
+ console.log(updateCount, 'catalogs synced');
81
+ }
82
+
83
+ main()
84
+ .then()
85
+ .catch(console.error);
@@ -107,7 +107,7 @@ function createEmailMessageAbout(params) {
107
107
  });
108
108
  }
109
109
  function createEmailMessageSender(params) {
110
- var _a, _b, _c, _d;
110
+ var _a, _b;
111
111
  return {
112
112
  typeOf: params.order.seller.typeOf,
113
113
  name: (typeof ((_b = (_a = params.email) === null || _a === void 0 ? void 0 : _a.sender) === null || _b === void 0 ? void 0 : _b.name) === 'string')
@@ -115,10 +115,11 @@ function createEmailMessageSender(params) {
115
115
  : (typeof params.order.seller.name === 'string')
116
116
  ? params.order.seller.name
117
117
  : String(params.order.seller.id),
118
- // sender.email指定を非推奨化(2023-08-23~)
119
- email: (settings_1.USE_CUSTOM_SENDER_EMAIL && typeof ((_d = (_c = params.email) === null || _c === void 0 ? void 0 : _c.sender) === null || _d === void 0 ? void 0 : _d.email) === 'string')
120
- ? params.email.sender.email
121
- : settings_1.DEFAULT_SENDER_EMAIL
118
+ // sender.email指定を廃止(2023-09-07~)
119
+ // email: (USE_CUSTOM_SENDER_EMAIL && typeof params.email?.sender?.email === 'string')
120
+ // ? params.email.sender.email
121
+ // : DEFAULT_SENDER_EMAIL
122
+ email: settings_1.DEFAULT_SENDER_EMAIL
122
123
  };
123
124
  }
124
125
  /**
@@ -0,0 +1,62 @@
1
+ import { AnyExpression, Connection, PipelineStage } from 'mongoose';
2
+ import * as factory from '../factory';
3
+ type IMatchStage = PipelineStage.Match;
4
+ type KeyOfUnitPriceOffer = keyof factory.unitPriceOffer.IUnitPriceOffer;
5
+ type IProjection = {
6
+ [key in KeyOfUnitPriceOffer]?: 0 | 1;
7
+ };
8
+ export type IUnitPriceOfferFromAggregateOffer = factory.unitPriceOffer.IUnitPriceOffer & {
9
+ offerIndex?: number;
10
+ parentOffer?: {
11
+ id: string;
12
+ };
13
+ };
14
+ /**
15
+ * 集計オファーリポジトリ
16
+ */
17
+ export declare class MongoRepository {
18
+ private readonly aggregateOfferModel;
19
+ constructor(connection: Connection);
20
+ static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params: factory.unitPriceOffer.ISearchConditions): IMatchStage[];
21
+ static CREATE_AGGREGATE_OFFERS_PROJECTION(params: IProjection): {
22
+ [field: string]: AnyExpression;
23
+ };
24
+ count(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
25
+ search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<factory.aggregateOffer.IAggregateOffer[]>;
26
+ pushIncludedInDataCatalog(params: {
27
+ project: {
28
+ id: string;
29
+ };
30
+ id: {
31
+ $in: string[];
32
+ };
33
+ $push: {
34
+ includedInDataCatalog: {
35
+ $each: {
36
+ id: string;
37
+ }[];
38
+ };
39
+ };
40
+ }): Promise<void>;
41
+ /**
42
+ * 記載カタログからカタログを除外する
43
+ */
44
+ pullIncludedInDataCatalog(params: {
45
+ project: {
46
+ id: string;
47
+ };
48
+ id?: {
49
+ $nin?: string[];
50
+ };
51
+ $pull: {
52
+ includedInDataCatalog: {
53
+ $elemMatch: {
54
+ id: {
55
+ $eq: string;
56
+ };
57
+ };
58
+ };
59
+ };
60
+ }): Promise<void>;
61
+ }
62
+ export {};