@chevre/domain 26.0.0-alpha.9 → 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 (315) 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/adminScheduledTask.d.ts +1 -1
  56. package/lib/chevre/repo/adminTask.d.ts +25 -8
  57. package/lib/chevre/repo/adminTask.js +31 -32
  58. package/lib/chevre/repo/adminTransaction.d.ts +131 -0
  59. package/lib/chevre/repo/adminTransaction.js +237 -0
  60. package/lib/chevre/repo/aggregateAction.d.ts +8 -11
  61. package/lib/chevre/repo/aggregateAction.js +0 -61
  62. package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
  63. package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
  64. package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
  65. package/lib/chevre/repo/aggregateTransaction.js +166 -0
  66. package/lib/chevre/repo/aggregateUseAction.d.ts +35 -0
  67. package/lib/chevre/repo/aggregateUseAction.js +164 -0
  68. package/lib/chevre/repo/aggregation.d.ts +0 -8
  69. package/lib/chevre/repo/aggregation.js +0 -10
  70. package/lib/chevre/repo/assetTransaction.d.ts +10 -235
  71. package/lib/chevre/repo/assetTransaction.js +48 -636
  72. package/lib/chevre/repo/authorization.d.ts +0 -6
  73. package/lib/chevre/repo/authorization.js +15 -27
  74. package/lib/chevre/repo/message.d.ts +0 -7
  75. package/lib/chevre/repo/message.js +0 -38
  76. package/lib/chevre/repo/migrateAction.d.ts +48 -0
  77. package/lib/chevre/repo/migrateAction.js +32 -0
  78. package/lib/chevre/repo/mongoose/schemas/action/inform.d.ts +11 -0
  79. package/lib/chevre/repo/mongoose/schemas/action/inform.js +82 -0
  80. package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
  81. package/lib/chevre/repo/mongoose/schemas/action/update.js +112 -0
  82. package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/use.d.ts} +4 -6
  83. package/lib/chevre/repo/mongoose/schemas/action/use.js +92 -0
  84. package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
  85. package/lib/chevre/repo/mongoose/schemas/action.js +22 -7
  86. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +1 -0
  87. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +19 -1
  88. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
  89. package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
  90. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
  91. package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
  92. package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
  93. package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
  94. package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
  95. package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
  96. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +5 -16
  97. package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
  98. package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
  99. package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
  100. package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
  101. package/lib/chevre/repo/orderInTransaction.js +30 -22
  102. package/lib/chevre/repo/scheduledTask.d.ts +4 -1
  103. package/lib/chevre/repo/scheduledTask.js +3 -25
  104. package/lib/chevre/repo/task.d.ts +44 -155
  105. package/lib/chevre/repo/task.js +13 -555
  106. package/lib/chevre/repo/taskDelayed.d.ts +74 -0
  107. package/lib/chevre/repo/taskDelayed.js +195 -0
  108. package/lib/chevre/repo/taskRunning.d.ts +35 -0
  109. package/lib/chevre/repo/taskRunning.js +89 -0
  110. package/lib/chevre/repo/ticket.d.ts +0 -6
  111. package/lib/chevre/repo/ticket.js +0 -11
  112. package/lib/chevre/repo/transaction.d.ts +1 -187
  113. package/lib/chevre/repo/transaction.js +2 -383
  114. package/lib/chevre/repository.d.ts +65 -25
  115. package/lib/chevre/repository.js +144 -56
  116. package/lib/chevre/service/aggregation/system.d.ts +9 -8
  117. package/lib/chevre/service/aggregation/system.js +5 -5
  118. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
  119. package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
  120. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +0 -1
  121. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +0 -1
  122. package/lib/chevre/service/assetTransaction/pay/start.d.ts +0 -1
  123. package/lib/chevre/service/assetTransaction/refund.d.ts +0 -1
  124. package/lib/chevre/service/assetTransaction/refund.js +2 -2
  125. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +4 -2
  126. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +4 -2
  127. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +8 -4
  128. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -1
  129. package/lib/chevre/service/asyncAction.d.ts +2 -2
  130. package/lib/chevre/service/asyncAction.js +1 -4
  131. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
  132. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
  133. package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
  134. package/lib/chevre/service/asyncActionHandler.js +11 -13
  135. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
  136. package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
  137. package/lib/chevre/service/event.d.ts +4 -2
  138. package/lib/chevre/service/event.js +3 -3
  139. package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
  140. package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
  141. package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
  142. package/lib/chevre/service/notification/triggerWebhook.js +5 -16
  143. package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
  144. package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +0 -1
  145. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +4 -2
  146. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
  147. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +9 -5
  148. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +1 -1
  149. package/lib/chevre/service/offer/event/voidTransaction.d.ts +6 -4
  150. package/lib/chevre/service/offer/event/voidTransaction.js +7 -9
  151. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +6 -4
  152. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +3 -15
  153. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
  154. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  155. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
  156. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +19 -19
  157. package/lib/chevre/service/offer/onEventChanged.js +0 -2
  158. package/lib/chevre/service/order/confirmPayTransaction.d.ts +4 -10
  159. package/lib/chevre/service/order/confirmPayTransaction.js +7 -11
  160. package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
  161. package/lib/chevre/service/order/createAccountingReportIfNotExist.js +2 -56
  162. package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
  163. package/lib/chevre/service/order/deleteOrder.js +1 -2
  164. package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
  165. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
  166. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
  167. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
  168. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
  169. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
  170. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -9
  171. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
  172. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -8
  173. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
  174. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -11
  175. package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
  176. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +4 -2
  177. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
  178. package/lib/chevre/service/order/placeOrder.d.ts +6 -4
  179. package/lib/chevre/service/order/placeOrder.js +9 -17
  180. package/lib/chevre/service/order/returnOrder.d.ts +4 -4
  181. package/lib/chevre/service/order/returnOrder.js +11 -43
  182. package/lib/chevre/service/order/sendOrder.d.ts +4 -6
  183. package/lib/chevre/service/order/sendOrder.js +30 -72
  184. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +0 -1
  185. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +0 -1
  186. package/lib/chevre/service/payment/any/authorize.d.ts +0 -1
  187. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
  188. package/lib/chevre/service/payment/any/findAcceptAction.js +19 -19
  189. package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
  190. package/lib/chevre/service/payment/any/findAuthorizeAction.js +19 -19
  191. package/lib/chevre/service/payment/any/findCheckAction.d.ts +0 -4
  192. package/lib/chevre/service/payment/any/findCheckAction.js +19 -19
  193. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +0 -1
  194. package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +0 -1
  195. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
  196. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +0 -1
  197. package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +0 -1
  198. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  199. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
  200. package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
  201. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +0 -1
  202. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +0 -1
  203. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +0 -1
  204. package/lib/chevre/service/payment/creditCard/authorize.d.ts +0 -1
  205. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +0 -1
  206. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +0 -1
  207. package/lib/chevre/service/payment/faceToFace.d.ts +0 -2
  208. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
  209. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +0 -1
  210. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +0 -1
  211. package/lib/chevre/service/project.d.ts +0 -6
  212. package/lib/chevre/service/project.js +0 -2
  213. package/lib/chevre/service/reserve/cancelReservation.d.ts +7 -3
  214. package/lib/chevre/service/reserve/cancelReservation.js +15 -25
  215. package/lib/chevre/service/reserve/checkInReservation.d.ts +4 -2
  216. package/lib/chevre/service/reserve/checkInReservation.js +2 -2
  217. package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -2
  218. package/lib/chevre/service/reserve/confirmReservation.js +10 -36
  219. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
  220. package/lib/chevre/service/reserve/useReservation.d.ts +6 -2
  221. package/lib/chevre/service/reserve/useReservation.js +6 -24
  222. package/lib/chevre/service/reserveCOA/cancelReservation.d.ts +4 -2
  223. package/lib/chevre/service/reserveCOA/cancelReservation.js +3 -3
  224. package/lib/chevre/service/scheduledTask.d.ts +1 -4
  225. package/lib/chevre/service/scheduledTask.js +3 -10
  226. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
  227. package/lib/chevre/service/scheduledTaskHandler.js +0 -13
  228. package/lib/chevre/service/task/acceptCOAOffer.js +1 -14
  229. package/lib/chevre/service/task/authorizePayment.js +1 -7
  230. package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
  231. package/lib/chevre/service/task/cancelReservation.js +3 -5
  232. package/lib/chevre/service/task/checkMovieTicket.js +1 -7
  233. package/lib/chevre/service/task/checkResource.js +14 -57
  234. package/lib/chevre/service/task/confirmPayTransaction.js +11 -12
  235. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
  236. package/lib/chevre/service/task/confirmReserveTransaction.js +12 -7
  237. package/lib/chevre/service/task/createAccountingReport.js +8 -15
  238. package/lib/chevre/service/task/deleteTransaction.js +10 -41
  239. package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
  240. package/lib/chevre/service/task/invalidatePaymentUrl.js +0 -1
  241. package/lib/chevre/service/task/onAuthorizationCreated.js +4 -13
  242. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
  243. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
  244. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
  245. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
  246. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
  247. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
  248. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
  249. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
  250. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
  251. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
  252. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
  253. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
  254. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
  255. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
  256. package/lib/chevre/service/task/onResourceDeleted.js +4 -3
  257. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
  258. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
  259. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
  260. package/lib/chevre/service/task/onResourceUpdated.js +0 -10
  261. package/lib/chevre/service/task/pay.js +0 -1
  262. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
  263. package/lib/chevre/service/task/payment/payByTask.d.ts +0 -1
  264. package/lib/chevre/service/task/payment/refundByTask.d.ts +0 -1
  265. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +0 -2
  266. package/lib/chevre/service/task/placeOrder.js +8 -6
  267. package/lib/chevre/service/task/publishPaymentUrl.js +2 -13
  268. package/lib/chevre/service/task/refund.js +0 -1
  269. package/lib/chevre/service/task/reserve.js +3 -6
  270. package/lib/chevre/service/task/returnOrder.js +3 -7
  271. package/lib/chevre/service/task/returnPayTransaction.js +9 -19
  272. package/lib/chevre/service/task/returnReserveTransaction.js +5 -6
  273. package/lib/chevre/service/task/sendEmailMessage.js +2 -2
  274. package/lib/chevre/service/task/sendOrder.js +4 -8
  275. package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
  276. package/lib/chevre/service/task/triggerWebhook.js +4 -2
  277. package/lib/chevre/service/task/useReservation.js +6 -2
  278. package/lib/chevre/service/task/voidPayment.js +0 -2
  279. package/lib/chevre/service/task/voidReserveTransaction.js +11 -13
  280. package/lib/chevre/service/task.d.ts +4 -4
  281. package/lib/chevre/service/task.js +8 -12
  282. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
  283. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
  284. package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
  285. package/lib/chevre/service/taskHandler.d.ts +1 -2
  286. package/lib/chevre/service/taskHandler.js +7 -19
  287. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
  288. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
  289. package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -4
  290. package/lib/chevre/service/transaction/deleteTransaction.js +7 -7
  291. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
  292. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  293. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +11 -17
  294. package/lib/chevre/service/transaction/returnOrder.js +11 -17
  295. package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
  296. package/lib/chevre/service/validation/validateOrder.js +3 -3
  297. package/lib/chevre/taskSettings.d.ts +4 -4
  298. package/package.json +2 -2
  299. package/lib/chevre/repo/action/actionProcess.d.ts +0 -147
  300. package/lib/chevre/repo/action/checkThing.d.ts +0 -8
  301. package/lib/chevre/repo/action/checkThing.js +0 -13
  302. package/lib/chevre/repo/action.js +0 -468
  303. package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
  304. package/lib/chevre/repo/asyncActionLegacy.js +0 -59
  305. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
  306. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
  307. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
  308. package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
  309. package/lib/chevre/repo/ownershipInfo.js +0 -466
  310. package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -39
  311. package/lib/chevre/repo/scheduledTaskLegacy.js +0 -96
  312. package/lib/chevre/repo/scheduledTaskMigration.d.ts +0 -21
  313. package/lib/chevre/repo/scheduledTaskMigration.js +0 -70
  314. package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
  315. package/lib/chevre/service/validation/validateEvent.js +0 -21
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AsyncActionLegacyRepo = void 0;
4
- const task_1 = require("../eventEmitter/task");
5
- const factory_1 = require("../factory");
6
- const task_2 = require("./mongoose/schemas/task");
7
- /**
8
- * 旧非同期アクション(tasksコレクションにて管理)リポジトリ
9
- */
10
- class AsyncActionLegacyRepo {
11
- taskModel;
12
- constructor(connection) {
13
- this.taskModel = connection.model(task_2.modelName, (0, task_2.createSchema)());
14
- }
15
- async runImmediately(params,
16
- // support customr function(2025-05-25~)
17
- next) {
18
- const { expires } = params;
19
- if (!(expires instanceof Date)) {
20
- throw new factory_1.factory.errors.Argument('expires', 'must be Date');
21
- }
22
- const savingTask = {
23
- ...params,
24
- status: factory_1.factory.taskStatus.Ready,
25
- numberOfTried: 0,
26
- executionResults: []
27
- };
28
- const result = await this.taskModel.insertMany(savingTask, { rawResult: true });
29
- const id = result.insertedIds?.[0]?.toHexString();
30
- if (typeof id !== 'string') {
31
- throw new factory_1.factory.errors.Internal('task not saved');
32
- }
33
- task_1.taskEventEmitter.emitTaskStatusChanged({
34
- id,
35
- status: factory_1.factory.taskStatus.Ready,
36
- expires // emit expires(2025-03-31~)
37
- }, next);
38
- return { id };
39
- }
40
- /**
41
- * Readyのままで期限切れのタスクをExpiredに変更する
42
- */
43
- async makeExpiredMany(params) {
44
- const { expiresLt } = params;
45
- if (!(expiresLt instanceof Date)) {
46
- throw new factory_1.factory.errors.Argument('expiresLt', 'must be Date');
47
- }
48
- return this.taskModel.updateMany({
49
- status: { $eq: factory_1.factory.taskStatus.Ready },
50
- expires: { $exists: true, $lt: expiresLt }
51
- }, {
52
- $set: {
53
- status: factory_1.factory.taskStatus.Expired
54
- }
55
- })
56
- .exec();
57
- }
58
- }
59
- exports.AsyncActionLegacyRepo = AsyncActionLegacyRepo;
@@ -1,227 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modelName = exports.indexes = void 0;
4
- exports.createSchema = createSchema;
5
- const mongoose_1 = require("mongoose");
6
- const writeConcern_1 = require("../writeConcern");
7
- const settings_1 = require("../../../settings");
8
- const modelName = 'OwnershipInfo';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
- _id: String,
13
- typeOf: { type: String, required: true },
14
- identifier: { type: String, required: true },
15
- ownedBy: mongoose_1.SchemaTypes.Mixed,
16
- acquiredFrom: mongoose_1.SchemaTypes.Mixed,
17
- ownedFrom: { type: Date, required: true },
18
- ownedThrough: { type: Date, required: true },
19
- typeOfGood: mongoose_1.SchemaTypes.Mixed
20
- };
21
- const schemaOptions = {
22
- autoIndex: settings_1.MONGO_AUTO_INDEX,
23
- autoCreate: false,
24
- collection: 'ownershipInfos',
25
- id: true,
26
- read: 'primary',
27
- writeConcern: writeConcern_1.writeConcern,
28
- strict: true,
29
- strictQuery: false,
30
- timestamps: false,
31
- versionKey: false,
32
- toJSON: {
33
- getters: false,
34
- virtuals: false,
35
- minimize: false,
36
- versionKey: false
37
- },
38
- toObject: {
39
- getters: false,
40
- virtuals: true,
41
- minimize: false,
42
- versionKey: false
43
- }
44
- };
45
- const indexes = [
46
- [
47
- // 識別子はユニークな前提
48
- { identifier: 1 },
49
- {
50
- unique: true,
51
- name: 'uniqueIdentifier'
52
- }
53
- ],
54
- [
55
- { ownedFrom: -1 },
56
- { name: 'searchByOwnedFrom-v3' }
57
- ],
58
- [
59
- { 'project.id': 1, ownedFrom: -1 },
60
- {
61
- name: 'searchByProjectId-v20220721'
62
- }
63
- ],
64
- [
65
- { typeOf: 1, ownedFrom: -1 },
66
- { name: 'searchByTypeOf-v2' }
67
- ],
68
- // [
69
- // { identifier: 1, ownedFrom: -1 },
70
- // {
71
- // name: 'searchByIdentifier-v2',
72
- // partialFilterExpression: {
73
- // identifier: { $exists: true }
74
- // }
75
- // }
76
- // ],
77
- [
78
- { identifier: 1, ownedFrom: -1 },
79
- { name: 'identifier' }
80
- ],
81
- [
82
- { 'acquiredFrom.id': 1, ownedFrom: -1 },
83
- {
84
- name: 'searchByAcquiredFromId-v2',
85
- partialFilterExpression: {
86
- 'acquiredFrom.id': { $exists: true }
87
- }
88
- }
89
- ],
90
- [
91
- { 'ownedBy.typeOf': 1, ownedFrom: -1 },
92
- {
93
- name: 'searchByOwnedByTypeOf',
94
- partialFilterExpression: {
95
- 'ownedBy.typeOf': { $exists: true }
96
- }
97
- }
98
- ],
99
- [
100
- { 'ownedBy.id': 1, ownedFrom: -1 },
101
- {
102
- name: 'searchByOwnedById',
103
- partialFilterExpression: {
104
- 'ownedBy.id': { $exists: true }
105
- }
106
- }
107
- ],
108
- // [
109
- // { 'ownedBy.memberOf.membershipNumber': 1, ownedFrom: -1 },
110
- // {
111
- // name: 'searchByOwnedByMemberOfMembershipNumber',
112
- // partialFilterExpression: {
113
- // 'ownedBy.memberOf.membershipNumber': { $exists: true }
114
- // }
115
- // }
116
- // ],
117
- // [
118
- // { ownedThrough: -1, ownedFrom: -1 },
119
- // {
120
- // name: 'searchByOwnedThrough-v2',
121
- // partialFilterExpression: {
122
- // ownedThrough: { $exists: true }
123
- // }
124
- // }
125
- // ],
126
- [
127
- { ownedThrough: 1, ownedFrom: -1 },
128
- { name: 'ownedThrough' }
129
- ],
130
- [
131
- { 'typeOfGood.typeOf': 1, ownedFrom: -1 },
132
- {
133
- name: 'searchByTypeOfGoodTypeOf-v2',
134
- partialFilterExpression: {
135
- 'typeOfGood.typeOf': { $exists: true }
136
- }
137
- }
138
- ],
139
- // [
140
- // { 'typeOfGood.reservedTicket.ticketToken': 1, ownedFrom: -1 },
141
- // {
142
- // name: 'searchByTypeOfGoofReservedTicketToken',
143
- // partialFilterExpression: {
144
- // 'typeOfGood.reservedTicket.ticketToken': { $exists: true }
145
- // }
146
- // }
147
- // ],
148
- [
149
- { 'typeOfGood.id': 1, ownedFrom: -1 },
150
- {
151
- name: 'searchByTypeOfGoodId',
152
- partialFilterExpression: {
153
- 'typeOfGood.id': { $exists: true }
154
- }
155
- }
156
- ],
157
- [
158
- { 'typeOfGood.identifier': 1, ownedFrom: -1 },
159
- {
160
- name: 'searchByTypeOfGoodIdentifier',
161
- partialFilterExpression: {
162
- 'typeOfGood.identifier': { $exists: true }
163
- }
164
- }
165
- ],
166
- // [
167
- // { 'typeOfGood.membershipFor.id': 1, ownedFrom: -1 },
168
- // {
169
- // name: 'searchByTypeOfGoodMembershipForId',
170
- // partialFilterExpression: {
171
- // 'typeOfGood.membershipFor.id': { $exists: true }
172
- // }
173
- // }
174
- // ],
175
- [
176
- { 'typeOfGood.issuedThrough.id': 1, ownedFrom: -1 },
177
- {
178
- name: 'searchByTypeOfGoodIssuedThroughId',
179
- partialFilterExpression: {
180
- 'typeOfGood.issuedThrough.id': { $exists: true }
181
- }
182
- }
183
- ],
184
- [
185
- { 'typeOfGood.issuedThrough.typeOf': 1, ownedFrom: -1 },
186
- {
187
- name: 'searchByTypeOfGoodIssuedThroughTypeOf',
188
- partialFilterExpression: {
189
- 'typeOfGood.issuedThrough.typeOf': { $exists: true }
190
- }
191
- }
192
- ],
193
- // [
194
- // { 'typeOfGood.accountNumber': 1, ownedFrom: -1 },
195
- // {
196
- // name: 'searchByTypeOfGoodAccountNumber',
197
- // partialFilterExpression: {
198
- // 'typeOfGood.accountNumber': { $exists: true }
199
- // }
200
- // }
201
- // ],
202
- [
203
- { 'typeOfGood.reservationNumber': 1, ownedFrom: -1 },
204
- {
205
- name: 'searchByTypeOfGoodReservationNumber',
206
- partialFilterExpression: {
207
- 'typeOfGood.reservationNumber': { $exists: true }
208
- }
209
- }
210
- ]
211
- ];
212
- exports.indexes = indexes;
213
- /**
214
- * 所有権スキーマ
215
- */
216
- let schema;
217
- function createSchema() {
218
- if (schema === undefined) {
219
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
220
- if (settings_1.MONGO_AUTO_INDEX) {
221
- indexes.forEach((indexParams) => {
222
- schema?.index(...indexParams);
223
- });
224
- }
225
- }
226
- return schema;
227
- }
@@ -1,25 +0,0 @@
1
- import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
- import { factory } from '../../../factory';
3
- import { IVirtuals } from '../virtuals';
4
- interface IAggregateReservation {
5
- project: {
6
- id: string;
7
- typeOf: factory.organizationType.Project;
8
- };
9
- typeOf: 'AggregateReservation';
10
- reservationCount: number;
11
- reservationFor: {
12
- id: string;
13
- startDate: Date;
14
- };
15
- reservationIds: string[];
16
- expires: Date;
17
- }
18
- type IDocType = IAggregateReservation;
19
- type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
20
- type ISchemaDefinition = SchemaDefinition<IDocType>;
21
- type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
22
- declare const modelName = "PendingReservationAggregate";
23
- declare const indexes: [d: IndexDefinition, o: IndexOptions][];
24
- declare function createSchema(): ISchema;
25
- export { createSchema, IDocType, IModel, IAggregateReservation, indexes, modelName };
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modelName = exports.indexes = void 0;
4
- exports.createSchema = createSchema;
5
- const mongoose_1 = require("mongoose");
6
- const settings_1 = require("../../../settings");
7
- const writeConcern_1 = require("../writeConcern");
8
- const modelName = 'PendingReservationAggregate';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
- typeOf: { type: String, required: true },
13
- expires: { type: Date, required: true },
14
- reservationCount: { type: Number, required: true },
15
- reservationFor: { type: mongoose_1.SchemaTypes.Mixed, required: true },
16
- reservationIds: [mongoose_1.SchemaTypes.Mixed]
17
- };
18
- const schemaOptions = {
19
- autoIndex: settings_1.MONGO_AUTO_INDEX,
20
- autoCreate: false,
21
- collection: 'pendingReservationAggregates',
22
- id: true,
23
- read: settings_1.MONGO_READ_PREFERENCE,
24
- writeConcern: writeConcern_1.writeConcern,
25
- strict: true,
26
- strictQuery: false,
27
- timestamps: false,
28
- versionKey: false,
29
- toJSON: {
30
- getters: false,
31
- virtuals: false,
32
- minimize: false,
33
- versionKey: false
34
- },
35
- toObject: {
36
- getters: false,
37
- virtuals: true,
38
- minimize: false,
39
- versionKey: false
40
- }
41
- };
42
- const indexes = [
43
- [
44
- { expires: -1 },
45
- { name: 'expires' }
46
- ],
47
- // [
48
- // { 'project.id': 1, expires: -1 },
49
- // { name: 'projectId' }
50
- // ],
51
- // [
52
- // { 'reservationFor.id': 1, expires: -1 },
53
- // { name: 'reservationForId' }
54
- // ],
55
- // [
56
- // { reservationIds: 1, expires: -1 },
57
- // { name: 'reservationIds' }
58
- // ], // このindexで性能下がる?
59
- // [
60
- // { reservationIds: 1 },
61
- // { name: 'reservationIds' }
62
- // ], // このindexで性能下がる?
63
- [
64
- { 'reservationFor.id': 1 },
65
- {
66
- unique: true,
67
- name: 'uniqueReservationForId'
68
- }
69
- ],
70
- [
71
- {
72
- 'reservationFor.id': 1,
73
- reservationCount: 1
74
- },
75
- { name: 'increaseReservationCount' }
76
- ],
77
- [
78
- {
79
- 'reservationFor.id': 1,
80
- reservationIds: 1
81
- },
82
- { name: 'decreaseReservationCount' }
83
- ]
84
- ];
85
- exports.indexes = indexes;
86
- /**
87
- * 保留予約集計スキーマ
88
- */
89
- let schema;
90
- function createSchema() {
91
- if (schema === undefined) {
92
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
93
- if (settings_1.MONGO_AUTO_INDEX) {
94
- indexes.forEach((indexParams) => {
95
- schema?.index(...indexParams);
96
- });
97
- }
98
- }
99
- return schema;
100
- }
@@ -1,122 +0,0 @@
1
- import type { Connection } from 'mongoose';
2
- import { IDocType } from './mongoose/schemas/ownershipInfo';
3
- import { factory } from '../factory';
4
- export type IOwnershipInfoWithId = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
5
- id: string;
6
- };
7
- /**
8
- * 所有権リポジトリ
9
- */
10
- export declare class OwnershipInfoRepo {
11
- private readonly ownershipInfoModel;
12
- constructor(connection: Connection);
13
- static CREATE_MONGO_CONDITIONS(params: factory.ownershipInfo.ISearchConditions): any[];
14
- /**
15
- * なければ作成する
16
- */
17
- createIfNotExistByIdentifier(ownershipInfo: Omit<IOwnershipInfoWithId, 'id'>): Promise<{
18
- id: string;
19
- }>;
20
- projectFieldsById(params: {
21
- id: string;
22
- }, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId>;
23
- /**
24
- * 所有権を検索する
25
- */
26
- projectFields(params: factory.ownershipInfo.ISearchConditions, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId[]>;
27
- /**
28
- * 識別子から所有期限を変更する
29
- * 存在しない場合undefinedを返す
30
- */
31
- findByIdentifierAndUpdateOwnedThrough(params: {
32
- project: {
33
- id: string;
34
- };
35
- identifier: string;
36
- ownedThrough: Date;
37
- }): Promise<Pick<IOwnershipInfoWithId, 'id' | 'identifier'> | undefined>;
38
- /**
39
- * 所有者の所有権を全て削除する
40
- */
41
- deleteByOwnedById(params: {
42
- project: {
43
- id: string;
44
- };
45
- ownedBy: {
46
- id: string;
47
- };
48
- }): Promise<{
49
- deletedCount?: number;
50
- }>;
51
- /**
52
- * 特定所有者の特定所有権を削除する
53
- */
54
- deleteByIdAndOwnedById(params: {
55
- project: {
56
- id: string;
57
- };
58
- id: string;
59
- ownedBy: {
60
- id: string;
61
- };
62
- }): Promise<{
63
- deletedCount?: number;
64
- }>;
65
- /**
66
- * 識別子から所有期限切れの所有権を削除する
67
- */
68
- deleteExpiredByIdentifiers(params: {
69
- project: {
70
- id: string;
71
- };
72
- identifiers: string[];
73
- ownedThrough: {
74
- $lte: Date;
75
- };
76
- }): Promise<void>;
77
- /**
78
- * 所有期限切れの所有権を削除する
79
- */
80
- deleteExpiredOwnershipInfos(params: {
81
- ownedThroughLte: Date;
82
- }): Promise<void>;
83
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>, "id"> & {
84
- _id: string;
85
- } & Required<{
86
- _id: string;
87
- }> & {
88
- __v: number;
89
- }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>, "id"> & {
90
- _id: string;
91
- } & Required<{
92
- _id: string;
93
- }> & {
94
- __v: number;
95
- }) | null>;
96
- /**
97
- * 所有者を追加する
98
- */
99
- addOwnerIfNotExist(params: {
100
- /**
101
- * 所有権ID
102
- */
103
- id: string;
104
- ownedBy: factory.ownershipInfo.IOwner;
105
- }): Promise<void>;
106
- /**
107
- * 所有者を削除する
108
- */
109
- removeOwnerIfExist(params: {
110
- /**
111
- * 所有権ID
112
- */
113
- id: string;
114
- ownedBy: {
115
- id: string;
116
- };
117
- }): Promise<void>;
118
- unsetUnnecessaryFields(params: {
119
- filter: any;
120
- $unset: any;
121
- }): Promise<import("mongoose").UpdateWriteOpResult>;
122
- }