@chevre/domain 21.2.0-alpha.12 → 21.2.0-alpha.120

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 (293) hide show
  1. package/example/src/chevre/aggregateEventReservation.ts +1 -1
  2. package/example/src/chevre/aggregation/aggregateSystem.ts +85 -27
  3. package/example/src/chevre/countDelayedTasks.ts +7 -2
  4. package/example/src/chevre/deleteTasksByName.ts +10 -2
  5. package/example/src/chevre/findMovieTheaterById.ts +40 -0
  6. package/example/src/chevre/importEventsFromCOA.ts +3 -4
  7. package/example/src/chevre/lockStockHolder.ts +2 -1
  8. package/example/src/chevre/migrateOrderAdditionalProperties.ts +85 -0
  9. package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +79 -0
  10. package/example/src/chevre/migrateStockHolderKeys.ts +1 -1
  11. package/example/src/chevre/processPay.ts +5 -1
  12. package/example/src/chevre/processRegisterMembership.ts +8 -4
  13. package/example/src/chevre/processRegisterPaymentCard.ts +8 -4
  14. package/example/src/chevre/processReserve.ts +5 -2
  15. package/example/src/chevre/saveTasks.ts +13 -10
  16. package/example/src/chevre/searchAbortedTasks.ts +36 -0
  17. package/example/src/chevre/searchActions.ts +33 -0
  18. package/example/src/chevre/searchEventSeats.ts +2 -1
  19. package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +37 -1
  20. package/example/src/chevre/searchSendEmailActions.ts +44 -0
  21. package/example/src/chevre/task/executeTasks.ts +26 -0
  22. package/example/src/chevre/transaction/findCreditCard.ts +1 -1
  23. package/example/src/chevre/transaction/orderMembershipService.ts +1 -1
  24. package/example/src/chevre/transaction/processReturnOrder.ts +40 -0
  25. package/example/src/chevre/transaction/startExportTasks.ts +20 -0
  26. package/example/src/chevre/updateScreeningRoom.ts +41 -0
  27. package/example/src/chevre/updateTransaction.ts +1 -1
  28. package/example/src/playOnMoment.ts +24 -0
  29. package/lib/chevre/credentials.d.ts +1 -0
  30. package/lib/chevre/credentials.js +2 -1
  31. package/lib/chevre/eventEmitter/assetTransaction.d.ts +21 -0
  32. package/lib/chevre/eventEmitter/assetTransaction.js +25 -0
  33. package/lib/chevre/eventEmitter/task.d.ts +18 -0
  34. package/lib/chevre/eventEmitter/task.js +25 -0
  35. package/lib/chevre/eventEmitter/transaction.d.ts +21 -0
  36. package/lib/chevre/eventEmitter/transaction.js +25 -0
  37. package/lib/chevre/eventEmitter.d.ts +4 -0
  38. package/lib/chevre/eventEmitter.js +9 -0
  39. package/lib/chevre/index.d.ts +3 -2
  40. package/lib/chevre/index.js +5 -3
  41. package/lib/chevre/repo/account.js +3 -2
  42. package/lib/chevre/repo/accountTransaction.d.ts +3 -11
  43. package/lib/chevre/repo/accountTransaction.js +3 -55
  44. package/lib/chevre/repo/action.d.ts +42 -2
  45. package/lib/chevre/repo/action.js +130 -57
  46. package/lib/chevre/repo/additionalProperty.js +2 -1
  47. package/lib/chevre/repo/aggregation.d.ts +3 -0
  48. package/lib/chevre/repo/aggregation.js +3 -0
  49. package/lib/chevre/repo/assetTransaction.d.ts +25 -9
  50. package/lib/chevre/repo/assetTransaction.js +259 -87
  51. package/lib/chevre/repo/categoryCode.d.ts +1 -1
  52. package/lib/chevre/repo/categoryCode.js +37 -25
  53. package/lib/chevre/repo/code.js +3 -2
  54. package/lib/chevre/repo/comment.d.ts +4 -1
  55. package/lib/chevre/repo/comment.js +22 -6
  56. package/lib/chevre/repo/confirmationNumber.d.ts +0 -1
  57. package/lib/chevre/repo/confirmationNumber.js +3 -15
  58. package/lib/chevre/repo/creativeWork.d.ts +2 -4
  59. package/lib/chevre/repo/creativeWork.js +35 -12
  60. package/lib/chevre/repo/customer.js +2 -1
  61. package/lib/chevre/repo/emailMessage.d.ts +1 -27
  62. package/lib/chevre/repo/emailMessage.js +2 -1
  63. package/lib/chevre/repo/event.d.ts +27 -1
  64. package/lib/chevre/repo/event.js +67 -33
  65. package/lib/chevre/repo/member.js +4 -3
  66. package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -3
  67. package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
  68. package/lib/chevre/repo/mongoose/schemas/account.d.ts +4 -2
  69. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +29 -3
  70. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +31 -3
  71. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  72. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +13 -3
  73. package/lib/chevre/repo/mongoose/schemas/action.d.ts +43 -3
  74. package/lib/chevre/repo/mongoose/schemas/action.js +19 -1
  75. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +17 -3
  76. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +4 -2
  77. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +44 -3
  78. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +32 -19
  79. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +19 -3
  80. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  81. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +25 -3
  82. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +27 -3
  83. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  84. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +43 -3
  85. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +25 -3
  86. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +21 -3
  87. package/lib/chevre/repo/mongoose/schemas/event.d.ts +71 -3
  88. package/lib/chevre/repo/mongoose/schemas/holdReservation.d.ts +75 -0
  89. package/lib/chevre/repo/mongoose/schemas/holdReservation.js +56 -0
  90. package/lib/chevre/repo/mongoose/schemas/member.d.ts +13 -3
  91. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +21 -3
  92. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +65 -3
  93. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +27 -3
  94. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +74 -0
  95. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +45 -0
  96. package/lib/chevre/repo/mongoose/schemas/order.d.ts +51 -3
  97. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  98. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +25 -3
  99. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  100. package/lib/chevre/repo/mongoose/schemas/place.d.ts +49 -3
  101. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +29 -3
  102. package/lib/chevre/repo/mongoose/schemas/product.d.ts +31 -3
  103. package/lib/chevre/repo/mongoose/schemas/project.d.ts +23 -3
  104. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +63 -5
  105. package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
  106. package/lib/chevre/repo/mongoose/schemas/role.d.ts +11 -3
  107. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +31 -3
  108. package/lib/chevre/repo/mongoose/schemas/seller.js +6 -0
  109. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +11 -3
  110. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  111. package/lib/chevre/repo/mongoose/schemas/task.d.ts +30 -3
  112. package/lib/chevre/repo/mongoose/schemas/task.js +2 -1
  113. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +21 -3
  114. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +40 -3
  115. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -1
  116. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +11 -3
  117. package/lib/chevre/repo/offer.js +3 -2
  118. package/lib/chevre/repo/offerCatalog.js +0 -27
  119. package/lib/chevre/repo/offerItemCondition.d.ts +22 -0
  120. package/lib/chevre/repo/offerItemCondition.js +121 -0
  121. package/lib/chevre/repo/order.d.ts +55 -3
  122. package/lib/chevre/repo/order.js +62 -10
  123. package/lib/chevre/repo/ownershipInfo.js +2 -7
  124. package/lib/chevre/repo/place.d.ts +20 -5
  125. package/lib/chevre/repo/place.js +63 -23
  126. package/lib/chevre/repo/priceSpecification.js +3 -2
  127. package/lib/chevre/repo/product.d.ts +1 -3
  128. package/lib/chevre/repo/product.js +25 -4
  129. package/lib/chevre/repo/project.js +2 -1
  130. package/lib/chevre/repo/reservation.d.ts +20 -4
  131. package/lib/chevre/repo/reservation.js +40 -59
  132. package/lib/chevre/repo/role.js +3 -2
  133. package/lib/chevre/repo/seller.d.ts +1 -1
  134. package/lib/chevre/repo/seller.js +44 -23
  135. package/lib/chevre/repo/serviceOutput.js +2 -1
  136. package/lib/chevre/repo/stockHolder.d.ts +35 -5
  137. package/lib/chevre/repo/stockHolder.js +306 -87
  138. package/lib/chevre/repo/task.d.ts +45 -2
  139. package/lib/chevre/repo/task.js +94 -15
  140. package/lib/chevre/repo/transaction.d.ts +23 -3
  141. package/lib/chevre/repo/transaction.js +177 -56
  142. package/lib/chevre/repo/trip.js +2 -1
  143. package/lib/chevre/repository.d.ts +5 -2
  144. package/lib/chevre/repository.js +8 -4
  145. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +8 -6
  146. package/lib/chevre/service/aggregation/system.d.ts +110 -23
  147. package/lib/chevre/service/aggregation/system.js +213 -91
  148. package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -28
  149. package/lib/chevre/service/assetTransaction/moneyTransfer.js +2 -24
  150. package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -1
  151. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +17 -1
  152. package/lib/chevre/service/assetTransaction/pay.d.ts +5 -1
  153. package/lib/chevre/service/assetTransaction/pay.js +20 -34
  154. package/lib/chevre/service/assetTransaction/refund.js +2 -24
  155. package/lib/chevre/service/assetTransaction/registerService.js +1 -25
  156. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +15 -5
  157. package/lib/chevre/service/assetTransaction/reserve/factory.js +122 -58
  158. package/lib/chevre/service/assetTransaction/reserve.d.ts +10 -1
  159. package/lib/chevre/service/assetTransaction/reserve.js +85 -69
  160. package/lib/chevre/service/assetTransaction.d.ts +6 -0
  161. package/lib/chevre/service/assetTransaction.js +9 -4
  162. package/lib/chevre/service/event.js +16 -5
  163. package/lib/chevre/service/notification/factory.js +2 -2
  164. package/lib/chevre/service/notification.d.ts +3 -1
  165. package/lib/chevre/service/notification.js +41 -7
  166. package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
  167. package/lib/chevre/service/offer/event/authorize.js +8 -2
  168. package/lib/chevre/service/offer/event/factory.d.ts +3 -0
  169. package/lib/chevre/service/offer/event/factory.js +16 -5
  170. package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
  171. package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
  172. package/lib/chevre/service/offer/event/voidTransaction.js +17 -1
  173. package/lib/chevre/service/offer/eventServiceByCOA.js +7 -9
  174. package/lib/chevre/service/offer/product.js +2 -2
  175. package/lib/chevre/service/offer.d.ts +16 -8
  176. package/lib/chevre/service/offer.js +69 -8
  177. package/lib/chevre/service/order/deleteOrder.d.ts +3 -1
  178. package/lib/chevre/service/order/deleteOrder.js +8 -8
  179. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +5 -2
  180. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +41 -81
  181. package/lib/chevre/service/order/onOrderStatusChanged.js +1 -3
  182. package/lib/chevre/service/order/onOrderUpdated.d.ts +16 -0
  183. package/lib/chevre/service/order/onOrderUpdated.js +22 -0
  184. package/lib/chevre/service/order/placeOrder.d.ts +1 -0
  185. package/lib/chevre/service/order/placeOrder.js +41 -24
  186. package/lib/chevre/service/order/returnOrder.d.ts +1 -0
  187. package/lib/chevre/service/order/returnOrder.js +7 -12
  188. package/lib/chevre/service/order/sendOrder.d.ts +1 -0
  189. package/lib/chevre/service/order/sendOrder.js +7 -10
  190. package/lib/chevre/service/order.d.ts +2 -1
  191. package/lib/chevre/service/order.js +3 -1
  192. package/lib/chevre/service/payment/any/onPaid.js +1 -1
  193. package/lib/chevre/service/payment/any/onRefund.js +1 -1
  194. package/lib/chevre/service/payment/any.d.ts +9 -5
  195. package/lib/chevre/service/payment/any.js +80 -18
  196. package/lib/chevre/service/payment/creditCard.d.ts +1 -1
  197. package/lib/chevre/service/payment/creditCard.js +23 -17
  198. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +8 -7
  199. package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
  200. package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
  201. package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -1
  202. package/lib/chevre/service/payment/movieTicket/validation.d.ts +6 -6
  203. package/lib/chevre/service/payment/movieTicket/validation.js +55 -32
  204. package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
  205. package/lib/chevre/service/payment/movieTicket.js +7 -6
  206. package/lib/chevre/service/product.js +1 -5
  207. package/lib/chevre/service/report/telemetry.d.ts +0 -11
  208. package/lib/chevre/service/report/telemetry.js +21 -24
  209. package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
  210. package/lib/chevre/service/reserve/cancelReservation.js +147 -139
  211. package/lib/chevre/service/reserve/checkInReservation.d.ts +9 -4
  212. package/lib/chevre/service/reserve/checkInReservation.js +77 -3
  213. package/lib/chevre/service/reserve/confirmReservation.d.ts +7 -4
  214. package/lib/chevre/service/reserve/confirmReservation.js +133 -58
  215. package/lib/chevre/service/reserve/factory.d.ts +1 -1
  216. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +17 -5
  217. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +26 -24
  218. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -3
  219. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -31
  220. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
  221. package/lib/chevre/service/reserve/useReservation.d.ts +7 -3
  222. package/lib/chevre/service/reserve/useReservation.js +61 -71
  223. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +15 -0
  224. package/lib/chevre/service/reserve/verifyToken4reservation.js +56 -0
  225. package/lib/chevre/service/reserve.d.ts +3 -2
  226. package/lib/chevre/service/reserve.js +4 -2
  227. package/lib/chevre/service/task/aggregateScreeningEvent.js +1 -1
  228. package/lib/chevre/service/task/cancelPendingReservation.js +6 -2
  229. package/lib/chevre/service/task/cancelReservation.js +1 -1
  230. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -1
  231. package/lib/chevre/service/task/deleteTransaction.js +10 -8
  232. package/lib/chevre/service/task/importOffersFromCOA.js +4 -0
  233. package/lib/chevre/service/task/onAuthorizationCreated.d.ts +7 -0
  234. package/lib/chevre/service/task/onAuthorizationCreated.js +108 -0
  235. package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
  236. package/lib/chevre/service/task/{deleteOrder.js → onEventChanged.js} +8 -14
  237. package/lib/chevre/service/task/onResourceUpdated.d.ts +7 -0
  238. package/lib/chevre/service/task/onResourceUpdated.js +352 -0
  239. package/lib/chevre/service/task/placeOrder.js +1 -1
  240. package/lib/chevre/service/task/reserve.js +10 -7
  241. package/lib/chevre/service/task/returnOrder.js +1 -1
  242. package/lib/chevre/service/task/returnPayTransaction.js +2 -12
  243. package/lib/chevre/service/task/sendOrder.js +1 -1
  244. package/lib/chevre/service/task/useReservation.d.ts +7 -0
  245. package/lib/chevre/service/task/useReservation.js +36 -0
  246. package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
  247. package/lib/chevre/service/task.d.ts +9 -0
  248. package/lib/chevre/service/task.js +43 -4
  249. package/lib/chevre/service/transaction/deleteTransaction.d.ts +21 -0
  250. package/lib/chevre/service/transaction/deleteTransaction.js +232 -0
  251. package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +11 -1
  252. package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +1 -1
  253. package/lib/chevre/service/transaction/moneyTransfer/factory.js +3 -1
  254. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -0
  255. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -1
  256. package/lib/chevre/service/transaction/moneyTransfer.js +10 -13
  257. package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
  258. package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +1 -1
  259. package/lib/chevre/service/transaction/orderProgramMembership.js +7 -3
  260. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +42 -30
  261. package/lib/chevre/service/transaction/placeOrder.js +1 -5
  262. package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +1 -1
  263. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -0
  264. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
  265. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +1 -0
  266. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
  267. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +1 -0
  268. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +3 -0
  269. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +7 -3
  270. package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -0
  271. package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -2
  272. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +1 -1
  273. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +2 -2
  274. package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +2 -1
  275. package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +23 -17
  276. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -3
  277. package/lib/chevre/service/transaction/placeOrderInProgress.js +28 -15
  278. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +10 -1
  279. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +25 -17
  280. package/lib/chevre/service/transaction/returnOrder.d.ts +4 -0
  281. package/lib/chevre/service/transaction/returnOrder.js +228 -36
  282. package/lib/chevre/service/transaction.d.ts +8 -13
  283. package/lib/chevre/service/transaction.js +12 -145
  284. package/lib/chevre/settings.d.ts +12 -1
  285. package/lib/chevre/settings.js +53 -6
  286. package/package.json +5 -5
  287. package/example/src/chevre/createManyEventsIfNotExist.ts +0 -205
  288. package/example/src/chevre/eventCatalog2eventService.ts +0 -123
  289. package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +0 -96
  290. package/example/src/chevre/migrateMovieAdditionalProperties.ts +0 -98
  291. package/lib/chevre/service/task/deleteAssetTransaction.d.ts +0 -12
  292. package/lib/chevre/service/task/deleteAssetTransaction.js +0 -65
  293. package/lib/chevre/service/task/deleteOrder.d.ts +0 -6
