@chevre/domain 20.2.0-alpha.8 → 20.2.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 (140) hide show
  1. package/example/src/chevre/aggregateEventReservation.ts +37 -0
  2. package/example/src/chevre/aggregation/aggregateSystem.ts +116 -0
  3. package/example/src/chevre/attendIfNotAttended.ts +22 -0
  4. package/example/src/chevre/createManyEventsIfNotExist.ts +209 -0
  5. package/example/src/chevre/findByOrderNumberAndReservationId.ts +20 -0
  6. package/example/src/chevre/findScreeningRoomsByBranchCode.ts +27 -0
  7. package/example/src/chevre/importEventsFromCOA.ts +8 -1
  8. package/example/src/chevre/migrateEventOffersItemOfferedAvailableChannel.ts +2 -1
  9. package/example/src/chevre/migrateOwnershipInfos2newUserPool.ts +1 -1
  10. package/example/src/chevre/migrateProjectSubscription.ts +51 -0
  11. package/example/src/chevre/ownershipInfosCsv2peopleJson.ts +2 -2
  12. package/example/src/chevre/processReserve.ts +2 -0
  13. package/example/src/chevre/searchEventIds.ts +24 -0
  14. package/example/src/chevre/searchEventTicketOffers.ts +5 -4
  15. package/example/src/chevre/searchEvents.ts +20 -41
  16. package/example/src/chevre/searchOffersByCatalog.ts +27 -0
  17. package/example/src/chevre/updateTransaction.ts +38 -0
  18. package/lib/chevre/factory/event.d.ts +2 -0
  19. package/lib/chevre/factory/event.js +2 -0
  20. package/lib/chevre/repo/action.d.ts +77 -1
  21. package/lib/chevre/repo/action.js +249 -6
  22. package/lib/chevre/repo/aggregation.d.ts +38 -0
  23. package/lib/chevre/repo/aggregation.js +68 -0
  24. package/lib/chevre/repo/assetTransaction.d.ts +32 -0
  25. package/lib/chevre/repo/assetTransaction.js +148 -0
  26. package/lib/chevre/repo/code.d.ts +13 -16
  27. package/lib/chevre/repo/code.js +33 -19
  28. package/lib/chevre/repo/creativeWork.js +13 -12
  29. package/lib/chevre/repo/event.d.ts +64 -17
  30. package/lib/chevre/repo/event.js +456 -156
  31. package/lib/chevre/repo/mongoose/model/aggregation.d.ts +7 -0
  32. package/lib/chevre/repo/mongoose/model/aggregation.js +47 -0
  33. package/lib/chevre/repo/mongoose/model/event.js +4 -3
  34. package/lib/chevre/repo/mongoose/model/offer.js +2 -1
  35. package/lib/chevre/repo/mongoose/model/project.js +7 -1
  36. package/lib/chevre/repo/mongoose/model/telemetry.js +4 -28
  37. package/lib/chevre/repo/offer.d.ts +10 -0
  38. package/lib/chevre/repo/offer.js +47 -16
  39. package/lib/chevre/repo/order.d.ts +6 -0
  40. package/lib/chevre/repo/order.js +53 -7
  41. package/lib/chevre/repo/place.d.ts +26 -1
  42. package/lib/chevre/repo/place.js +216 -12
  43. package/lib/chevre/repo/product.d.ts +1 -0
  44. package/lib/chevre/repo/product.js +5 -0
  45. package/lib/chevre/repo/project.d.ts +7 -1
  46. package/lib/chevre/repo/project.js +15 -6
  47. package/lib/chevre/repo/reservation.d.ts +7 -8
  48. package/lib/chevre/repo/reservation.js +181 -76
  49. package/lib/chevre/repo/task.d.ts +31 -4
  50. package/lib/chevre/repo/task.js +146 -33
  51. package/lib/chevre/repo/transaction.d.ts +57 -5
  52. package/lib/chevre/repo/transaction.js +228 -34
  53. package/lib/chevre/repo/trip.js +33 -27
  54. package/lib/chevre/repository.d.ts +3 -0
  55. package/lib/chevre/repository.js +5 -1
  56. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +86 -68
  57. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +5 -8
  58. package/lib/chevre/service/aggregation/system.d.ts +100 -0
  59. package/lib/chevre/service/aggregation/system.js +409 -0
  60. package/lib/chevre/service/aggregation.d.ts +2 -0
  61. package/lib/chevre/service/aggregation.js +3 -1
  62. package/lib/chevre/service/assetTransaction/pay/movieTicket/validation.js +5 -1
  63. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +2 -4
  64. package/lib/chevre/service/assetTransaction/pay.d.ts +19 -4
  65. package/lib/chevre/service/assetTransaction/pay.js +65 -32
  66. package/lib/chevre/service/assetTransaction/registerService.js +4 -1
  67. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +3 -0
  68. package/lib/chevre/service/assetTransaction/reserve/factory.js +33 -2
  69. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +16 -0
  70. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +84 -0
  71. package/lib/chevre/service/assetTransaction/reserve.d.ts +38 -6
  72. package/lib/chevre/service/assetTransaction/reserve.js +120 -94
  73. package/lib/chevre/service/assetTransaction.d.ts +1 -1
  74. package/lib/chevre/service/code.d.ts +2 -3
  75. package/lib/chevre/service/delivery/factory.d.ts +1 -1
  76. package/lib/chevre/service/delivery/product/factory.js +9 -3
  77. package/lib/chevre/service/event.d.ts +2 -4
  78. package/lib/chevre/service/event.js +35 -14
  79. package/lib/chevre/service/offer/event/authorize.d.ts +4 -7
  80. package/lib/chevre/service/offer/event/authorize.js +33 -87
  81. package/lib/chevre/service/offer/event/cancel.js +0 -1
  82. package/lib/chevre/service/offer/event/factory.d.ts +3 -2
  83. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +14 -7
  84. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +95 -53
  85. package/lib/chevre/service/offer/event/voidTransaction.js +0 -2
  86. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -1
  87. package/lib/chevre/service/offer/eventServiceByCOA.js +10 -2
  88. package/lib/chevre/service/offer/factory.js +10 -3
  89. package/lib/chevre/service/offer/product/searchProductOffers.d.ts +1 -0
  90. package/lib/chevre/service/offer/product/searchProductOffers.js +1 -1
  91. package/lib/chevre/service/offer/product.d.ts +1 -0
  92. package/lib/chevre/service/offer/product.js +7 -2
  93. package/lib/chevre/service/offer.d.ts +13 -2
  94. package/lib/chevre/service/offer.js +68 -46
  95. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +25 -27
  96. package/lib/chevre/service/order/onOrderStatusChanged.js +2 -1
  97. package/lib/chevre/service/order/placeOrder.js +16 -0
  98. package/lib/chevre/service/order/returnOrder.js +6 -4
  99. package/lib/chevre/service/order/sendOrder.js +4 -2
  100. package/lib/chevre/service/payment/any.d.ts +9 -0
  101. package/lib/chevre/service/payment/any.js +16 -1
  102. package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
  103. package/lib/chevre/service/payment/movieTicket.js +8 -2
  104. package/lib/chevre/service/product.js +5 -3
  105. package/lib/chevre/service/report/telemetry.js +1 -1
  106. package/lib/chevre/service/reserve/checkInReservation.js +2 -2
  107. package/lib/chevre/service/reserve/confirmReservation.js +7 -10
  108. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +2 -1
  109. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -1
  110. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -1
  111. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +32 -35
  112. package/lib/chevre/service/reserve/useReservation.d.ts +0 -3
  113. package/lib/chevre/service/reserve/useReservation.js +58 -32
  114. package/lib/chevre/service/task/confirmPayTransaction.js +20 -1
  115. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +4 -0
  116. package/lib/chevre/service/task/confirmReserveTransaction.js +5 -5
  117. package/lib/chevre/service/task/importEventsFromCOA.js +3 -1
  118. package/lib/chevre/service/task/returnPayTransaction.js +10 -4
  119. package/lib/chevre/service/task.js +6 -9
  120. package/lib/chevre/service/transaction/moneyTransfer.js +9 -1
  121. package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.d.ts +1 -1
  122. package/lib/chevre/service/transaction/orderProgramMembership.js +6 -6
  123. package/lib/chevre/service/transaction/placeOrder.js +5 -3
  124. package/lib/chevre/service/transaction/placeOrderInProgress/factory.d.ts +1 -1
  125. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +0 -2
  126. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +2 -11
  127. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +1 -1
  128. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +3 -8
  129. package/lib/chevre/service/transaction/placeOrderInProgress.js +92 -107
  130. package/lib/chevre/service/transaction/returnOrder.js +8 -6
  131. package/lib/chevre/settings.d.ts +2 -0
  132. package/lib/chevre/settings.js +20 -12
  133. package/package.json +3 -3
  134. package/CHANGELOG.md +0 -2030
  135. package/example/.gitignore +0 -1
  136. package/example/src/chevre/.gitignore +0 -1
  137. package/example/src/chevre/aggregateReservationOnProject.ts +0 -32
  138. package/example/src/chevre/migratePlaceAdditionalProperties.ts +0 -162
  139. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.d.ts +0 -6
  140. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.js +0 -65
