@chevre/domain 21.2.0-alpha.10 → 21.2.0-alpha.100

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 (235) hide show
  1. package/example/src/chevre/aggregation/aggregateSystem.ts +58 -31
  2. package/example/src/chevre/createManyEventsIfNotExist.ts +4 -1
  3. package/example/src/chevre/deleteTasksByName.ts +10 -2
  4. package/example/src/chevre/importEventsFromCOA.ts +3 -4
  5. package/example/src/chevre/migrateOrderAdditionalProperties.ts +85 -0
  6. package/example/src/chevre/processPay.ts +5 -1
  7. package/example/src/chevre/processReserve.ts +4 -1
  8. package/example/src/chevre/saveTasks.ts +13 -10
  9. package/example/src/chevre/searchAbortedTasks.ts +36 -0
  10. package/example/src/chevre/searchActions.ts +33 -0
  11. package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +37 -1
  12. package/example/src/chevre/searchSendEmailActions.ts +44 -0
  13. package/example/src/chevre/task/executeTasks.ts +26 -0
  14. package/example/src/chevre/transaction/findCreditCard.ts +1 -1
  15. package/example/src/chevre/transaction/orderMembershipService.ts +1 -1
  16. package/example/src/chevre/transaction/processReturnOrder.ts +40 -0
  17. package/example/src/chevre/transaction/startExportTasks.ts +20 -0
  18. package/example/src/chevre/updateTransaction.ts +1 -1
  19. package/example/src/playOnMoment.ts +24 -0
  20. package/lib/chevre/credentials.d.ts +1 -0
  21. package/lib/chevre/credentials.js +2 -1
  22. package/lib/chevre/eventEmitter/assetTransaction.d.ts +21 -0
  23. package/lib/chevre/eventEmitter/assetTransaction.js +25 -0
  24. package/lib/chevre/eventEmitter/task.d.ts +18 -0
  25. package/lib/chevre/eventEmitter/task.js +25 -0
  26. package/lib/chevre/eventEmitter/transaction.d.ts +21 -0
  27. package/lib/chevre/eventEmitter/transaction.js +25 -0
  28. package/lib/chevre/eventEmitter.d.ts +4 -0
  29. package/lib/chevre/eventEmitter.js +9 -0
  30. package/lib/chevre/index.d.ts +3 -2
  31. package/lib/chevre/index.js +5 -3
  32. package/lib/chevre/repo/accountTransaction.d.ts +3 -11
  33. package/lib/chevre/repo/accountTransaction.js +1 -54
  34. package/lib/chevre/repo/action.d.ts +29 -1
  35. package/lib/chevre/repo/action.js +98 -55
  36. package/lib/chevre/repo/assetTransaction.d.ts +25 -9
  37. package/lib/chevre/repo/assetTransaction.js +256 -85
  38. package/lib/chevre/repo/comment.d.ts +4 -1
  39. package/lib/chevre/repo/comment.js +20 -5
  40. package/lib/chevre/repo/confirmationNumber.d.ts +0 -1
  41. package/lib/chevre/repo/confirmationNumber.js +3 -15
  42. package/lib/chevre/repo/creativeWork.d.ts +1 -3
  43. package/lib/chevre/repo/emailMessage.d.ts +1 -27
  44. package/lib/chevre/repo/event.d.ts +5 -1
  45. package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -3
  46. package/lib/chevre/repo/mongoose/schemas/account.d.ts +4 -2
  47. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +29 -3
  48. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +31 -3
  49. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  50. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +13 -3
  51. package/lib/chevre/repo/mongoose/schemas/action.d.ts +43 -3
  52. package/lib/chevre/repo/mongoose/schemas/action.js +19 -1
  53. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +17 -3
  54. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +4 -2
  55. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +44 -3
  56. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +32 -19
  57. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +19 -3
  58. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  59. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +25 -3
  60. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +27 -3
  61. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  62. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +43 -3
  63. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +25 -3
  64. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +21 -3
  65. package/lib/chevre/repo/mongoose/schemas/event.d.ts +71 -3
  66. package/lib/chevre/repo/mongoose/schemas/member.d.ts +13 -3
  67. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +21 -3
  68. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +65 -3
  69. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +27 -3
  70. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +74 -0
  71. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +45 -0
  72. package/lib/chevre/repo/mongoose/schemas/order.d.ts +51 -3
  73. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  74. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +25 -3
  75. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  76. package/lib/chevre/repo/mongoose/schemas/place.d.ts +49 -3
  77. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +29 -3
  78. package/lib/chevre/repo/mongoose/schemas/product.d.ts +31 -3
  79. package/lib/chevre/repo/mongoose/schemas/project.d.ts +23 -3
  80. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +63 -5
  81. package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
  82. package/lib/chevre/repo/mongoose/schemas/role.d.ts +11 -3
  83. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +31 -3
  84. package/lib/chevre/repo/mongoose/schemas/seller.js +6 -0
  85. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +11 -3
  86. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  87. package/lib/chevre/repo/mongoose/schemas/task.d.ts +30 -3
  88. package/lib/chevre/repo/mongoose/schemas/task.js +2 -1
  89. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +21 -3
  90. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +40 -3
  91. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -1
  92. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +11 -3
  93. package/lib/chevre/repo/offerItemCondition.d.ts +22 -0
  94. package/lib/chevre/repo/offerItemCondition.js +120 -0
  95. package/lib/chevre/repo/order.d.ts +55 -3
  96. package/lib/chevre/repo/order.js +56 -5
  97. package/lib/chevre/repo/reservation.d.ts +12 -4
  98. package/lib/chevre/repo/reservation.js +16 -44
  99. package/lib/chevre/repo/seller.js +19 -19
  100. package/lib/chevre/repo/task.d.ts +42 -2
  101. package/lib/chevre/repo/task.js +90 -9
  102. package/lib/chevre/repo/transaction.d.ts +23 -3
  103. package/lib/chevre/repo/transaction.js +174 -54
  104. package/lib/chevre/repository.d.ts +5 -2
  105. package/lib/chevre/repository.js +8 -4
  106. package/lib/chevre/service/aggregation/system.d.ts +67 -22
  107. package/lib/chevre/service/aggregation/system.js +101 -89
  108. package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -28
  109. package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -23
  110. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +17 -1
  111. package/lib/chevre/service/assetTransaction/pay.d.ts +5 -1
  112. package/lib/chevre/service/assetTransaction/pay.js +18 -32
  113. package/lib/chevre/service/assetTransaction/refund.js +1 -23
  114. package/lib/chevre/service/assetTransaction/registerService.js +1 -25
  115. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +15 -5
  116. package/lib/chevre/service/assetTransaction/reserve/factory.js +122 -58
  117. package/lib/chevre/service/assetTransaction/reserve.d.ts +10 -1
  118. package/lib/chevre/service/assetTransaction/reserve.js +85 -69
  119. package/lib/chevre/service/assetTransaction.d.ts +6 -2
  120. package/lib/chevre/service/assetTransaction.js +9 -5
  121. package/lib/chevre/service/event.js +3 -1
  122. package/lib/chevre/service/notification/factory.js +2 -2
  123. package/lib/chevre/service/notification.d.ts +3 -1
  124. package/lib/chevre/service/notification.js +41 -7
  125. package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
  126. package/lib/chevre/service/offer/event/authorize.js +8 -2
  127. package/lib/chevre/service/offer/event/factory.d.ts +3 -0
  128. package/lib/chevre/service/offer/event/factory.js +16 -5
  129. package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
  130. package/lib/chevre/service/offer/event/voidTransaction.js +17 -1
  131. package/lib/chevre/service/offer.js +1 -1
  132. package/lib/chevre/service/order/deleteOrder.d.ts +3 -1
  133. package/lib/chevre/service/order/deleteOrder.js +8 -8
  134. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +5 -2
  135. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +41 -81
  136. package/lib/chevre/service/order/onOrderStatusChanged.js +1 -3
  137. package/lib/chevre/service/order/onOrderUpdated.d.ts +16 -0
  138. package/lib/chevre/service/order/onOrderUpdated.js +22 -0
  139. package/lib/chevre/service/order/placeOrder.d.ts +1 -0
  140. package/lib/chevre/service/order/placeOrder.js +41 -24
  141. package/lib/chevre/service/order/returnOrder.d.ts +1 -0
  142. package/lib/chevre/service/order/returnOrder.js +7 -12
  143. package/lib/chevre/service/order/sendOrder.d.ts +1 -0
  144. package/lib/chevre/service/order/sendOrder.js +7 -10
  145. package/lib/chevre/service/order.d.ts +2 -1
  146. package/lib/chevre/service/order.js +3 -1
  147. package/lib/chevre/service/payment/any/onPaid.js +1 -1
  148. package/lib/chevre/service/payment/any/onRefund.js +1 -1
  149. package/lib/chevre/service/payment/any.d.ts +9 -5
  150. package/lib/chevre/service/payment/any.js +80 -18
  151. package/lib/chevre/service/payment/creditCard.d.ts +1 -1
  152. package/lib/chevre/service/payment/creditCard.js +21 -15
  153. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +7 -6
  154. package/lib/chevre/service/payment/movieTicket/validation.d.ts +6 -6
  155. package/lib/chevre/service/payment/movieTicket/validation.js +54 -31
  156. package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
  157. package/lib/chevre/service/payment/movieTicket.js +5 -4
  158. package/lib/chevre/service/product.js +1 -5
  159. package/lib/chevre/service/report/telemetry.d.ts +0 -11
  160. package/lib/chevre/service/report/telemetry.js +21 -24
  161. package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
  162. package/lib/chevre/service/reserve/cancelReservation.js +147 -139
  163. package/lib/chevre/service/reserve/checkInReservation.d.ts +9 -4
  164. package/lib/chevre/service/reserve/checkInReservation.js +77 -3
  165. package/lib/chevre/service/reserve/confirmReservation.d.ts +7 -4
  166. package/lib/chevre/service/reserve/confirmReservation.js +125 -58
  167. package/lib/chevre/service/reserve/factory.d.ts +1 -1
  168. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +17 -5
  169. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +26 -24
  170. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -3
  171. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -31
  172. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
  173. package/lib/chevre/service/reserve/useReservation.d.ts +7 -3
  174. package/lib/chevre/service/reserve/useReservation.js +61 -71
  175. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +15 -0
  176. package/lib/chevre/service/reserve/verifyToken4reservation.js +56 -0
  177. package/lib/chevre/service/reserve.d.ts +3 -2
  178. package/lib/chevre/service/reserve.js +4 -2
  179. package/lib/chevre/service/task/cancelPendingReservation.js +5 -1
  180. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -1
  181. package/lib/chevre/service/task/deleteTransaction.js +10 -8
  182. package/lib/chevre/service/task/importOffersFromCOA.js +4 -0
  183. package/lib/chevre/service/task/onAuthorizationCreated.d.ts +7 -0
  184. package/lib/chevre/service/task/onAuthorizationCreated.js +108 -0
  185. package/lib/chevre/service/task/placeOrder.js +1 -1
  186. package/lib/chevre/service/task/reserve.js +10 -7
  187. package/lib/chevre/service/task/returnOrder.js +1 -1
  188. package/lib/chevre/service/task/returnPayTransaction.js +2 -12
  189. package/lib/chevre/service/task/sendOrder.js +1 -1
  190. package/lib/chevre/service/task/useReservation.d.ts +7 -0
  191. package/lib/chevre/service/task/useReservation.js +36 -0
  192. package/lib/chevre/service/task/voidReserveTransaction.js +3 -1
  193. package/lib/chevre/service/task.d.ts +9 -0
  194. package/lib/chevre/service/task.js +43 -4
  195. package/lib/chevre/service/transaction/deleteTransaction.d.ts +21 -0
  196. package/lib/chevre/service/transaction/deleteTransaction.js +232 -0
  197. package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +11 -1
  198. package/lib/chevre/service/transaction/moneyTransfer/factory.js +3 -1
  199. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -0
  200. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -1
  201. package/lib/chevre/service/transaction/moneyTransfer.js +9 -12
  202. package/lib/chevre/service/transaction/orderProgramMembership.js +6 -2
  203. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +42 -30
  204. package/lib/chevre/service/transaction/placeOrder.js +1 -5
  205. package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +1 -1
  206. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -0
  207. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
  208. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +1 -0
  209. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
  210. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +1 -0
  211. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +3 -0
  212. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +7 -3
  213. package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -0
  214. package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -2
  215. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +1 -1
  216. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +2 -2
  217. package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +2 -1
  218. package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +23 -17
  219. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -3
  220. package/lib/chevre/service/transaction/placeOrderInProgress.js +22 -11
  221. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +10 -1
  222. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +25 -17
  223. package/lib/chevre/service/transaction/returnOrder.d.ts +4 -0
  224. package/lib/chevre/service/transaction/returnOrder.js +225 -35
  225. package/lib/chevre/service/transaction.d.ts +8 -13
  226. package/lib/chevre/service/transaction.js +12 -145
  227. package/lib/chevre/settings.d.ts +4 -1
  228. package/lib/chevre/settings.js +15 -5
  229. package/package.json +5 -5
  230. package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +0 -96
  231. package/example/src/chevre/migrateMovieAdditionalProperties.ts +0 -98
  232. package/lib/chevre/service/task/deleteAssetTransaction.d.ts +0 -12
  233. package/lib/chevre/service/task/deleteAssetTransaction.js +0 -65
  234. package/lib/chevre/service/task/deleteOrder.d.ts +0 -6
  235. package/lib/chevre/service/task/deleteOrder.js +0 -35