@@ -13,14 +13,16 @@ exports.StockHolderRepository = void 0;
13
13
  const createDebug = require("debug");
14
14
  const moment = require("moment");
15
15
  const factory = require("../factory");
16
+ const holdReservation_1 = require("./mongoose/schemas/holdReservation");
16
17
  const settings_1 = require("../settings");
17
18
  const debug = createDebug('chevre-domain:repo');
18
19
  /**
19
20
  * イベントストックホルダーリポジトリ
20
21
  */
21
22
  class StockHolderRepository {
22
- constructor(redisClient) {
23
+ constructor(redisClient, connection) {
23
24
  this.redisClient = redisClient;
25
+ this.holdReservationModel = connection.model(holdReservation_1.modelName, holdReservation_1.schema);
24
26
  }
25
27
  // public static GET_KEY(params: {
26
28
  // eventId: string;
@@ -37,6 +39,25 @@ class StockHolderRepository {
37
39
  }
38
40
  return `${params.seatSection}:${params.seatNumber}`;
39
41
  }
42
+ static offer2subReservation(params) {
43
+ var _a, _b;
44
+ const serviceOutputId = (_b = (_a = params.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.id;
45
+ if (typeof serviceOutputId === 'string') {
46
+ return {
47
+ id: serviceOutputId,
48
+ identifier: serviceOutputId
49
+ };
50
+ }
51
+ return {
52
+ identifier: `${params.seatSection}:${params.seatNumber}`,
53
+ reservedTicket: {
54
+ ticketedSeat: {
55
+ seatSection: params.seatSection,
56
+ seatNumber: params.seatNumber
57
+ }
58
+ }
59
+ };
60
+ }
40
61
  static createKey(params) {
41
62
  if (!(params.startDate instanceof Date)) {
42
63
  throw new factory.errors.Argument('startDate', 'must be Date');
@@ -50,21 +71,62 @@ class StockHolderRepository {
50
71
  return `${StockHolderRepository.KEY_PREFIX}:${params.eventId}`;
51
72
  }
52
73
  }
74
+ /**
75
+ * 新リポジトリを使用するかどうか
76
+ */
77
+ static useMongoose(params) {
78
+ if (settings_1.USE_NEW_STOCK_HOLDER_REPO_IDS.includes(params.eventId)) {
79
+ return true;
80
+ }
81
+ return false;
82
+ }
53
83
  /**
54
84
  * 座席をロックする(maxキャパシティチェック有)
55
85
  */
56
86
  lockIfNotLimitExceeded(lockKey, maximum) {
57
87
  return __awaiter(this, void 0, void 0, function* () {
58
- const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
59
- yield this.redisClient.watch(key);
60
- const hashCount = yield this.redisClient.hLen(key);
61
- // Process result
62
- // Heavy and time consuming operation here
63
- debug('checking hash count...hashCount:', hashCount);
64
- if (hashCount + lockKey.offers.length > maximum) {
65
- throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
88
+ if (StockHolderRepository.useMongoose({ eventId: lockKey.eventId, startDate: lockKey.startDate })) {
89
+ // reservationCount<=nであれば$push+$incする
90
+ yield this.initializeHoldReservation({ eventId: lockKey.eventId, startDate: lockKey.startDate });
91
+ const addedReservationCount = lockKey.offers.length;
92
+ const reservationCountLte = maximum - addedReservationCount;
93
+ const subReservations = lockKey.offers.map((offer) => StockHolderRepository.offer2subReservation(offer));
94
+ const reservationPackage = {
95
+ typeOf: factory.reservationType.ReservationPackage,
96
+ reservationNumber: lockKey.holder,
97
+ subReservation: subReservations
98
+ };
99
+ yield this.holdReservationModel.findOneAndUpdate({
100
+ reservationCount: { $lte: reservationCountLte },
101
+ 'reservationFor.id': { $eq: lockKey.eventId },
102
+ // 座席有無に関わらずsubReservation.identifierはuniqueであるはず
103
+ 'reservations.subReservation.identifier': {
104
+ $nin: subReservations.map((r) => r.identifier)
105
+ }
106
+ }, {
107
+ $inc: { reservationCount: addedReservationCount },
108
+ $push: { reservations: reservationPackage }
109
+ }, { new: true })
110
+ .select({ _id: 1 })
111
+ .exec()
112
+ .then((doc) => {
113
+ if (doc === null) {
114
+ throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
115
+ }
116
+ });
117
+ }
118
+ else {
119
+ const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
120
+ yield this.redisClient.watch(key);
121
+ const hashCount = yield this.redisClient.hLen(key);
122
+ // Process result
123
+ // Heavy and time consuming operation here
124
+ debug('checking hash count...hashCount:', hashCount);
125
+ if (hashCount + lockKey.offers.length > maximum) {
126
+ throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
127
+ }
128
+ yield this.lock(lockKey);
66
129
  }
67
- yield this.lock(lockKey);
68
130
  });
69
131
  }
70
132
  /**
@@ -72,47 +134,76 @@ class StockHolderRepository {
72
134
  */
73
135
  lock(lockKey) {
74
136
  return __awaiter(this, void 0, void 0, function* () {
75
- if (!(lockKey.expires instanceof Date)) {
76
- throw new factory.errors.Argument('expires', 'must be Date');
77
- }
78
- const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
79
- yield this.checkIfConflicted({ key, eventId: lockKey.eventId });
80
- const value = lockKey.holder;
81
- const multi = this.redisClient.multi();
82
- const fields = lockKey.offers.map((offer) => StockHolderRepository.offer2field(offer));
83
- fields.forEach((field) => {
84
- multi.hSetNX(key, field, value);
85
- });
86
- const results = yield multi.expireAt(key, moment(lockKey.expires)
87
- .unix())
88
- .exec();
89
- const lockedFields = [];
90
- if (Array.isArray(results)) {
91
- results.slice(0, fields.length)
92
- .forEach((r, index) => {
93
- if (r === 1 || r === true) {
94
- lockedFields.push(fields[index]);
137
+ if (StockHolderRepository.useMongoose({ eventId: lockKey.eventId, startDate: lockKey.startDate })) {
138
+ yield this.initializeHoldReservation({ eventId: lockKey.eventId, startDate: lockKey.startDate });
139
+ const addedReservationCount = lockKey.offers.length;
140
+ const subReservations = lockKey.offers.map((offer) => StockHolderRepository.offer2subReservation(offer));
141
+ const reservationPackage = {
142
+ typeOf: factory.reservationType.ReservationPackage,
143
+ reservationNumber: lockKey.holder,
144
+ subReservation: subReservations
145
+ };
146
+ yield this.holdReservationModel.findOneAndUpdate({
147
+ 'reservationFor.id': { $eq: lockKey.eventId },
148
+ // 座席有無に関わらずsubReservation.identifierはuniqueであるはず
149
+ 'reservations.subReservation.identifier': {
150
+ $nin: subReservations.map((r) => r.identifier)
151
+ }
152
+ }, {
153
+ $inc: { reservationCount: addedReservationCount },
154
+ $push: { reservations: reservationPackage }
155
+ }, { new: true })
156
+ .select({ _id: 1 })
157
+ .exec()
158
+ .then((doc) => {
159
+ if (doc === null) {
160
+ throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
95
161
  }
96
162
  });
97
163
  }
98
- const lockedAll = lockedFields.length === fields.length;
99
- debug('lockedAll?', lockedAll);
100
- // expireAtReplyの検証も追加する(2023-04-19~)
101
- const expiredAll = results.slice(fields.length)
102
- .every((r) => (r === 1 || r === true));
103
- debug('expiredAll?', expiredAll);
104
- if (!lockedAll || !expiredAll) {
105
- if (lockedFields.length > 0) {
106
- // 全て仮押さえできなければ仮押さえできたものは解除
107
- yield this.redisClient.multi()
108
- .hDel(key, lockedFields)
109
- .exec();
164
+ else {
165
+ if (!(lockKey.expires instanceof Date)) {
166
+ throw new factory.errors.Argument('expires', 'must be Date');
110
167
  }
111
- if (!lockedAll) {
112
- throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
168
+ const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
169
+ yield this.checkIfConflicted({ key, eventId: lockKey.eventId });
170
+ const value = lockKey.holder;
171
+ const multi = this.redisClient.multi();
172
+ const fields = lockKey.offers.map((offer) => StockHolderRepository.offer2field(offer));
173
+ fields.forEach((field) => {
174
+ multi.hSetNX(key, field, value);
175
+ });
176
+ const results = yield multi.expireAt(key, moment(lockKey.expires)
177
+ .unix())
178
+ .exec();
179
+ const lockedFields = [];
180
+ if (Array.isArray(results)) {
181
+ results.slice(0, fields.length)
182
+ .forEach((r, index) => {
183
+ if (r === 1 || r === true) {
184
+ lockedFields.push(fields[index]);
185
+ }
186
+ });
113
187
  }
114
- else {
115
- throw new factory.errors.ServiceUnavailable('timeout cannot be set unexpectedly');
188
+ const lockedAll = lockedFields.length === fields.length;
189
+ debug('lockedAll?', lockedAll);
190
+ // expireAtReplyの検証も追加する(2023-04-19~)
191
+ const expiredAll = results.slice(fields.length)
192
+ .every((r) => (r === 1 || r === true));
193
+ debug('expiredAll?', expiredAll);
194
+ if (!lockedAll || !expiredAll) {
195
+ if (lockedFields.length > 0) {
196
+ // 全て仮押さえできなければ仮押さえできたものは解除
197
+ yield this.redisClient.multi()
198
+ .hDel(key, lockedFields)
199
+ .exec();
200
+ }
201
+ if (!lockedAll) {
202
+ throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
203
+ }
204
+ else {
205
+ throw new factory.errors.ServiceUnavailable('timeout cannot be set unexpectedly');
206
+ }
116
207
  }
117
208
  }
118
209
  });
@@ -122,55 +213,126 @@ class StockHolderRepository {
122
213
  */
123
214
  unlock(params) {
124
215
  return __awaiter(this, void 0, void 0, function* () {
125
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
126
- yield this.checkIfConflicted({ key, eventId: params.eventId });
127
- const field = StockHolderRepository.offer2field(params.offer);
128
- yield this.redisClient.multi()
129
- .hDel(key, field)
130
- .exec();
216
+ if (StockHolderRepository.useMongoose({ eventId: params.eventId, startDate: params.startDate })) {
217
+ // [id]あるいは[seatNumber+seatSection]でreservations.subReservationsから$pull+$incする
218
+ yield this.initializeHoldReservation({ eventId: params.eventId, startDate: params.startDate });
219
+ const subReservation = StockHolderRepository.offer2subReservation(params.offer);
220
+ yield this.holdReservationModel.findOneAndUpdate({
221
+ 'reservationFor.id': { $eq: params.eventId },
222
+ 'reservations.subReservation.identifier': {
223
+ $eq: subReservation.identifier
224
+ }
225
+ }, {
226
+ $inc: { reservationCount: -1 },
227
+ $pull: { 'reservations.subReservation': { identifier: { $eq: subReservation.identifier } } }
228
+ }, { new: true })
229
+ .select({ _id: 1 })
230
+ .exec();
231
+ // docが存在しなくてもよい
232
+ }
233
+ else {
234
+ const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
235
+ yield this.checkIfConflicted({ key, eventId: params.eventId });
236
+ const field = StockHolderRepository.offer2field(params.offer);
237
+ yield this.redisClient.multi()
238
+ .hDel(key, field)
239
+ .exec();
240
+ }
131
241
  });
132
242
  }
133
243
  /**
134
244
  * 空席でない座席を検索する
135
245
  */
136
- findUnavailableOffersByEventId(params) {
137
- return __awaiter(this, void 0, void 0, function* () {
138
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
139
- const reply = yield this.redisClient.hGetAll(key);
140
- let offers = [];
141
- if (reply !== null) {
142
- offers = Object.keys(reply)
143
- .map((field) => {
144
- const seatSection = field.split(':')[0];
145
- const seatNumber = field.split(':')[1];
146
- return { seatSection, seatNumber };
147
- });
148
- }
149
- return offers;
150
- });
151
- }
246
+ // public async findUnavailableOffersByEventId(params: { eventId: string; startDate: Date }): Promise<IOffer[]> {
247
+ // const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
248
+ // const reply = await this.redisClient.hGetAll(key);
249
+ // let offers: IOffer[] = [];
250
+ // if (reply !== null) {
251
+ // offers = Object.keys(reply)
252
+ // .map((field) => {
253
+ // const seatSection = field.split(':')[0];
254
+ // const seatNumber = field.split(':')[1];
255
+ // return { seatSection, seatNumber };
256
+ // });
257
+ // }
258
+ // return offers;
259
+ // }
152
260
  /**
153
261
  * 空席でない座席をカウントする
154
262
  */
155
263
  countUnavailableOffers(params) {
156
264
  return __awaiter(this, void 0, void 0, function* () {
157
- const key = StockHolderRepository.createKey({ eventId: params.event.id, startDate: params.event.startDate });
158
- const reply = yield this.redisClient.hLen(key);
159
- let fieldCount = 0;
160
- if (typeof reply === 'number') {
161
- fieldCount = Number(reply);
265
+ if (StockHolderRepository.useMongoose({ eventId: params.event.id, startDate: params.event.startDate })) {
266
+ // reservationCountを返す
267
+ return this.holdReservationModel.findOne({
268
+ 'reservationFor.id': { $eq: params.event.id }
269
+ })
270
+ .select({ reservationCount: 1 })
271
+ .exec()
272
+ .then((doc) => {
273
+ if (doc === null) {
274
+ return 0;
275
+ }
276
+ else {
277
+ return doc.reservationCount;
278
+ }
279
+ });
280
+ }
281
+ else {
282
+ const key = StockHolderRepository.createKey({ eventId: params.event.id, startDate: params.event.startDate });
283
+ const reply = yield this.redisClient.hLen(key);
284
+ let fieldCount = 0;
285
+ if (typeof reply === 'number') {
286
+ fieldCount = Number(reply);
287
+ }
288
+ return fieldCount;
162
289
  }
163
- return fieldCount;
164
290
  });
165
291
  }
166
292
  /**
167
293
  * 保持者を取得する
168
294
  */
169
295
  getHolder(params) {
296
+ var _a;
170
297
  return __awaiter(this, void 0, void 0, function* () {
171
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
172
- const field = StockHolderRepository.offer2field(params.offer);
173
- return this.redisClient.hGet(key, field);
298
+ if (StockHolderRepository.useMongoose({ eventId: params.eventId, startDate: params.startDate })) {
299
+ // [id]あるいは[seatNumber+seatSection]でreservationNumberを返す
300
+ yield this.initializeHoldReservation({ eventId: params.eventId, startDate: params.startDate });
301
+ const subReservation = StockHolderRepository.offer2subReservation(params.offer);
302
+ const matchStages = [
303
+ {
304
+ $match: { 'reservationFor.id': { $eq: params.eventId } }
305
+ },
306
+ {
307
+ $match: { 'reservations.subReservation.identifier': { $eq: subReservation.identifier } }
308
+ }
309
+ ];
310
+ const aggregate = this.holdReservationModel.aggregate([
311
+ { $unwind: '$reservations' },
312
+ { $unwind: '$reservations.subReservation' },
313
+ ...matchStages,
314
+ {
315
+ $project: {
316
+ _id: 0,
317
+ reservationNumber: '$reservations.reservationNumber',
318
+ identifier: '$reservations.subReservation.identifier'
319
+ }
320
+ }
321
+ ]);
322
+ const subReservations = yield aggregate.exec();
323
+ debug('getHolder found subReservations.', subReservation.identifier, subReservations);
324
+ if (subReservations.length > 0) {
325
+ return String((_a = subReservations.shift()) === null || _a === void 0 ? void 0 : _a.reservationNumber);
326
+ }
327
+ else {
328
+ return;
329
+ }
330
+ }
331
+ else {
332
+ const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
333
+ const field = StockHolderRepository.offer2field(params.offer);
334
+ return this.redisClient.hGet(key, field);
335
+ }
174
336
  });
175
337
  }
176
338
  /**
@@ -207,17 +369,52 @@ class StockHolderRepository {
207
369
  // }
208
370
  searchHolders(params) {
209
371
  return __awaiter(this, void 0, void 0, function* () {
210
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
211
- const fields = params.offers.map((o) => {
212
- return StockHolderRepository.offer2field(o);
213
- });
214
- // Array reply: list of values associated with the given fields, in the same order as they are requested.
215
- const result = yield this.redisClient.hmGet(key, fields);
216
- if (!Array.isArray(result)) {
217
- throw new factory.errors.ServiceUnavailable(`searchAvailability got non-array: ${typeof result}`);
372
+ if (StockHolderRepository.useMongoose({ eventId: params.eventId, startDate: params.startDate })) {
373
+ // [id]あるいは[seatNumber+seatSection]のリストでreservationNumberのリストを返す
374
+ yield this.initializeHoldReservation({ eventId: params.eventId, startDate: params.startDate });
375
+ const subReservations = params.offers.map((offer) => StockHolderRepository.offer2subReservation(offer));
376
+ const matchStages = [
377
+ {
378
+ $match: { 'reservationFor.id': { $eq: params.eventId } }
379
+ },
380
+ {
381
+ $match: { 'reservations.subReservation.identifier': { $in: subReservations.map((r) => r.identifier) } }
382
+ }
383
+ ];
384
+ const aggregate = this.holdReservationModel.aggregate([
385
+ { $unwind: '$reservations' },
386
+ { $unwind: '$reservations.subReservation' },
387
+ ...matchStages,
388
+ {
389
+ $project: {
390
+ _id: 0,
391
+ reservationNumber: '$reservations.reservationNumber',
392
+ identifier: '$reservations.subReservation.identifier'
393
+ }
394
+ }
395
+ ]);
396
+ const subReservationsByDoc = yield aggregate.exec();
397
+ return subReservations.map((subReservation) => {
398
+ const subReservationByDoc = subReservationsByDoc.find((r) => r.identifier === subReservation.identifier);
399
+ return (subReservationByDoc !== undefined)
400
+ ? String(subReservationByDoc.reservationNumber)
401
+ // tslint:disable-next-line:no-null-keyword
402
+ : null;
403
+ });
404
+ }
405
+ else {
406
+ const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
407
+ const fields = params.offers.map((o) => {
408
+ return StockHolderRepository.offer2field(o);
409
+ });
410
+ // Array reply: list of values associated with the given fields, in the same order as they are requested.
411
+ const result = yield this.redisClient.hmGet(key, fields);
412
+ if (!Array.isArray(result)) {
413
+ throw new factory.errors.ServiceUnavailable(`searchAvailability got non-array: ${typeof result}`);
414
+ }
415
+ // そのまま返却(2023-04-17~)
416
+ return result;
218
417
  }
219
- // そのまま返却(2023-04-17~)
220
- return result;
221
418
  });
222
419
  }
223
420
  // public async migrateKey(params: {
@@ -267,6 +464,28 @@ class StockHolderRepository {
267
464
  }
268
465
  });
269
466
  }
467
+ initializeHoldReservation(params) {
468
+ return __awaiter(this, void 0, void 0, function* () {
469
+ if (!(params.startDate instanceof Date)) {
470
+ throw new factory.errors.Argument('startDate', 'must be Date');
471
+ }
472
+ const aggregateReservation = {
473
+ typeOf: 'AggregateReservation',
474
+ reservationCount: 0,
475
+ reservationFor: {
476
+ id: params.eventId,
477
+ startDate: params.startDate
478
+ },
479
+ reservations: []
480
+ };
481
+ const initializedHoldReservation = yield this.holdReservationModel.findOneAndUpdate({ 'reservationFor.id': { $eq: params.eventId } }, {
482
+ $setOnInsert: aggregateReservation
483
+ }, { new: true, upsert: true })
484
+ .select({ _id: 1 })
485
+ .exec();
486
+ debug('holdReservation initialized', initializedHoldReservation, params.eventId);
487
+ });
488
+ }
270
489
  }
271
490
  StockHolderRepository.KEY_PREFIX_NEW = 'stockHolder';
272
491
  StockHolderRepository.KEY_PREFIX = 'chevre:itemAvailability:screeningEvent';
@@ -17,6 +17,9 @@ interface IStatus {
17
17
  export interface IAggregateTask {
18
18
  statuses: IStatus[];
19
19
  }
20
+ interface IOptionOnCreate {
21
+ emitImmediately: boolean;
22
+ }
20
23
  /**
21
24
  * タスクリポジトリ
22
25
  */
@@ -24,13 +27,43 @@ export declare class MongoRepository {
24
27
  readonly taskModel: typeof Model;
25
28
  constructor(connection: Connection);
26
29
  static CREATE_MONGO_CONDITIONS(params: factory.task.ISearchConditions): any[];
27
- saveMany(taskAttributes: factory.task.IAttributes<factory.taskName>[]): Promise<{
30
+ saveMany(taskAttributes: factory.task.IAttributes<factory.taskName>[], options: IOptionOnCreate): Promise<{
28
31
  id: string;
29
32
  }[]>;
30
- createInformTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.TriggerWebhook>): Promise<void>;
33
+ createInformTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.TriggerWebhook>, options: IOptionOnCreate): Promise<void>;
34
+ executeById(params: {
35
+ id: string;
36
+ executor: {
37
+ name: string;
38
+ };
39
+ }): Promise<factory.task.ITask<factory.taskName> | null>;
31
40
  executeOneByName<T extends factory.taskName>(params: {
32
41
  name: T;
42
+ executor: {
43
+ name: string;
44
+ };
33
45
  }): Promise<factory.task.ITask<T> | null>;
46
+ /**
47
+ * 一定期間遅延したタスクを実行する
48
+ */
49
+ executeTasks(params: {
50
+ now: Date;
51
+ /**
52
+ * 指定期間遅延しているタスクを実行する
53
+ */
54
+ delayInSeconds: number;
55
+ limit: number;
56
+ name: {
57
+ /**
58
+ * 指定タスクのみ実行する
59
+ */
60
+ $in?: factory.taskName[];
61
+ /**
62
+ * 指定タスク以外のみ実行する
63
+ */
64
+ $nin?: factory.taskName[];
65
+ };
66
+ }): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
34
67
  retry(params: {
35
68
  intervalInMinutes: number;
36
69
  }): Promise<void>;
@@ -60,9 +93,19 @@ export declare class MongoRepository {
60
93
  }): Promise<void>;
61
94
  deleteByName(params: {
62
95
  name: factory.taskName;
96
+ status?: {
97
+ $eq?: factory.taskStatus;
98
+ };
99
+ runsAt?: {
100
+ $gte: Date;
101
+ $lte: Date;
102
+ };
63
103
  }): Promise<import("mongodb").DeleteResult>;
64
104
  countDelayedTasks(params: {
65
105
  delayInSeconds: number;
106
+ name: {
107
+ $nin?: factory.taskName[];
108
+ };
66
109
  }): Promise<number>;
67
110
  aggregateTask(params: {
68
111
  project?: {