@@ -15,6 +15,7 @@ exports.aggregateByEvent = exports.aggregateScreeningEvent = void 0;
15
15
  */
16
16
  const createDebug = require("debug");
17
17
  const moment = require("moment-timezone");
18
+ const event_1 = require("../../../repo/event");
18
19
  const factory = require("../../../factory");
19
20
  const debug = createDebug('chevre-domain:service');
20
21
  /**
@@ -23,7 +24,9 @@ const debug = createDebug('chevre-domain:service');
23
24
  function aggregateScreeningEvent(params) {
24
25
  return (repos) => __awaiter(this, void 0, void 0, function* () {
25
26
  // 集計対象イベント検索
26
- const event = yield repos.event.findById(params);
27
+ // イベント取得属性最適化(2023-01-23~)
28
+ // const event = await repos.event.findById<factory.eventType.ScreeningEvent | factory.eventType.Event>(params);
29
+ const event = yield repos.event.findMinimizedIndividualEventById(params);
27
30
  let aggregatingEvents = [event];
28
31
  const availableOffers = yield findOffers({ event })(repos);
29
32
  const offerRateLimitExists = availableOffers.some((o) => { var _a; return typeof ((_a = o.validRateLimit) === null || _a === void 0 ? void 0 : _a.scope) === 'string'; });
@@ -36,6 +39,7 @@ function aggregateScreeningEvent(params) {
36
39
  .add(1, 'hour')
37
40
  .add(-1, 'second')
38
41
  .toDate();
42
+ // 取得属性最適化(2023-01-25~)
39
43
  aggregatingEvents = yield repos.event.search({
40
44
  limit: 100,
41
45
  page: 1,
@@ -45,7 +49,7 @@ function aggregateScreeningEvent(params) {
45
49
  startFrom: startFrom,
46
50
  startThrough: startThrough,
47
51
  location: { branchCode: { $eq: event.location.branchCode } }
48
- });
52
+ }, event_1.PROJECTION_MINIMIZED_EVENT);
49
53
  // ID指定されたイベントについてはEventScheduledでなくても集計したいので、集計対象を調整
50
54
  aggregatingEvents = aggregatingEvents.filter((e) => e.id !== event.id);
51
55
  aggregatingEvents = [event, ...aggregatingEvents];
@@ -59,22 +63,36 @@ function aggregateScreeningEvent(params) {
59
63
  exports.aggregateScreeningEvent = aggregateScreeningEvent;
60
64
  function aggregateByEvent(params) {
61
65
  return (repos) => __awaiter(this, void 0, void 0, function* () {
66
+ var _a;
62
67
  const now = new Date();
63
68
  // 集計対象イベント検索
64
69
  let event = params.event;
65
- // 施設取得
66
- const movieTheater = yield findLocation(params)(repos);
67
- // 万が一施設が存在しなければ処理終了
68
- if (movieTheater === undefined) {
69
- return;
70
+ // 施設取得は冗長なので、ルーム検索に変更(2023-01-30~)
71
+ let movieTheaterId;
72
+ if (params.event.typeOf === factory.eventType.ScreeningEvent) {
73
+ movieTheaterId = params.event.superEvent.location.id;
70
74
  }
71
- const screeningRoom = movieTheater.containsPlace.find((p) => p.branchCode === event.location.branchCode);
72
- if (screeningRoom === undefined) {
73
- // 基本的にありえないはずだが、万が一スクリーンが見つからなければcapacityは0のまま
74
- // tslint:disable-next-line:no-console
75
- console.error(new Error(`Screening room not found. branchCode: ${event.location.branchCode}`));
76
- return;
75
+ else {
76
+ movieTheaterId = String((_a = params.event.offers) === null || _a === void 0 ? void 0 : _a.itemOffered.availableChannel.serviceLocation.containedInPlace.id);
77
77
  }
78
+ const screeningRoom = yield repos.place.findScreeningRoomsByBranchCode({
79
+ branchCode: { $eq: event.location.branchCode },
80
+ containedInPlace: { id: { $eq: movieTheaterId } }
81
+ });
82
+ // 施設取得
83
+ // const movieTheater = await findLocation(params)(repos);
84
+ // // 万が一施設が存在しなければ処理終了
85
+ // if (movieTheater === undefined) {
86
+ // return;
87
+ // }
88
+ // const screeningRoom = <factory.place.screeningRoom.IPlace | undefined>
89
+ // movieTheater.containsPlace.find((p) => p.branchCode === event.location.branchCode);
90
+ // if (screeningRoom === undefined) {
91
+ // // 基本的にありえないはずだが、万が一スクリーンが見つからなければcapacityは0のまま
92
+ // // tslint:disable-next-line:no-console
93
+ // console.error(new Error(`Screening room not found. branchCode: ${event.location.branchCode}`));
94
+ // return;
95
+ // }
78
96
  // 予約集計
79
97
  const { maximumAttendeeCapacity, remainingAttendeeCapacity, aggregateReservation } = yield aggregateReservationByEvent({
80
98
  aggregateDate: now,
@@ -89,13 +107,6 @@ function aggregateByEvent(params) {
89
107
  screeningRoom: screeningRoom
90
108
  })(repos);
91
109
  debug('offers aggregated', aggregateOffer);
92
- // 入場ゲートごとの集計
93
- // const aggregateEntranceGate = await aggregateEntranceGateByEvent({
94
- // aggregateDate: now,
95
- // event,
96
- // entranceGates: movieTheater.hasEntranceGate
97
- // })(repos);
98
- // debug('entrances aggregated', aggregateEntranceGate);
99
110
  // 値がundefinedの場合に更新しないように注意
100
111
  const update = {
101
112
  $set: Object.assign(Object.assign(Object.assign(Object.assign({ updatedAt: new Date(), // $setオブジェクトが空だとMongoエラーになるので
@@ -118,31 +129,33 @@ exports.aggregateByEvent = aggregateByEvent;
118
129
  * イベントロケーション取得
119
130
  * NotFoundエラーをハンドリングする
120
131
  */
