@chevre/domain 21.2.0-alpha.14 → 21.2.0-alpha.141

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 (302) 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/importEventsFromCOA.ts +3 -4
  6. package/example/src/chevre/lockStockHolder.ts +5 -2
  7. package/example/src/chevre/migrateOrderAdditionalProperties.ts +85 -0
  8. package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +79 -0
  9. package/example/src/chevre/processPay.ts +5 -1
  10. package/example/src/chevre/processRegisterMembership.ts +8 -4
  11. package/example/src/chevre/processRegisterPaymentCard.ts +8 -4
  12. package/example/src/chevre/processReserve.ts +5 -2
  13. package/example/src/chevre/saveTasks.ts +13 -10
  14. package/example/src/chevre/searchAbortedTasks.ts +34 -0
  15. package/example/src/chevre/searchActions.ts +33 -0
  16. package/example/src/chevre/searchEventSeats.ts +5 -2
  17. package/example/src/chevre/searchHoldReservations.ts +38 -0
  18. package/example/src/chevre/searchPaymentServiceProviders.ts +38 -0
  19. package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +37 -1
  20. package/example/src/chevre/searchScreeningRooms.ts +23 -0
  21. package/example/src/chevre/searchSendEmailActions.ts +44 -0
  22. package/example/src/chevre/syncScreeningRooms.ts +21 -0
  23. package/example/src/chevre/syncScreeningRoomsAll.ts +41 -0
  24. package/example/src/chevre/task/executeTasks.ts +26 -0
  25. package/example/src/chevre/transaction/findCreditCard.ts +1 -1
  26. package/example/src/chevre/transaction/orderMembershipService.ts +1 -1
  27. package/example/src/chevre/transaction/processReturnOrder.ts +40 -0
  28. package/example/src/chevre/transaction/startExportTasks.ts +2 -1
  29. package/example/src/chevre/updateTransaction.ts +1 -1
  30. package/example/src/playOnMoment.ts +24 -0
  31. package/lib/chevre/credentials.d.ts +1 -0
  32. package/lib/chevre/credentials.js +2 -1
  33. package/lib/chevre/eventEmitter/assetTransaction.d.ts +21 -0
  34. package/lib/chevre/eventEmitter/assetTransaction.js +25 -0
  35. package/lib/chevre/eventEmitter/task.d.ts +2 -1
  36. package/lib/chevre/eventEmitter/task.js +1 -4
  37. package/lib/chevre/eventEmitter/transaction.d.ts +1 -1
  38. package/lib/chevre/eventEmitter/transaction.js +1 -4
  39. package/lib/chevre/eventEmitter.d.ts +2 -1
  40. package/lib/chevre/eventEmitter.js +3 -1
  41. package/lib/chevre/index.d.ts +1 -1
  42. package/lib/chevre/index.js +2 -2
  43. package/lib/chevre/repo/account.js +3 -2
  44. package/lib/chevre/repo/accountTransaction.d.ts +3 -1
  45. package/lib/chevre/repo/accountTransaction.js +3 -2
  46. package/lib/chevre/repo/action.d.ts +42 -2
  47. package/lib/chevre/repo/action.js +130 -57
  48. package/lib/chevre/repo/additionalProperty.js +2 -1
  49. package/lib/chevre/repo/aggregation.d.ts +3 -0
  50. package/lib/chevre/repo/aggregation.js +3 -0
  51. package/lib/chevre/repo/assetTransaction.d.ts +23 -8
  52. package/lib/chevre/repo/assetTransaction.js +253 -80
  53. package/lib/chevre/repo/categoryCode.d.ts +1 -1
  54. package/lib/chevre/repo/categoryCode.js +37 -25
  55. package/lib/chevre/repo/code.js +3 -2
  56. package/lib/chevre/repo/comment.d.ts +4 -1
  57. package/lib/chevre/repo/comment.js +22 -6
  58. package/lib/chevre/repo/confirmationNumber.d.ts +0 -1
  59. package/lib/chevre/repo/confirmationNumber.js +3 -15
  60. package/lib/chevre/repo/creativeWork.d.ts +2 -4
  61. package/lib/chevre/repo/creativeWork.js +35 -12
  62. package/lib/chevre/repo/customer.js +2 -1
  63. package/lib/chevre/repo/emailMessage.d.ts +1 -27
  64. package/lib/chevre/repo/emailMessage.js +2 -1
  65. package/lib/chevre/repo/event.d.ts +27 -1
  66. package/lib/chevre/repo/event.js +67 -33
  67. package/lib/chevre/repo/member.js +4 -3
  68. package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -3
  69. package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
  70. package/lib/chevre/repo/mongoose/schemas/account.d.ts +4 -2
  71. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +29 -3
  72. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +31 -3
  73. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  74. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +13 -3
  75. package/lib/chevre/repo/mongoose/schemas/action.d.ts +43 -3
  76. package/lib/chevre/repo/mongoose/schemas/action.js +19 -1
  77. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +17 -3
  78. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +4 -2
  79. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +44 -3
  80. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +32 -19
  81. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +19 -3
  82. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  83. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +25 -3
  84. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +27 -3
  85. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  86. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +43 -3
  87. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +25 -3
  88. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +21 -3
  89. package/lib/chevre/repo/mongoose/schemas/event.d.ts +71 -3
  90. package/lib/chevre/repo/mongoose/schemas/holdReservation.d.ts +75 -0
  91. package/lib/chevre/repo/mongoose/schemas/holdReservation.js +93 -0
  92. package/lib/chevre/repo/mongoose/schemas/member.d.ts +13 -3
  93. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +21 -3
  94. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +65 -3
  95. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +27 -3
  96. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +74 -0
  97. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +45 -0
  98. package/lib/chevre/repo/mongoose/schemas/order.d.ts +51 -3
  99. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  100. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +25 -3
  101. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  102. package/lib/chevre/repo/mongoose/schemas/place.d.ts +55 -3
  103. package/lib/chevre/repo/mongoose/schemas/place.js +16 -1
  104. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +29 -3
  105. package/lib/chevre/repo/mongoose/schemas/product.d.ts +31 -3
  106. package/lib/chevre/repo/mongoose/schemas/product.js +6 -0
  107. package/lib/chevre/repo/mongoose/schemas/project.d.ts +23 -3
  108. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +63 -5
  109. package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
  110. package/lib/chevre/repo/mongoose/schemas/role.d.ts +11 -3
  111. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +31 -3
  112. package/lib/chevre/repo/mongoose/schemas/seller.js +6 -0
  113. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +11 -3
  114. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  115. package/lib/chevre/repo/mongoose/schemas/task.d.ts +30 -3
  116. package/lib/chevre/repo/mongoose/schemas/task.js +2 -1
  117. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +21 -3
  118. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +40 -3
  119. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -1
  120. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +11 -3
  121. package/lib/chevre/repo/offer.js +3 -2
  122. package/lib/chevre/repo/offerCatalog.js +0 -27
  123. package/lib/chevre/repo/offerItemCondition.d.ts +22 -0
  124. package/lib/chevre/repo/offerItemCondition.js +121 -0
  125. package/lib/chevre/repo/order.d.ts +55 -3
  126. package/lib/chevre/repo/order.js +62 -10
  127. package/lib/chevre/repo/ownershipInfo.js +2 -7
  128. package/lib/chevre/repo/place.d.ts +97 -24
  129. package/lib/chevre/repo/place.js +266 -76
  130. package/lib/chevre/repo/priceSpecification.js +3 -2
  131. package/lib/chevre/repo/product.d.ts +18 -3
  132. package/lib/chevre/repo/product.js +139 -5
  133. package/lib/chevre/repo/project.js +2 -1
  134. package/lib/chevre/repo/reservation.d.ts +20 -4
  135. package/lib/chevre/repo/reservation.js +40 -59
  136. package/lib/chevre/repo/role.js +3 -2
  137. package/lib/chevre/repo/seller.d.ts +1 -1
  138. package/lib/chevre/repo/seller.js +44 -23
  139. package/lib/chevre/repo/serviceOutput.js +2 -1
  140. package/lib/chevre/repo/stockHolder.d.ts +143 -7
  141. package/lib/chevre/repo/stockHolder.js +622 -104
  142. package/lib/chevre/repo/task.d.ts +42 -2
  143. package/lib/chevre/repo/task.js +68 -20
  144. package/lib/chevre/repo/transaction.d.ts +21 -2
  145. package/lib/chevre/repo/transaction.js +160 -48
  146. package/lib/chevre/repo/trip.js +2 -1
  147. package/lib/chevre/repository.d.ts +5 -2
  148. package/lib/chevre/repository.js +8 -4
  149. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +6 -2
  150. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +19 -8
  151. package/lib/chevre/service/aggregation/system.d.ts +110 -23
  152. package/lib/chevre/service/aggregation/system.js +213 -91
  153. package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -28
  154. package/lib/chevre/service/assetTransaction/moneyTransfer.js +2 -24
  155. package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -1
  156. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +17 -1
  157. package/lib/chevre/service/assetTransaction/pay.d.ts +5 -1
  158. package/lib/chevre/service/assetTransaction/pay.js +20 -34
  159. package/lib/chevre/service/assetTransaction/refund.js +2 -24
  160. package/lib/chevre/service/assetTransaction/registerService.js +1 -25
  161. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +15 -5
  162. package/lib/chevre/service/assetTransaction/reserve/factory.js +122 -58
  163. package/lib/chevre/service/assetTransaction/reserve.d.ts +10 -1
  164. package/lib/chevre/service/assetTransaction/reserve.js +92 -69
  165. package/lib/chevre/service/assetTransaction.d.ts +6 -0
  166. package/lib/chevre/service/assetTransaction.js +9 -4
  167. package/lib/chevre/service/event.d.ts +3 -0
  168. package/lib/chevre/service/event.js +54 -22
  169. package/lib/chevre/service/notification/factory.js +2 -2
  170. package/lib/chevre/service/notification.d.ts +3 -1
  171. package/lib/chevre/service/notification.js +41 -7
  172. package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
  173. package/lib/chevre/service/offer/event/authorize.js +8 -2
  174. package/lib/chevre/service/offer/event/factory.d.ts +3 -0
  175. package/lib/chevre/service/offer/event/factory.js +16 -5
  176. package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
  177. package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
  178. package/lib/chevre/service/offer/event/voidTransaction.js +17 -1
  179. package/lib/chevre/service/offer/eventServiceByCOA.js +7 -9
  180. package/lib/chevre/service/offer/product.js +2 -2
  181. package/lib/chevre/service/offer.d.ts +16 -8
  182. package/lib/chevre/service/offer.js +71 -8
  183. package/lib/chevre/service/order/deleteOrder.d.ts +3 -1
  184. package/lib/chevre/service/order/deleteOrder.js +8 -8
  185. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +5 -2
  186. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +41 -81
  187. package/lib/chevre/service/order/onOrderStatusChanged.js +1 -3
  188. package/lib/chevre/service/order/onOrderUpdated.d.ts +16 -0
  189. package/lib/chevre/service/order/onOrderUpdated.js +22 -0
  190. package/lib/chevre/service/order/placeOrder.d.ts +1 -0
  191. package/lib/chevre/service/order/placeOrder.js +41 -24
  192. package/lib/chevre/service/order/returnOrder.d.ts +1 -0
  193. package/lib/chevre/service/order/returnOrder.js +7 -12
  194. package/lib/chevre/service/order/sendOrder.d.ts +1 -0
  195. package/lib/chevre/service/order/sendOrder.js +7 -10
  196. package/lib/chevre/service/order.d.ts +2 -1
  197. package/lib/chevre/service/order.js +3 -1
  198. package/lib/chevre/service/payment/any/onPaid.js +1 -1
  199. package/lib/chevre/service/payment/any/onRefund.js +1 -1
  200. package/lib/chevre/service/payment/any.d.ts +9 -5
  201. package/lib/chevre/service/payment/any.js +80 -18
  202. package/lib/chevre/service/payment/creditCard.d.ts +1 -1
  203. package/lib/chevre/service/payment/creditCard.js +23 -17
  204. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +8 -7
  205. package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
  206. package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
  207. package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -1
  208. package/lib/chevre/service/payment/movieTicket/validation.d.ts +6 -6
  209. package/lib/chevre/service/payment/movieTicket/validation.js +65 -37
  210. package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
  211. package/lib/chevre/service/payment/movieTicket.js +7 -6
  212. package/lib/chevre/service/product.js +1 -5
  213. package/lib/chevre/service/report/telemetry.d.ts +0 -11
  214. package/lib/chevre/service/report/telemetry.js +21 -24
  215. package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
  216. package/lib/chevre/service/reserve/cancelReservation.js +162 -142
  217. package/lib/chevre/service/reserve/checkInReservation.d.ts +9 -4
  218. package/lib/chevre/service/reserve/checkInReservation.js +77 -3
  219. package/lib/chevre/service/reserve/confirmReservation.d.ts +7 -4
  220. package/lib/chevre/service/reserve/confirmReservation.js +133 -58
  221. package/lib/chevre/service/reserve/factory.d.ts +1 -1
  222. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +17 -5
  223. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +26 -24
  224. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -3
  225. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -31
  226. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
  227. package/lib/chevre/service/reserve/useReservation.d.ts +7 -3
  228. package/lib/chevre/service/reserve/useReservation.js +61 -71
  229. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +15 -0
  230. package/lib/chevre/service/reserve/verifyToken4reservation.js +56 -0
  231. package/lib/chevre/service/reserve.d.ts +3 -2
  232. package/lib/chevre/service/reserve.js +4 -2
  233. package/lib/chevre/service/task/aggregateScreeningEvent.js +1 -1
  234. package/lib/chevre/service/task/cancelPendingReservation.js +6 -2
  235. package/lib/chevre/service/task/cancelReservation.js +1 -1
  236. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -1
  237. package/lib/chevre/service/task/deleteTransaction.js +10 -8
  238. package/lib/chevre/service/task/importOffersFromCOA.js +4 -0
  239. package/lib/chevre/service/task/onAuthorizationCreated.d.ts +7 -0
  240. package/lib/chevre/service/task/onAuthorizationCreated.js +108 -0
  241. package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
  242. package/lib/chevre/service/task/{deleteOrder.js → onEventChanged.js} +8 -14
  243. package/lib/chevre/service/task/onResourceUpdated.d.ts +10 -0
  244. package/lib/chevre/service/task/onResourceUpdated.js +423 -0
  245. package/lib/chevre/service/task/placeOrder.js +1 -1
  246. package/lib/chevre/service/task/reserve.js +10 -7
  247. package/lib/chevre/service/task/returnOrder.js +1 -1
  248. package/lib/chevre/service/task/returnPayTransaction.js +2 -12
  249. package/lib/chevre/service/task/sendOrder.js +1 -1
  250. package/lib/chevre/service/task/syncScreeningRooms.d.ts +7 -0
  251. package/lib/chevre/service/task/syncScreeningRooms.js +23 -0
  252. package/lib/chevre/service/task/useReservation.d.ts +7 -0
  253. package/lib/chevre/service/task/useReservation.js +36 -0
  254. package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
  255. package/lib/chevre/service/task.d.ts +6 -0
  256. package/lib/chevre/service/task.js +22 -4
  257. package/lib/chevre/service/transaction/deleteTransaction.d.ts +21 -0
  258. package/lib/chevre/service/transaction/deleteTransaction.js +232 -0
  259. package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +11 -1
  260. package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +1 -1
  261. package/lib/chevre/service/transaction/moneyTransfer/factory.js +3 -1
  262. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -0
  263. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -1
  264. package/lib/chevre/service/transaction/moneyTransfer.js +10 -13
  265. package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
  266. package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +1 -1
  267. package/lib/chevre/service/transaction/orderProgramMembership.js +7 -3
  268. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +42 -30
  269. package/lib/chevre/service/transaction/placeOrder.js +1 -5
  270. package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +1 -1
  271. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -0
  272. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
  273. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +1 -0
  274. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
  275. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +1 -0
  276. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +3 -0
  277. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +7 -3
  278. package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -0
  279. package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -2
  280. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +1 -1
  281. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +2 -2
  282. package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +2 -1
  283. package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +23 -17
  284. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -3
  285. package/lib/chevre/service/transaction/placeOrderInProgress.js +28 -15
  286. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +10 -1
  287. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +25 -17
  288. package/lib/chevre/service/transaction/returnOrder.d.ts +4 -0
  289. package/lib/chevre/service/transaction/returnOrder.js +228 -36
  290. package/lib/chevre/service/transaction.d.ts +7 -13
  291. package/lib/chevre/service/transaction.js +12 -139
  292. package/lib/chevre/settings.d.ts +13 -2
  293. package/lib/chevre/settings.js +56 -7
  294. package/package.json +5 -5
  295. package/example/src/chevre/createManyEventsIfNotExist.ts +0 -205
  296. package/example/src/chevre/eventCatalog2eventService.ts +0 -123
  297. package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +0 -96
  298. package/example/src/chevre/migrateMovieAdditionalProperties.ts +0 -98
  299. package/example/src/chevre/migrateStockHolderKeys.ts +0 -89
  300. package/lib/chevre/service/task/deleteAssetTransaction.d.ts +0 -12
  301. package/lib/chevre/service/task/deleteAssetTransaction.js +0 -65
  302. package/lib/chevre/service/task/deleteOrder.d.ts +0 -6
