@chevre/domain 25.2.0-alpha.9 → 26.0.0-alpha.1

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 (262) hide show
  1. package/lib/chevre/eventEmitter/task.d.ts +2 -1
  2. package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
  3. package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
  4. package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
  5. package/lib/chevre/repo/action/acceptPay.js +47 -19
  6. package/lib/chevre/repo/action.d.ts +16 -9
  7. package/lib/chevre/repo/action.js +99 -180
  8. package/lib/chevre/repo/adminScheduledTask.d.ts +20 -0
  9. package/lib/chevre/repo/adminScheduledTask.js +95 -0
  10. package/lib/chevre/repo/adminTask.d.ts +37 -0
  11. package/lib/chevre/repo/adminTask.js +163 -0
  12. package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
  13. package/lib/chevre/repo/aggregateOffer.js +16 -125
  14. package/lib/chevre/repo/aggregateTask.d.ts +37 -0
  15. package/lib/chevre/repo/aggregateTask.js +136 -0
  16. package/lib/chevre/repo/asyncAction.d.ts +69 -0
  17. package/lib/chevre/repo/asyncAction.js +237 -0
  18. package/lib/chevre/repo/concurrentLock.d.ts +3 -1
  19. package/lib/chevre/repo/creativeWork.d.ts +2 -3
  20. package/lib/chevre/repo/credentials.d.ts +2 -1
  21. package/lib/chevre/repo/customerType.d.ts +2 -3
  22. package/lib/chevre/repo/event.d.ts +10 -11
  23. package/lib/chevre/repo/eventOffer.d.ts +4 -5
  24. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
  25. package/lib/chevre/repo/eventSeries.d.ts +4 -5
  26. package/lib/chevre/repo/message.d.ts +1 -1
  27. package/lib/chevre/repo/message.js +1 -1
  28. package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +13 -0
  29. package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
  30. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  31. package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
  32. package/lib/chevre/repo/mongoose/schemas/scheduledTasks.d.ts +16 -0
  33. package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
  34. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
  35. package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
  36. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  37. package/lib/chevre/repo/note.d.ts +3 -4
  38. package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
  39. package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
  40. package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
  41. package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
  42. package/lib/chevre/repo/offerCatalog.d.ts +2 -3
  43. package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
  44. package/lib/chevre/repo/order.d.ts +2 -0
  45. package/lib/chevre/repo/order.js +14 -14
  46. package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
  47. package/lib/chevre/repo/orderInTransaction.js +181 -3
  48. package/lib/chevre/repo/passport.d.ts +2 -1
  49. package/lib/chevre/repo/person.d.ts +0 -15
  50. package/lib/chevre/repo/person.js +122 -108
  51. package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
  52. package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
  53. package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
  54. package/lib/chevre/repo/place/seat.d.ts +4 -5
  55. package/lib/chevre/repo/place/section.d.ts +3 -4
  56. package/lib/chevre/repo/priceSpecification.d.ts +4 -4
  57. package/lib/chevre/repo/product.d.ts +3 -4
  58. package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
  59. package/lib/chevre/repo/rateLimit/offer.js +0 -12
  60. package/lib/chevre/repo/reservation.d.ts +2 -3
  61. package/lib/chevre/repo/scheduledTask.d.ts +90 -0
  62. package/lib/chevre/repo/scheduledTask.js +223 -0
  63. package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
  64. package/lib/chevre/repo/stockHolder.d.ts +1 -1
  65. package/lib/chevre/repo/stockHolder.js +0 -146
  66. package/lib/chevre/repo/task.d.ts +30 -71
  67. package/lib/chevre/repo/task.js +59 -345
  68. package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
  69. package/lib/chevre/repo/transaction/placeOrder.js +43 -83
  70. package/lib/chevre/repo/transaction.d.ts +2 -2
  71. package/lib/chevre/repo/transactionNumberCounter.js +0 -34
  72. package/lib/chevre/repo/transactionProcess.d.ts +2 -1
  73. package/lib/chevre/repo/transactionProcess.js +0 -13
  74. package/lib/chevre/repository.d.ts +25 -0
  75. package/lib/chevre/repository.js +57 -2
  76. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
  77. package/lib/chevre/service/aggregation/system.d.ts +2 -2
  78. package/lib/chevre/service/aggregation/system.js +1 -1
  79. package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
  80. package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -1
  81. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  82. package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
  83. package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
  84. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  85. package/lib/chevre/service/assetTransaction/refund.js +1 -1
  86. package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
  87. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
  88. package/lib/chevre/service/asyncAction.d.ts +16 -0
  89. package/lib/chevre/service/asyncAction.js +36 -0
  90. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
  91. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
  92. package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
  93. package/lib/chevre/service/asyncActionHandler.js +89 -0
  94. package/lib/chevre/service/notification/factory.d.ts +2 -4
  95. package/lib/chevre/service/notification/factory.js +26 -24
  96. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +12 -6
  97. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
  98. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
  99. package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
  100. package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
  101. package/lib/chevre/service/offer/event/authorize.js +2 -2
  102. package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
  103. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
  104. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
  105. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
  106. package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
  107. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
  108. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
  109. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
  110. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
  111. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
  112. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +20 -9
  113. package/lib/chevre/service/offer/onEventChanged.js +2 -2
  114. package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
  115. package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
  116. package/lib/chevre/service/order/deleteOrder.js +8 -1
  117. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
  118. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
  119. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
  120. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
  121. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
  122. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
  123. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  124. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
  125. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
  126. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  127. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
  128. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
  129. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
  130. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
  131. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
  132. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
  133. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
  134. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
  135. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
  136. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  137. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
  138. package/lib/chevre/service/order/onOrderUpdated.js +1 -1
  139. package/lib/chevre/service/order/payOrder.d.ts +2 -0
  140. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
  141. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
  142. package/lib/chevre/service/order/placeOrder/factory.js +3 -21
  143. package/lib/chevre/service/order/placeOrder.d.ts +4 -5
  144. package/lib/chevre/service/order/placeOrder.js +20 -31
  145. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
  146. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
  147. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
  148. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
  149. package/lib/chevre/service/payment/any/authorize.js +7 -5
  150. package/lib/chevre/service/payment/any/factory.d.ts +7 -7
  151. package/lib/chevre/service/payment/any/factory.js +18 -21
  152. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
  153. package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
  154. package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
  155. package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
  156. package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
  157. package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
  158. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
  159. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
  160. package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
  161. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
  162. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
  163. package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
  164. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
  165. package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
  166. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  167. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
  168. package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
  169. package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
  170. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -1
  171. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
  172. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
  173. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
  174. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
  175. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
  176. package/lib/chevre/service/reserve/searchByOrder.js +2 -6
  177. package/lib/chevre/service/reserve.d.ts +2 -2
  178. package/lib/chevre/service/reserve.js +3 -3
  179. package/lib/chevre/service/scheduledTask.d.ts +11 -0
  180. package/lib/chevre/service/scheduledTask.js +40 -0
  181. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
  182. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
  183. package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
  184. package/lib/chevre/service/scheduledTaskHandler.js +66 -0
  185. package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
  186. package/lib/chevre/service/task/aggregateOffers.js +2 -1
  187. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
  188. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
  189. package/lib/chevre/service/task/authorizePayment.js +3 -1
  190. package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
  191. package/lib/chevre/service/task/cancelReservation.js +2 -1
  192. package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
  193. package/lib/chevre/service/task/confirmReserveTransaction.js +3 -8
  194. package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
  195. package/lib/chevre/service/task/deleteTransaction.js +2 -1
  196. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
  197. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
  198. package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
  199. package/lib/chevre/service/task/onEventChanged.js +2 -1
  200. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
  201. package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
  202. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -2
  203. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
  204. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
  205. package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
  206. package/lib/chevre/service/task/onResourceUpdated.js +10 -9
  207. package/lib/chevre/service/task/placeOrder.d.ts +2 -2
  208. package/lib/chevre/service/task/placeOrder.js +6 -3
  209. package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
  210. package/lib/chevre/service/task/refund.d.ts +2 -2
  211. package/lib/chevre/service/task/refund.js +4 -10
  212. package/lib/chevre/service/task/reserve.d.ts +2 -2
  213. package/lib/chevre/service/task/reserve.js +2 -1
  214. package/lib/chevre/service/task/returnOrder.d.ts +2 -2
  215. package/lib/chevre/service/task/returnOrder.js +2 -1
  216. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  217. package/lib/chevre/service/task/sendOrder.d.ts +2 -2
  218. package/lib/chevre/service/task/sendOrder.js +2 -1
  219. package/lib/chevre/service/task/voidPayTransaction.js +3 -7
  220. package/lib/chevre/service/task/voidPayment.d.ts +2 -2
  221. package/lib/chevre/service/task/voidPayment.js +2 -1
  222. package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
  223. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -1
  224. package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
  225. package/lib/chevre/service/taskHandler.d.ts +2 -2
  226. package/lib/chevre/service/taskHandler.js +36 -37
  227. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
  228. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
  229. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
  230. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
  231. package/lib/chevre/service/transaction/deleteTransaction.d.ts +1 -1
  232. package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
  233. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
  234. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
  235. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
  236. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
  237. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +32 -4
  238. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
  239. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
  240. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
  241. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
  242. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
  243. package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
  244. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  245. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  246. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
  247. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
  248. package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
  249. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
  250. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
  251. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
  252. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
  253. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  254. package/lib/chevre/service/transaction/returnOrder.js +1 -1
  255. package/lib/chevre/service.d.ts +8 -0
  256. package/lib/chevre/service.js +23 -1
  257. package/lib/chevre/taskSettings.d.ts +3 -4
  258. package/package.json +8 -11
  259. package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
  260. package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
  261. package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
  262. package/lib/chevre/service/reserve/findReservations.js +0 -61