121
- function findLocation(params) {
122
- return (repos) => __awaiter(this, void 0, void 0, function* () {
123
- var _a;
124
- let movieTheater;
125
- try {
126
- if (params.event.typeOf === factory.eventType.ScreeningEvent) {
127
- movieTheater = yield repos.place.findById({ id: params.event.superEvent.location.id });
128
- }
129
- else {
130
- const movieTheaterId = String((_a = params.event.offers) === null || _a === void 0 ? void 0 : _a.itemOffered.availableChannel.serviceLocation.containedInPlace.id);
131
- movieTheater = yield repos.place.findById({ id: movieTheaterId });
132
- }
133
- }
134
- catch (error) {
135
- let throwsError = true;
136
- if (error instanceof factory.errors.NotFound) {
137
- throwsError = false;
138
- }
139
- if (throwsError) {
140
- throw error;
141
- }
142
- }
143
- return movieTheater;
144
- });
145
- }
132
+ // function findLocation(params: {
133
+ // event: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
134
+ // }) {
135
+ // return async (repos: {
136
+ // place: PlaceRepo;
137
+ // }): Promise<factory.place.movieTheater.IPlace | undefined> => {
138
+ // let movieTheater: factory.place.movieTheater.IPlace | undefined;
139
+ // try {
140
+ // if (params.event.typeOf === factory.eventType.ScreeningEvent) {
141
+ // movieTheater = await repos.place.findById({ id: params.event.superEvent.location.id });
142
+ // } else {
143
+ // const movieTheaterId: string =
144
+ // String(params.event.offers?.itemOffered.availableChannel.serviceLocation.containedInPlace.id);
145
+ // movieTheater = await repos.place.findById({ id: movieTheaterId });
146
+ // }
147
+ // } catch (error) {
148
+ // let throwsError = true;
149
+ // if (error instanceof factory.errors.NotFound) {
150
+ // throwsError = false;
151
+ // }
152
+ // if (throwsError) {
153
+ // throw error;
154
+ // }
155
+ // }
156
+ // return movieTheater;
157
+ // };
158
+ // }
146
159
  /**
147
160
  * 集計後アクション
148
161
  */
