@chevre/domain 26.0.0-alpha.8 → 26.0.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 (317) 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 +3 -1
  6. package/lib/chevre/repo/action/acceptCOAOffer.js +8 -2
  7. package/lib/chevre/repo/action/acceptPay.d.ts +3 -1
  8. package/lib/chevre/repo/action/acceptPay.js +8 -4
  9. package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +120 -0
  10. package/lib/chevre/repo/action/{actionProcess.js → anyAction/actionProcess.js} +28 -157
  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 +7 -4
  15. package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
  16. package/lib/chevre/repo/action/authorizeOffer.js +7 -2
  17. package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +3 -1
  18. package/lib/chevre/repo/action/authorizePaymentMethod.js +7 -4
  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 +3 -1
  24. package/lib/chevre/repo/action/checkMovieTicket.js +8 -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/inform.d.ts +38 -0
  30. package/lib/chevre/repo/action/inform.js +146 -0
  31. package/lib/chevre/repo/action/order.d.ts +21 -0
  32. package/lib/chevre/repo/action/order.js +35 -0
  33. package/lib/chevre/repo/action/pay.d.ts +3 -1
  34. package/lib/chevre/repo/action/pay.js +7 -4
  35. package/lib/chevre/repo/action/refund.d.ts +3 -1
  36. package/lib/chevre/repo/action/refund.js +7 -4
  37. package/lib/chevre/repo/action/reserve.d.ts +21 -0
  38. package/lib/chevre/repo/action/reserve.js +37 -0
  39. package/lib/chevre/repo/action/returnAction.d.ts +11 -0
  40. package/lib/chevre/repo/action/returnAction.js +16 -0
  41. package/lib/chevre/repo/action/sendEmailMessage.d.ts +10 -0
  42. package/lib/chevre/repo/action/sendEmailMessage.js +17 -0
  43. package/lib/chevre/repo/action/sendOrder.d.ts +10 -0
  44. package/lib/chevre/repo/action/sendOrder.js +16 -0
  45. package/lib/chevre/repo/action/unknown2actionError.d.ts +6 -0
  46. package/lib/chevre/repo/action/unknown2actionError.js +15 -0
  47. package/lib/chevre/repo/action/update.d.ts +48 -0
  48. package/lib/chevre/repo/action/update.js +166 -0
  49. package/lib/chevre/repo/action/use.d.ts +39 -0
  50. package/lib/chevre/repo/action/use.js +153 -0
  51. package/lib/chevre/repo/{action.d.ts → adminAction.d.ts} +11 -37
  52. package/lib/chevre/repo/adminAction.js +176 -0
  53. package/lib/chevre/repo/adminAssetTransaction.d.ts +126 -0
  54. package/lib/chevre/repo/adminAssetTransaction.js +491 -0
  55. package/lib/chevre/repo/adminAsyncAction.d.ts +2 -2
  56. package/lib/chevre/repo/adminScheduledTask.d.ts +1 -1
  57. package/lib/chevre/repo/adminTask.d.ts +25 -8
  58. package/lib/chevre/repo/adminTask.js +31 -32
  59. package/lib/chevre/repo/adminTransaction.d.ts +131 -0
  60. package/lib/chevre/repo/adminTransaction.js +237 -0
  61. package/lib/chevre/repo/aggregateAction.d.ts +8 -11
  62. package/lib/chevre/repo/aggregateAction.js +0 -61
  63. package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
  64. package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
  65. package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
  66. package/lib/chevre/repo/aggregateTransaction.js +166 -0
  67. package/lib/chevre/repo/aggregateUseAction.d.ts +35 -0
  68. package/lib/chevre/repo/aggregateUseAction.js +164 -0
  69. package/lib/chevre/repo/aggregation.d.ts +0 -8
  70. package/lib/chevre/repo/aggregation.js +0 -10
  71. package/lib/chevre/repo/assetTransaction.d.ts +10 -235
  72. package/lib/chevre/repo/assetTransaction.js +48 -636
  73. package/lib/chevre/repo/asyncAction.d.ts +2 -2
  74. package/lib/chevre/repo/authorization.d.ts +0 -6
  75. package/lib/chevre/repo/authorization.js +15 -27
  76. package/lib/chevre/repo/message.d.ts +0 -7
  77. package/lib/chevre/repo/message.js +0 -38
  78. package/lib/chevre/repo/migrateAction.d.ts +48 -0
  79. package/lib/chevre/repo/migrateAction.js +32 -0
  80. package/lib/chevre/repo/mongoose/schemas/action/inform.d.ts +11 -0
  81. package/lib/chevre/repo/mongoose/schemas/action/inform.js +82 -0
  82. package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
  83. package/lib/chevre/repo/mongoose/schemas/action/update.js +112 -0
  84. package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/use.d.ts} +4 -6
  85. package/lib/chevre/repo/mongoose/schemas/action/use.js +92 -0
  86. package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
  87. package/lib/chevre/repo/mongoose/schemas/action.js +22 -7
  88. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +1 -0
  89. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +19 -1
  90. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
  91. package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
  92. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
  93. package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
  94. package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
  95. package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
  96. package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
  97. package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
  98. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +5 -16
  99. package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
  100. package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
  101. package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
  102. package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
  103. package/lib/chevre/repo/orderInTransaction.js +30 -22
  104. package/lib/chevre/repo/scheduledTask.d.ts +4 -1
  105. package/lib/chevre/repo/scheduledTask.js +3 -25
  106. package/lib/chevre/repo/task.d.ts +44 -150
  107. package/lib/chevre/repo/task.js +13 -446
  108. package/lib/chevre/repo/taskDelayed.d.ts +74 -0
  109. package/lib/chevre/repo/taskDelayed.js +195 -0
  110. package/lib/chevre/repo/taskRunning.d.ts +35 -0
  111. package/lib/chevre/repo/taskRunning.js +89 -0
  112. package/lib/chevre/repo/ticket.d.ts +0 -6
  113. package/lib/chevre/repo/ticket.js +0 -11
  114. package/lib/chevre/repo/transaction.d.ts +1 -187
  115. package/lib/chevre/repo/transaction.js +2 -383
  116. package/lib/chevre/repository.d.ts +65 -25
  117. package/lib/chevre/repository.js +144 -56
  118. package/lib/chevre/service/aggregation/system.d.ts +9 -8
  119. package/lib/chevre/service/aggregation/system.js +5 -5
  120. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
  121. package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
  122. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +0 -1
  123. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +0 -1
  124. package/lib/chevre/service/assetTransaction/pay/start.d.ts +0 -1
  125. package/lib/chevre/service/assetTransaction/refund.d.ts +0 -1
  126. package/lib/chevre/service/assetTransaction/refund.js +2 -2
  127. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +4 -2
  128. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +4 -2
  129. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +8 -4
  130. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -1
  131. package/lib/chevre/service/asyncAction.d.ts +2 -2
  132. package/lib/chevre/service/asyncAction.js +1 -4
  133. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
  134. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
  135. package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
  136. package/lib/chevre/service/asyncActionHandler.js +11 -13
  137. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
  138. package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
  139. package/lib/chevre/service/event.d.ts +4 -2
  140. package/lib/chevre/service/event.js +3 -3
  141. package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
  142. package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
  143. package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
  144. package/lib/chevre/service/notification/triggerWebhook.js +5 -16
  145. package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
  146. package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +0 -1
  147. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +4 -2
  148. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
  149. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +9 -5
  150. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +1 -1
  151. package/lib/chevre/service/offer/event/voidTransaction.d.ts +6 -4
  152. package/lib/chevre/service/offer/event/voidTransaction.js +7 -9
  153. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +6 -4
  154. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +3 -15
  155. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
  156. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  157. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
  158. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +19 -19
  159. package/lib/chevre/service/offer/onEventChanged.js +0 -2
  160. package/lib/chevre/service/order/confirmPayTransaction.d.ts +4 -10
  161. package/lib/chevre/service/order/confirmPayTransaction.js +7 -11
  162. package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
  163. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +2 -56
  164. package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
  165. package/lib/chevre/service/order/deleteOrder.js +1 -2
  166. package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
  167. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
  168. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
  169. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
  170. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
  171. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
  172. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -9
  173. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
  174. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -8
  175. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
  176. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -11
  177. package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
  178. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +4 -2
  179. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
  180. package/lib/chevre/service/order/placeOrder.d.ts +6 -4
  181. package/lib/chevre/service/order/placeOrder.js +9 -17
  182. package/lib/chevre/service/order/returnOrder.d.ts +4 -4
  183. package/lib/chevre/service/order/returnOrder.js +11 -43
  184. package/lib/chevre/service/order/sendOrder.d.ts +4 -6
  185. package/lib/chevre/service/order/sendOrder.js +30 -72
  186. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +0 -1
  187. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +0 -1
  188. package/lib/chevre/service/payment/any/authorize.d.ts +0 -1
  189. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
  190. package/lib/chevre/service/payment/any/findAcceptAction.js +19 -19
  191. package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
  192. package/lib/chevre/service/payment/any/findAuthorizeAction.js +19 -19
  193. package/lib/chevre/service/payment/any/findCheckAction.d.ts +0 -4
  194. package/lib/chevre/service/payment/any/findCheckAction.js +19 -19
  195. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +0 -1
  196. package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +0 -1
  197. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
  198. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +0 -1
  199. package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +0 -1
  200. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  201. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
  202. package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
  203. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +0 -1
  204. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +0 -1
  205. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +0 -1
  206. package/lib/chevre/service/payment/creditCard/authorize.d.ts +0 -1
  207. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +0 -1
  208. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +0 -1
  209. package/lib/chevre/service/payment/faceToFace.d.ts +0 -2
  210. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
  211. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +0 -1
  212. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +0 -1
  213. package/lib/chevre/service/project.d.ts +0 -6
  214. package/lib/chevre/service/project.js +0 -2
  215. package/lib/chevre/service/reserve/cancelReservation.d.ts +7 -3
  216. package/lib/chevre/service/reserve/cancelReservation.js +15 -25
  217. package/lib/chevre/service/reserve/checkInReservation.d.ts +4 -2
  218. package/lib/chevre/service/reserve/checkInReservation.js +2 -2
  219. package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -2
  220. package/lib/chevre/service/reserve/confirmReservation.js +10 -36
  221. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
  222. package/lib/chevre/service/reserve/useReservation.d.ts +6 -2
  223. package/lib/chevre/service/reserve/useReservation.js +6 -24
  224. package/lib/chevre/service/reserveCOA/cancelReservation.d.ts +4 -2
  225. package/lib/chevre/service/reserveCOA/cancelReservation.js +3 -3
  226. package/lib/chevre/service/scheduledTask.d.ts +1 -4
  227. package/lib/chevre/service/scheduledTask.js +3 -10
  228. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
  229. package/lib/chevre/service/scheduledTaskHandler.js +0 -13
  230. package/lib/chevre/service/task/acceptCOAOffer.js +1 -14
  231. package/lib/chevre/service/task/authorizePayment.js +1 -7
  232. package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
  233. package/lib/chevre/service/task/cancelReservation.js +3 -5
  234. package/lib/chevre/service/task/checkMovieTicket.js +1 -7
  235. package/lib/chevre/service/task/checkResource.js +14 -57
  236. package/lib/chevre/service/task/confirmPayTransaction.js +11 -12
  237. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
  238. package/lib/chevre/service/task/confirmReserveTransaction.js +12 -7
  239. package/lib/chevre/service/task/createAccountingReport.js +8 -15
  240. package/lib/chevre/service/task/deleteTransaction.js +10 -41
  241. package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
  242. package/lib/chevre/service/task/invalidatePaymentUrl.js +0 -1
  243. package/lib/chevre/service/task/onAuthorizationCreated.js +4 -13
  244. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
  245. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
  246. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
  247. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
  248. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
  249. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
  250. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
  251. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
  252. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
  253. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
  254. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
  255. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
  256. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
  257. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
  258. package/lib/chevre/service/task/onResourceDeleted.js +4 -3
  259. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
  260. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
  261. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
  262. package/lib/chevre/service/task/onResourceUpdated.js +0 -10
  263. package/lib/chevre/service/task/pay.js +0 -1
  264. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
  265. package/lib/chevre/service/task/payment/payByTask.d.ts +0 -1
  266. package/lib/chevre/service/task/payment/refundByTask.d.ts +0 -1
  267. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +0 -2
  268. package/lib/chevre/service/task/placeOrder.js +8 -6
  269. package/lib/chevre/service/task/publishPaymentUrl.js +2 -13
  270. package/lib/chevre/service/task/refund.js +0 -1
  271. package/lib/chevre/service/task/reserve.js +3 -6
  272. package/lib/chevre/service/task/returnOrder.js +3 -7
  273. package/lib/chevre/service/task/returnPayTransaction.js +9 -19
  274. package/lib/chevre/service/task/returnReserveTransaction.js +5 -6
  275. package/lib/chevre/service/task/sendEmailMessage.js +2 -2
  276. package/lib/chevre/service/task/sendOrder.js +4 -8
  277. package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
  278. package/lib/chevre/service/task/triggerWebhook.js +4 -2
  279. package/lib/chevre/service/task/useReservation.js +6 -2
  280. package/lib/chevre/service/task/voidPayment.js +0 -2
  281. package/lib/chevre/service/task/voidReserveTransaction.js +11 -13
  282. package/lib/chevre/service/task.d.ts +3 -22
  283. package/lib/chevre/service/task.js +8 -40
  284. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
  285. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
  286. package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
  287. package/lib/chevre/service/taskHandler.d.ts +1 -2
  288. package/lib/chevre/service/taskHandler.js +7 -19
  289. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
  290. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
  291. package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -4
  292. package/lib/chevre/service/transaction/deleteTransaction.js +7 -7
  293. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
  294. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  295. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +11 -17
  296. package/lib/chevre/service/transaction/returnOrder.js +11 -17
  297. package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
  298. package/lib/chevre/service/validation/validateOrder.js +3 -3
  299. package/lib/chevre/taskSettings.d.ts +4 -4
  300. package/package.json +2 -2
  301. package/lib/chevre/repo/action/actionProcess.d.ts +0 -147
  302. package/lib/chevre/repo/action/checkThing.d.ts +0 -8
  303. package/lib/chevre/repo/action/checkThing.js +0 -13
  304. package/lib/chevre/repo/action.js +0 -468
  305. package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
  306. package/lib/chevre/repo/asyncActionLegacy.js +0 -59
  307. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
  308. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
  309. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
  310. package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
  311. package/lib/chevre/repo/ownershipInfo.js +0 -466
  312. package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -19
  313. package/lib/chevre/repo/scheduledTaskLegacy.js +0 -42
  314. package/lib/chevre/repo/scheduledTaskMigration.d.ts +0 -21
  315. package/lib/chevre/repo/scheduledTaskMigration.js +0 -70
  316. package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
  317. package/lib/chevre/service/validation/validateEvent.js +0 -21