@@ -21,7 +21,7 @@ class MongoRepository {
21
21
  }
22
22
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
23
23
  static CREATE_MONGO_CONDITIONS(params) {
24
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53;
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65;
25
25
  const andConditions = [];
26
26
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
27
27
  // tslint:disable-next-line:no-single-line-block-comment
@@ -75,9 +75,27 @@ class MongoRepository {
75
75
  }
76
76
  });
77
77
  }
78
+ const objectMovieTicketsIdentifierEq = (_o = (_m = (_l = params.object) === null || _l === void 0 ? void 0 : _l.movieTickets) === null || _m === void 0 ? void 0 : _m.identifier) === null || _o === void 0 ? void 0 : _o.$eq;
79
+ if (typeof objectMovieTicketsIdentifierEq === 'string') {
80
+ andConditions.push({
81
+ 'object.movieTickets.identifier': {
82
+ $exists: true,
83
+ $eq: objectMovieTicketsIdentifierEq
84
+ }
85
+ });
86
+ }
87
+ const objectMovieTicketsServiceOutputReservationForIdEq = (_t = (_s = (_r = (_q = (_p = params.object) === null || _p === void 0 ? void 0 : _p.movieTickets) === null || _q === void 0 ? void 0 : _q.serviceOutput) === null || _r === void 0 ? void 0 : _r.reservationFor) === null || _s === void 0 ? void 0 : _s.id) === null || _t === void 0 ? void 0 : _t.$eq;
88
+ if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
89
+ andConditions.push({
90
+ 'object.movieTickets.serviceOutput.reservationFor.id': {
91
+ $exists: true,
92
+ $eq: objectMovieTicketsServiceOutputReservationForIdEq
93
+ }
94
+ });
95
+ }
78
96
  // tslint:disable-next-line:no-single-line-block-comment
