@chevre/domain 24.1.0-alpha.5 → 24.1.0-alpha.50

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 (192) hide show
  1. package/lib/chevre/emailMessageBuilder.js +4 -12
  2. package/lib/chevre/index.d.ts +1 -2
  3. package/lib/chevre/index.js +1 -3
  4. package/lib/chevre/repo/acceptedOffer.d.ts +15 -26
  5. package/lib/chevre/repo/acceptedOffer.js +106 -67
  6. package/lib/chevre/repo/acceptedOfferInReserve.d.ts +30 -0
  7. package/lib/chevre/repo/acceptedOfferInReserve.js +86 -0
  8. package/lib/chevre/repo/accountingReport.js +2 -30
  9. package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
  10. package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -2
  11. package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
  12. package/lib/chevre/repo/event.js +12 -8
  13. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +7 -0
  14. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +74 -0
  15. package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
  16. package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -362
  17. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
  18. package/lib/chevre/repo/mongoose/schemas/order.js +108 -108
  19. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
  20. package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
  21. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +84 -0
  22. package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
  23. package/lib/chevre/repo/order.d.ts +2 -83
  24. package/lib/chevre/repo/order.js +10 -373
  25. package/lib/chevre/repo/orderInTransaction.d.ts +56 -6
  26. package/lib/chevre/repo/orderInTransaction.js +58 -4
  27. package/lib/chevre/repo/place/hasPOS.js +2 -1
  28. package/lib/chevre/repo/reservation.d.ts +20 -7
  29. package/lib/chevre/repo/reservation.js +16 -12
  30. package/lib/chevre/repo/role.d.ts +1 -15
  31. package/lib/chevre/repo/role.js +7 -14
  32. package/lib/chevre/repo/setting/integration.d.ts +27 -0
  33. package/lib/chevre/repo/setting/integration.js +102 -0
  34. package/lib/chevre/repo/transaction.d.ts +6 -6
  35. package/lib/chevre/repository.d.ts +5 -0
  36. package/lib/chevre/repository.js +11 -0
  37. package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
  38. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
  39. package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
  40. package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
  41. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
  42. package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
  43. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
  44. package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
  45. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
  46. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
  47. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
  48. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  49. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
  50. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
  51. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +0 -12
  52. package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
  53. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
  54. package/lib/chevre/service/delivery/factory.d.ts +6 -1
  55. package/lib/chevre/service/delivery/factory.js +1 -1
  56. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
  57. package/lib/chevre/service/delivery/reservation/factory.js +0 -17
  58. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
  59. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
  60. package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
  61. package/lib/chevre/service/notification/notifyByEmail.js +7 -12
  62. package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
  63. package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
  64. package/lib/chevre/service/offer/any.d.ts +7 -2
  65. package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
  66. package/lib/chevre/service/offer/event/authorize/factory.js +13 -15
  67. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  68. package/lib/chevre/service/offer/event/authorize.d.ts +16 -2
  69. package/lib/chevre/service/offer/event/authorize.js +62 -11
  70. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
  71. package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
  72. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
  73. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -3
  74. package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
  75. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +15 -15
  76. package/lib/chevre/service/order/deleteOrder.js +19 -43
  77. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
  78. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
  79. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
  80. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
  81. package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
  82. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
  83. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
  84. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
  85. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
  86. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
  87. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  88. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
  89. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
  90. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
  91. package/lib/chevre/service/order/onOrderUpdated.js +0 -1
  92. package/lib/chevre/service/order/payOrder.d.ts +1 -1
  93. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +4 -1
  94. package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
  95. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
  96. package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
  97. package/lib/chevre/service/order/placeOrder.d.ts +1 -1
  98. package/lib/chevre/service/order/returnOrder.js +0 -1
  99. package/lib/chevre/service/order/sendOrder.js +0 -4
  100. package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
  101. package/lib/chevre/service/payment/any/person2username.js +0 -1
  102. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
  103. package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
  104. package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
  105. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
  106. package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
  107. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
  108. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
  109. package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
  110. package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
  111. package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
  112. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  113. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
  114. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
  115. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
  116. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
  117. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
  118. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
  119. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
  120. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
  121. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
  122. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
  123. package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
  124. package/lib/chevre/service/reserve/confirmReservation.js +7 -7
  125. package/lib/chevre/service/reserve/factory.js +2 -1
  126. package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
  127. package/lib/chevre/service/reserve/findByCode.js +1 -1
  128. package/lib/chevre/service/reserve/findReservations.d.ts +14 -6
  129. package/lib/chevre/service/reserve/findReservations.js +26 -36
  130. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
  131. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
  132. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
  133. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
  134. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
  135. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
  136. package/lib/chevre/service/reserve/searchByOrder.js +7 -3
  137. package/lib/chevre/service/task/acceptCOAOffer.js +6 -3
  138. package/lib/chevre/service/task/authorizePayment.js +4 -2
  139. package/lib/chevre/service/task/cancelPendingReservation.js +4 -2
  140. package/lib/chevre/service/task/checkMovieTicket.js +4 -2
  141. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
  142. package/lib/chevre/service/task/confirmReserveTransaction.js +5 -3
  143. package/lib/chevre/service/task/createAccountingReport.js +4 -8
  144. package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -2
  145. package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
  146. package/lib/chevre/service/task/importOffersFromCOA.js +4 -2
  147. package/lib/chevre/service/task/invalidatePaymentUrl.js +3 -1
  148. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -1
  149. package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -1
  150. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
  151. package/lib/chevre/service/task/pay.js +4 -2
  152. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
  153. package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
  154. package/lib/chevre/service/task/payment/payByTask.js +6 -7
  155. package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
  156. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
  157. package/lib/chevre/service/task/placeOrder.js +3 -1
  158. package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
  159. package/lib/chevre/service/task/refund.js +4 -2
  160. package/lib/chevre/service/task/returnReserveTransaction.js +4 -2
  161. package/lib/chevre/service/task/sendEmailMessage.js +5 -3
  162. package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
  163. package/lib/chevre/service/task/voidPayment.js +4 -2
  164. package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
  165. package/lib/chevre/service/task.d.ts +0 -7
  166. package/lib/chevre/service/taskHandler.js +1 -0
  167. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
  168. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
  169. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
  170. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
  171. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
  172. package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -3
  173. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
  174. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
  175. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
  176. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
  177. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
  178. package/lib/chevre/service/transaction/returnOrder/preStart.js +0 -3
  179. package/lib/chevre/service/validation/validateOrder.js +3 -78
  180. package/lib/chevre/settings.d.ts +0 -55
  181. package/lib/chevre/settings.js +1 -29
  182. package/lib/chevre/taskSettings.d.ts +0 -22
  183. package/lib/chevre/taskSettings.js +1 -7
  184. package/package.json +2 -2
  185. package/lib/chevre/credentials/customSearch.d.ts +0 -13
  186. package/lib/chevre/credentials/customSearch.js +0 -16
  187. package/lib/chevre/credentials/lineNotify.d.ts +0 -17
  188. package/lib/chevre/credentials/lineNotify.js +0 -20
  189. package/lib/chevre/credentials/sendGrid.d.ts +0 -24
  190. package/lib/chevre/credentials/sendGrid.js +0 -18
  191. package/lib/chevre/credentials.d.ts +0 -20
  192. package/lib/chevre/credentials.js +0 -42