@@ -32,7 +32,6 @@ declare function payTask2payActionAttributes(params: factory.task.pay.IData & {
32
32
  }): (repos: IPayTask2payActionAttributesRepos) => Promise<factory.action.trade.pay.IAttributes>;
33
33
  interface IPayByTaskRepos {
34
34
  acceptedOffer: AcceptedOfferRepo;
35
- action?: never;
36
35
  actions: {
37
36
  pay: PayActionRepo;
38
37
  refund: RefundActionRepo;
@@ -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 })
@@ -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 })
@@ -3,20 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
5
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
6
- const action_1 = require("../../repo/action");
6
+ const sendOrder_1 = require("../../repo/action/sendOrder");
7
7
  const order_1 = require("../../repo/order");
8
- const ownershipInfo_1 = require("../../repo/ownershipInfo");
9
8
  const setting_1 = require("../../repo/setting");
10
9
  const task_1 = require("../../repo/task");
11
- const placeOrder_1 = require("../../repo/transaction/placeOrder");
12
- const sendOrder_1 = require("../order/sendOrder");
10
+ const sendOrder_2 = require("../order/sendOrder");
13
11
  /**
14
12
  * タスク実行関数
15
13
  */
16
14
  function call(params) {
17
15
  return async ({ connection }) => {
18
16
  const { data } = params;
19
- await (0, sendOrder_1.sendOrder)({
17
+ await (0, sendOrder_2.sendOrder)({
20
18
  ...data,
21
19
  object: {
22
20
  ...data.object,
@@ -30,12 +28,10 @@ function call(params) {
30
28
  useOnOrderStatusChanged: true
31
29
  })({
32
30
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
33
- action: new action_1.ActionRepo(connection),
31
+ actions: { sendOrder: new sendOrder_1.SendOrderActionRepo(connection) },
34
32
  order: new order_1.OrderRepo(connection),
35
- ownershipInfo: new ownershipInfo_1.OwnershipInfoRepo(connection),
36
33
  setting: new setting_1.SettingRepo(connection),
37
34
  task: new task_1.TaskRepo(connection),
38
- placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
39
35
  });
40
36
  };
41
37
  }
@@ -7,7 +7,7 @@ exports.call = call;
7
7
  const coa_service_1 = require("@motionpicture/coa-service");
8
8
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
9
9
  const factory_1 = require("../../factory");
10
- const action_1 = require("../../repo/action");
10
+ const update_1 = require("../../repo/action/update");
11
11
  const categoryCode_1 = require("../../repo/categoryCode");
12
12
  const creativeWork_1 = require("../../repo/creativeWork");
13
13
  const credentials_1 = require("../../repo/credentials");
@@ -24,14 +24,10 @@ let coaAuthClient;
24
24
  * タスク実行関数
25
25
  */
26
26
  function call(params) {
27
- return async ({ connection, redisClient }, options) => {
27
+ return async ({ connection, redisClient }) => {
28
28
  if (redisClient === undefined) {
29
29
  throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
30
30
  }
31
- // 遅延実行(executeByName)には対応しない
32
- if (!options.executeById) {
33
- return;
34
- }
35
31
  const settings = new integration_1.IntegrationSettingRepo({ connection });
36
32
  const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
37
33
  const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
@@ -57,21 +53,22 @@ function call(params) {
57
53
  ...(credentialsRepo !== undefined) ? { credentialsRepo } : undefined
58
54
  });
59
55
  }
60
- const actionRepo = new action_1.ActionRepo(connection);
56
+ const updateActionRepo = new update_1.UpdateActionRepo(connection);
61
57
  try {
62
58
  const masterService = new coa_service_1.COA.service.Master({
63
59
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
64
60
  auth: coaAuthClient
65
61
  }, { timeout: (await settings.getByKey('coa')).timeoutMaster });
66
- const { agent, object } = params.data;
62
+ const { object } = params.data;
67
63
  if (object.typeOf === factory_1.factory.eventType.ScreeningEventSeries) {
68
64
  await syncEventSeries({
69
65
  project: { id: params.project.id },
70
- agent,
71
66
  object,
72
67
  sameAs: { id: params.id }
73
68
  })({
74
- action: actionRepo,
69
+ actions: {
70
+ update: updateActionRepo
71
+ },
75
72
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
76
73
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
77
74
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
@@ -82,11 +79,12 @@ function call(params) {
82
79
  else if (object.typeOf === factory_1.factory.eventType.ScreeningEvent) {
83
80
  await syncEvents({
84
81
  project: { id: params.project.id },
85
- agent,
86
82
  object,
87
83
  sameAs: { id: params.id }
88
84
  })({
89
- action: actionRepo,
85
+ actions: {
86
+ update: updateActionRepo
87
+ },
90
88
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
91
89
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
92
90
  event: new event_1.EventRepo(connection),
@@ -100,7 +98,7 @@ function call(params) {
100
98
  catch (error) {
101
99
  let throwsError = true;
102
100
  // アクションが存在すればタスクを実行済扱いにする
103
- const action = (await actionRepo.searchBySameAs({
101
+ const action = (await updateActionRepo.findUpdateActionsBySameAs({
104
102
  sameAs: { id: { $eq: params.id } },
105
103
  typeOf: { $eq: factory_1.factory.actionType.ReplaceAction }
106
104
  })).shift();
@@ -119,21 +117,26 @@ function call(params) {
119
117
  function syncEventSeries(params) {
120
118
  return async (repos) => {
121
119
  const { locationBranchCode, titleBranchNum, titleCode } = params.object;
120
+ const instrument = {
121
+ theaterCode: params.object.locationBranchCode,
122
+ typeOf: 'WebAPI',
123
+ identifier: factory_1.factory.service.webAPI.Identifier.COA
124
+ };
122
125
  const actionAttributes = {
123
126
  project: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
124
127
  typeOf: factory_1.factory.actionType.ReplaceAction,
125
- agent: params.agent,
128
+ agent: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
126
129
  // eslint-disable-next-line no-warning-comments
127
130
  // TODO define object
128
131
  object: {
129
132
  ...params.object,
130
133
  typeOf: factory_1.factory.eventType.ScreeningEventSeries
131
134
  }, // eslint-disable-line @typescript-eslint/no-explicit-any
132
- // instrument,
135
+ instrument,
133
136
  targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEventSeries },
134
137
  sameAs: { id: params.sameAs.id, typeOf: 'Task' }
135
138
  };
136
- const action = await repos.action.start(actionAttributes);
139
+ const action = await repos.actions.update.startUpdateAction(actionAttributes);
137
140
  let saveResult;
138
141
  try {
139
142
  const movieTheater = (await repos.movieTheater.projectFields({
@@ -169,7 +172,7 @@ function syncEventSeries(params) {
169
172
  }
170
173
  catch (error) {
171
174
  try {
172
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
175
+ await repos.actions.update.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
173
176
  }
174
177
  catch (__) {
175
178
  // no op
@@ -182,27 +185,32 @@ function syncEventSeries(params) {
182
185
  typeOf: eventSeries.typeOf
183
186
  };
184
187
  });
185
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
188
+ await repos.actions.update.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result });
186
189
  };
187
190
  }
188
191
  function syncEvents(params) {
189
192
  return async (repos) => {
190
193
  const { locationBranchCode, titleBranchNum, titleCode, roomCode, startDate } = params.object;
194
+ const instrument = {
195
+ theaterCode: params.object.locationBranchCode,
196
+ typeOf: 'WebAPI',
197
+ identifier: factory_1.factory.service.webAPI.Identifier.COA
198
+ };
191
199
  const actionAttributes = {
192
200
  project: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
193
201
  typeOf: factory_1.factory.actionType.ReplaceAction,
194
- agent: params.agent,
202
+ agent: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
195
203
  // eslint-disable-next-line no-warning-comments
196
204
  // TODO define object
197
205
  object: {
198
206
  ...params.object,
199
207
  typeOf: factory_1.factory.eventType.ScreeningEvent
200
208
  }, // eslint-disable-line @typescript-eslint/no-explicit-any
201
- // instrument,
209
+ instrument,
202
210
  targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEvent },
203
211
  sameAs: { id: params.sameAs.id, typeOf: 'Task' }
204
212
  };
205
- const action = await repos.action.start(actionAttributes);
213
+ const action = await repos.actions.update.startUpdateAction(actionAttributes);
206
214
  let saveResult;
207
215
  try {
208
216
  const movieTheater = (await repos.movieTheater.projectFields({
@@ -284,7 +292,7 @@ function syncEvents(params) {
284
292
  }
285
293
  catch (error) {
286
294
  try {
287
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
295
+ await repos.actions.update.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
288
296
  }
289
297
  catch (__) {
290
298
  // no op
@@ -297,6 +305,6 @@ function syncEvents(params) {
297
305
  typeOf: event.typeOf
298
306
  };
299
307
  });
300
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
308
+ await repos.actions.update.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result });
301
309
  };
302
310
  }
@@ -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 inform_1 = require("../../repo/action/inform");
5
5
  const potentialAction_1 = require("../../repo/potentialAction");
6
6
  const setting_1 = require("../../repo/setting");
7
7
  const notification_1 = require("../notification");
@@ -14,7 +14,9 @@ function call(params) {
14
14
  ...params.data,
15
15
  project: { id: params.project.id }
16
16
  })({
17
- action: new action_1.ActionRepo(connection),
17
+ actions: {
18
+ inform: new inform_1.InformActionRepo(connection)
19
+ },
18
20
  potentialAction: new potentialAction_1.PotentialActionRepo(connection),
19
21
  setting: new setting_1.SettingRepo(connection)
20
22
  });
@@ -1,7 +1,8 @@
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
+ const use_1 = require("../../repo/action/use");
5
6
  const assetTransaction_1 = require("../../repo/assetTransaction");
6
7
  const authorization_1 = require("../../repo/authorization");
7
8
  const order_1 = require("../../repo/order");
@@ -22,7 +23,10 @@ function call(params) {
22
23
  instrument: data.instrument,
23
24
  ...(typeof data.location?.identifier === 'string') ? { location: data.location } : undefined
24
25
  })({
25
- action: new action_1.ActionRepo(connection),
26
+ actions: {
27
+ use: new use_1.UseActionRepo(connection),
28
+ reserve: new reserve_1.ReserveActionRepo(connection)
29
+ },
26
30
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
27
31
  code: new authorization_1.AuthorizationRepo(connection),
28
32
  order: new order_1.OrderRepo(connection),
@@ -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
- const action_1 = require("../../repo/action");
7
6
  const pay_1 = require("../../repo/action/pay");
8
7
  const refund_1 = require("../../repo/action/refund");
9
8
  const authorizeInvoice_1 = require("../../repo/action/authorizeInvoice");
@@ -32,7 +31,6 @@ function call(params) {
32
31
  && typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
33
32
  await (0, voidPaymentByTask_1.voidPaymentByTask)(data)({
34
33
  accountingReport: new accountingReport_1.AccountingReportRepo(connection),
35
- action: new action_1.ActionRepo(connection),
36
34
  actions: {
37
35
  pay: new pay_1.PayActionRepo(connection),
38
36
  refund: new refund_1.RefundActionRepo(connection),