@chevre/domain 26.0.0-alpha.9 → 26.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/lib/chevre/eventEmitter/task.d.ts +8 -23
  2. package/lib/chevre/eventEmitter/task.js +2 -2
  3. package/lib/chevre/repo/acceptedOffer.d.ts +0 -7
  4. package/lib/chevre/repo/acceptedOffer.js +27 -27
  5. package/lib/chevre/repo/action/acceptCOAOffer.d.ts +11 -1
  6. package/lib/chevre/repo/action/acceptCOAOffer.js +25 -2
  7. package/lib/chevre/repo/action/acceptPay.d.ts +11 -1
  8. package/lib/chevre/repo/action/acceptPay.js +27 -6
  9. package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +111 -0
  10. package/lib/chevre/repo/action/anyAction/actionProcess.js +290 -0
  11. package/lib/chevre/repo/action/anyAction/actionRecipe.d.ts +37 -0
  12. package/lib/chevre/repo/action/anyAction/actionRecipe.js +53 -0
  13. package/lib/chevre/repo/action/authorizeInvoice.d.ts +5 -8
  14. package/lib/chevre/repo/action/authorizeInvoice.js +8 -5
  15. package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
  16. package/lib/chevre/repo/action/authorizeOffer.js +8 -7
  17. package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +11 -1
  18. package/lib/chevre/repo/action/authorizePaymentMethod.js +25 -5
  19. package/lib/chevre/repo/action/authorizeTicketedObject.d.ts +3 -1
  20. package/lib/chevre/repo/action/authorizeTicketedObject.js +7 -2
  21. package/lib/chevre/repo/action/cancel.d.ts +25 -0
  22. package/lib/chevre/repo/action/cancel.js +47 -0
  23. package/lib/chevre/repo/action/checkMovieTicket.d.ts +11 -1
  24. package/lib/chevre/repo/action/checkMovieTicket.js +25 -1
  25. package/lib/chevre/repo/action/confirm.d.ts +11 -0
  26. package/lib/chevre/repo/action/confirm.js +16 -0
  27. package/lib/chevre/repo/action/create.d.ts +10 -0
  28. package/lib/chevre/repo/action/create.js +17 -0
  29. package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.d.ts +46 -0
  30. package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.js +92 -0
  31. package/lib/chevre/repo/action/inform.d.ts +39 -0
  32. package/lib/chevre/repo/action/inform.js +115 -0
  33. package/lib/chevre/repo/action/order.d.ts +21 -0
  34. package/lib/chevre/repo/action/order.js +35 -0
  35. package/lib/chevre/repo/action/pay.d.ts +3 -1
  36. package/lib/chevre/repo/action/pay.js +8 -5
  37. package/lib/chevre/repo/action/refund.d.ts +3 -1
  38. package/lib/chevre/repo/action/refund.js +7 -4
  39. package/lib/chevre/repo/action/reserve.d.ts +21 -0
  40. package/lib/chevre/repo/action/reserve.js +37 -0
  41. package/lib/chevre/repo/action/returnAction.d.ts +11 -0
  42. package/lib/chevre/repo/action/returnAction.js +16 -0
  43. package/lib/chevre/repo/action/sendEmailMessage.d.ts +10 -0
  44. package/lib/chevre/repo/action/sendEmailMessage.js +17 -0
  45. package/lib/chevre/repo/action/sendOrder.d.ts +10 -0
  46. package/lib/chevre/repo/action/sendOrder.js +16 -0
  47. package/lib/chevre/repo/action/unknown2actionError.d.ts +6 -0
  48. package/lib/chevre/repo/action/unknown2actionError.js +15 -0
  49. package/lib/chevre/repo/action/update.d.ts +50 -0
  50. package/lib/chevre/repo/action/update.js +129 -0
  51. package/lib/chevre/repo/action/use.d.ts +40 -0
  52. package/lib/chevre/repo/action/use.js +122 -0
  53. package/lib/chevre/repo/{action.d.ts → adminAction.d.ts} +11 -37
  54. package/lib/chevre/repo/adminAction.js +202 -0
  55. package/lib/chevre/repo/adminAssetTransaction.d.ts +126 -0
  56. package/lib/chevre/repo/adminAssetTransaction.js +491 -0
  57. package/lib/chevre/repo/adminScheduledTask.d.ts +1 -1
  58. package/lib/chevre/repo/adminTask.d.ts +25 -8
  59. package/lib/chevre/repo/adminTask.js +31 -32
  60. package/lib/chevre/repo/adminTransaction.d.ts +131 -0
  61. package/lib/chevre/repo/adminTransaction.js +237 -0
  62. package/lib/chevre/repo/aggregateAction.d.ts +8 -11
  63. package/lib/chevre/repo/aggregateAction.js +0 -61
  64. package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
  65. package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
  66. package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
  67. package/lib/chevre/repo/aggregateTransaction.js +166 -0
  68. package/lib/chevre/repo/aggregateUseAction.d.ts +35 -0
  69. package/lib/chevre/repo/aggregateUseAction.js +164 -0
  70. package/lib/chevre/repo/aggregation.d.ts +0 -8
  71. package/lib/chevre/repo/aggregation.js +0 -10
  72. package/lib/chevre/repo/assetTransaction.d.ts +10 -235
  73. package/lib/chevre/repo/assetTransaction.js +48 -636
  74. package/lib/chevre/repo/authorization.d.ts +0 -6
  75. package/lib/chevre/repo/authorization.js +15 -27
  76. package/lib/chevre/repo/factory/action/createMongoConditions.d.ts +4 -0
  77. package/lib/chevre/repo/factory/action/createMongoConditions.js +335 -0
  78. package/lib/chevre/repo/message.d.ts +0 -7
  79. package/lib/chevre/repo/message.js +0 -38
  80. package/lib/chevre/repo/migrateAction.d.ts +48 -0
  81. package/lib/chevre/repo/migrateAction.js +32 -0
  82. package/lib/chevre/repo/mongoose/schemas/action/abstractAction.d.ts +5 -0
  83. package/lib/chevre/repo/mongoose/schemas/action/abstractAction.js +2 -0
  84. package/lib/chevre/repo/mongoose/schemas/action/inform.d.ts +11 -0
  85. package/lib/chevre/repo/mongoose/schemas/action/inform.js +82 -0
  86. package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
  87. package/lib/chevre/repo/mongoose/schemas/action/update.js +112 -0
  88. package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/use.d.ts} +4 -6
  89. package/lib/chevre/repo/mongoose/schemas/action/use.js +92 -0
  90. package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
  91. package/lib/chevre/repo/mongoose/schemas/action.js +22 -7
  92. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +1 -0
  93. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +19 -1
  94. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
  95. package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
  96. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
  97. package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
  98. package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
  99. package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
  100. package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
  101. package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
  102. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +5 -16
  103. package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
  104. package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
  105. package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
  106. package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
  107. package/lib/chevre/repo/orderInTransaction.js +30 -22
  108. package/lib/chevre/repo/scheduledTask.d.ts +4 -1
  109. package/lib/chevre/repo/scheduledTask.js +3 -25
  110. package/lib/chevre/repo/task.d.ts +44 -155
  111. package/lib/chevre/repo/task.js +13 -555
  112. package/lib/chevre/repo/taskDelayed.d.ts +74 -0
  113. package/lib/chevre/repo/taskDelayed.js +195 -0
  114. package/lib/chevre/repo/taskRunning.d.ts +35 -0
  115. package/lib/chevre/repo/taskRunning.js +89 -0
  116. package/lib/chevre/repo/ticket.d.ts +0 -6
  117. package/lib/chevre/repo/ticket.js +0 -11
  118. package/lib/chevre/repo/transaction.d.ts +1 -187
  119. package/lib/chevre/repo/transaction.js +2 -383
  120. package/lib/chevre/repository.d.ts +65 -25
  121. package/lib/chevre/repository.js +144 -56
  122. package/lib/chevre/service/aggregation/system.d.ts +9 -8
  123. package/lib/chevre/service/aggregation/system.js +5 -5
  124. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
  125. package/lib/chevre/service/assetTransaction/pay/check.d.ts +3 -1
  126. package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
  127. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -2
  128. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -2
  129. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -2
  130. package/lib/chevre/service/assetTransaction/refund.d.ts +0 -1
  131. package/lib/chevre/service/assetTransaction/refund.js +2 -2
  132. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +4 -2
  133. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +4 -2
  134. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +8 -4
  135. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -1
  136. package/lib/chevre/service/asyncAction.d.ts +2 -2
  137. package/lib/chevre/service/asyncAction.js +1 -4
  138. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
  139. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
  140. package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
  141. package/lib/chevre/service/asyncActionHandler.js +11 -13
  142. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
  143. package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
  144. package/lib/chevre/service/event.d.ts +4 -2
  145. package/lib/chevre/service/event.js +3 -3
  146. package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
  147. package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
  148. package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
  149. package/lib/chevre/service/notification/triggerWebhook.js +5 -16
  150. package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
  151. package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +0 -1
  152. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +4 -2
  153. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
  154. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +9 -5
  155. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +1 -1
  156. package/lib/chevre/service/offer/event/voidTransaction.d.ts +6 -4
  157. package/lib/chevre/service/offer/event/voidTransaction.js +7 -9
  158. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +6 -4
  159. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +3 -15
  160. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
  161. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  162. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
  163. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +23 -24
  164. package/lib/chevre/service/offer/onEventChanged.js +0 -2
  165. package/lib/chevre/service/order/confirmPayTransaction.d.ts +4 -10
  166. package/lib/chevre/service/order/confirmPayTransaction.js +7 -11
  167. package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
  168. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +2 -56
  169. package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
  170. package/lib/chevre/service/order/deleteOrder.js +1 -2
  171. package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
  172. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
  173. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
  174. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
  175. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
  176. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
  177. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -9
  178. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
  179. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -8
  180. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
  181. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -11
  182. package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
  183. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +4 -2
  184. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
  185. package/lib/chevre/service/order/placeOrder.d.ts +6 -4
  186. package/lib/chevre/service/order/placeOrder.js +9 -17
  187. package/lib/chevre/service/order/returnOrder.d.ts +4 -4
  188. package/lib/chevre/service/order/returnOrder.js +11 -43
  189. package/lib/chevre/service/order/sendOrder.d.ts +4 -6
  190. package/lib/chevre/service/order/sendOrder.js +30 -72
  191. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +0 -1
  192. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +0 -1
  193. package/lib/chevre/service/payment/any/authorize.d.ts +1 -2
  194. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
  195. package/lib/chevre/service/payment/any/findAcceptAction.js +23 -24
  196. package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
  197. package/lib/chevre/service/payment/any/findAuthorizeAction.js +23 -24
  198. package/lib/chevre/service/payment/any/findCheckAction.d.ts +3 -5
  199. package/lib/chevre/service/payment/any/findCheckAction.js +24 -25
  200. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +0 -1
  201. package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +0 -1
  202. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
  203. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +0 -1
  204. package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +0 -1
  205. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  206. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
  207. package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
  208. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +0 -1
  209. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +0 -1
  210. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +0 -1
  211. package/lib/chevre/service/payment/creditCard/authorize.d.ts +0 -1
  212. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +0 -1
  213. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +0 -1
  214. package/lib/chevre/service/payment/faceToFace.d.ts +0 -2
  215. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -2
  216. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -1
  217. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
  218. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +0 -1
  219. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +0 -1
  220. package/lib/chevre/service/payment/movieTicket/validation.d.ts +3 -1
  221. package/lib/chevre/service/payment/movieTicket/validation.js +2 -2
  222. package/lib/chevre/service/project.d.ts +0 -6
  223. package/lib/chevre/service/project.js +0 -2
  224. package/lib/chevre/service/reserve/cancelReservation.d.ts +7 -3
  225. package/lib/chevre/service/reserve/cancelReservation.js +15 -25
  226. package/lib/chevre/service/reserve/checkInReservation.d.ts +4 -2
  227. package/lib/chevre/service/reserve/checkInReservation.js +2 -2
  228. package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -2
  229. package/lib/chevre/service/reserve/confirmReservation.js +10 -36
  230. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
  231. package/lib/chevre/service/reserve/useReservation.d.ts +6 -2
  232. package/lib/chevre/service/reserve/useReservation.js +6 -24
  233. package/lib/chevre/service/reserveCOA/cancelReservation.d.ts +4 -2
  234. package/lib/chevre/service/reserveCOA/cancelReservation.js +3 -3
  235. package/lib/chevre/service/scheduledTask.d.ts +1 -4
  236. package/lib/chevre/service/scheduledTask.js +3 -10
  237. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
  238. package/lib/chevre/service/scheduledTaskHandler.js +0 -13
  239. package/lib/chevre/service/task/acceptCOAOffer.js +5 -19
  240. package/lib/chevre/service/task/authorizePayment.js +6 -13
  241. package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
  242. package/lib/chevre/service/task/cancelReservation.js +3 -5
  243. package/lib/chevre/service/task/checkMovieTicket.js +8 -13
  244. package/lib/chevre/service/task/checkResource.js +14 -57
  245. package/lib/chevre/service/task/confirmPayTransaction.js +11 -12
  246. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
  247. package/lib/chevre/service/task/confirmReserveTransaction.js +12 -7
  248. package/lib/chevre/service/task/createAccountingReport.js +8 -15
  249. package/lib/chevre/service/task/deleteTransaction.js +10 -41
  250. package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
  251. package/lib/chevre/service/task/invalidatePaymentUrl.js +0 -1
  252. package/lib/chevre/service/task/onAuthorizationCreated.js +4 -13
  253. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
  254. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
  255. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
  256. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
  257. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
  258. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
  259. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
  260. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
  261. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
  262. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
  263. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
  264. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
  265. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
  266. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
  267. package/lib/chevre/service/task/onResourceDeleted.js +4 -3
  268. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
  269. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
  270. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
  271. package/lib/chevre/service/task/onResourceUpdated.js +0 -10
  272. package/lib/chevre/service/task/pay.js +3 -3
  273. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
  274. package/lib/chevre/service/task/payment/payByTask.d.ts +3 -2
  275. package/lib/chevre/service/task/payment/payByTask.js +1 -1
  276. package/lib/chevre/service/task/payment/refundByTask.d.ts +0 -1
  277. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +0 -2
  278. package/lib/chevre/service/task/placeOrder.js +8 -6
  279. package/lib/chevre/service/task/publishPaymentUrl.js +6 -18
  280. package/lib/chevre/service/task/refund.js +0 -1
  281. package/lib/chevre/service/task/reserve.js +3 -6
  282. package/lib/chevre/service/task/returnOrder.js +3 -7
  283. package/lib/chevre/service/task/returnPayTransaction.js +9 -19
  284. package/lib/chevre/service/task/returnReserveTransaction.js +5 -6
  285. package/lib/chevre/service/task/sendEmailMessage.js +2 -2
  286. package/lib/chevre/service/task/sendOrder.js +4 -8
  287. package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
  288. package/lib/chevre/service/task/triggerWebhook.js +4 -2
  289. package/lib/chevre/service/task/useReservation.js +6 -2
  290. package/lib/chevre/service/task/voidPayment.js +0 -2
  291. package/lib/chevre/service/task/voidReserveTransaction.js +11 -13
  292. package/lib/chevre/service/task.d.ts +4 -4
  293. package/lib/chevre/service/task.js +8 -12
  294. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
  295. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
  296. package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
  297. package/lib/chevre/service/taskHandler.d.ts +1 -2
  298. package/lib/chevre/service/taskHandler.js +7 -19
  299. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
  300. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
  301. package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -4
  302. package/lib/chevre/service/transaction/deleteTransaction.js +7 -7
  303. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
  304. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  305. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +11 -17
  306. package/lib/chevre/service/transaction/returnOrder.js +11 -17
  307. package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
  308. package/lib/chevre/service/validation/validateOrder.js +3 -3
  309. package/lib/chevre/taskSettings.d.ts +4 -4
  310. package/package.json +2 -2
  311. package/lib/chevre/repo/action/actionProcess.d.ts +0 -147
  312. package/lib/chevre/repo/action/actionProcess.js +0 -775
  313. package/lib/chevre/repo/action/checkThing.d.ts +0 -8
  314. package/lib/chevre/repo/action/checkThing.js +0 -13
  315. package/lib/chevre/repo/action.js +0 -468
  316. package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
  317. package/lib/chevre/repo/asyncActionLegacy.js +0 -59
  318. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
  319. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
  320. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
  321. package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
  322. package/lib/chevre/repo/ownershipInfo.js +0 -466
  323. package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -39
  324. package/lib/chevre/repo/scheduledTaskLegacy.js +0 -96
  325. package/lib/chevre/repo/scheduledTaskMigration.d.ts +0 -21
  326. package/lib/chevre/repo/scheduledTaskMigration.js +0 -70
  327. package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
  328. package/lib/chevre/service/validation/validateEvent.js +0 -21