79
97
  /* istanbul ignore else */
80
- const objectPaymentMethodIdEq = (_m = (_l = params.object) === null || _l === void 0 ? void 0 : _l.paymentMethodId) === null || _m === void 0 ? void 0 : _m.$eq;
98
+ const objectPaymentMethodIdEq = (_v = (_u = params.object) === null || _u === void 0 ? void 0 : _u.paymentMethodId) === null || _v === void 0 ? void 0 : _v.$eq;
81
99
  if (typeof objectPaymentMethodIdEq === 'string') {
82
100
  andConditions.push({
83
101
  'object.paymentMethodId': {
@@ -86,7 +104,7 @@ class MongoRepository {
86
104
  }
87
105
  });
88
106
  }
89
- const objectObjectPaymentMethodIdEq = (_q = (_p = (_o = params.object) === null || _o === void 0 ? void 0 : _o.object) === null || _p === void 0 ? void 0 : _p.paymentMethodId) === null || _q === void 0 ? void 0 : _q.$eq;
107
+ const objectObjectPaymentMethodIdEq = (_y = (_x = (_w = params.object) === null || _w === void 0 ? void 0 : _w.object) === null || _x === void 0 ? void 0 : _x.paymentMethodId) === null || _y === void 0 ? void 0 : _y.$eq;
90
108
  if (typeof objectObjectPaymentMethodIdEq === 'string') {
91
109
  andConditions.push({
92
110
  'object.object.paymentMethodId': {
@@ -95,7 +113,7 @@ class MongoRepository {
95
113
  }
96
114
  });
97
115
  }
98
- const objectReservationForIdEq = (_t = (_s = (_r = params.object) === null || _r === void 0 ? void 0 : _r.reservationFor) === null || _s === void 0 ? void 0 : _s.id) === null || _t === void 0 ? void 0 : _t.$eq;
116
+ const objectReservationForIdEq = (_1 = (_0 = (_z = params.object) === null || _z === void 0 ? void 0 : _z.reservationFor) === null || _0 === void 0 ? void 0 : _0.id) === null || _1 === void 0 ? void 0 : _1.$eq;
99
117
  // tslint:disable-next-line:no-single-line-block-comment
100
118
  /* istanbul ignore else */
101
119
  if (typeof objectReservationForIdEq === 'string') {
@@ -106,7 +124,25 @@ class MongoRepository {
106
124
  }
107
125
  });
108
126
  }