@@ -73,7 +73,7 @@ function processPurchaseNumberAuth(params) {
73
73
  const authService = new sdk_1.Surfrock.service.auth.AuthService({
74
74
  endpoint: String(availableChannel.serviceUrl),
75
75
  auth: mvtkReserveAuthClient
76
- }, { timeout: settings.movieticketReserve.timeoutCheck });
76
+ }, { timeout: (await settings.getByKey('movieticketReserve')).timeoutCheck });
77
77
  const purchaseNumberAuthResult = await authService.purchaseNumberAuth(purchaseNumberAuthIn);
78
78
  return { purchaseNumberAuthIn, purchaseNumberAuthResult };
79
79
  };
@@ -5,7 +5,7 @@ import type { CredentialsRepo } from '../../../repo/credentials';
5
5
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
6
6
  import type { TaskRepo } from '../../../repo/task';
7
7
  import { factory } from '../../../factory';
8
- import { Settings } from '../../../settings';
8
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
9
9
  interface IRefundOperationRepos {
10
10
  action?: never;
11
11
  actions: {
@@ -17,7 +17,7 @@ const processSeatInfoSyncCancel_1 = require("./refundMovieTicket/processSeatInfo
17
17
  function wait4payActionDelayIfNeeded(params) {
18
18
  return async (settings) => {
19
19
  const { payAction } = params;
20
- const minIntervalBetweenPayAndRefund = settings.movieticketReserve.minIntervalBetweenPayAndRefund;
20
+ const minIntervalBetweenPayAndRefund = (await settings.getByKey('movieticketReserve')).minIntervalBetweenPayAndRefund;
21
21
  let waitingNecessary = false;
22
22
  if (typeof minIntervalBetweenPayAndRefund === 'number' && minIntervalBetweenPayAndRefund > 0) {
23
23
  if (payAction.actionStatus !== factory_1.factory.actionStatusType.CompletedActionStatus) {
@@ -74,7 +74,7 @@ function refundMovieTicket(params, options) {
74
74
  state: '',
75
75
  credentialsRepo: repos.credentials // set credentialsRepo(2024-11-20~)
76
76
  });
77
- const seatService = new sdk_1.Surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: settings.movieticketReserve.timeout });
77
+ const seatService = new sdk_1.Surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: (await settings.getByKey('movieticketReserve')).timeoutRefund });
78
78
  let seatInfoSyncCancelIn;
79
79
  let seatInfoSyncIn;
80
80
  const useSeatInfoSyncCancel = availableChannel.credentials?.useSeatInfoSyncCancel === true;
@@ -5,7 +5,7 @@ import type { CredentialsRepo } from '../../../repo/credentials';
5
5
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
6
6
  import type { TaskRepo } from '../../../repo/task';
7
7
  import { factory } from '../../../factory';
8
- import { Settings } from '../../../settings';
8
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
9
9
  declare function voidTransaction(params: factory.task.voidPayment.IData): (repos: {
10
10
  actions: {
11
11
  pay: PayActionRepo;
@@ -61,7 +61,8 @@ function confirmReservation(params) {
61
61
  ...rawReservation.reservedTicket,
62
62
  ticketType: ticketTypeByTransaction
63
63
  },
64
- reservationFor: reserveTransaction.object.reservationFor // reservationForは予約取引から参照する(2026-04-05~)
64
+ reservationFor: reserveTransaction.object.reservationFor, // reservationForは予約取引から参照する(2026-04-05~)
65
+ issuedThrough: reserveTransaction.object.issuedThrough // issuedThroughは予約取引から補完する(2026-05-08~)
65
66
  };
66
67
  });
67
68
  confirmedReservations = confirmedReservations.map((r) => {
@@ -189,25 +190,24 @@ params, options) {
189
190
  if (reserveTransaction.object.disablePendingReservations === true) {
190
191
  const reservationFor = reserveTransaction.object.reservationFor;
191
192
  const subReservations = reserveTransaction.object.subReservation;
192
- const issuedThrough = reserveTransaction.object.issuedThrough;
193
+ // const issuedThrough = reserveTransaction.object.issuedThrough;
193
194
  if (Array.isArray(subReservations)
194
195
  && typeof reservationFor?.typeOf === 'string'
195
- && typeof issuedThrough?.typeOf === 'string') {
196
- // confirmManyに変更(2023-06-13~)
197
- const confirmManyIfNotExistResult = await repos.reservation.confirmManyIfNotExist({
196
+ // && typeof issuedThrough?.typeOf === 'string'
197
+ ) {
198
+ await repos.reservation.confirmManyIfNotExist({
198
199
  bookingTime: reserveTransaction.startDate, // startDateに設定(2024-04-08~)
199
200
  project: { id: reserveTransaction.project.id },
200
201
  provider: (typeof reserveTransaction.object.provider?.id === 'string')
201
202
  ? reserveTransaction.object.provider
202
203
  : { id: reserveTransaction.agent.id, typeOf: factory_1.factory.organizationType.Corporation },
203
204
  subReservation: subReservations,
204
- issuedThrough,
205
+ // issuedThrough,
205
206
  reservationFor,
206
207
  reservationNumber: reserveTransaction.object.reservationNumber,
207
208
  underName,
208
209
  broker: reserveTransaction.object.broker
209
210
  });
210
- debug('confirmManyIfNotExistResult:', confirmManyIfNotExistResult, 'reservationNumber:', reservationPackage.reservationNumber);
211
211
  }
212
212
  }
213
213
  else {
@@ -21,7 +21,8 @@ function createCancelPendingReservationAction(params) {
21
21
  const reservationPackage = {
22
22
  typeOf: factory_1.factory.reservationType.ReservationPackage,
23
23
  reservationNumber: transaction.transactionNumber,
24
- reservationFor: { typeOf: reservationFor.typeOf, id: String(reservationFor.id) },
24
+ // discontinue reservationFor(2026-05-09~)
25
+ // reservationFor: { typeOf: reservationFor.typeOf, id: String(reservationFor.id) },
25
26
  reservationStatus: (typeof params.transaction.object.reservationStatus === 'string')
26
27
  ? params.transaction.object.reservationStatus
27
28
  : factory_1.factory.reservationStatusType.ReservationPending
@@ -5,7 +5,7 @@ import type { OrderRepo } from '../../repo/order';
5
5
  import type { ReservationRepo } from '../../repo/reservation';
6
6
  type IReservationResult = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'additionalTicketText' | 'checkedIn' | 'reservationStatus'> & {
7
7
  reservedTicket: {
8
- ticketType: Pick<factory.reservation.eventReservation.ITicketType, 'identifier'> & {
8
+ ticketType: Pick<factory.assetTransaction.reserve.ITicketType, 'identifier'> & {
9
9
  name: {
10
10
  ja?: string;
11
11
  };
@@ -39,7 +39,7 @@ function findByCode(params) {
39
39
  // typeOf?: { $in?: factory.order.IItemOffered['typeOf'][] };
40
40
  }
41
41
  }
42
- }, ['itemOffered'])).shift();
42
+ })).shift();
43
43
  if (acceptedOffer === undefined) {
44
44
  throw new factory_1.factory.errors.NotFound('acceptedOffer');
45
45
  }
@@ -1,21 +1,29 @@
1
1
  import { factory } from '../../factory';
2
2
  import type { ReserveTransactionRepo } from '../../repo/assetTransaction/reserve';
3
- import type { IDeprecatedField, IKeyOfProjection, ReservationRepo } from '../../repo/reservation';
3
+ import type { IKeyOfProjection, ReservationRepo } from '../../repo/reservation';
4
4
  /**
5
5
  * 予約検索レスポンスとしての予約
6
6
  * 予約ドキュメントに予約取引の情報を補完する
7
7
  */
8
- type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor'> & {
9
- price?: factory.reservation.eventReservation.IPrice;
8
+ type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, 'underName' | 'reservedTicket' | 'reservationFor'> & {
10
9
  underName?: factory.assetTransaction.reserve.IUnderName;
11
- reservedTicket?: factory.assetTransaction.reserve.IObjectSubReservation['reservedTicket'];
12
- reservationFor?: factory.assetTransaction.reserve.IReservationFor;
10
+ reservedTicket?: factory.reservation.eventReservation.IReservedTicket | factory.assetTransaction.reserve.IObjectSubReservation['reservedTicket'];
11
+ reservationFor?: factory.reservation.eventReservation.IReservationForMinimized | factory.assetTransaction.reserve.IReservationFor;
12
+ price?: never;
13
13
  };
14
14
  /**
15
15
  * 予約を検索する
16
16
  */
17
17
  export declare function findReservations(params: factory.reservation.eventReservation.ISearchConditions, options: {
18
- inclusion: Partial<Record<IKeyOfProjection | IDeprecatedField, 1>>;
18
+ inclusion: Partial<Record<IKeyOfProjection | 'underName', 1>>;
19
+ /**
20
+ * reservationForを予約ドキュメントそのままで返すかどうか
21
+ */
22
+ minimizeReservationFor: boolean;
23
+ /**
24
+ * reservedTicketからticketTypeを除外するかどうか
25
+ */
26
+ minimizeReservedTicket: boolean;
19
27
  }): (repos: {
20
28
  assetTransaction: {
21
29
  reserve: ReserveTransactionRepo;
@@ -1,23 +1,17 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.findReservations = findReservations;
7
- const debug_1 = __importDefault(require("debug"));
8
- const debug = (0, debug_1.default)('chevre-domain:service:reserve:findReservations');
9
4
  /**
10
5
  * 予約を検索する
11
6
  */
12
7
  function findReservations(params, options) {
13
8
  return async (repos) => {
14
- const { inclusion } = options;
9
+ const { inclusion, minimizeReservationFor, minimizeReservedTicket } = options;
15
10
  const rawReservations = await repos.reservation.findReservations(params, inclusion);
16
11
  if (rawReservations.length === 0) {
17
12
  return [];
18
13
  }
19
14
  else {
20
- const requirePrice = Object.keys(inclusion).includes('price');
21
15
  const requireUnderName = Object.keys(inclusion).includes('underName');
22
16
  const requireReservedTicket = Object.keys(inclusion).includes('reservedTicket');
23
17
  const requireReservationFor = Object.keys(inclusion).includes('reservationFor');
@@ -25,45 +19,41 @@ function findReservations(params, options) {
25
19
  const subReservations = await repos.assetTransaction.reserve.findSubReservationsById({
26
20
  ids: reservationIds
27
21
  });
28
- // 予約取引から参照した予約数と同じはず
29
- debug('useReserveTransaction: true. reservations.length === subReservations.length?', rawReservations.length === subReservations.length);
30
22
  return rawReservations.map((reservation) => {
31
23
  const subReservationByTransaction = subReservations.find((s) => s.id === reservation.id);
32
- const priceByTransaction = subReservationByTransaction?.price;
33
24
  const underNameByTransaction = subReservationByTransaction?.underName;
34
25
  const ticketTypeByTransaction = subReservationByTransaction?.reservedTicket?.ticketType;
35
26
  const reservationForByTransaction = subReservationByTransaction?.reservationFor;
36
- // 予約ドキュメントを最適化し始めたため、もう等しくない(2026-04-06~)
37
- // // 予約取引から参照した属性と全く等しいはず
38
- // if (requirePrice) {
39
- // }
40
- // if (requireUnderName) {
41
- // }
42
- // if (requireReservedTicket) {
43
- // }
44
- // if (requireReservationFor) {
45
- // const reservationForMatched = isDeepStrictEqual(reservation.reservationFor, reservationForByTransaction);
46
- // debug('requireReservationFor. reservationForMatched?', reservationForMatched);
47
- // if (!reservationForMatched) {
48
- // console.error('reservationForMatched: false!!!', reservation.id);
49
- // }
50
- // }
51
- const { reservationFor, reservedTicket, ...rawReservation4result } = reservation; // eslint-disable-line @typescript-eslint/no-unused-vars
27
+ const { reservationFor, issuedThrough: _issuedThrough, priceCurrency: _priceCurrency, numSeats: _numSeats, reservedTicket, ...rawReservation4result } = reservation;
52
28
  return {
53
29
  ...rawReservation4result, // 予約ドキュメントはそのまま返す
54
- ...(requirePrice && priceByTransaction !== undefined) ? { price: priceByTransaction } : undefined, // priceがあれば上書き
55
30
  ...(requireUnderName && underNameByTransaction !== undefined) ? { underName: underNameByTransaction } : undefined, // underNameがあれば上書き
56
- ...(requireReservedTicket && ticketTypeByTransaction !== undefined) // ticketTypeがあれば上書き
57
- ? {
58
- reservedTicket: {
59
- ...reservedTicket, // 予約ドキュメントのreservedTicketはそのまま返す
60
- ticketType: ticketTypeByTransaction
31
+ ...(requireReservedTicket)
32
+ ? (!minimizeReservedTicket && ticketTypeByTransaction !== undefined)
33
+ ? {
34
+ reservedTicket: {
35
+ ...reservedTicket, // 予約ドキュメントのreservedTicketはそのまま返す
36
+ ticketType: ticketTypeByTransaction
37
+ }
61
38
  }
62
- }
39
+ : { reservedTicket } // 予約検索レスポンスからticketTypeは廃止(2026-06-01~)
63
40
  : undefined,
64
- ...(requireReservationFor && reservationForByTransaction !== undefined)
65
- ? { reservationFor: reservationForByTransaction }
66
- : undefined, // reservationForがあれば上書き(2026-04-06~)
41
+ ...(requireReservationFor)
42
+ ? (!minimizeReservationFor && reservationForByTransaction !== undefined)
43
+ ? { reservationFor: reservationForByTransaction }
44
+ : { reservationFor } // 予約検索レスポンスのreservationForはそのまま返す(2026-06-01~)
45
+ : undefined,
46
+ // ...(requireReservedTicket && ticketTypeByTransaction !== undefined) // ticketTypeがあれば上書き
47
+ // ? {
48
+ // reservedTicket: {
49
+ // ...reservedTicket, // 予約ドキュメントのreservedTicketはそのまま返す
50
+ // ticketType: ticketTypeByTransaction
51
+ // }
52
+ // }
53
+ // : undefined,
54
+ // ...(requireReservationFor && reservationForByTransaction !== undefined)
55
+ // ? { reservationFor: reservationForByTransaction }
56
+ // : undefined, // reservationForがあれば上書き(2026-04-06~)
67
57
  };
68
58
  });
69
59
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.onPendingReservationCanceled = onPendingReservationCanceled;
4
4
  const factory_1 = require("../../../factory");
5
- // import { Settings } from '../../../settings';
6
5
  const factory_2 = require("../factory");
7
6
  function onPendingReservationCanceled(params) {
8
7
  return async (repos
@@ -5,7 +5,6 @@ exports.onReservationCanceled = onReservationCanceled;
5
5
  * 予約取消時アクション
6
6
  */
7
7
  const factory_1 = require("../../../factory");
8
- // import { Settings } from '../../../settings';
9
8
  const factory_2 = require("../factory");
10
9
  function onReservationCanceled(
11
10
  /**
@@ -5,13 +5,14 @@ import { factory } from '../../../factory';
5
5
  import { AuthorizationRepo } from '../../../repo/authorization';
6
6
  import type { SettingRepo } from '../../../repo/setting';
7
7
  import type { TaskRepo } from '../../../repo/task';
8
- export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor'> & {
9
- price?: factory.reservation.eventReservation.IPrice;
8
+ export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor' | 'issuedThrough'> & {
9
+ price?: factory.assetTransaction.reserve.IPrice;
10
10
  underName?: Pick<factory.reservation.IUnderName, 'id' | 'typeOf'>;
11
11
  reservedTicket: Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
12
- ticketType: factory.reservation.eventReservation.ITicketType;
12
+ ticketType: factory.assetTransaction.reserve.ITicketType;
13
13
  };
14
14
  reservationFor: factory.assetTransaction.reserve.IReservationFor;
15
+ issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
15
16
  };
16
17
  /**
17
18
  * 予約確定後のアクション
@@ -6,7 +6,6 @@ exports.onReservationConfirmed = onReservationConfirmed;
6
6
  * 予約確定時アクション
7
7
  */
8
8
  const factory_1 = require("../../../factory");
9
- // import { Settings } from '../../../settings';
10
9
  const factory_2 = require("../factory");
11
10
  /**
12
11
  * 予約確定後のアクション
@@ -98,22 +97,14 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
98
97
  }
99
98
  }
100
99
  const subReservations4inform = confirmedReservations.map((r) => {
101
- const { additionalProperty, additionalTicketText,
102
- // attended, checkedIn,
103
- id, modifiedTime,
104
- // numSeats,
105
- price, programMembershipUsed, reservedTicket, subReservation, typeOf } = r;
100
+ const { additionalProperty, additionalTicketText, id, modifiedTime, price, programMembershipUsed, reservedTicket, subReservation, typeOf } = r;
106
101
  return {
107
- // bookingTime, // discontinue(2024-10-27~)
108
102
  id,
109
103
  typeOf,
110
104
  reservedTicket,
111
105
  ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
112
106
  ...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
113
- // ...(typeof attended === 'boolean') ? { attended } : undefined, // discontinue(2024-10-27~)
114
- // ...(typeof checkedIn === 'boolean') ? { checkedIn } : undefined, // discontinue(2024-10-27~)
115
107
  ...(modifiedTime instanceof Date) ? { modifiedTime } : undefined,
116
- // ...(typeof numSeats === 'number') ? { numSeats } : undefined, // discontinue(2024-10-27~)
117
108
  ...(price !== undefined) ? { price } : undefined,
118
109
  ...(programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined,
119
110
  ...(Array.isArray(subReservation)) ? { subReservation } : undefined
@@ -9,7 +9,6 @@ exports.onReservationUsed = onReservationUsed;
9
9
  */
10
10
  const moment_1 = __importDefault(require("moment"));
11
11
  const factory_1 = require("../../../factory");
12
- // import { Settings } from '../../../settings';
13
12
  const factory_2 = require("../factory");
14
13
  /**
15
14
  * 予約使用
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.onReservationsCreated = onReservationsCreated;
4
4
  const factory_1 = require("../../../factory");
5
- // import { Settings } from '../../../settings';
6
5
  const factory_2 = require("../factory");
7
6
  /**
8
7
  * 予約作成時イベント
@@ -11,14 +11,18 @@ function searchByOrder(params) {
11
11
  page: params.page,
12
12
  project: { id: { $eq: params.project.id } },
13
13
  orderNumber: { $eq: params.orderNumber },
14
- acceptedOffers: { itemOffered: { typeOf: { $in: [reservationType] } } }
15
- }, ['itemOffered']);
14
+ acceptedOffers: {
15
+ itemOffered: {
16
+ // typeOf: { $in: [reservationType] }
17
+ }
18
+ }
19
+ });
16
20
  const reservationIds = acceptedOffers.map((offer) => {
17
21
  if (offer.itemOffered.typeOf === reservationType) {
18
22
  return offer.itemOffered.id;
19
23
  }
20
24
  else {
21
- // 検索条件にreservationTypeを含めているので、ありえないケース
25
+ // EventReservationしか存在しないので、ありえないケース
22
26
  throw new factory_1.factory.errors.Internal(`unexpected itemOffered.typeOf ${offer.itemOffered.typeOf}`);
23
27
  }
24
28
  });
@@ -11,6 +11,7 @@ const event_1 = require("../../repo/event");
11
11
  const orderNumber_1 = require("../../repo/orderNumber");
12
12
  const project_1 = require("../../repo/project");
13
13
  const reserveInterface_1 = require("../../repo/reserveInterface");
14
+ const integration_1 = require("../../repo/setting/integration");
14
15
  // import { TransactionRepo } from '../../repo/transaction';
15
16
  const placeOrder_1 = require("../../repo/transaction/placeOrder");
16
17
  const acceptOffer_1 = require("../offer/eventServiceByCOA/acceptOffer");
@@ -19,7 +20,7 @@ let coaAuthClient;
19
20
  * タスク実行関数
20
21
  */
21
22
  function call(params) {
22
- return async ({ connection, redisClient, settings }, options) => {
23
+ return async ({ connection, redisClient }, options) => {
23
24
  if (redisClient === undefined) {
24
25
  throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
25
26
  }
@@ -27,6 +28,7 @@ function call(params) {
27
28
  if (!options.executeById) {
28
29
  return;
29
30
  }
31
+ const settings = new integration_1.IntegrationSettingRepo({ connection });
30
32
  const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
31
33
  const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
32
34
  if (typeof coaAPI?.id !== 'string') {
@@ -58,14 +60,15 @@ function call(params) {
58
60
  const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
59
61
  // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
60
62
  try {
63
+ const coaIntegrationSettings = await settings.getByKey('coa');
61
64
  const reserveService = new coa_service_1.COA.service.Reserve({
62
65
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
63
66
  auth: coaAuthClient
64
- }, { timeout: settings.coa.timeout });
67
+ }, { timeout: coaIntegrationSettings.timeoutReserve });
65
68
  const masterService = new coa_service_1.COA.service.Master({
66
69
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
67
70
  auth: coaAuthClient
68
- }, { timeout: settings.coa.timeout });
71
+ }, { timeout: coaIntegrationSettings.timeoutMaster });
69
72
  const { agent, object, potentialActions, purpose } = params.data;
70
73
  // agent.idからflgMemberを自動セット(2024-12-16~)
71
74
  const isMember = memberClients.includes(agent.id);
@@ -24,6 +24,7 @@ const potentialAction_1 = require("../../repo/potentialAction");
24
24
  const product_1 = require("../../repo/product");
25
25
  const project_1 = require("../../repo/project");
26
26
  const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
27
+ const integration_1 = require("../../repo/setting/integration");
27
28
  const task_1 = require("../../repo/task");
28
29
  const ticket_1 = require("../../repo/ticket");
29
30
  // import { TransactionRepo } from '../../repo/transaction';
@@ -35,7 +36,7 @@ const any_1 = require("../payment/any");
35
36
  * タスク実行関数
36
37
  */
37
38
  function call(params) {
38
- return async ({ connection, redisClient, settings }, options) => {
39
+ return async ({ connection, redisClient }, options) => {
39
40
  if (redisClient === undefined) {
40
41
  throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
41
42
  }
@@ -44,11 +45,12 @@ function call(params) {
44
45
  return;
45
46
  }
46
47
  let callResult;
48
+ const settings = new integration_1.IntegrationSettingRepo({ connection });
47
49
  // const actionRepo = new ActionRepo(connection);
48
50
  const authorizePaymentMethodActionRepo = new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection);
49
51
  // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
50
52
  const paymentServiceId = params.data.object.issuedThrough.id;
51
- const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
53
+ const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
52
54
  const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
53
55
  && typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
54
56
  try {
@@ -9,6 +9,7 @@ const offer_1 = require("../../repo/rateLimit/offer");
9
9
  const reservation_1 = require("../../repo/reservation");
10
10
  const reserveInterface_1 = require("../../repo/reserveInterface");
11
11
  const setting_1 = require("../../repo/setting");
12
+ const integration_1 = require("../../repo/setting/integration");
12
13
  const stockHolder_1 = require("../../repo/stockHolder");
13
14
  const task_1 = require("../../repo/task");
14
15
  const cancelReservation_1 = require("../reserve/cancelReservation");
@@ -23,10 +24,11 @@ let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
23
24
  * タスク実行関数
24
25
  */
25
26
  function call(params) {
26
- return async ({ connection, redisClient, settings }) => {
27
+ return async ({ connection, redisClient }) => {
27
28
  if (redisClient === undefined) {
28
29
  throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
29
30
  }
31
+ const settings = new integration_1.IntegrationSettingRepo({ connection });
30
32
  const { data } = params;
31
33
  // support COAReserve(2025-03-01~)
32
34
  if (data.purpose?.typeOf === factory_1.factory.assetTransactionType.Reserve) {
@@ -54,7 +56,7 @@ function call(params) {
54
56
  const reserveService = new coa_service_1.COA.service.Reserve({
55
57
  endpoint: coaAuthClient.options.endpoint,
56
58
  auth: coaAuthClient
57
- }, { timeout: settings.coa.timeout });
59
+ }, { timeout: (await settings.getByKey('coa')).timeoutReserve });
58
60
  const { object, instrument } = data;
59
61
  await (0, cancelReservation_2.cancelPendingReservation)({
60
62
  object,
@@ -8,13 +8,14 @@ const event_1 = require("../../repo/event");
8
8
  const paymentService_1 = require("../../repo/paymentService");
9
9
  const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
10
10
  const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
11
+ const integration_1 = require("../../repo/setting/integration");
11
12
  // import { TransactionProcessRepo } from '../../repo/transactionProcess';
12
13
  const pay_1 = require("../assetTransaction/pay");
13
14
  /**
14
15
  * タスク実行関数
15
16
  */
16
17
  function call(params) {
17
- return async ({ connection, redisClient, settings }, options) => {
18
+ return async ({ connection, redisClient }, options) => {
18
19
  if (redisClient === undefined) {
19
20
  throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
20
21
  }
@@ -22,10 +23,11 @@ function call(params) {
22
23
  if (!options.executeById) {
23
24
  return;
24
25
  }
26
+ const settings = new integration_1.IntegrationSettingRepo({ connection });
25
27
  const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
26
28
  // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
27
29
  const paymentServiceId = params.data.object[0]?.id;
28
- const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
30
+ const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
29
31
  const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
30
32
  && typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
31
33
  try {
@@ -1,6 +1,6 @@
1
1
  import { COA } from '@motionpicture/coa-service';
2
2
  import { factory } from '../../factory';
3
- import { Settings } from '../../settings';
3
+ import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
4
4
  import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
5
5
  import { AcceptedOfferRepo } from '../../repo/acceptedOffer';
6
6
  import { ActionRepo } from '../../repo/action';
@@ -17,6 +17,7 @@ const order_1 = require("../../repo/order");
17
17
  const reservation_1 = require("../../repo/reservation");
18
18
  const reserveInterface_1 = require("../../repo/reserveInterface");
19
19
  const setting_1 = require("../../repo/setting");
20
+ const integration_1 = require("../../repo/setting/integration");
20
21
  const task_1 = require("../../repo/task");
21
22
  let coaAuthClientCreated = false;
22
23
  let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
@@ -28,7 +29,8 @@ let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
28
29
  * タスク実行関数
29
30
  */
30
31
  function call(params) {
31
- return async ({ connection, settings }) => {
32
+ return async ({ connection }) => {
33
+ const settings = new integration_1.IntegrationSettingRepo({ connection });
32
34
  if (!coaAuthClientCreated) {
33
35
  const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
34
36
  const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
@@ -41,7 +43,7 @@ function call(params) {
41
43
  const reserveService = new coa_service_1.COA.service.Reserve({
42
44
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
43
45
  auth: coaAuthClient
44
- }, { timeout: settings.coa.timeout });
46
+ }, { timeout: (await settings.getByKey('coa')).timeoutReserve });
45
47
  await confirmReserveTransaction({
46
48
  ...params.data,
47
49
  project: params.project,
@@ -137,7 +139,7 @@ function fixOrderAsPurpose(params) {
137
139
  const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
138
140
  orderNumber: { $eq: order.orderNumber },
139
141
  project: { id: { $eq: params.project.id } }
140
- }, ['itemOffered', 'offeredThrough']);
142
+ });
141
143
  return {
142
144
  ...order,
143
145
  acceptedOffers
@@ -27,11 +27,12 @@ function createAccountingReport(params) {
27
27
  orderNumber: data.object.mainEntity.orderNumber,
28
28
  project: { id: params.project.id },
29
29
  inclusion: [
30
- 'orderNumber', 'project', 'customer', 'confirmationNumber', 'paymentMethods',
30
+ 'orderNumber', 'project', 'paymentMethods', 'seller', 'typeOf', 'orderDate'
31
+ // 'customer', 'confirmationNumber',
31
32
  // 'orderedItem',
32
33
  // 'broker',
33
- 'price', 'priceCurrency', 'seller', 'typeOf', 'orderDate'
34
- ] // explicit projection(2024-07-25~)
34
+ // 'price', 'priceCurrency',
35
+ ]
35
36
  });
36
37
  const simpleOrder = {
37
38
  typeOf: order.typeOf,
@@ -39,7 +40,6 @@ function createAccountingReport(params) {
39
40
  orderDate: order.orderDate
40
41
  };
41
42
  const actionObject = {
42
- // ...params,
43
43
  mainEntity: { orderNumber: simpleOrder.orderNumber },
44
44
  typeOf: 'Report'
45
45
  };
@@ -53,10 +53,6 @@ function createAccountingReport(params) {
53
53
  };
54
54
  const action = await repos.action.start(actionAttributes);
55
55
  try {
56
- // const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
57
- // orderNumber: { $eq: data.object.mainEntity.orderNumber },
58
- // project: { id: { $eq: params.project.id } }
59
- // });
60
56
  await (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)({
61
57
  ...order,
62
58
  // acceptedOffers
@@ -37,6 +37,7 @@ exports.call = call;
37
37
  const coa_service_1 = require("@motionpicture/coa-service");
38
38
  const event_1 = require("../../repo/event");
39
39
  const reserveInterface_1 = require("../../repo/reserveInterface");
40
+ const integration_1 = require("../../repo/setting/integration");
40
41
  const factory_1 = require("../../factory");
41
42
  const EventAggregationService = __importStar(require("../aggregation/event"));
42
43
  let coaAuthClient;
@@ -44,7 +45,7 @@ let coaAuthClient;
44
45
  * タスク実行関数
45
46
  */
46
47
  function call(params) {
47
- return async ({ connection, settings }) => {
48
+ return async ({ connection }) => {
48
49
  if (coaAuthClient === undefined) {
49
50
  const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
50
51
  const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
@@ -54,10 +55,11 @@ function call(params) {
54
55
  }
55
56
  coaAuthClient = new coa_service_1.COA.auth.RefreshToken(credentials);
56
57
  }
58
+ const settings = new integration_1.IntegrationSettingRepo({ connection });
57
59
  const reserveService = new coa_service_1.COA.service.Reserve({
58
60
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
59
61
  auth: coaAuthClient
60
- }, { timeout: settings.coa.timeout });
62
+ }, { timeout: (await settings.getByKey('coa')).timeoutReserve });
61
63
  await EventAggregationService.importFromCOA(params.data)({
62
64
  event: new event_1.EventRepo(connection),
63
65
  reserveService