@@ -80,16 +80,16 @@ function createReserveTransactionStartParams(params) {
80
80
  .toDate() // 余裕を持って
81
81
  };
82
82
  }
83
- function createAuthorizeSeatReservationActionAttributes(params, options) {
84
- const { useLegacyAuthorizeOfferObject } = options;
85
- const { event, transaction } = params;
86
- const authorizeObjectEvent = {
87
- id: event.id,
88
- typeOf: factory_1.factory.eventType.ScreeningEvent // fix(2024-07-17~)
89
- };
83
+ function createAuthorizeSeatReservationActionAttributes(params) {
84
+ // const { useLegacyAuthorizeOfferObject } = options;
85
+ const { transaction } = params;
86
+ // const authorizeObjectEvent: factory.action.authorize.offer.eventService.IEventInObject = {
87
+ // id: event.id,
88
+ // typeOf: factory.eventType.ScreeningEvent // fix(2024-07-17~)
89
+ // };
90
90
  const object = {
91
91
  typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
92
- ...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
92
+ // ...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
93
93
  };
94
94
  const instrument = {
95
95
  typeOf: factory_1.factory.assetTransactionType.Reserve, // 変更(2024-03-08~)
@@ -144,82 +144,100 @@ function acceptedOffers2amount(params) {
144
144
  });
145
145
  return amount;
146
146
  }
147
- function acceptedOffers2programMembershipUsed(params) {
148
- const programMembershipUsed = [];
149
- const permitIdentifiers = [];
150
- params.acceptedOffers.forEach(({ itemOffered }) => {
151
- if (itemOffered.programMembershipUsed?.typeOf === factory_1.factory.programMembership.ProgramMembershipType.ProgramMembership) {
152
- // メンバーシップコードに対してユニークに集計
153
- if (!permitIdentifiers.includes(itemOffered.programMembershipUsed.identifier)) {
154
- permitIdentifiers.push(itemOffered.programMembershipUsed.identifier);
155
- const issuedThroughTypeOf = itemOffered.programMembershipUsed.issuedThrough.typeOf;
156
- if (issuedThroughTypeOf === factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace) {
157
- programMembershipUsed.push({
158
- typeOf: factory_1.factory.permit.PermitType.Permit,
159
- identifier: itemOffered.programMembershipUsed.identifier,
160
- issuedThrough: { typeOf: issuedThroughTypeOf }
161
- });
162
- }
163
- else {
164
- programMembershipUsed.push({
165
- typeOf: factory_1.factory.permit.PermitType.Permit,
166
- identifier: itemOffered.programMembershipUsed.identifier,
167
- issuedThrough: { typeOf: issuedThroughTypeOf, id: itemOffered.programMembershipUsed.issuedThrough.id }
168
- });
169
- }
170
- }
171
- }
172
- });
173
- return programMembershipUsed;
174
- }
147
+ // function acceptedOffers2programMembershipUsed(params: {
148
+ // acceptedOffers: IResultAcceptedOffer[];
149
+ // }): factory.action.authorize.offer.eventService.IAggregateProgramMembershipUsed {
150
+ // const programMembershipUsed: factory.action.authorize.offer.eventService.IAggregateProgramMembershipUsed = [];
151
+ // const permitIdentifiers: string[] = [];
152
+ // params.acceptedOffers.forEach(
153
+ // ({ itemOffered }) => {
154
+ // if (itemOffered.programMembershipUsed?.typeOf === factory.programMembership.ProgramMembershipType.ProgramMembership) {
155
+ // // メンバーシップコードに対してユニークに集計
156
+ // if (!permitIdentifiers.includes(itemOffered.programMembershipUsed.identifier)) {
157
+ // permitIdentifiers.push(itemOffered.programMembershipUsed.identifier);
158
+ // const issuedThroughTypeOf = itemOffered.programMembershipUsed.issuedThrough.typeOf;
159
+ // if (issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.FaceToFace) {
160
+ // programMembershipUsed.push({
161
+ // typeOf: factory.permit.PermitType.Permit,
162
+ // identifier: itemOffered.programMembershipUsed.identifier,
163
+ // issuedThrough: { typeOf: issuedThroughTypeOf }
164
+ // });
165
+ // } else {
166
+ // programMembershipUsed.push({
167
+ // typeOf: factory.permit.PermitType.Permit,
168
+ // identifier: itemOffered.programMembershipUsed.identifier,
169
+ // issuedThrough: { typeOf: issuedThroughTypeOf, id: itemOffered.programMembershipUsed.issuedThrough.id }
170
+ // });
171
+ // }
172
+ // }
173
+ // }
174
+ // }
175
+ // );
176
+ // return programMembershipUsed;
177
+ // }
175
178
  function acceptedOffers2authorizeResult(params) {
176
- const { acceptedOffers4result, noOfferSpecified, ticketOffers } = params;
177
- // const priceCurrency = factory.priceCurrency.JPY; // fix(2024-07-03~)
178
- let offers;
179
+ const { acceptedOffers4result, noOfferSpecified,
180
+ // ticketOffers
181
+ } = params;
182
+ // let offers: factory.action.authorize.offer.eventService.IAcceptedOfferInResult[] | undefined;
179
183
  let price;
180
- let programMembershipUsed = [];
184
+ // let programMembershipUsed: factory.action.authorize.offer.eventService.IAggregateProgramMembershipUsed = [];
181
185
  if (!noOfferSpecified) {
182
186
  price = acceptedOffers2amount({ acceptedOffers: acceptedOffers4result }); // オファー指定の場合のみ金額計算(2023-11-27~)
183
- programMembershipUsed = acceptedOffers2programMembershipUsed({ acceptedOffers: acceptedOffers4result });
187
+ // programMembershipUsed = acceptedOffers2programMembershipUsed({ acceptedOffers: acceptedOffers4result });
184
188
  // オファーIDごとに集計
185
- const offerIds = [...new Set(acceptedOffers4result.map((o) => String(o.id)))];
186
- // const offerIds = [...new Set(acceptedOffers.map((o) => o.id))];
187
- offers = offerIds.map((offerId) => {
188
- const acceptedOffer = ticketOffers.find(({ id }) => id === offerId);
189
- if (acceptedOffer === undefined) {
190
- throw new factory_1.factory.errors.Internal(`acceptedOffer not found [id:${offerId}]`);
191
- }
192
- const amountOfThisGood = acceptedOffers4result.filter(({ id }) => id === offerId).length;
193
- // const amountOfThisGood: number = acceptedOffers.filter(({ id }) => id === offerId).length;
194
- const { acceptedPaymentMethod, priceSpecification } = acceptedOffer;
195
- const unitPriceSpec = priceSpecification.priceComponent.find((spec) => spec.typeOf === factory_1.factory.priceSpecificationType.UnitPriceSpecification
196
- && (!Array.isArray(spec.appliesToAddOn)) // アドオン単価ではない
197
- );
198
- if (unitPriceSpec === undefined) {
199
- throw new factory_1.factory.errors.Internal(`unitPriceSpec not found [id:${offerId}]`);
200
- }
201
- const { eligibleQuantity } = unitPriceSpec;
202
- return {
203
- id: offerId,
204
- includesObject: { amountOfThisGood },
205
- typeOf: factory_1.factory.offerType.Offer,
206
- priceSpecification: {
207
- ...(eligibleQuantity !== undefined) ? { eligibleQuantity } : undefined,
208
- // ...(eligibleTransactionVolume !== undefined) ? { eligibleTransactionVolume } : undefined // discontinue(2026-07-05~)
209
- },
210
- ...(acceptedPaymentMethod !== undefined) ? { acceptedPaymentMethod } : undefined
211
- };
212
- });
189
+ // const offerIds = [...new Set(acceptedOffers4result.map((o) => String(o.id)))];
190
+ // offers = offerIds.map<factory.action.authorize.offer.eventService.IAcceptedOfferInResult>((offerId) => {
191
+ // const acceptedOffer = ticketOffers.find(({ id }) => id === offerId);
192
+ // if (acceptedOffer === undefined) {
193
+ // throw new factory.errors.Internal(`acceptedOffer not found [id:${offerId}]`);
194
+ // }
195
+ // const amountOfThisGood: number = acceptedOffers4result.filter(({ id }) => id === offerId).length;
196
+ // // const amountOfThisGood: number = acceptedOffers.filter(({ id }) => id === offerId).length;
197
+ // const { acceptedPaymentMethod, priceSpecification } = acceptedOffer;
198
+ // const unitPriceSpec = priceSpecification.priceComponent.find(
199
+ // (spec) => spec.typeOf === factory.priceSpecificationType.UnitPriceSpecification
200
+ // && (!Array.isArray(spec.appliesToAddOn)) // アドオン単価ではない
201
+ // ) as IUnitPriceSpecification | undefined;
202
+ // if (unitPriceSpec === undefined) {
203
+ // throw new factory.errors.Internal(`unitPriceSpec not found [id:${offerId}]`);
204
+ // }
205
+ // const { eligibleQuantity } = unitPriceSpec;
206
+ // return {
207
+ // id: offerId,
208
+ // includesObject: { amountOfThisGood },
209
+ // typeOf: factory.offerType.Offer,
210
+ // priceSpecification: {
211
+ // ...(eligibleQuantity !== undefined) ? { eligibleQuantity } : undefined,
212
+ // // ...(eligibleTransactionVolume !== undefined) ? { eligibleTransactionVolume } : undefined // discontinue(2026-07-05~)
213
+ // },
214
+ // ...(acceptedPaymentMethod !== undefined) ? { acceptedPaymentMethod } : undefined
215
+ // };
216
+ // });
213
217
  }
218
+ // discontinue useLegacyAuthorizeOfferResult(2026-07-18~)
219
+ // if (useLegacyAuthorizeOfferResult) {
220
+ // return {
221
+ // typeOf: factory.offerType.AggregateOffer,
222
+ // // priceCurrency, // discontinue(2026-07-06~)
223
+ // // amount: [], // discontinue(2026-07-06~)
224
+ // itemOffered: {
225
+ // serviceOutput: { programMembershipUsed } // add programMembershipUsed required(2024-08-15~)
226
+ // },
227
+ // ...(typeof price === 'number') ? { price } : undefined,
228
+ // ...(Array.isArray(offers)) ? { offers } : undefined
229
+ // };
230
+ // } else {
231
+ // return {
232
+ // typeOf: factory.offerType.AggregateOffer,
233
+ // onlyPrice: true,
234
+ // ...(typeof price === 'number') ? { price } : undefined,
235
+ // };
236
+ // }
214
237
  return {
215
238
  typeOf: factory_1.factory.offerType.AggregateOffer,
216
- // priceCurrency, // discontinue(2026-07-06~)
217
- // amount: [], // discontinue(2026-07-06~)
218
- itemOffered: {
219
- serviceOutput: { programMembershipUsed } // add programMembershipUsed required(2024-08-15~)
220
- },
239
+ onlyPrice: true,
221
240
  ...(typeof price === 'number') ? { price } : undefined,
222
- ...(Array.isArray(offers)) ? { offers } : undefined
223
241
  };
224
242
  }
225
243
  function responseBody2acceptedOffers4result(params) {
@@ -63,10 +63,6 @@ interface IAuthorizeOptions {
63
63
  * 最大n日前から予約可能
64
64
  */
65
65
  maxReservationGracePeriodInDays: number;
66
- /**
67
- * 2026-07-04~
68
- */
69
- useLegacyAuthorizeOfferObject: boolean;
70
66
  }
71
67
  /**
72
68
  * 興行オファー承認
@@ -32,9 +32,9 @@ function authorize(params, options) {
32
32
  // まず取引番号発行
33
33
  const { transactionNumber } = await repos.transactionNumber.publishByTimestamp({ startDate: now });
34
34
  const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
35
- event, transaction,
35
+ transaction,
36
36
  instrument: { transactionNumber }
37
- }, options);
37
+ });
38
38
  const action = await repos.authorizeOfferAction.start(actionAttributes);
39
39
  try {
40
40
  const processStartReserveResult = await (0, processStartReserve4chevre_1.processStartReserve4chevre)({
@@ -36,7 +36,7 @@ interface IVoidTransactionRepos {
36
36
  * 興行オファー承認取消(タスクから実行 or apiから実行))
37
37
  * 取引中の承認アクション全てについて処理する or 特定の承認アクションについて処理する
38
38
  */
39
- declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidReserveTransaction> & {
39
+ declare function voidTransaction(params: factory.task.voidReserveTransaction.IData & {
40
40
  project: {
41
41
  id: string;
42
42
  };
@@ -36,7 +36,7 @@ interface IVoidTransactionByActionIdRepos {
36
36
  * 興行オファー承認取消(apiから実行)
37
37
  * 特定の承認アクションについて処理する
38
38
  */
39
- declare function voidTransactionByActionId(params: factory.task.IData<factory.taskName.VoidReserveTransaction> & {
39
+ declare function voidTransactionByActionId(params: factory.task.voidReserveTransaction.IData & {
40
40
  project: {
41
41
  id: string;
42
42
  };
@@ -8,14 +8,13 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
8
8
  acceptAction: {
9
9
  id: string;
10
10
  };
11
- event: {
12
- id: string;
13
- typeOf: factory.eventType.ScreeningEvent;
14
- };
15
11
  transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
16
- pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction;
17
- }, options: {
18
- useLegacyAuthorizeOfferObject: boolean;
12
+ /**
13
+ * 仮予約済のCOA予約取引
14
+ */
15
+ pendingTransaction: {
16
+ transactionNumber: string;
17
+ };
19
18
  }): factory.action.authorize.offer.eventService.IAttributes;
20
19
  /**
21
20
  * 供給情報から承認アクションの価格を導き出す
@@ -9,20 +9,20 @@ exports.responseBody2acceptedOffers4result = responseBody2acceptedOffers4result;
9
9
  const moment_1 = __importDefault(require("moment"));
10
10
  const util_1 = require("util");
11
11
  const factory_1 = require("../../../../factory");
12
- function createAuthorizeSeatReservationActionAttributes(params, options) {
13
- const { useLegacyAuthorizeOfferObject } = options;
12
+ function createAuthorizeSeatReservationActionAttributes(params) {
13
+ // const { useLegacyAuthorizeOfferObject } = options;
14
14
  const transaction = params.transaction;
15
- const authorizeObjectEvent = {
16
- id: params.event.id,
17
- typeOf: params.event.typeOf
18
- };
15
+ // const authorizeObjectEvent: factory.action.authorize.offer.eventService.IEventInObject = {
16
+ // id: params.event.id,
17
+ // typeOf: params.event.typeOf
18
+ // };
19
19
  const authorizeObject = {
20
20
  typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
21
21
  id: params.acceptAction.id,
22
- ...((useLegacyAuthorizeOfferObject) && {
23
- event: authorizeObjectEvent,
24
- pendingTransaction: params.pendingTransaction
25
- })
22
+ // ...((useLegacyAuthorizeOfferObject) && {
23
+ // event: authorizeObjectEvent,
24
+ // pendingTransaction: params.pendingTransaction
25
+ // })
26
26
  };
27
27
  const instrument = {
28
28
  typeOf: factory_1.factory.assetTransactionType.COAReserveTransaction, // 変更(2024-03-08~)
@@ -310,7 +310,8 @@ function validateAcceptedOffers(params) {
310
310
  // 指定された単価オファーを検索
311
311
  // ticketCodeで検索(2023-03-22~)
312
312
  if (offerIdentifiers.length > 0) {
313
- availableUnitPriceOffers = await repos.offer.search({
313
+ // availableUnitPriceOffers = await repos.offer.search({
314
+ availableUnitPriceOffers = await repos.offer.findUnitPriceOffers({
314
315
  identifier: { $in: offerIdentifiers },
315
316
  project: { id: { $eq: params.project.id } }
316
317
  });
@@ -53,11 +53,6 @@ export declare function authorize(params: {
53
53
  requestBody: IRequestBody;
54
54
  responseBody: IResponseBody;
55
55
  };
56
- }, options: {
57
- /**
58
- * 2026-07-04~
59
- */
60
- useLegacyAuthorizeOfferObject: boolean;
61
56
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
62
57
  result: IAuthorizeOfferAction['result'];
63
58
  }>;
@@ -12,7 +12,7 @@ const factory_2 = require("../../../factory");
12
12
  /**
13
13
  * COA興行オファー承認
14
14
  */
15
- function authorize(params, options) {
15
+ function authorize(params) {
16
16
  return async (repos) => {
17
17
  const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
18
18
  typeOf: factory_2.factory.transactionType.PlaceOrder,
@@ -28,15 +28,18 @@ function authorize(params, options) {
28
28
  }
29
29
  let screeningEvent;
30
30
  let acceptedOffers;
31
+ // const pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction = {
32
+ // theaterCode: params.result.requestBody.theaterCode,
33
+ // dateJouei: params.result.requestBody.dateJouei,
34
+ // titleCode: params.result.requestBody.titleCode,
35
+ // titleBranchNum: params.result.requestBody.titleBranchNum,
36
+ // timeBegin: params.result.requestBody.timeBegin,
37
+ // tmpReserveNum: params.result.responseBody.tmpReserveNum,
38
+ // transactionNumber: params.result.responseBody.tmpReserveNum,
39
+ // typeOf: factory.assetTransactionType.COAReserveTransaction
40
+ // };
31
41
  const pendingTransaction = {
32
- theaterCode: params.result.requestBody.theaterCode,
33
- dateJouei: params.result.requestBody.dateJouei,
34
- titleCode: params.result.requestBody.titleCode,
35
- titleBranchNum: params.result.requestBody.titleBranchNum,
36
- timeBegin: params.result.requestBody.timeBegin,
37
- tmpReserveNum: params.result.responseBody.tmpReserveNum,
38
42
  transactionNumber: params.result.responseBody.tmpReserveNum,
39
- typeOf: factory_2.factory.assetTransactionType.COAReserveTransaction
40
43
  };
41
44
  try {
42
45
  screeningEvent = await repos.event.projectEventFieldsById({ id: params.object.event.id }, [
@@ -71,10 +74,10 @@ function authorize(params, options) {
71
74
  // アクション開始前に例外がthrowされてもCOA仮予約を取り消す機会をつくるためにFailedアクションを作成する(2023-09-12~)
72
75
  const failedActionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
73
76
  acceptAction: params.object.acceptAction,
74
- event: { id: params.object.event.id, typeOf: factory_2.factory.eventType.ScreeningEvent },
77
+ // event: { id: params.object.event.id, typeOf: factory.eventType.ScreeningEvent },
75
78
  transaction,
76
79
  pendingTransaction
77
- }, options);
80
+ });
78
81
  const failedAction = await repos.action.start(failedActionAttributes);
79
82
  await repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
80
83
  throw error;
@@ -88,10 +91,10 @@ function authorize(params, options) {
88
91
  // 承認アクションを開始
89
92
  const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
90
93
  acceptAction: params.object.acceptAction,
91
- event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
94
+ // event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
92
95
  transaction,
93
96
  pendingTransaction
94
- }, options);
97
+ });
95
98
  const action = await repos.action.start(actionAttributes);
96
99
  try {
97
100
  // 座席仮予約からオファー情報を生成する
@@ -26,11 +26,6 @@ export declare function authorizeByAcceptAction(params: {
26
26
  */
27
27
  id: string;
28
28
  };
29
- }, options: {
30
- /**
31
- * 2026-07-04~
32
- */
33
- useLegacyAuthorizeOfferObject: boolean;
34
29
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
35
30
  result: IAuthorizeOfferAction['result'];
36
31
  }>;
@@ -7,7 +7,7 @@ const factory_1 = require("../../../factory");
7
7
  /**
8
8
  * 採用アクションからCOA興行オファー承認
9
9
  */
10
- function authorizeByAcceptAction(params, options) {
10
+ function authorizeByAcceptAction(params) {
11
11
  return async (repos) => {
12
12
  const acceptAction = await repos.accpetCOAOfferAction.findCompletedById({
13
13
  project: { id: params.project.id },
@@ -57,7 +57,7 @@ function authorizeByAcceptAction(params, options) {
57
57
  store: { id: params.store.id },
58
58
  result: { requestBody, responseBody }
59
59
  };
60
- action = await (0, authorize_1.authorize)(authorizeParams, options)(repos);
60
+ action = await (0, authorize_1.authorize)(authorizeParams)(repos);
61
61
  }
62
62
  return action;
63
63
  };
@@ -1,5 +1,6 @@
1
1
  import { factory } from '../../../factory';
2
2
  import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
3
+ import type { AsyncActionRepo } from '../../../repo/asyncAction';
3
4
  import type { TaskRepo } from '../../../repo/task';
4
5
  interface IFindAcceptActionResult {
5
6
  /**
@@ -34,8 +35,11 @@ declare function findAcceptAction(params: {
34
35
  */
35
36
  id: string;
36
37
  };
38
+ }, options: {
39
+ useAsyncAction: boolean;
37
40
  }): (repos: {
38
41
  action: AcceptCOAOfferActionRepo;
42
+ asyncAction: AsyncActionRepo;
39
43
  task: TaskRepo;
40
44
  }) => Promise<IFindAcceptActionResult>;
41
45
  export { findAcceptAction };
@@ -2,16 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findAcceptAction = findAcceptAction;
4
4
  const factory_1 = require("../../../factory");
5
- function findAcceptAction(params) {
5
+ function findAcceptAction(params, options) {
6
6
  return async (repos) => {
7
- // タスク検索
8
- const task = (await repos.task.projectFields({
9
- limit: 1,
10
- page: 1,
11
- id: { $eq: params.sameAs.id },
12
- project: { id: { $eq: params.project.id } },
13
- name: factory_1.factory.taskName.AcceptCOAOffer
14
- }, ['status', 'executionResults'])).shift();
7
+ // 非同期アクションに対応(2026-07-27~)
8
+ const { useAsyncAction } = options;
9
+ let task;
10
+ if (useAsyncAction) {
11
+ // まず非同期アクションを参照
12
+ task = await repos.asyncAction.findAsyncActionById({
13
+ id: { $eq: params.sameAs.id },
14
+ project: { id: { $eq: params.project.id } },
15
+ name: factory_1.factory.taskName.AcceptCOAOffer
16
+ }, ['status', 'executionResults']);
17
+ }
18
+ // 非同期アクションが存在しなければタスクを参照
19
+ if (task === undefined) {
20
+ task = await repos.task.findTaskById({
21
+ id: { $eq: params.sameAs.id },
22
+ project: { id: { $eq: params.project.id } },
23
+ name: factory_1.factory.taskName.AcceptCOAOffer
24
+ }, ['status', 'executionResults']);
25
+ }
15
26
  if (task === undefined) {
16
27
  throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.AcceptCOAOffer);
17
28
  }
@@ -228,7 +228,7 @@ function createInformTasks(params, setting) {
228
228
  });
229
229
  });
230
230
  if (informTasks.length > 0) {
231
- await repos.task.saveMany(informTasks, { emitImmediately: true });
231
+ await repos.task.saveMany(informTasks);
232
232
  }
233
233
  }
234
234
  };
@@ -281,7 +281,7 @@ function createInform2aggTasks(params, setting) {
281
281
  };
282
282
  });
283
283
  if (informTasks.length > 0) {
284
- await repos.task.saveMany(informTasks, { emitImmediately: true });
284
+ await repos.task.saveMany(informTasks);
285
285
  }
286
286
  }
287
287
  }
@@ -122,7 +122,7 @@ function onConfirmed(params) {
122
122
  executionResults: [],
123
123
  data: onAssetTransactionStatusChangedTaskData
124
124
  };
125
- await repos.task.createOnAssetTransactionStatusChangedTaskIfNotExist(onAssetTransactionStatusChangedTask, { emitImmediately: true });
125
+ await repos.task.createOnAssetTransactionStatusChangedTaskIfNotExist(onAssetTransactionStatusChangedTask);
126
126
  }
127
127
  }