109
- const objectPaymentMethodAccountIdEq = (_w = (_v = (_u = params.object) === null || _u === void 0 ? void 0 : _u.paymentMethod) === null || _v === void 0 ? void 0 : _v.accountId) === null || _w === void 0 ? void 0 : _w.$eq;
127
+ const objectReservationNumberEq = (_3 = (_2 = params.object) === null || _2 === void 0 ? void 0 : _2.reservationNumber) === null || _3 === void 0 ? void 0 : _3.$eq;
128
+ if (typeof objectReservationNumberEq === 'string') {
129
+ andConditions.push({
130
+ 'object.reservationNumber': {
131
+ $exists: true,
132
+ $eq: objectReservationNumberEq
133
+ }
134
+ });
135
+ }
136
+ const objectReservationNumberIn = (_5 = (_4 = params.object) === null || _4 === void 0 ? void 0 : _4.reservationNumber) === null || _5 === void 0 ? void 0 : _5.$in;
137
+ if (Array.isArray(objectReservationNumberIn)) {
138
+ andConditions.push({
139
+ 'object.reservationNumber': {
140
+ $exists: true,
141
+ $in: objectReservationNumberIn
142
+ }
143
+ });
144
+ }
145
+ const objectPaymentMethodAccountIdEq = (_8 = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.paymentMethod) === null || _7 === void 0 ? void 0 : _7.accountId) === null || _8 === void 0 ? void 0 : _8.$eq;
110
146
  // tslint:disable-next-line:no-single-line-block-comment
111
147
  /* istanbul ignore else */
112
148
  if (typeof objectPaymentMethodAccountIdEq === 'string') {
@@ -117,7 +153,7 @@ class MongoRepository {
117
153
  }
118
154
  });
119
155
  }
120
- const objectPaymentMethodPaymentMethodIdEq = (_z = (_y = (_x = params.object) === null || _x === void 0 ? void 0 : _x.paymentMethod) === null || _y === void 0 ? void 0 : _y.paymentMethodId) === null || _z === void 0 ? void 0 : _z.$eq;
156
+ const objectPaymentMethodPaymentMethodIdEq = (_11 = (_10 = (_9 = params.object) === null || _9 === void 0 ? void 0 : _9.paymentMethod) === null || _10 === void 0 ? void 0 : _10.paymentMethodId) === null || _11 === void 0 ? void 0 : _11.$eq;
121
157
  // tslint:disable-next-line:no-single-line-block-comment
122
158
  /* istanbul ignore else */
123
159
  if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
@@ -128,7 +164,7 @@ class MongoRepository {
128
164
  }
129
165
  });
130
166
  }
131
- const objectPaymentMethodPaymentMethodIdIn = (_2 = (_1 = (_0 = params.object) === null || _0 === void 0 ? void 0 : _0.paymentMethod) === null || _1 === void 0 ? void 0 : _1.paymentMethodId) === null || _2 === void 0 ? void 0 : _2.$in;
167
+ const objectPaymentMethodPaymentMethodIdIn = (_14 = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.paymentMethod) === null || _13 === void 0 ? void 0 : _13.paymentMethodId) === null || _14 === void 0 ? void 0 : _14.$in;
132
168
  if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
133
169
  andConditions.push({
134
170
  'object.paymentMethod.paymentMethodId': {
@@ -137,7 +173,7 @@ class MongoRepository {
137
173
  }
138
174
  });
139
175
  }
140
- const objectPaymentMethodTypeOfEq = (_5 = (_4 = (_3 = params.object) === null || _3 === void 0 ? void 0 : _3.paymentMethod) === null || _4 === void 0 ? void 0 : _4.typeOf) === null || _5 === void 0 ? void 0 : _5.$eq;
176
+ const objectPaymentMethodTypeOfEq = (_17 = (_16 = (_15 = params.object) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.typeOf) === null || _17 === void 0 ? void 0 : _17.$eq;
141
177
  // tslint:disable-next-line:no-single-line-block-comment
142
178
  /* istanbul ignore else */
143
179
  if (typeof objectPaymentMethodTypeOfEq === 'string') {
@@ -148,7 +184,7 @@ class MongoRepository {
148
184
  }
149
185
  });
150
186
  }
151
- const objectTypeOfEq = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$eq;
187
+ const objectTypeOfEq = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.typeOf) === null || _19 === void 0 ? void 0 : _19.$eq;
152
188
  // tslint:disable-next-line:no-single-line-block-comment