@@ -62,6 +62,7 @@ interface IConfirmRepo {
62
62
  task: TaskRepo;
63
63
  }
64
64
  export type IConfirmOperation<T> = (repos: IConfirmRepo) => Promise<T>;
65
+ type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
65
66
  type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail & {
66
67
  /**
67
68
  * 承認アクションを介した場合に検索済のイベント
@@ -94,7 +95,15 @@ type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail &
94
95
  /**
95
96
  * 取引開始
96
97
  */
97
- export declare function start(params: IStartParams): IStartOperation<factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>>;
98
+ export declare function start(params: IStartParams & {
99
+ disablePendingReservations: boolean;
100
+ useHoldStockByTransactionNumber: boolean;
101
+ stockHoldUntilDaysAfterEventEnd: number;
102
+ }): IStartOperation<{
103
+ transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>;
104
+ objectSubReservations: IObjectSubReservation[];
105
+ issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
106
+ }>;
98
107
  /**
99
108
  * 取引確定
100
109
  */
@@ -27,7 +27,7 @@ const validateStartRequest_1 = require("./reserve/validateStartRequest");
27
27
  */
28
28
  function start(params) {
29
29
  return (repos) => __awaiter(this, void 0, void 0, function* () {
30
- var _a, _b, _c, _d, _e;
30
+ var _a, _b, _c, _d;
31
31
  const now = new Date();
32
32
  // 自動発行廃止(2022-05-17~)
33
33
  const reservationNumber = params.transactionNumber;
@@ -35,7 +35,8 @@ function start(params) {
35
35
  throw new factory.errors.ArgumentNull('transactionNumber');
36
36
  }
37
37
  // eventをfix
38
- if (typeof ((_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.id) !== 'string' || params.object.reservationFor.id.length === 0) {
38
+ const reservationForId = (_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.id;
39
+ if (typeof reservationForId !== 'string' || reservationForId.length === 0) {
39
40
  throw new factory.errors.ArgumentNull('object.reservationFor.id');
40
41
  }
41
42
  let event;
@@ -43,7 +44,7 @@ function start(params) {
43
44
  event = params.preSearchedEvent;
44
45
  }
45
46
  else {
46
- event = yield repos.event.findMinimizedIndividualEventById({ id: params.object.reservationFor.id });
47
+ event = yield repos.event.findMinimizedIndividualEventById({ id: reservationForId });
47
48
  }
48
49
  // validationを承認アクション開始前から移行(2023-01-27~)
49
50
  (0, validateStartRequest_1.validateStartRequest)({
@@ -63,19 +64,24 @@ function start(params) {
63
64
  catch (error) {
64
65
  throw error;
65
66
  }
66
- // 指定があれば予約追加
67
- if (typeof ((_d = params.object.reservationFor) === null || _d === void 0 ? void 0 : _d.id) === 'string') {
68
- transaction = yield addReservations({
69
- id: transaction.id,
70
- object: params.object,
71
- event,
72
- preSearchedTicketOffers: params.preSearchedTicketOffers,
73
- preSearchedUnitPriceOffers: params.preSearchedUnitPriceOffers,
74
- availableAtOrFrom: { id: (_e = params.availableAtOrFrom) === null || _e === void 0 ? void 0 : _e.id },
75
- validateAppliesToMovieTicket: params.validateAppliesToMovieTicket
76
- })(repos);
77
- }
78
- return transaction;
67
+ let objectSubReservations = [];
68
+ const addReservationsResult = yield addReservations({
69
+ id: transaction.id,
70
+ object: params.object,
71
+ event,
72
+ preSearchedTicketOffers: params.preSearchedTicketOffers,
73
+ preSearchedUnitPriceOffers: params.preSearchedUnitPriceOffers,
74
+ availableAtOrFrom: { id: (_d = params.availableAtOrFrom) === null || _d === void 0 ? void 0 : _d.id },
75
+ validateAppliesToMovieTicket: params.validateAppliesToMovieTicket,
76
+ stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
77
+ })(repos);
78
+ transaction = addReservationsResult.transaction;
79
+ objectSubReservations = addReservationsResult.objectSubReservations;
80
+ return {
81
+ transaction,
82
+ objectSubReservations,
83
+ issuedThrough: addReservationsResult.issuedThrough
84
+ };
79
85
  });
80
86
  }
81
87
  exports.start = start;
@@ -132,6 +138,21 @@ function addReservations(params) {
132
138
  })(repos);
133
139
  // 予約イベント最適化
134
140
  const reservationFor = (0, factory_1.createReservationFor)(event);
141
+ const { issuedThrough } = (0, factory_1.createIssuedThrough)({ reservationFor: event });
142
+ // const minimizedObjectSubReservations: factory.assetTransaction.reserve.IMinimizedObjectSubReservation[] =
143
+ // objectSubReservations.map((r) => {
144
+ // return {
145
+ // id: r.id,
146
+ // typeOf: r.typeOf,
147
+ // reservedTicket: {
148
+ // ticketType: r.reservedTicket.ticketType,
149
+ // ...(typeof r.reservedTicket.ticketedSeat?.typeOf === 'string')
150
+ // ? { ticketedSeat: r.reservedTicket.ticketedSeat }
151
+ // : undefined
152
+ // },
153
+ // ...(Array.isArray(r.subReservation)) ? { subReservation: r.subReservation } : undefined
154
+ // };
155
+ // });
135
156
  // 取引に予約追加
136
157
  let lockedOfferRateLimitKeys = [];
137
158
  try {
@@ -140,12 +161,13 @@ function addReservations(params) {
140
161
  typeOf: factory.assetTransactionType.Reserve,
141
162
  id: transaction.id,
142
163
  object: {
143
- project: transaction.project,
144
164
  acceptedOffer: acceptedOffers4transactionObject,
165
+ // issuedThroughを追加(2023-06-05~)
166
+ issuedThrough,
145
167
  reservationFor,
146
168
  // subReservationにreservationForを保管しない(2021-10-19~)
147
- subReservation: objectSubReservations,
148
- typeOf: factory.reservationType.ReservationPackage
169
+ subReservation: objectSubReservations
170
+ // subReservation: minimizedObjectSubReservations
149
171
  }
150
172
  });
151
173
  }
@@ -162,13 +184,20 @@ function addReservations(params) {
162
184
  yield processLockSeats({
163
185
  event: event,
164
186
  reservations: objectSubReservations,
165
- transaction: transaction
187
+ transaction: {
188
+ id: transaction.id,
189
+ transactionNumber: transaction.transactionNumber,
190
+ object: { useHoldStockByTransactionNumber: transaction.object.useHoldStockByTransactionNumber === true }
191
+ },
192
+ stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
166
193
  })(repos);
167
- // 予約作成(insertManyで実装)
168
- yield repos.reservation.createMany({ reservationFor, reservations: objectSubReservations });
169
- // 予約作成後処理
194
+ if (transaction.object.disablePendingReservations !== true) {
195
+ // 予約作成(insertManyで実装)
196
+ yield repos.reservation.createMany({ reservationFor, reservations: objectSubReservations });
197
+ }
198
+ // ストックホルダー処理(stockHolderで残席数を集計しているので必要)
170
199
  yield onReservationsCreated({ event })(repos);
171
- return transaction;
200
+ return { transaction, objectSubReservations, issuedThrough };
172
201
  });
173
202
  }
174
203
  /**
@@ -210,9 +239,11 @@ function searchEventSeatOffers(params) {
210
239
  });
211
240
  if (seats.length > 0) {
212
241
  const availabilities = yield repos.stockHolder.searchHolders({
242
+ project: { id: params.event.project.id },
213
243
  eventId: params.event.id,
214
244
  startDate: moment(params.event.startDate)
215
245
  .toDate(),
246
+ hasTicketedSeat: true,
216
247
  offers: seats.map((s) => {
217
248
  var _a;
218
249
  return {
@@ -385,7 +416,7 @@ function createReservations4transactionObject(params) {
385
416
  id: reservationId,
386
417
  reserveDate: params.now,
387
418
  agent: params.transaction.agent,
388
- broker: params.transaction.object.broker,
419
+ // broker: params.transaction.object.broker,
389
420
  reservationNumber: reservationNumber,
390
421
  reservationFor: params.event,
391
422
  reservedTicket: reservedTicket,
@@ -596,7 +627,7 @@ function processLockOfferRateLimit(params) {
596
627
  */
597
628
  function processLockSeats(params) {
598
629
  return (repos) => __awaiter(this, void 0, void 0, function* () {
599
- var _a;
630
+ var _a, _b, _c, _d, _e;
600
631
  const offers = [];
601
632
  params.reservations.forEach((r) => {
602
633
  var _a, _b;
@@ -636,15 +667,24 @@ function processLockSeats(params) {
636
667
  }
637
668
  });
638
669
  const expires = moment(params.event.endDate)
639
- .add(1, 'month')
670
+ // 設定化(2023-06-05~)
671
+ // .add(1, 'month')
672
+ .add(params.stockHoldUntilDaysAfterEventEnd, 'days')
640
673
  .toDate();
641
- const holder = params.transaction.id;
642
- const maximumAttendeeCapacity4event = (_a = params.event.location) === null || _a === void 0 ? void 0 : _a.maximumAttendeeCapacity;
674
+ // holder:取引番号に対応(2023-06-05~)
675
+ let holder = params.transaction.id;
676
+ if (((_a = params.transaction.object) === null || _a === void 0 ? void 0 : _a.useHoldStockByTransactionNumber) === true) {
677
+ holder = params.transaction.transactionNumber;
678
+ }
679
+ const hasTicketedSeat = ((_d = (_c = (_b = params.event.offers.itemOffered.serviceOutput) === null || _b === void 0 ? void 0 : _b.reservedTicket) === null || _c === void 0 ? void 0 : _c.ticketedSeat) === null || _d === void 0 ? void 0 : _d.typeOf) === factory.placeType.Seat;
680
+ const maximumAttendeeCapacity4event = (_e = params.event.location) === null || _e === void 0 ? void 0 : _e.maximumAttendeeCapacity;
643
681
  if (typeof maximumAttendeeCapacity4event === 'number') {
644
682
  yield repos.stockHolder.lockIfNotLimitExceeded({
683
+ project: { id: params.event.project.id },
645
684
  eventId: params.event.id,
646
685
  startDate: moment(params.event.startDate)
647
686
  .toDate(),
687
+ hasTicketedSeat,
648
688
  offers,
649
689
  expires,
650
690
  holder
@@ -652,9 +692,11 @@ function processLockSeats(params) {
652
692
  }
653
693
  else {
654
694
  yield repos.stockHolder.lock({
695
+ project: { id: params.event.project.id },
655
696
  eventId: params.event.id,
656
697
  startDate: moment(params.event.startDate)
657
698
  .toDate(),
699
+ hasTicketedSeat,
658
700
  offers,
659
701
  expires,
660
702
  holder
@@ -698,20 +740,22 @@ function confirm(params) {
698
740
  throw new factory.errors.ArgumentNull('Transaction ID or Transaction Number');
699
741
  }
700
742
  const order = yield fixOrderAsPurpose(params, transaction)(repos);
701
- const potentialActions = (0, factory_1.createPotentialActions)(Object.assign(Object.assign({}, params), { transaction: transaction, order }));
743
+ const { potentialActions, underName } = (0, factory_1.createPotentialActions)(Object.assign(Object.assign({}, params), { transaction,
744
+ order }));
702
745
  // 取引確定
703
746
  const result = {};
704
- yield repos.assetTransaction.confirm({
705
- typeOf: factory.assetTransactionType.Reserve,
706
- id: transaction.id,
707
- result: result,
708
- potentialActions: (settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING)
747
+ yield repos.assetTransaction.confirm(Object.assign({ typeOf: factory.assetTransactionType.Reserve, id: transaction.id, result: result, potentialActions: (settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING)
709
748
  ? { reserve: [] }
710
- : potentialActions
711
- });
749
+ : potentialActions }, (typeof (underName === null || underName === void 0 ? void 0 : underName.typeOf) === 'string')
750
+ ? { object: { underName } }
751
+ : undefined));
712
752
  if (settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING) {
713
753
  // sync対応(2023-01-13~)
714
- yield (0, confirmReservation_1.confirmReservation)(potentialActions.reserve)(repos);
754
+ yield (0, confirmReservation_1.confirmReservation)({
755
+ actionAttributesList: potentialActions.reserve,
756
+ useOnReservationConfirmed: true,
757
+ byTask: true
758
+ })(repos);
715
759
  }
716
760
  });
717
761
  }
@@ -732,7 +776,7 @@ function fixOrderAsPurpose(params, transaction) {
732
776
  project: { id: { $eq: transaction.project.id } },
733
777
  confirmationNumbers: [payPurposeConfirmationNumber],
734
778
  orderNumbers: [payPurposeOrderNumber]
735
- });
779
+ }, { customer: 1, orderNumber: 1, typeOf: 1 });
736
780
  order = orders.shift();
737
781
  if (order === undefined) {
738
782
  throw new factory.errors.NotFound('Order as purpose');
@@ -754,8 +798,8 @@ function cancel(params) {
754
798
  });
755
799
  // 本来非同期でタスクが実行されるが、同期的に仮予約取消が実行されていないと、サービス利用側が困る可能性があるので、
756
800
  // 同期的にもcancelPendingReservationを実行しておく
757
- const cancelActionAttributes = (0, factory_1.createPendingReservationAction)({ transaction });
758
- if (cancelActionAttributes.length > 0) {
801
+ const cancelActionAttributes = (0, factory_1.createCancelPendingReservationAction)({ transaction });
802
+ if (cancelActionAttributes !== undefined) {
759
803
  yield (0, cancelReservation_1.cancelPendingReservation)(cancelActionAttributes)(repos);
760
804
  }
761
805
  });
@@ -773,27 +817,6 @@ function exportTasksById(params) {
773
817
  });
774
818
  const potentialActions = transaction.potentialActions;
775
819
  const taskAttributes = [];
776
- // 資産取引削除タスクを作成
777
- const deleteTransactionTask = {
778
- project: transaction.project,
779
- name: factory.taskName.DeleteAssetTransaction,
780
- status: factory.taskStatus.Ready,
781
- runsAt: moment(transaction.endDate)
782
- .add(settings_1.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS, 'days')
783
- .toDate(),
784
- remainingNumberOfTries: 3,
785
- numberOfTried: 0,
786
- executionResults: [],
787
- data: {
788
- object: {
789
- project: transaction.project,
790
- id: transaction.id,
791
- transactionNumber: transaction.transactionNumber,
792
- typeOf: transaction.typeOf
793
- }
794
- }
795
- };
796
- taskAttributes.push(deleteTransactionTask);
797
820
  switch (transaction.status) {
798
821
  case factory.transactionStatusType.Confirmed:
799
822
  // tslint:disable-next-line:no-single-line-block-comment
@@ -821,8 +844,8 @@ function exportTasksById(params) {
821
844
  case factory.transactionStatusType.Canceled:
822
845
  // sync対応(2023-01-13~)
823
846
  if (!settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING) {
824
- const cancelActionAttributes4canceled = (0, factory_1.createPendingReservationAction)({ transaction });
825
- if (cancelActionAttributes4canceled.length > 0) {
847
+ const cancelActionAttributes4canceled = (0, factory_1.createCancelPendingReservationAction)({ transaction });
848
+ if (cancelActionAttributes4canceled !== undefined) {
826
849
  const cancelPendingReservationTask = {
827
850
  project: transaction.project,
828
851
  name: factory.taskName.CancelPendingReservation,
@@ -832,7 +855,7 @@ function exportTasksById(params) {
832
855
  numberOfTried: 0,
833
856
  executionResults: [],
834
857
  data: {
835
- actionAttributes: cancelActionAttributes4canceled
858
+ actionAttributes: [cancelActionAttributes4canceled]
836
859
  }
837
860
  };
838
861
  taskAttributes.push(cancelPendingReservationTask);
@@ -840,8 +863,8 @@ function exportTasksById(params) {
840
863
  }
841
864
  break;
842
865
  case factory.transactionStatusType.Expired:
843
- const cancelActionAttributes = (0, factory_1.createPendingReservationAction)({ transaction });
844
- if (cancelActionAttributes.length > 0) {
866
+ const cancelActionAttributes = (0, factory_1.createCancelPendingReservationAction)({ transaction });
867
+ if (cancelActionAttributes !== undefined) {
845
868
  const cancelPendingReservationTask = {
846
869
  project: transaction.project,
847
870
  name: factory.taskName.CancelPendingReservation,
@@ -851,7 +874,7 @@ function exportTasksById(params) {
851
874
  numberOfTried: 0,
852
875
  executionResults: [],
853
876
  data: {
854
- actionAttributes: cancelActionAttributes
877
+ actionAttributes: [cancelActionAttributes]
855
878
  }
856
879
  };
857
880
  taskAttributes.push(cancelPendingReservationTask);
@@ -860,7 +883,7 @@ function exportTasksById(params) {
860
883
  default:
861
884
  throw new factory.errors.NotImplemented(`Transaction status "${transaction.status}" not implemented.`);
862
885
  }
863
- return repos.task.saveMany(taskAttributes);
886
+ return repos.task.saveMany(taskAttributes, { emitImmediately: true });
864
887
  });
865
888
  }
866
889
  exports.exportTasksById = exportTasksById;
@@ -28,6 +28,12 @@ export declare function exportTasks<T extends factory.assetTransactionType>(para
28
28
  typeOf?: {
29
29
  $in: T[];
30
30
  };
31
+ id?: string;
32
+ tasksExportAction?: {
33
+ agent: {
34
+ name: string;
35
+ };
36
+ };
31
37
  }): (repos: {
32
38
  task: TaskRepo;
33
39
  assetTransaction: AssetTransactionRepo;
@@ -20,6 +20,7 @@ const PayTransactionService = require("./assetTransaction/pay");
20
20
  const RefundTransactionService = require("./assetTransaction/refund");
21
21
  const RegisterServiceTransactionService = require("./assetTransaction/registerService");
22
22
  const ReserveTransactionService = require("./assetTransaction/reserve");
23
+ const settings_1 = require("../settings");
23
24
  exports.cancelReservation = CancelReservationTransactionService;
24
25
  exports.moneyTransfer = MoneyTransferTransactionService;
25
26
  exports.pay = PayTransactionService;
@@ -31,10 +32,14 @@ exports.reserve = ReserveTransactionService;
31
32
  */
32
33
  function exportTasks(params) {
33
34
  return (repos) => __awaiter(this, void 0, void 0, function* () {
34
- const transaction = yield repos.assetTransaction.startExportTasks({
35
- typeOf: params.typeOf,
36
- status: params.status
37
- });
35
+ var _a;
36
+ const transaction = yield repos.assetTransaction.startExportTasks(Object.assign({ typeOf: params.typeOf, status: params.status, tasksExportAction: {
37
+ agent: {
38
+ name: (typeof ((_a = params.tasksExportAction) === null || _a === void 0 ? void 0 : _a.agent.name) === 'string')
39
+ ? params.tasksExportAction.agent.name
40
+ : settings_1.DEFAULT_TASKS_EXPORT_AGENT_NAME
41
+ }
42
+ } }, (typeof params.id === 'string') ? { id: params.id } : undefined));
38
43
  if (transaction === null) {
39
44
  return;
40
45
  }
@@ -17,6 +17,9 @@ export declare function importFromCOA(params: {
17
17
  id: string;
18
18
  typeOf: factory.organizationType.Project;
19
19
  };
20
+ /**
21
+ * 施設コード
22
+ */
20
23
  locationBranchCode: string;
21
24
  importFrom: Date;
22
25
  importThrough: Date;
@@ -22,7 +22,6 @@ const moment = require("moment-timezone");
22
22
  const credentials_1 = require("../credentials");
23
23
  const factory = require("../factory");
24
24
  const offer_1 = require("./offer");
25
- // const customsearch = google.customsearch('v1');
26
25
  const debug = createDebug('chevre-domain:service:event');
27
26
  const coaAuthClient = new COA.auth.RefreshToken({
28
27
  endpoint: credentials_1.credentials.coa.endpoint,
@@ -99,18 +98,29 @@ function importFromCOA(params) {
99
98
  if (typeof (seller === null || seller === void 0 ? void 0 : seller.id) !== 'string') {
100
99
  throw new factory.errors.NotFound('Seller', `Seller with branchCod '${params.locationBranchCode}' not found`);
101
100
  }
102
- // 施設取得
103
- let movieTheater = createMovieTheaterFromCOA(project, { id: seller.id }, yield masterService.theater({ theaterCode: params.locationBranchCode }), yield masterService.screen({ theaterCode: params.locationBranchCode }));
104
101
  // saveMovieTheater:trueの場合のみ、施設保管(2022-10-10~)
105
102
  if (params.saveMovieTheater === true) {
106
- movieTheater = yield repos.place.saveMovieTheaterByBranchCode4coa(movieTheater);
103
+ const savingMovieTheater = createMovieTheaterFromCOA(project, { id: seller.id }, yield masterService.theater({ theaterCode: params.locationBranchCode }), yield masterService.screen({ theaterCode: params.locationBranchCode }));
104
+ yield repos.place.saveMovieTheaterByBranchCode4coa(savingMovieTheater);
105
+ // } else {
106
+ // movieTheater = await repos.place.findMovieTheaterByBranchCode({
107
+ // project: { id: project.id },
108
+ // branchCode: creatingMovieTheater.branchCode
109
+ // });
107
110
  }
108
- else {
109
- movieTheater = yield repos.place.findMovieTheaterByBranchCode({
110
- project: { id: movieTheater.project.id },
111
- branchCode: movieTheater.branchCode
112
- });
111
+ const movieTheaters = yield repos.place.searchMovieTheaters({
112
+ limit: 1,
113
+ page: 1,
114
+ project: { id: { $eq: project.id } },
115
+ branchCode: { $eq: params.locationBranchCode }
116
+ }, ['_id', 'typeOf', 'branchCode', 'name', 'kanaName'], []);
117
+ const movieTheater = movieTheaters.shift();
118
+ if (movieTheater === undefined) {
119
+ throw new factory.errors.NotFound(factory.placeType.MovieTheater);
113
120
  }
121
+ const screeningRooms = yield repos.place.searchScreeningRooms({
122
+ containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
123
+ });
114
124
  const targetImportFrom = moment(`${moment(params.importFrom)
115
125
  .tz('Asia/Tokyo')
116
126
  .format('YYYY-MM-DD')}T00:00:00+09:00`);
@@ -121,16 +131,17 @@ function importFromCOA(params) {
121
131
  debug('importing screening events...', targetImportFrom, targetImportThrough);
122
132
  const { screeningEventSerieses, savedEventsCount } = yield saveScreeningEventSeries({
123
133
  locationBranchCode: params.locationBranchCode,
124
- movieTheater: movieTheater,
134
+ movieTheater,
125
135
  project: project,
126
136
  saveScreeningEventSeries: params.saveScreeningEventSeries
127
137
  })(repos);
128
138
  savedScreeningEventSeriesCount = savedEventsCount;
129
139
  try {
130
- // イベントごとに永続化トライ
140
+ // イベント永続化
131
141
  const screeningEvents = yield saveScreeningEvents({
132
142
  locationBranchCode: params.locationBranchCode,
133
- movieTheater: movieTheater,
143
+ // movieTheater: movieTheater,
144
+ screeningRooms,
134
145
  screeningEventSerieses: screeningEventSerieses,
135
146
  project: project,
136
147
  targetImportFrom: targetImportFrom.toDate(),
@@ -154,6 +165,8 @@ function importFromCOA(params) {
154
165
  // "message": "ESOCKETTIMEDOUT",
155
166
  if (error.name === 'COAServiceError') {
156
167
  if (error.message === 'ESOCKETTIMEDOUT') {
168
+ // tslint:disable-next-line:no-console
169
+ console.error('saveScreeningEvents throwed an error', error.name, error.message);
157
170
  throwsError = false;
158
171
  }
159
172
  }
@@ -181,7 +194,6 @@ function importFromCOA(params) {
181
194
  exports.importFromCOA = importFromCOA;
182
195
  function saveScreeningEventSeries(params) {
183
196
  return (repos) => __awaiter(this, void 0, void 0, function* () {
184
- const movieTheater = params.movieTheater;
185
197
  const project = params.project;
186
198
  const masterService = new COA.service.Master({
187
199
  endpoint: credentials_1.credentials.coa.endpoint,
@@ -212,12 +224,12 @@ function saveScreeningEventSeries(params) {
212
224
  const availablePaymentMethodTypes = yield repos.categoryCode.search({
213
225
  project: { id: { $eq: params.project.id } },
214
226
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
215
- });
227
+ }, [], []);
216
228
  const screeningEventSerieses = filmsFromCOA.map((filmFromCOA) => {
217
229
  return createScreeningEventSeriesFromCOA({
218
230
  project: project,
219
231
  filmFromCOA: filmFromCOA,
220
- movieTheater: movieTheater,
232
+ movieTheater: params.movieTheater,
221
233
  eirinKubuns: eirinKubuns,
222
234
  eizouKubuns: eizouKubuns,
223
235
  joueihousikiKubuns: joueihousikiKubuns,
@@ -291,7 +303,7 @@ function saveScreeningEvents(params) {
291
303
  }
292
304
  function createScreeningEvents(params) {
293
305
  return () => __awaiter(this, void 0, void 0, function* () {
294
- const movieTheater = params.movieTheater;
306
+ // const movieTheater = params.movieTheater;
295
307
  const screeningEventSerieses = params.screeningEventSerieses;
296
308
  const project = params.project;
297
309
  const masterService = new COA.service.Master({
@@ -327,8 +339,11 @@ function createScreeningEvents(params) {
327
339
  titleCode: scheduleFromCOA.titleCode,
328
340
  titleBranchNum: scheduleFromCOA.titleBranchNum
329
341
  });
330
- // スクリーン存在チェック
331
- const screenRoom = movieTheater.containsPlace.find((place) => place.branchCode === scheduleFromCOA.screenCode);
342
+ // ルーム存在チェック
343
+ const screenRoom = params.screeningRooms.find((place) => place.branchCode === scheduleFromCOA.screenCode);
344
+ // const screenRoom = <factory.place.screeningRoom.IPlace | undefined>movieTheater.containsPlace.find(
345
+ // (place) => place.branchCode === scheduleFromCOA.screenCode
346
+ // );
332
347
  if (screenRoom === undefined) {
333
348
  // tslint:disable-next-line:no-console
334
349
  console.error('screenRoom not found.', scheduleFromCOA.screenCode);
@@ -446,7 +461,15 @@ function createScreeningEventFromCOA(params) {
446
461
  typeOf: 'WebAPI',
447
462
  identifier: factory.service.webAPI.Identifier.COA
448
463
  },
449
- priceCurrency: factory.priceCurrency.JPY
464
+ priceCurrency: factory.priceCurrency.JPY,
465
+ itemOffered: {
466
+ serviceOutput: {
467
+ reservedTicket: {
468
+ typeOf: 'Ticket',
469
+ ticketedSeat: { typeOf: factory.placeType.Seat }
470
+ }
471
+ }
472
+ }
450
473
  };
451
474
  const { additionalProperty, coaInfo } = createScreeningEventAdditionalPropertyFromCOA(params);
452
475
  return {
@@ -584,7 +607,10 @@ function createScreeningEventSeriesFromCOA(params) {
584
607
  endDate: endDate,
585
608
  startDate: startDate,
586
609
  coaInfo,
587
- offers: Object.assign({ project: { typeOf: params.project.typeOf, id: params.project.id }, typeOf: factory.offerType.Offer, priceCurrency: factory.priceCurrency.JPY }, (Array.isArray(unacceptedPaymentMethod)) ? { unacceptedPaymentMethod: unacceptedPaymentMethod } : undefined),
610
+ offers: Object.assign({
611
+ // 不要なので廃止(2023-06-09~)
612
+ // project: { typeOf: params.project.typeOf, id: params.project.id },
613
+ typeOf: factory.offerType.Offer, priceCurrency: factory.priceCurrency.JPY }, (Array.isArray(unacceptedPaymentMethod)) ? { unacceptedPaymentMethod: unacceptedPaymentMethod } : undefined),
588
614
  additionalProperty
589
615
  };
590
616
  }
@@ -765,8 +791,14 @@ function updateEvent4ttts(params) {
765
791
  throw error;
766
792
  }
767
793
  // アクション完了
768
- yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: {} });
769
- yield (0, offer_1.onEventChanged)({ event, isNew: false })({
794
+ yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: { id: event.id } });
795
+ yield (0, offer_1.onEventChanged)({
796
+ id: [event.id],
797
+ project: { id: event.project.id },
798
+ typeOf: event.typeOf,
799
+ isNew: false,
800
+ useInform: true
801
+ })({
770
802
  event: repos.event,
771
803
  project: repos.project,
772
804
  task: repos.task
@@ -12,7 +12,7 @@ function task2lineNotify(params) {
12
12
  const lastExecutionResult = (task.executionResults.length > 0) ? task.executionResults.slice(-1)[0] : undefined;
13
13
  let lastError = lastExecutionResult === null || lastExecutionResult === void 0 ? void 0 : lastExecutionResult.error;
14
14
  if (typeof lastError === 'string') {
15
- lastError = { message: lastError };
15
+ lastError = { message: lastError, name: 'Error' };
16
16
  }
17
17
  const lastMessage = `${String(lastError === null || lastError === void 0 ? void 0 : lastError.name)} ${String(lastError === null || lastError === void 0 ? void 0 : lastError.message)}`;
18
18
  const content = `project:${(_a = task.project) === null || _a === void 0 ? void 0 : _a.id}
@@ -38,7 +38,7 @@ function tasks2lineNotify(params) {
38
38
  const lastExecutionResult = (task.executionResults.length > 0) ? task.executionResults.slice(-1)[0] : undefined;
39
39
  let lastError = lastExecutionResult === null || lastExecutionResult === void 0 ? void 0 : lastExecutionResult.error;
40
40
  if (typeof lastError === 'string') {
41
- lastError = { message: lastError };
41
+ lastError = { message: lastError, name: 'Error' };
42
42
  }
43
43
  const lastMessage = `${String(lastError === null || lastError === void 0 ? void 0 : lastError.name)} ${String(lastError === null || lastError === void 0 ? void 0 : lastError.message)}`;
44
44
  return `project:${(_a = task.project) === null || _a === void 0 ? void 0 : _a.id}
@@ -1,7 +1,9 @@
1
1
  import * as factory from '../factory';
2
2
  import { MongoRepository as ActionRepo } from '../repo/action';
3
3
  import { MongoRepository as ProjectRepo } from '../repo/project';
4
- export type Operation<T> = () => Promise<T>;
4
+ export type Operation<T> = (repos: {
5
+ accessToken: string;
6
+ }) => Promise<T>;
5
7
  /**
6
8
  * Eメールメッセージを送信する
7
9
  * https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html