128
128
  };
@@ -1,5 +1,6 @@
1
1
  import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
2
2
  import type { AccountingReportRepo } from '../../repo/accountingReport';
3
+ import type { IDeleteActionResult, ActionRepo } from '../../repo/action';
3
4
  import type { NoteRepo } from '../../repo/note';
4
5
  import type { OrderRepo } from '../../repo/order';
5
6
  import type { ReservationRepo } from '../../repo/reservation';
@@ -17,8 +18,11 @@ declare function deleteOrder(params: {
17
18
  }): (repos: {
18
19
  acceptedOffer: AcceptedOfferRepo;
19
20
  accountingReport: AccountingReportRepo;
21
+ action: ActionRepo;
20
22
  note: NoteRepo;
21
23
  order: OrderRepo;
22
24
  reservation: ReservationRepo;
23
- }) => Promise<void>;
25
+ }) => Promise<{
26
+ deleteActionsResult: IDeleteActionResult[];
27
+ }>;
24
28
  export { deleteOrder };
@@ -12,6 +12,7 @@ function deleteOrder(params) {
12
12
  if (typeof params.object.identifier !== 'string' || params.object.identifier === '') {
13
13
  throw new factory_1.factory.errors.ArgumentNull('object.identifier');
14
14
  }
15
+ let deleteActionsResult = [];
15
16
  const orders = await repos.order.projectFields({
16
17
  limit: 1,
17
18
  page: 1,
@@ -21,7 +22,7 @@ function deleteOrder(params) {
21
22
  const order = orders.shift();
22
23
  if (order === undefined) {
23
24
  // すでに削除済
24
- return;
25
+ return { deleteActionsResult: [] };
25
26
  }
26
27
  if (typeof order.id !== 'string') {
27
28
  throw new factory_1.factory.errors.Internal(`order.id undefined. orderNumber: ${order.orderNumber}`);
@@ -43,8 +44,14 @@ function deleteOrder(params) {
43
44
  typeOf: factory_1.factory.order.OrderType.Order
44
45
  }
45
46
  });
47
+ // アクション削除(2026-07-10~)
48
+ deleteActionsResult = await repos.action.deleteActionsByOrderNumber({
49
+ orderNumber: order.orderNumber,
50
+ project: { id: order.project.id },
51
+ });
46
52
  // 注文削除
47
53
  await repos.order.deleteByOrderNumber({ orderNumber: order.orderNumber });
54
+ return { deleteActionsResult };
48
55
  };
49
56
  }
50
57
  function deleteReservationsByOrder(order) {
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.onPayTransactionCanceled = onPayTransactionCanceled;
4
- const findConfirmedPlaceOrder_1 = require("../findConfirmedPlaceOrder");
5
4
  const onOrderStatusChanged_1 = require("../onOrderStatusChanged");
6
5
  const factory_1 = require("../../../factory");
7
6
  function onPayTransactionCanceled(params) {
8
- return async (repos
9
- // settings: Settings
10
- ) => {
7
+ return async (repos) => {
11
8
  if (typeof params.useOnOrderStatusChanged !== 'boolean') {
12
9
  throw new factory_1.factory.errors.Argument('useOnOrderStatusChanged', 'must be boolean');
13
10
  }
14
- // 注文が存在すればキャンセル(2023-08-30~)
11
+ // 中止された決済取引に依存した注文ドキュメントがもし存在すればキャンセル(2023-08-30~)
15
12
  await cancelOrderIfExist({
16
13
  project: { id: params.project.id },
17
14
  paymentMethodId: params.object.transactionNumber,
@@ -32,14 +29,25 @@ function cancelOrderIfExist(params) {
32
29
  paymentMethodIds: [params.paymentMethodId]
33
30
  },
34
31
  project: { id: { $eq: params.project.id } }
35
- }, { inclusion: ['confirmationNumber', 'orderNumber'] });
32
+ }, { inclusion: ['orderNumber'] });
36
33
  const orderByPaymentMethodId = ordersByPaymentMethodId.shift();
37
34
  if (orderByPaymentMethodId !== undefined) {
38
- const placeOrderTransaction = await (0, findConfirmedPlaceOrder_1.findConfirmedPlaceOrder)({
39
- project: { id: params.project.id },
40
- confirmationNumber: orderByPaymentMethodId.confirmationNumber,
41
- orderNumber: orderByPaymentMethodId.orderNumber
42
- })(repos);
35
+ const placeOrderTransactions = await repos.placeOrder.findPlaceOrderTransactions({
36
+ limit: 1,
37
+ page: 1,
38
+ project: { id: { $eq: params.project.id } },
39
+ typeOf: factory_1.factory.transactionType.PlaceOrder,
40
+ statuses: [factory_1.factory.transactionStatusType.Confirmed],
41
+ // resultではなくobjectで参照するように変更(2026-06-16~)
42
+ object: {
43
+ orderNumber: { $eq: orderByPaymentMethodId.orderNumber },
44
+ },
45
+ inclusion: ['project', 'typeOf']
46
+ });
47
+ const placeOrderTransaction = placeOrderTransactions.shift();
48
+ if (placeOrderTransaction === undefined) {
49
+ throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
50
+ }
43
51
  const order = await repos.order.changeStatus({
44
52
  project: { id: params.project.id },
45
53
  orderNumber: orderByPaymentMethodId.orderNumber,
@@ -1,5 +1,6 @@
1
1
  import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
2
2
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
3
+ import type { MessageRepo } from '../../../repo/message';
3
4
  import type { OrderRepo } from '../../../repo/order';
4
5
  import type { SettingRepo } from '../../../repo/setting';
5
6
  import type { TaskRepo } from '../../../repo/task';
@@ -9,6 +10,7 @@ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/i
9
10
  interface IOnPayTransactionConfirmedRepos {
10
11
  acceptedOffer: AcceptedOfferRepo;
11
12
  assetTransaction: AssetTransactionRepo;
13
+ message: MessageRepo;
12
14
  order: OrderRepo;
13
15
  setting: SettingRepo;
14
16
  task: TaskRepo;