@@ -196,20 +209,13 @@ function findOffers(params) {
196
209
  const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id });
197
210
  if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
198
211
  availableOffers = yield repos.offer.findOffersByOfferCatalogId({
199
- offerCatalog: { id: eventService.hasOfferCatalog.id }
212
+ offerCatalog: { id: eventService.hasOfferCatalog.id },
213
+ sort: false // ソート不要(2023-01-27~)
200
214
  });
201
215
  }
202
216
  }
203
217
  else {
204
- // hasOfferCatalog参照廃止(2022-09-02~)
205
218
  throw new factory.errors.NotFound('event.offers.itemOffered.id');
206
- // if (typeof params.event.hasOfferCatalog?.id === 'string') {
207
- // availableOffers = await repos.offer.findOffersByOfferCatalogId({
208
- // offerCatalog: {
209
- // id: params.event.hasOfferCatalog.id
210
- // }
211
- // });
212
- // }
213
219
  }
214
220
  }
215
221
  catch (error) {
@@ -230,24 +236,29 @@ function aggregateReservationByOffer(params) {
230
236
  let reservationCount4offer;
231
237
  let attendeeCount4offer;
232
238
  let checkInCount4offer;
233
- // tslint:disable-next-line:no-suspicious-comment
234
- // TODO EventReservationを旅客対応
239
+ let reservationType = factory.reservationType.EventReservation;
240
+ if (params.event.typeOf === factory.eventType.Event) {
241
+ reservationType = factory.reservationType.BusReservation;
242
+ }
235
243
  reservationCount4offer = yield repos.reservation.count({
236
- typeOf: factory.reservationType.EventReservation,
237
- reservationFor: { ids: [params.event.id] },
244
+ typeOf: reservationType,
245
+ // reservationFor: { ids: [params.event.id] },
246
+ reservationFor: { id: { $eq: params.event.id } },
238
247
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
239
248
  reservedTicket: { ticketType: { ids: [params.offer.id] } }
240
249
  });
241
250
  attendeeCount4offer = yield repos.reservation.count({
242
- typeOf: factory.reservationType.EventReservation,
243
- reservationFor: { ids: [params.event.id] },
251
+ typeOf: reservationType,
252
+ // reservationFor: { ids: [params.event.id] },
253
+ reservationFor: { id: { $eq: params.event.id } },
244
254
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
245
255
  reservedTicket: { ticketType: { ids: [params.offer.id] } },
246
256
  attended: true
247
257
  });
248
258
  checkInCount4offer = yield repos.reservation.count({
249
- typeOf: factory.reservationType.EventReservation,
250
- reservationFor: { ids: [params.event.id] },
259
+ typeOf: reservationType,
260
+ // reservationFor: { ids: [params.event.id] },
261
+ reservationFor: { id: { $eq: params.event.id } },
251
262
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
252
263
  reservedTicket: { ticketType: { ids: [params.offer.id] } },
253
264
  checkedIn: true
@@ -399,9 +410,14 @@ function aggregateReservationByEvent(params) {
399
410
  let attendeeCount;
400
411
  let checkInCount;
401
412
  let reservationCount;
413
+ let reservationType = factory.reservationType.EventReservation;
414
+ if (params.event.typeOf === factory.eventType.Event) {
415
+ reservationType = factory.reservationType.BusReservation;
416
+ }
402
417
  reservationCount = yield repos.reservation.count({
403
- typeOf: factory.reservationType.EventReservation,
404
- reservationFor: { ids: [params.event.id] },
418
+ typeOf: reservationType,
419
+ // reservationFor: { ids: [params.event.id] },
420
+ reservationFor: { id: { $eq: params.event.id } },
405
421
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed]
406
422
  });
407
423
  // maximumAttendeeCapacityを決定
@@ -430,14 +446,16 @@ function aggregateReservationByEvent(params) {
430
446
  }
431
447
  }
432
448
  attendeeCount = yield repos.reservation.count({
433
- typeOf: factory.reservationType.EventReservation,
434
- reservationFor: { ids: [params.event.id] },
449
+ typeOf: reservationType,
450
+ // reservationFor: { ids: [params.event.id] },
451
+ reservationFor: { id: { $eq: params.event.id } },
435
452
  // reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
436
453
  attended: true
437
454
  });
438
455
  checkInCount = yield repos.reservation.count({
439
- typeOf: factory.reservationType.EventReservation,
440
- reservationFor: { ids: [params.event.id] },
456
+ typeOf: reservationType,
457
+ // reservationFor: { ids: [params.event.id] },
458
+ reservationFor: { id: { $eq: params.event.id } },
441
459
  // reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
442
460
  checkedIn: true
443
461
  });
@@ -20,7 +20,9 @@ function aggregateUseActionsOnEvent(params) {
20
20
  return (repos) => __awaiter(this, void 0, void 0, function* () {
21
21
  const now = new Date();
22
22
  // 集計対象イベント検索
23
- const event = yield repos.event.findById(params);
23
+ // イベント取得属性最適化(2023-01-23~)
24
+ // const event = await repos.event.findById<factory.eventType.ScreeningEvent>(params);
25
+ const event = yield repos.event.findMinimizedIndividualEventById(params);
24
26
  // 入場ゲート検索
25
27
  const entranceGates = yield findEntranceGates({ event })(repos);
26
28
  // 入場ゲートごとの集計
@@ -90,18 +92,13 @@ function findOffers(params) {
90
92
  const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id });
91
93
  if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
92
94
  availableOffers = yield repos.offer.findOffersByOfferCatalogId({
93
- offerCatalog: { id: eventService.hasOfferCatalog.id }
95
+ offerCatalog: { id: eventService.hasOfferCatalog.id },
96
+ sort: false // ソート不要(2023-01-27~)
94
97
  });
95
98
  }
96
99
  }
97
100
  else {
98
- // hasOfferCatalog参照廃止(2022-09-02~)
99
101
  throw new factory.errors.NotFound('event.offers.itemOffered.id');
100
- // if (typeof params.event.hasOfferCatalog?.id === 'string') {
101
- // availableOffers = await repos.offer.findOffersByOfferCatalogId({
102
- // offerCatalog: { id: params.event.hasOfferCatalog.id }
103
- // });
104
- // }
105
102
  }
106
103
  }
107
104
  catch (error) {
@@ -0,0 +1,100 @@
1
+ import { MongoRepository as ActionRepo } from '../../repo/action';
2
+ import { MongoRepository as AggregationRepo } from '../../repo/aggregation';
3
+ import { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
4
+ import { MongoRepository as EventRepo } from '../../repo/event';
5
+ import { MongoRepository as TasKRepo } from '../../repo/task';
6
+ import { MongoRepository as TransactionRepo } from '../../repo/transaction';
7
+ declare function aggregateEvent(params: {
8
+ aggregationDays: number;
9
+ excludedProjectId?: string;
10
+ }): (repos: {
11
+ agregation: AggregationRepo;
12
+ event: EventRepo;
13
+ }) => Promise<void>;
14
+ /**
15
+ * 注文取引集計
16
+ */
17
+ declare function aggregatePlaceOrder(params: {
18
+ aggregationDays: number;
19
+ excludedProjectId?: string;
20
+ clientIds?: string[];
21
+ }): (repos: {
22
+ agregation: AggregationRepo;
23
+ transaction: TransactionRepo;
24
+ }) => Promise<void>;
25
+ /**
26
+ * 興行オファー承認アクション集計
27
+ */
28
+ declare function aggregateAuthorizeEventServiceOfferAction(params: {
29
+ aggregationDays: number;
30
+ excludedProjectId?: string;
31
+ }): (repos: {
32
+ agregation: AggregationRepo;
33
+ action: ActionRepo;
34
+ }) => Promise<void>;
35
+ /**
36
+ * 決済承認アクション集計
37
+ */
38
+ declare function aggregateAuthorizePaymentAction(params: {
39
+ aggregationDays: number;
40
+ excludedProjectId?: string;
41
+ }): (repos: {
42
+ agregation: AggregationRepo;
43
+ action: ActionRepo;
44
+ }) => Promise<void>;
45
+ declare function aggregateAuthorizeOrderAction(params: {
46
+ aggregationDays: number;
47
+ excludedProjectId?: string;
48
+ }): (repos: {
49
+ agregation: AggregationRepo;
50
+ action: ActionRepo;
51
+ }) => Promise<void>;
52
+ /**
53
+ * 使用アクション集計
54
+ */
55
+ declare function aggregateUseAction(params: {
56
+ aggregationDays: number;
57
+ excludedProjectId?: string;
58
+ }): (repos: {
59
+ agregation: AggregationRepo;
60
+ action: ActionRepo;
61
+ }) => Promise<void>;
62
+ declare function aggregateCheckMovieTicketAction(params: {
63
+ aggregationDays: number;
64
+ excludedProjectId?: string;
65
+ }): (repos: {
66
+ agregation: AggregationRepo;
67
+ action: ActionRepo;
68
+ }) => Promise<void>;
69
+ declare function aggregatePayMovieTicketAction(params: {
70
+ aggregationDays: number;
71
+ excludedProjectId?: string;
72
+ }): (repos: {
73
+ agregation: AggregationRepo;
74
+ action: ActionRepo;
75
+ }) => Promise<void>;
76
+ declare function aggregatePayTransaction(params: {
77
+ aggregationDays: number;
78
+ excludedProjectId?: string;
79
+ }): (repos: {
80
+ agregation: AggregationRepo;
81
+ assetTransaction: AssetTransactionRepo;
82
+ }) => Promise<void>;
83
+ /**
84
+ * 予約集計
85
+ */
86
+ declare function aggregateReserveTransaction(params: {
87
+ aggregationDays: number;
88
+ excludedProjectId?: string;
89
+ }): (repos: {
90
+ agregation: AggregationRepo;
91
+ assetTransaction: AssetTransactionRepo;
92
+ }) => Promise<void>;
93
+ declare function aggregateTask(params: {
94
+ aggregationDays: number;
95
+ excludedProjectId?: string;
96
+ }): (repos: {
97
+ agregation: AggregationRepo;
98
+ task: TasKRepo;
99
+ }) => Promise<void>;
100
+ export { aggregateAuthorizeEventServiceOfferAction, aggregateAuthorizeOrderAction, aggregateAuthorizePaymentAction, aggregateCheckMovieTicketAction, aggregateEvent, aggregatePayMovieTicketAction, aggregatePayTransaction, aggregatePlaceOrder, aggregateReserveTransaction, aggregateTask, aggregateUseAction };