153
189
  /* istanbul ignore else */
154
190
  if (typeof objectTypeOfEq === 'string') {
@@ -159,7 +195,7 @@ class MongoRepository {
159
195
  }
160
196
  });
161
197
  }
162
- const objectTypeOfIn = (_9 = (_8 = params.object) === null || _8 === void 0 ? void 0 : _8.typeOf) === null || _9 === void 0 ? void 0 : _9.$in;
198
+ const objectTypeOfIn = (_21 = (_20 = params.object) === null || _20 === void 0 ? void 0 : _20.typeOf) === null || _21 === void 0 ? void 0 : _21.$in;
163
199
  if (Array.isArray(objectTypeOfIn)) {
164
200
  andConditions.push({
165
201
  'object.typeOf': {
@@ -168,7 +204,7 @@ class MongoRepository {
168
204
  }
169
205
  });
170
206
  }
171
- const objectIdEq = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.id) === null || _11 === void 0 ? void 0 : _11.$eq;
207
+ const objectIdEq = (_23 = (_22 = params.object) === null || _22 === void 0 ? void 0 : _22.id) === null || _23 === void 0 ? void 0 : _23.$eq;
172
208
  // tslint:disable-next-line:no-single-line-block-comment
173
209
  /* istanbul ignore else */
174
210
  if (typeof objectIdEq === 'string') {
@@ -179,7 +215,7 @@ class MongoRepository {
179
215
  }
180
216
  });
181
217
  }