@@ -15,8 +15,8 @@ function deleteResourcesByRoom(params) {
15
15
  project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
16
16
  typeOf: factory_1.factory.actionType.DeleteAction
17
17
  };
18
- let deleteResult; // eslint-disable-line @typescript-eslint/no-explicit-any
19
- const action = await repos.action.start(deleteActionAttributes);
18
+ let deleteResult;
19
+ const action = await repos.actions.update.startUpdateAction(deleteActionAttributes);
20
20
  try {
21
21
  // イベント削除
22
22
  const deleteScreeningEventResult = await repos.event.deleteManyEventsByScreeningRoom({
@@ -30,13 +30,13 @@ function deleteResourcesByRoom(params) {
30
30
  }
31
31
  catch (error) {
32
32
  try {
33
- await repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
33
+ await repos.actions.update.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
34
34
  }
35
35
  catch (_) {
36
36
  // no op
37
37
  }
38
38
  throw error;
39
39
  }
40
- await repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
40
+ await repos.actions.update.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
41
41
  };
42
42
  }
@@ -1,4 +1,4 @@
1
- import type { ActionRepo } from '../../../repo/action';
1
+ import type { UpdateActionRepo } from '../../../repo/action/update';
2
2
  import type { EventRepo } from '../../../repo/event';
3
3
  import type { EventOfferRepo } from '../../../repo/eventOffer';
4
4
  import type { EventSeriesRepo } from '../../../repo/eventSeries';
@@ -12,7 +12,9 @@ export declare function deleteResourcesBySeller(params: {
12
12
  };
13
13
  ids: string[];
14
14
  }): (repos: {
15
- action: ActionRepo;
15
+ actions: {
16
+ update: UpdateActionRepo;
17
+ };
16
18
  event: EventRepo;
17
19
  eventOffer: EventOfferRepo;
18
20
  eventSeries: EventSeriesRepo;
@@ -14,8 +14,8 @@ function deleteResourcesBySeller(params) {
14
14
  project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
15
15
  typeOf: factory_1.factory.actionType.DeleteAction
16
16
  };
17
- let deleteResult; // eslint-disable-line @typescript-eslint/no-explicit-any
18
- const action = await repos.action.start(deleteActionAttributes);
17
+ let deleteResult;
18
+ const action = await repos.actions.update.startUpdateAction(deleteActionAttributes);
19
19
  try {
20
20
  // メンバー削除
21
21
  const deleteMemberResult = await repos.member.deleteManyByMemberOfId({
@@ -65,14 +65,14 @@ function deleteResourcesBySeller(params) {
65
65
  }
66
66
  catch (error) {
67
67
  try {
68
- await repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
68
+ await repos.actions.update.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
69
69
  }
70
70
  catch (_) {
71
71
  // no op
72
72
  }
73
73
  throw error;
74
74
  }
75
- await repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
75
+ await repos.actions.update.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
76
76
  }
77
77
  };
78
78
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
- const action_1 = require("../../repo/action");
5
+ const update_1 = require("../../repo/action/update");
6
6
  const aggregateOffer_1 = require("../../repo/aggregateOffer");
7
7
  const categoryCode_1 = require("../../repo/categoryCode");
8
8
  const event_1 = require("../../repo/event");
@@ -27,7 +27,6 @@ const deleteResourcesByProduct_1 = require("./onResourceDeleted/deleteResourcesB
27
27
  const deleteResourcesByRoom_1 = require("./onResourceDeleted/deleteResourcesByRoom");
28
28
  const deleteResourcesBySeller_1 = require("./onResourceDeleted/deleteResourcesBySeller");
29
29
  const onHasPOSUpdated_1 = require("./onResourceUpdated/onHasPOSUpdated");
30
- // import { syncCategoryCode } from './onResourceUpdated/syncCategoryCode';
31
30
  const syncOfferCatalog_1 = require("./onResourceUpdated/syncOfferCatalog");
32
31
  /**
33
32
  * タスク実行関数
@@ -35,7 +34,9 @@ const syncOfferCatalog_1 = require("./onResourceUpdated/syncOfferCatalog");
35
34
  function call(params) {
36
35
  return async ({ connection }) => {
37
36
  await onResourceDeleted(params.data)({
38
- action: new action_1.ActionRepo(connection),
37
+ actions: {
38
+ update: new update_1.UpdateActionRepo(connection),
39
+ },
39
40
  aggregateOffer: new aggregateOffer_1.AggregateOfferRepo(connection),
40
41
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
41
42
  event: new event_1.EventRepo(connection),
@@ -26,7 +26,6 @@ function createInformOfferTasks(params, setting) {
26
26
  const informActionAttributes = {
27
27
  object: offer4inform,
28
28
  recipient: {
29
- id: '',
30
29
  name: String(informResource.recipient?.name),
31
30
  typeOf: factory_1.factory.creativeWorkType.WebApplication
32
31
  // url: informUrl // discontinue(2025-02-13~)
@@ -44,7 +44,6 @@ function createInformHasPOSTasks(params) {
44
44
  const informActionAttributes = {
45
45
  object: movieTheater4inform,
46
46
  recipient: {
47
- id: '',
48
47
  name: String(informResource.recipient?.name),
49
48
  typeOf: factory_1.factory.creativeWorkType.WebApplication
50
49
  // url: informUrl // discontinue(2025-02-13~)
@@ -32,7 +32,6 @@ function createInformOfferCatalogTasks(params, setting) {
32
32
  const informActionAttributes = {
33
33
  object: offerCatalog4inform,
34
34
  recipient: {
35
- id: '',
36
35
  name: String(informResource.recipient?.name),
37
36
  typeOf: factory_1.factory.creativeWorkType.WebApplication
38
37
  // url: informUrl // discontinue(2025-02-13~)
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
5
  const accountTitle_1 = require("../../repo/accountTitle");
6
- const action_1 = require("../../repo/action");
7
6
  const aggregateOffer_1 = require("../../repo/aggregateOffer");
8
7
  const categoryCode_1 = require("../../repo/categoryCode");
9
8
  const creativeWork_1 = require("../../repo/creativeWork");
@@ -34,7 +33,6 @@ function call(params) {
34
33
  const { data } = params;
35
34
  await onResourceUpdated(data)({
36
35
  accountTitle: new accountTitle_1.AccountTitleRepo(connection),
37
- action: new action_1.ActionRepo(connection),
38
36
  aggregateOffer: new aggregateOffer_1.AggregateOfferRepo(connection),
39
37
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
40
38
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
@@ -198,7 +196,6 @@ function createInformNoteTasks(params, setting) {
198
196
  const informActionAttributes = {
199
197
  object: informObject,
200
198
  recipient: {
201
- id: '',
202
199
  name: String(informResource.recipient?.name),
203
200
  typeOf: factory_1.factory.creativeWorkType.WebApplication
204
201
  // url: informUrl // discontinue(2025-02-13~)
@@ -247,7 +244,6 @@ function createInformMovieTasks(params, setting) {
247
244
  const informActionAttributes = {
248
245
  object: movie4inform,
249
246
  recipient: {
250
- id: '',
251
247
  name: String(informResource.recipient?.name),
252
248
  typeOf: factory_1.factory.creativeWorkType.WebApplication
253
249
  // url: informUrl // discontinue(2025-02-13~)
@@ -298,7 +294,6 @@ function createInformProductTasks(params, setting) {
298
294
  const informActionAttributes = {
299
295
  object: product4inform,
300
296
  recipient: {
301
- id: '',
302
297
  name: String(informResource.recipient?.name),
303
298
  typeOf: factory_1.factory.creativeWorkType.WebApplication
304
299
  // url: informUrl // discontinue(2025-02-13~)
@@ -347,7 +342,6 @@ function createInformCategoryCodeTasks(params, setting) {
347
342
  const informActionAttributes = {
348
343
  object: categoryCode4inform,
349
344
  recipient: {
350
- id: '',
351
345
  name: String(informResource.recipient?.name),
352
346
  typeOf: factory_1.factory.creativeWorkType.WebApplication
353
347
  // url: informUrl // discontinue(2025-02-13~)
@@ -446,7 +440,6 @@ function createInformMovieTheaterTasks(params, setting) {
446
440
  const informActionAttributes = {
447
441
  object: movieTheater4inform,
448
442
  recipient: {
449
- id: '',
450
443
  name: String(informResource.recipient?.name),
451
444
  typeOf: factory_1.factory.creativeWorkType.WebApplication
452
445
  // url: informUrl // discontinue(2025-02-13~)
@@ -509,7 +502,6 @@ function createInformRoomTasks(params, setting) {
509
502
  const informActionAttributes = {
510
503
  object: room4inform,
511
504
  recipient: {
512
- id: '',
513
505
  name: String(informResource.recipient?.name),
514
506
  typeOf: factory_1.factory.creativeWorkType.WebApplication
515
507
  },
@@ -567,7 +559,6 @@ function createInformEntranceGateTasks(params, setting) {
567
559
  const informActionAttributes = {
568
560
  object: entranceGateAsNotification,
569
561
  recipient: {
570
- id: '',
571
562
  name: String(informResource.recipient?.name),
572
563
  typeOf: factory_1.factory.creativeWorkType.WebApplication
573
564
  },
@@ -639,7 +630,6 @@ function createInformAccountTitleTasks(params, setting) {
639
630
  const informActionAttributes = {
640
631
  object: informObject,
641
632
  recipient: {
642
- id: '',
643
633
  name: String(informResource.recipient?.name),
644
634
  typeOf: factory_1.factory.creativeWorkType.WebApplication
645
635
  // url: informUrl // discontinue(2025-02-13~)
@@ -4,7 +4,6 @@ exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
5
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
6
6
  const accountingReport_1 = require("../../repo/accountingReport");
7
- // import { ActionRepo } from '../../repo/action';
8
7
  const pay_1 = require("../../repo/action/pay");
9
8
  const refund_1 = require("../../repo/action/refund");
10
9
  const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
@@ -33,8 +32,9 @@ function call(params) {
33
32
  ...params.data,
34
33
  sameAs: { id: params.id, typeOf: 'Task' } // タスクIDを関連付け(2024-04-20~)
35
34
  })({
36
- // action: new ActionRepo(connection),
37
- checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
35
+ actions: {
36
+ checkMovieTicket: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
37
+ },
38
38
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
39
39
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
40
40
  order: new order_1.OrderRepo(connection)
@@ -10,7 +10,6 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
10
10
  import type { TaskRepo } from '../../../repo/task';
11
11
  type IInvalidatePaymentUrlOperation<T> = (repos: {
12
12
  accountingReport: AccountingReportRepo;
13
- action?: never;
14
13
  actions: {
15
14
  pay: PayActionRepo;
16
15
  refund: RefundActionRepo;
@@ -16,7 +16,9 @@ import type { TaskRepo } from '../../../repo/task';
16
16
  import { factory } from '../../../factory';
17
17
  import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
18
18
  interface IPayTask2payActionAttributesRepos {
19
- checkMovieTicketAction: CheckMovieTicketActionRepo;
19
+ actions: {
20
+ checkMovieTicket: CheckMovieTicketActionRepo;
21
+ };
20
22
  acceptedOffer: AcceptedOfferRepo;
21
23
  assetTransaction: AssetTransactionRepo;
22
24
  order: OrderRepo;
@@ -32,7 +34,6 @@ declare function payTask2payActionAttributes(params: factory.task.pay.IData & {
32
34
  }): (repos: IPayTask2payActionAttributesRepos) => Promise<factory.action.trade.pay.IAttributes>;
33
35
  interface IPayByTaskRepos {
34
36
  acceptedOffer: AcceptedOfferRepo;
35
- action?: never;
36
37
  actions: {
37
38
  pay: PayActionRepo;
38
39
  refund: RefundActionRepo;
@@ -133,7 +133,7 @@ function payTask2payActionAttributes(params) {
133
133
  let checkResult;
134
134
  const checkedActionId = transaction.object.checkedAction?.id;
135
135
  if (typeof checkedActionId === 'string' && checkedActionId !== '') {
136
- const recipe = await repos.checkMovieTicketAction.findRecipeByAction({
136
+ const recipe = await repos.actions.checkMovieTicket.findRecipeByAction({
137
137
  project: { id: transaction.project.id },
138
138
  recipeFor: { id: checkedActionId }
139
139
  });
@@ -17,7 +17,6 @@ declare function refundByTask(params: factory.task.refund.IData & {
17
17
  id: string;
18
18
  };
19
19
  }): (repos: {
20
- action?: never;
21
20
  actions: {
22
21
  pay: PayActionRepo;
23
22
  refund: RefundActionRepo;
@@ -1,5 +1,4 @@
1
1
  import type { AccountingReportRepo } from '../../../repo/accountingReport';
2
- import type { ActionRepo } from '../../../repo/action';
3
2
  import type { PayActionRepo } from '../../../repo/action/pay';
4
3
  import type { RefundActionRepo } from '../../../repo/action/refund';
5
4
  import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
@@ -13,7 +12,6 @@ import type { TaskRepo } from '../../../repo/task';
13
12
  import { factory } from '../../../factory';
14
13
  import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
15
14
  declare function voidPaymentByTask(params: factory.task.voidPayment.IData): (repos: {
16
- action: ActionRepo;
17
15
  actions: {
18
16
  pay: PayActionRepo;
19
17
  refund: RefundActionRepo;
@@ -4,11 +4,11 @@ exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
5
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
6
6
  const accountingReport_1 = require("../../repo/accountingReport");
7
- const action_1 = require("../../repo/action");
7
+ const order_1 = require("../../repo/action/order");
8
8
  const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
9
9
  const authorizePaymentMethod_1 = require("../../repo/action/authorizePaymentMethod");
10
10
  const message_1 = require("../../repo/message");
11
- const order_1 = require("../../repo/order");
11
+ const order_2 = require("../../repo/order");
12
12
  const orderInTransaction_1 = require("../../repo/orderInTransaction");
13
13
  const setting_1 = require("../../repo/setting");
14
14
  const integration_1 = require("../../repo/setting/integration");
@@ -29,11 +29,13 @@ function call(params) {
29
29
  })({
30
30
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
31
31
  accountingReport: new accountingReport_1.AccountingReportRepo(connection),
32
- action: new action_1.ActionRepo(connection),
33
- authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
34
- authorizePaymentMethodAction: new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection),
32
+ actions: {
33
+ order: new order_1.OrderActionRepo(connection),
34
+ authorizeOffer: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
35
+ authorizePaymentMethod: new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection),
36
+ },
35
37
  message: new message_1.MessageRepo(connection),
36
- order: new order_1.OrderRepo(connection),
38
+ order: new order_2.OrderRepo(connection),
37
39
  orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
38
40
  setting: new setting_1.SettingRepo(connection),
39
41
  task: new task_1.TaskRepo(connection),
@@ -10,10 +10,8 @@ const event_1 = require("../../repo/event");
10
10
  const eventSeries_1 = require("../../repo/eventSeries");
11
11
  const issuer_1 = require("../../repo/issuer");
12
12
  const orderInTransaction_1 = require("../../repo/orderInTransaction");
13
- // import { OrderNumberRepo } from '../../repo/orderNumber';
14
13
  const paymentService_1 = require("../../repo/paymentService");
15
14
  const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
16
- // import { ProjectRepo } from '../../repo/project';
17
15
  const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
18
16
  const integration_1 = require("../../repo/setting/integration");
19
17
  const ticket_1 = require("../../repo/ticket");
@@ -24,26 +22,19 @@ const any_1 = require("../payment/any");
24
22
  * タスク実行関数
25
23
  */
26
24
  function call(params) {
27
- return async ({ connection, redisClient }, options) => {
25
+ return async ({ connection, redisClient }) => {
28
26
  if (redisClient === undefined) {
29
27
  throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
30
28
  }
31
- // 遅延実行(executeByName)には対応しない
32
- if (!options.executeById) {
33
- return;
34
- }
35
29
  const settings = new integration_1.IntegrationSettingRepo({ connection });
36
30
  const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
37
- // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
38
31
  try {
39
- const { savePaymentMethodIdInTransaction, project: _project, ...publishPaymentUrlParams } = params.data;
32
+ const { savePaymentMethodIdInTransaction: _savePaymentMethodIdInTransaction, project: _project, ...publishPaymentUrlParams } = params.data;
40
33
  await (0, any_1.publishPaymentUrl)({
41
34
  ...publishPaymentUrlParams,
42
35
  project: { id: params.project.id },
43
36
  instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [],
44
37
  sameAs: { id: params.id }
45
- }, {
46
- savePaymentMethodIdInTransaction: savePaymentMethodIdInTransaction === true
47
38
  })({
48
39
  acceptPayAction: actionRepo,
49
40
  authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
@@ -53,11 +44,9 @@ function call(params) {
53
44
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
54
45
  issuer: new issuer_1.IssuerRepo(connection),
55
46
  orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
56
- // orderNumber: new OrderNumberRepo({ connection }),
57
47
  paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
58
48
  paymentService: new paymentService_1.PaymentServiceRepo(connection),
59
49
  paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
60
- // project: new ProjectRepo(connection),
61
50
  ticket: new ticket_1.TicketRepo(connection),
62
51
  placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
63
52
  transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
@@ -66,11 +55,10 @@ function call(params) {
66
55
  catch (error) {
67
56
  let throwsError = true;
68
57
  // アクションが存在すればタスクを実行済扱いにする
69
- const action = (await actionRepo.searchBySameAs({
70
- sameAs: { id: { $eq: params.id } },
71
- purpose: { id: { $eq: params.data.purpose.id } },
72
- typeOf: { $eq: factory_1.factory.actionType.AcceptAction }
73
- })).shift();
58
+ const action = (await actionRepo.findActionBySameAs({
59
+ sameAs: { id: params.id },
60
+ purpose: { id: params.data.purpose.id }
61
+ }));
74
62
  if (typeof action?.id === 'string') {
75
63
  throwsError = false;
76
64
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
5
  const accountingReport_1 = require("../../repo/accountingReport");
6
- // import { ActionRepo } from '../../repo/action';
7
6
  const pay_1 = require("../../repo/action/pay");
8
7
  const refund_1 = require("../../repo/action/refund");
9
8
  const assetTransaction_1 = require("../../repo/assetTransaction");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
- const action_1 = require("../../repo/action");
4
+ const reserve_1 = require("../../repo/action/reserve");
5
5
  const assetTransaction_1 = require("../../repo/assetTransaction");
6
6
  const authorization_1 = require("../../repo/authorization");
7
7
  const reservation_1 = require("../../repo/reservation");
@@ -15,19 +15,16 @@ function call(params) {
15
15
  return async ({ connection }) => {
16
16
  const { data } = params;
17
17
  await (0, confirmReservation_1.confirmReservation)({
18
- // actionAttributesList: data.actionAttributes,
19
18
  potentialReserveAction: data, // optimize(2024-07-01~)
20
19
  useOnReservationConfirmed: true,
21
20
  byTask: true
22
21
  })({
23
- action: new action_1.ActionRepo(connection),
22
+ actions: { reserve: new reserve_1.ReserveActionRepo(connection) },
24
23
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
25
24
  code: new authorization_1.AuthorizationRepo(connection),
26
25
  reservation: new reservation_1.ReservationRepo(connection),
27
26
  setting: new setting_1.SettingRepo(connection),
28
27
  task: new task_1.TaskRepo(connection)
29
- }
30
- // settings
31
- );
28
+ });
32
29
  };
33
30
  }
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
5
- const action_1 = require("../../repo/action");
5
+ const returnAction_1 = require("../../repo/action/returnAction");
6
6
  const order_1 = require("../../repo/order");
7
- const ownershipInfo_1 = require("../../repo/ownershipInfo");
8
7
  const setting_1 = require("../../repo/setting");
9
8
  const task_1 = require("../../repo/task");
10
9
  const returnOrder_1 = require("../../repo/transaction/returnOrder");
@@ -20,14 +19,11 @@ function call(params) {
20
19
  useOnOrderStatusChanged: true
21
20
  })({
22
21
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
23
- action: new action_1.ActionRepo(connection),
22
+ actions: { returnAction: new returnAction_1.ReturnActionRepo(connection) },
24
23
  order: new order_1.OrderRepo(connection),
25
- ownershipInfo: new ownershipInfo_1.OwnershipInfoRepo(connection),
26
24
  setting: new setting_1.SettingRepo(connection),
27
25
  task: new task_1.TaskRepo(connection),
28
26
  returnOrder: new returnOrder_1.ReturnOrderRepo(connection)
29
- }
30
- // settings
31
- );
27
+ });
32
28
  };
33
29
  }
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.call = call;
40
40
  const moment_1 = __importDefault(require("moment"));
41
41
  const factory_1 = require("../../factory");
42
- const action_1 = require("../../repo/action");
42
+ const returnAction_1 = require("../../repo/action/returnAction");
43
43
  const pay_1 = require("../../repo/action/pay");
44
44
  const assetTransaction_1 = require("../../repo/assetTransaction");
45
45
  const order_1 = require("../../repo/order");
@@ -54,17 +54,14 @@ const RefundTransactionService = __importStar(require("../assetTransaction/refun
54
54
  * タスク実行関数
55
55
  */
56
56
  function call(params) {
57
- return async ({ redisClient, connection }) => {
58
- if (redisClient === undefined) {
59
- throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
60
- }
57
+ return async ({ connection }) => {
61
58
  await returnPayTransaction({
62
59
  ...params.data,
63
60
  sameAs: { id: params.id }
64
61
  })({
65
- action: new action_1.ActionRepo(connection),
66
62
  actions: {
67
63
  pay: new pay_1.PayActionRepo(connection),
64
+ returnAction: new returnAction_1.ReturnActionRepo(connection)
68
65
  },
69
66
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
70
67
  order: new order_1.OrderRepo(connection),
@@ -156,8 +153,7 @@ function returnPayTransaction(taskData) {
156
153
  transactionNumber = (await repos.transactionNumber.publishByTimestamp({ startDate: new Date() })).transactionNumber;
157
154
  }
158
155
  const refundActionAttributes = task2actionAttributes({ taskData, transactionNumber, order });
159
- const action = await repos.action.start(refundActionAttributes);
160
- // let refundTransaction: Pick<factory.assetTransaction.refund.ITransaction, 'id' | 'transactionNumber' | 'typeOf'> | undefined;
156
+ const action = await repos.actions.returnAction.start(refundActionAttributes);
161
157
  try {
162
158
  if (typeof transactionNumber === 'string') {
163
159
  const refundFee = transaction2refundFee({ returnOrderTransaction }); // 返品手数料
@@ -177,7 +173,6 @@ function returnPayTransaction(taskData) {
177
173
  product: repos.product,
178
174
  assetTransaction: repos.assetTransaction
179
175
  });
180
- // refundTransaction = { id, transactionNumber, typeOf };
181
176
  await RefundTransactionService.confirm({
182
177
  transactionNumber,
183
178
  potentialActions: { refund: { purpose: refundPurpose } }
@@ -188,17 +183,15 @@ function returnPayTransaction(taskData) {
188
183
  }
189
184
  catch (error) {
190
185
  try {
191
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
186
+ await repos.actions.returnAction.giveUp({ typeOf: action.typeOf, id: action.id, error });
192
187
  }
193
188
  catch (__) {
194
189
  // no op
195
190
  }
196
191
  throw error;
197
192
  }
198
- const result = {
199
- // ...(typeof refundTransaction?.id === 'string') ? { refundTransaction } : undefined // migrate into instrument(2024-06-17~)
200
- }; // optimize(2024-04-27~)
201
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
193
+ const result = {}; // optimize(2024-04-27~)
194
+ await repos.actions.returnAction.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
202
195
  await onRefund({ refundActionAttributes, order })({ task: repos.task });
203
196
  };
204
197
  }
@@ -213,14 +206,14 @@ function createRefundPurpose(params, order) {
213
206
  }
214
207
  function refundTransactionAlreadyExists(params) {
215
208
  return async (repos) => {
216
- const refundTransactions = await repos.assetTransaction.search({
209
+ const refundTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
217
210
  limit: 1,
218
211
  page: 1,
219
212
  project: { id: { $eq: params.project.id } },
220
213
  typeOf: factory_1.factory.assetTransactionType.Refund,
221
214
  statuses: [factory_1.factory.transactionStatusType.Confirmed],
222
215
  object: { paymentMethodId: { $eq: params.object.paymentMethodId } }
223
- }, ['_id'], []);
216
+ }, ['_id']);
224
217
  return refundTransactions.length > 0;
225
218
  };
226
219
  }
@@ -293,8 +286,6 @@ function onRefund(params) {
293
286
  const simpleOrder = {
294
287
  typeOf: order.typeOf,
295
288
  orderNumber: order.orderNumber,
296
- // price: order.price,
297
- // priceCurrency: order.priceCurrency,
298
289
  orderDate: order.orderDate
299
290
  };
300
291
  sendEmailMessageByPotentialActions.forEach((s) => {
@@ -303,7 +294,6 @@ function onRefund(params) {
303
294
  typeOf: factory_1.factory.actionType.SendAction,
304
295
  object: s.object,
305
296
  agent: refundActionAttributes.project,
306
- recipient: { typeOf: order.customer.typeOf, id: order.customer.id },
307
297
  purpose: simpleOrder
308
298
  };
309
299
  const sendEmailMessageTask = {
@@ -43,7 +43,7 @@ const factory_1 = require("../../factory");
43
43
  const CancelReservationTransactionService = __importStar(require("../assetTransaction/cancelReservation"));
44
44
  const CancelReservationCOAService = __importStar(require("../assetTransaction/cancelReservationCOA"));
45
45
  const factory_2 = require("../assetTransaction/cancelReservationCOA/factory");
46
- const action_1 = require("../../repo/action");
46
+ const returnAction_1 = require("../../repo/action/returnAction");
47
47
  const assetTransaction_1 = require("../../repo/assetTransaction");
48
48
  const project_1 = require("../../repo/project");
49
49
  const reservation_1 = require("../../repo/reservation");
@@ -54,7 +54,6 @@ let coaAuthClientCreated = false;
54
54
  let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
55
55
  endpoint: '', // 使用されないので空文字でok
56
56
  refreshToken: '', // 使用されないので空文字でok
57
- // useFetch: true
58
57
  });
59
58
  /**
60
59
  * タスク実行関数
@@ -82,7 +81,7 @@ function call(params) {
82
81
  ...params.data,
83
82
  sameAs: { id: params.id }
84
83
  })({
85
- action: new action_1.ActionRepo(connection),
84
+ actions: { returnAction: new returnAction_1.ReturnActionRepo(connection) },
86
85
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
87
86
  project: new project_1.ProjectRepo(connection),
88
87
  reservation: new reservation_1.ReservationRepo(connection),
@@ -108,7 +107,7 @@ function returnReserve(params) {
108
107
  project: { id: project.id }
109
108
  });
110
109
  }
111
- const action = await repos.action.start(returnActionAttributes, {
110
+ const action = await repos.actions.returnAction.start(returnActionAttributes, {
112
111
  ...(recipe !== undefined) ? { recipe } : undefined // add recipe(2024-06-11~)
113
112
  });
114
113
  try {
@@ -133,14 +132,14 @@ function returnReserve(params) {
133
132
  }
134
133
  catch (error) {
135
134
  try {
136
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
135
+ await repos.actions.returnAction.giveUp({ typeOf: action.typeOf, id: action.id, error });
137
136
  }
138
137
  catch (__) {
139
138
  // no op
140
139
  }
141
140
  throw error;
142
141
  }
143
- await repos.action.completeWithVoid({
142
+ await repos.actions.returnAction.completeWithVoid({
144
143
  typeOf: action.typeOf, id: action.id, result: {},
145
144
  ...(recipe !== undefined) ? { recipe } : undefined // add recipe(2024-06-11~)
146
145
  });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
- const action_1 = require("../../repo/action");
4
+ const sendEmailMessage_1 = require("../../repo/action/sendEmailMessage");
5
5
  const message_1 = require("../../repo/message");
6
6
  const project_1 = require("../../repo/project");
7
7
  const integration_1 = require("../../repo/setting/integration");
@@ -15,7 +15,7 @@ function call(params) {
15
15
  ...params.data.actionAttributes,
16
16
  sameAs: { id: params.id } // タスクIDを関連付け(2024-06-25~)
17
17
  })({
18
- action: new action_1.ActionRepo(connection),
18
+ actions: { sendEmailMessage: new sendEmailMessage_1.SendEmailMessageActionRepo(connection) },
19
19
  message: new message_1.MessageRepo(connection),
20
20
  project: new project_1.ProjectRepo(connection),
21
21
  integrationSetting: new integration_1.IntegrationSettingRepo({ connection })