182
- const objectIdIn = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.id) === null || _13 === void 0 ? void 0 : _13.$in;
218
+ const objectIdIn = (_25 = (_24 = params.object) === null || _24 === void 0 ? void 0 : _24.id) === null || _25 === void 0 ? void 0 : _25.$in;
183
219
  if (Array.isArray(objectIdIn)) {
184
220
  andConditions.push({
185
221
  'object.id': {
@@ -188,7 +224,7 @@ class MongoRepository {
188
224
  }
189
225
  });
190
226
  }
191
- const objectOrderNumberIn = (_15 = (_14 = params.object) === null || _14 === void 0 ? void 0 : _14.orderNumber) === null || _15 === void 0 ? void 0 : _15.$in;
227
+ const objectOrderNumberIn = (_27 = (_26 = params.object) === null || _26 === void 0 ? void 0 : _26.orderNumber) === null || _27 === void 0 ? void 0 : _27.$in;
192
228
  if (Array.isArray(objectOrderNumberIn)) {
193
229
  andConditions.push({
194
230
  'object.orderNumber': {
@@ -197,7 +233,7 @@ class MongoRepository {
197
233
  }
198
234
  });
199
235
  }
200
- const objectEventIdIn = (_18 = (_17 = (_16 = params.object) === null || _16 === void 0 ? void 0 : _16.event) === null || _17 === void 0 ? void 0 : _17.id) === null || _18 === void 0 ? void 0 : _18.$in;
236
+ const objectEventIdIn = (_30 = (_29 = (_28 = params.object) === null || _28 === void 0 ? void 0 : _28.event) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$in;
201
237
  if (Array.isArray(objectEventIdIn)) {
202
238
  andConditions.push({
203
239
  'object.event.id': {
@@ -206,7 +242,7 @@ class MongoRepository {
206
242
  }
207
243
  });
208
244
  }
209
- const objectAcceptedOfferSeatNumberIn = (_25 = (_24 = (_23 = (_22 = (_21 = (_20 = (_19 = params.object) === null || _19 === void 0 ? void 0 : _19.acceptedOffer) === null || _20 === void 0 ? void 0 : _20.itemOffered) === null || _21 === void 0 ? void 0 : _21.serviceOutput) === null || _22 === void 0 ? void 0 : _22.reservedTicket) === null || _23 === void 0 ? void 0 : _23.ticketedSeat) === null || _24 === void 0 ? void 0 : _24.seatNumber) === null || _25 === void 0 ? void 0 : _25.$in;
245
+ const objectAcceptedOfferSeatNumberIn = (_37 = (_36 = (_35 = (_34 = (_33 = (_32 = (_31 = params.object) === null || _31 === void 0 ? void 0 : _31.acceptedOffer) === null || _32 === void 0 ? void 0 : _32.itemOffered) === null || _33 === void 0 ? void 0 : _33.serviceOutput) === null || _34 === void 0 ? void 0 : _34.reservedTicket) === null || _35 === void 0 ? void 0 : _35.ticketedSeat) === null || _36 === void 0 ? void 0 : _36.seatNumber) === null || _37 === void 0 ? void 0 : _37.$in;
210
246
  if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
211
247
  andConditions.push({
212
248
  'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
@@ -223,7 +259,7 @@ class MongoRepository {
223
259
  });
224
260
  }
225
261
  else {
226
- const typeOfEq = (_26 = params.typeOf) === null || _26 === void 0 ? void 0 : _26.$eq;
262
+ const typeOfEq = (_38 = params.typeOf) === null || _38 === void 0 ? void 0 : _38.$eq;
227
263
  // tslint:disable-next-line:no-single-line-block-comment
228
264
  /* istanbul ignore else */
229
265
  if (typeof typeOfEq === 'string') {
@@ -232,7 +268,7 @@ class MongoRepository {
232
268
  });
233
269
  }
234
270
  }
235
- const actionStatusIn = (_27 = params.actionStatus) === null || _27 === void 0 ? void 0 : _27.$in;
271
+ const actionStatusIn = (_39 = params.actionStatus) === null || _39 === void 0 ? void 0 : _39.$in;
236
272
  // tslint:disable-next-line:no-single-line-block-comment
237
273
  /* istanbul ignore else */
238
274
  if (Array.isArray(actionStatusIn)) {
@@ -263,7 +299,7 @@ class MongoRepository {
263
299
  startDate: { $lte: startDateLte }
264
300
  });
265
301
  }
266
- const fromLocationTypeOfIn = (_29 = (_28 = params.fromLocation) === null || _28 === void 0 ? void 0 : _28.typeOf) === null || _29 === void 0 ? void 0 : _29.$in;
302
+ const fromLocationTypeOfIn = (_41 = (_40 = params.fromLocation) === null || _40 === void 0 ? void 0 : _40.typeOf) === null || _41 === void 0 ? void 0 : _41.$in;
267
303
  if (Array.isArray(fromLocationTypeOfIn)) {
268
304
  andConditions.push({
269
305
  'fromLocation.typeOf': {
@@ -272,7 +308,7 @@ class MongoRepository {
272
308
  }
273
309
  });
274
310
  }
275
- const fromLocationAccountNumberIn = (_31 = (_30 = params.fromLocation) === null || _30 === void 0 ? void 0 : _30.accountNumber) === null || _31 === void 0 ? void 0 : _31.$in;
311
+ const fromLocationAccountNumberIn = (_43 = (_42 = params.fromLocation) === null || _42 === void 0 ? void 0 : _42.accountNumber) === null || _43 === void 0 ? void 0 : _43.$in;
276
312
  if (Array.isArray(fromLocationAccountNumberIn)) {
277
313
  andConditions.push({
278
314
  'fromLocation.accountNumber': {
@@ -281,7 +317,7 @@ class MongoRepository {
281
317
  }
282
318
  });
283
319
  }
284
- const fromLocationAccountTypeIn = (_33 = (_32 = params.fromLocation) === null || _32 === void 0 ? void 0 : _32.accountType) === null || _33 === void 0 ? void 0 : _33.$in;
320
+ const fromLocationAccountTypeIn = (_45 = (_44 = params.fromLocation) === null || _44 === void 0 ? void 0 : _44.accountType) === null || _45 === void 0 ? void 0 : _45.$in;
285
321
  if (Array.isArray(fromLocationAccountTypeIn)) {
286
322
  andConditions.push({
287
323
  'fromLocation.accountType': {
@@ -290,7 +326,7 @@ class MongoRepository {
290
326
  }
291
327
  });
292
328
  }
293
- const toLocationTypeOfIn = (_35 = (_34 = params.toLocation) === null || _34 === void 0 ? void 0 : _34.typeOf) === null || _35 === void 0 ? void 0 : _35.$in;
329
+ const toLocationTypeOfIn = (_47 = (_46 = params.toLocation) === null || _46 === void 0 ? void 0 : _46.typeOf) === null || _47 === void 0 ? void 0 : _47.$in;
294
330
  if (Array.isArray(toLocationTypeOfIn)) {
295
331
  andConditions.push({
296
332
  'toLocation.typeOf': {
@@ -299,7 +335,7 @@ class MongoRepository {
299
335
  }
300
336
  });
301
337
  }
302
- const toLocationAccountNumberIn = (_37 = (_36 = params.toLocation) === null || _36 === void 0 ? void 0 : _36.accountNumber) === null || _37 === void 0 ? void 0 : _37.$in;
338
+ const toLocationAccountNumberIn = (_49 = (_48 = params.toLocation) === null || _48 === void 0 ? void 0 : _48.accountNumber) === null || _49 === void 0 ? void 0 : _49.$in;
303
339
  if (Array.isArray(toLocationAccountNumberIn)) {
304
340
  andConditions.push({
305
341
  'toLocation.accountNumber': {
@@ -308,7 +344,7 @@ class MongoRepository {
308
344
  }
309
345
  });
310
346
  }
311
- const toLocationAccountTypeIn = (_39 = (_38 = params.toLocation) === null || _38 === void 0 ? void 0 : _38.accountType) === null || _39 === void 0 ? void 0 : _39.$in;
347
+ const toLocationAccountTypeIn = (_51 = (_50 = params.toLocation) === null || _50 === void 0 ? void 0 : _50.accountType) === null || _51 === void 0 ? void 0 : _51.$in;
312
348
  if (Array.isArray(toLocationAccountTypeIn)) {
313
349
  andConditions.push({
314
350
  'toLocation.accountType': {
@@ -317,7 +353,7 @@ class MongoRepository {
317
353
  }
318
354
  });
319
355
  }
320
- const purposeTypeOfIn = (_41 = (_40 = params.purpose) === null || _40 === void 0 ? void 0 : _40.typeOf) === null || _41 === void 0 ? void 0 : _41.$in;
356
+ const purposeTypeOfIn = (_53 = (_52 = params.purpose) === null || _52 === void 0 ? void 0 : _52.typeOf) === null || _53 === void 0 ? void 0 : _53.$in;
321
357
  if (Array.isArray(purposeTypeOfIn)) {
322
358
  andConditions.push({
323
359
  'purpose.typeOf': {
@@ -326,7 +362,7 @@ class MongoRepository {
326
362
  }
327
363
  });
328
364
  }
329
- const purposeIdIn = (_43 = (_42 = params.purpose) === null || _42 === void 0 ? void 0 : _42.id) === null || _43 === void 0 ? void 0 : _43.$in;
365
+ const purposeIdIn = (_55 = (_54 = params.purpose) === null || _54 === void 0 ? void 0 : _54.id) === null || _55 === void 0 ? void 0 : _55.$in;
330
366
  if (Array.isArray(purposeIdIn)) {
331
367
  andConditions.push({
332
368
  'purpose.id': {
@@ -335,7 +371,7 @@ class MongoRepository {
335
371
  }
336
372
  });
337
373
  }
338
- const purposeOrderNumberIn = (_45 = (_44 = params.purpose) === null || _44 === void 0 ? void 0 : _44.orderNumber) === null || _45 === void 0 ? void 0 : _45.$in;
374
+ const purposeOrderNumberIn = (_57 = (_56 = params.purpose) === null || _56 === void 0 ? void 0 : _56.orderNumber) === null || _57 === void 0 ? void 0 : _57.$in;
339
375
  if (Array.isArray(purposeOrderNumberIn)) {
340
376
  andConditions.push({
341
377
  'purpose.orderNumber': {
@@ -344,7 +380,7 @@ class MongoRepository {
344
380
  }
345
381
  });
346
382
  }
347
- const resultTypeOfIn = (_47 = (_46 = params.result) === null || _46 === void 0 ? void 0 : _46.typeOf) === null || _47 === void 0 ? void 0 : _47.$in;
383
+ const resultTypeOfIn = (_59 = (_58 = params.result) === null || _58 === void 0 ? void 0 : _58.typeOf) === null || _59 === void 0 ? void 0 : _59.$in;
348
384
  if (Array.isArray(resultTypeOfIn)) {
349
385
  andConditions.push({
350
386
  'result.typeOf': {
@@ -353,7 +389,7 @@ class MongoRepository {
353
389
  }
354
390
  });
355
391
  }
356
- const resultIdIn = (_49 = (_48 = params.result) === null || _48 === void 0 ? void 0 : _48.id) === null || _49 === void 0 ? void 0 : _49.$in;
392
+ const resultIdIn = (_61 = (_60 = params.result) === null || _60 === void 0 ? void 0 : _60.id) === null || _61 === void 0 ? void 0 : _61.$in;
357
393
  if (Array.isArray(resultIdIn)) {
358
394
  andConditions.push({
359
395
  'result.id': {
@@ -362,7 +398,7 @@ class MongoRepository {
362
398
  }
363
399
  });
364
400
  }
365
- const resultOrderNumberIn = (_51 = (_50 = params.result) === null || _50 === void 0 ? void 0 : _50.orderNumber) === null || _51 === void 0 ? void 0 : _51.$in;
401
+ const resultOrderNumberIn = (_63 = (_62 = params.result) === null || _62 === void 0 ? void 0 : _62.orderNumber) === null || _63 === void 0 ? void 0 : _63.$in;
366
402
  if (Array.isArray(resultOrderNumberIn)) {
367
403
  andConditions.push({
368
404
  'result.orderNumber': {
@@ -371,7 +407,7 @@ class MongoRepository {
371
407
  }
372
408
  });
373
409
  }
374
- const resultCodeIn = (_53 = (_52 = params.result) === null || _52 === void 0 ? void 0 : _52.code) === null || _53 === void 0 ? void 0 : _53.$in;
410
+ const resultCodeIn = (_65 = (_64 = params.result) === null || _64 === void 0 ? void 0 : _64.code) === null || _65 === void 0 ? void 0 : _65.$in;
375
411
  if (Array.isArray(resultCodeIn)) {
376
412
  andConditions.push({
377
413
  'result.code': {
@@ -528,32 +564,16 @@ class MongoRepository {
528
564
  * 取引に対するアクション検索時などに使用
529
565
  */
530
566
  searchByPurpose(params) {
531
- var _a;
567
+ var _a, _b, _c, _d, _e, _f;
532
568
  return __awaiter(this, void 0, void 0, function* () {
533
- const conditions = {
534
- 'purpose.typeOf': {
535
- $exists: true,
536
- $eq: params.purpose.typeOf
537
- }
538
- };
539
- if (params.typeOf !== undefined) {
540
- conditions.typeOf = params.typeOf;
541
- }
542
- if (params.purpose.id !== undefined) {
543
- conditions['purpose.id'] = {
544
- $exists: true,
545
- $eq: params.purpose.id
546
- };
547
- }
548
- const query = this.actionModel.find(conditions)
549
- .select({ __v: 0, createdAt: 0, updatedAt: 0 });
550
- // tslint:disable-next-line:no-single-line-block-comment
551
- /* istanbul ignore else */
552
- if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
553
- query.sort({ startDate: params.sort.startDate });
554
- }
555
- return query.exec()
556
- .then((docs) => docs.map((doc) => doc.toObject()));
569
+ return this.search(Object.assign(Object.assign(Object.assign({ purpose: {
570
+ id: { $in: [params.purpose.id] },
571
+ typeOf: { $in: [params.purpose.typeOf] }
572
+ }, object: Object.assign(Object.assign({}, (typeof ((_b = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf) === null || _b === void 0 ? void 0 : _b.$eq) === 'string')
573
+ ? { typeOf: { $eq: params.object.typeOf.$eq } }
574
+ : undefined), (typeof ((_d = (_c = params.object) === null || _c === void 0 ? void 0 : _c.paymentMethodId) === null || _d === void 0 ? void 0 : _d.$eq) === 'string')
575
+ ? { paymentMethodId: { $eq: params.object.paymentMethodId.$eq } }
576
+ : undefined) }, (typeof ((_e = params.actionStatus) === null || _e === void 0 ? void 0 : _e.$eq) === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined), (typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined), (typeof ((_f = params.sort) === null || _f === void 0 ? void 0 : _f.startDate) === 'number') ? { sort: params.sort } : undefined), [], []);
557
577
  });
558
578
  }
559
579
  /**
@@ -691,6 +711,29 @@ class MongoRepository {
691
711
  .exec();
692
712
  });
693
713
  }
714
+ /**
715
+ * 取引からアクションを削除する
716
+ */
717
+ deleteByPurpose(params) {
718
+ return __awaiter(this, void 0, void 0, function* () {
719
+ return this.actionModel.deleteMany({
720
+ 'project.id': { $eq: params.project.id },
721
+ typeOf: { $in: params.typeOf.$in },
722
+ 'purpose.id': { $exists: true, $eq: params.purpose.id },
723
+ 'purpose.typeOf': { $exists: true, $eq: params.purpose.typeOf }
724
+ })
725
+ .exec()
726
+ .then((result) => {
727
+ return {
728
+ // n: result?.n,
729
+ // opTime: result.opTime,
730
+ // ok: result?.ok,
731
+ // operationTime,
732
+ deletedCount: result === null || result === void 0 ? void 0 : result.deletedCount
733
+ };
734
+ });
735
+ });
736
+ }
694
737
  aggregateAuthorizeEventServiceOfferAction(params) {
695
738
  return __awaiter(this, void 0, void 0, function* () {
696
739
  const statuses = yield Promise.all([
@@ -64,13 +64,10 @@ export declare class MongoRepository {
64
64
  typeOf: T;
65
65
  transactionNumber: string;
66
66
  }): Promise<factory.assetTransaction.ITransaction<T>>;
67
- /**
68
- * 取引を確定する
69
- */
70
67
  addReservations(params: {
71
68
  typeOf: factory.assetTransactionType.Reserve;
72
69
  id: string;
73
- object: factory.assetTransaction.reserve.IObject;
70
+ object: Pick<factory.assetTransaction.reserve.IObject, 'acceptedOffer' | 'issuedThrough' | 'reservationFor' | 'subReservation'>;
74
71
  }): Promise<factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>>;
75
72
  /**
76
73
  * 取引を確定する
@@ -78,9 +75,10 @@ export declare class MongoRepository {
78
75
  confirm<T extends factory.assetTransactionType>(params: {
79
76
  typeOf: T;
80
77
  id: string;
78
+ object?: Pick<factory.assetTransaction.reserve.IObject, 'underName'>;
81
79
  result: factory.assetTransaction.IResult<T>;
82
80
  potentialActions: factory.assetTransaction.IPotentialActions<T>;
83
- }): Promise<factory.assetTransaction.ITransaction<T>>;
81
+ }): Promise<void>;
84
82
  /**
85
83
  * 取引を開始&確定
86
84
  */
@@ -100,7 +98,13 @@ export declare class MongoRepository {
100
98
  $in: T[];
101
99
  };
102
100
  status: factory.transactionStatusType;
103
- }): Promise<factory.assetTransaction.ITransaction<T> | null>;
101
+ id?: string;
102
+ tasksExportAction: {
103
+ agent: {
104
+ name: string;
105
+ };
106
+ };
107
+ }): Promise<Pick<factory.assetTransaction.ITransaction<T>, 'id' | 'typeOf'> | null>;
104
108
  /**
105
109
  * タスクエクスポートリトライ
106
110
  * TODO updatedAtを基準にしているが、タスクエクスポートトライ日時を持たせた方が安全か?
@@ -108,6 +112,16 @@ export declare class MongoRepository {
108
112
  reexportTasks(params: {
109
113
  intervalInMinutes: number;
110
114
  }): Promise<void>;
115
+ /**
116
+ * タスクエクスポートの遅延している取引について明示的にemitTransactionStatusChangedを実行する
117
+ */
118
+ exportTasks(params: {
119
+ now: Date;
120
+ delayInSeconds: number;
121
+ status: {
122
+ $in: factory.transactionStatusType[];
123
+ };
124
+ }): Promise<Pick<import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction, "id" | "typeOf" | "status">[]>;
111
125
  /**
112
126
  * set task status exported by transaction id
113
127
  * IDでタスクをエクスポート済に変更する
@@ -119,7 +133,9 @@ export declare class MongoRepository {
119
133
  * 取引を期限切れにする
120
134
  */
121
135
  makeExpired(params: {
122
- expires: Date;
136
+ expires: {
137
+ $lt: Date;
138
+ };
123
139
  }): Promise<void>;
124
140
  /**
125
141
  * 取引を中止する
@@ -133,7 +149,7 @@ export declare class MongoRepository {
133
149
  /**
134
150
  * 取引を検索する
135
151
  */
136
- search<T extends factory.assetTransactionType>(params: factory.assetTransaction.ISearchConditions<T>, projection?: any): Promise<factory.assetTransaction.ITransaction<T>[]>;
152
+ search<T extends factory.assetTransactionType>(params: factory.assetTransaction.ISearchConditions<T>, inclusion?: string[], exclusion?: string[]): Promise<factory.assetTransaction.ITransaction<T>[]>;
137
153
  /**
138
154
  * 取引番号指定で削除する
139
155
  */
@@ -159,7 +175,7 @@ export declare class MongoRepository {
159
175
  /**
160
176
  * 特定の取引を更新する(汎用)
161
177
  */
162
- findByIdAndUpdate<T extends factory.assetTransactionType>(params: {
178
+ findByIdAndUpdateInProgress<T extends factory.assetTransactionType>(params: {
163
179
  id: string;
164
180
  update: any;
165
181
  }): Promise<factory.assetTransaction.ITransaction<T>>;