@chevre/domain 22.2.0-alpha.3 → 22.2.0-alpha.30

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 (260) hide show
  1. package/example/src/chevre/createProject.ts +19 -0
  2. package/example/src/chevre/findValidAuthorization.ts +1 -2
  3. package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
  4. package/example/src/chevre/{migrateMovieTheaterAdditionalProperties.ts → migrateRoomAdditionalProperties.ts} +17 -17
  5. package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +119 -0
  6. package/example/src/chevre/playAroundTicket.ts +3 -2
  7. package/example/src/chevre/processAction.ts +3 -1
  8. package/example/src/chevre/projectFields.ts +42 -0
  9. package/example/src/chevre/{projectEventFieldsById.ts → projectFieldsById.ts} +7 -12
  10. package/example/src/chevre/{projectReservationFieldsById.ts → projectOwnershipInfoFieldsById.ts} +4 -4
  11. package/example/src/chevre/searchActionsByPurpose.ts +38 -0
  12. package/example/src/chevre/searchProjects.ts +9 -4
  13. package/example/src/chevre/searchSellersByAggregate.ts +3 -3
  14. package/example/src/chevre/searchTransactions.ts +1 -1
  15. package/example/src/chevre/unsetUnnecessaryFields.ts +2 -41
  16. package/lib/chevre/repo/accountTitle.d.ts +9 -3
  17. package/lib/chevre/repo/accountingReport.d.ts +2 -15
  18. package/lib/chevre/repo/action.d.ts +64 -47
  19. package/lib/chevre/repo/action.js +170 -133
  20. package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
  21. package/lib/chevre/repo/assetTransaction.d.ts +134 -7
  22. package/lib/chevre/repo/assetTransaction.js +2 -2
  23. package/lib/chevre/repo/authorization.d.ts +3 -1
  24. package/lib/chevre/repo/authorization.js +21 -10
  25. package/lib/chevre/repo/categoryCode.d.ts +18 -2
  26. package/lib/chevre/repo/categoryCode.js +47 -19
  27. package/lib/chevre/repo/comment.d.ts +5 -1
  28. package/lib/chevre/repo/creativeWork.d.ts +14 -2
  29. package/lib/chevre/repo/customer.d.ts +5 -1
  30. package/lib/chevre/repo/customerType.d.ts +1 -1
  31. package/lib/chevre/repo/event.d.ts +49 -2
  32. package/lib/chevre/repo/member.d.ts +5 -1
  33. package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
  34. package/lib/chevre/repo/message.d.ts +1 -15
  35. package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
  36. package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
  37. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
  38. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
  39. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
  40. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  41. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
  42. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
  43. package/lib/chevre/repo/mongoose/schemas/action.d.ts +12 -3
  44. package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
  45. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
  46. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
  47. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
  48. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
  49. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
  50. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
  51. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
  52. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
  53. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
  54. package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
  55. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
  56. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
  57. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
  58. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  59. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
  60. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +22 -24
  61. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
  62. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  63. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
  64. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
  65. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
  66. package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
  67. package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
  68. package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
  69. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
  70. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
  71. package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
  72. package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
  73. package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
  74. package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
  75. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
  76. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
  77. package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
  78. package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
  79. package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
  80. package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
  81. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
  82. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
  83. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
  84. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
  85. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
  86. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
  87. package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
  88. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  89. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
  90. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  91. package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
  92. package/lib/chevre/repo/mongoose/schemas/paymentService.js +13 -4
  93. package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
  94. package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
  95. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
  96. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
  97. package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
  98. package/lib/chevre/repo/mongoose/schemas/product.js +6 -13
  99. package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
  100. package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
  101. package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
  102. package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
  103. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
  104. package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
  105. package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
  106. package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
  107. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
  108. package/lib/chevre/repo/mongoose/schemas/seller.js +22 -24
  109. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
  110. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  111. package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
  112. package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
  113. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
  114. package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
  115. package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
  116. package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
  117. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
  118. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
  119. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
  120. package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
  121. package/lib/chevre/repo/offer.d.ts +13 -4
  122. package/lib/chevre/repo/offerCatalog.d.ts +15 -2
  123. package/lib/chevre/repo/order.d.ts +13 -1
  124. package/lib/chevre/repo/ownershipInfo.d.ts +23 -7
  125. package/lib/chevre/repo/ownershipInfo.js +75 -19
  126. package/lib/chevre/repo/paymentService.d.ts +2 -2
  127. package/lib/chevre/repo/paymentService.js +108 -58
  128. package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -10
  129. package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
  130. package/lib/chevre/repo/priceSpecification.d.ts +42 -1
  131. package/lib/chevre/repo/product.d.ts +8 -3
  132. package/lib/chevre/repo/product.js +67 -33
  133. package/lib/chevre/repo/productModel.d.ts +1 -22
  134. package/lib/chevre/repo/project.d.ts +25 -5
  135. package/lib/chevre/repo/project.js +69 -28
  136. package/lib/chevre/repo/reservation.d.ts +35 -3
  137. package/lib/chevre/repo/reservation.js +1 -1
  138. package/lib/chevre/repo/role.d.ts +2 -9
  139. package/lib/chevre/repo/role.js +20 -10
  140. package/lib/chevre/repo/seller.d.ts +64 -14
  141. package/lib/chevre/repo/seller.js +61 -27
  142. package/lib/chevre/repo/task.d.ts +64 -3
  143. package/lib/chevre/repo/telemetry.d.ts +3 -2
  144. package/lib/chevre/repo/ticket.d.ts +4 -20
  145. package/lib/chevre/repo/ticket.js +23 -10
  146. package/lib/chevre/repo/transaction.d.ts +30 -14
  147. package/lib/chevre/repo/transaction.js +106 -77
  148. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
  149. package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
  150. package/lib/chevre/service/aggregation/project.js +1 -1
  151. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
  152. package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
  153. package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
  154. package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
  155. package/lib/chevre/service/assetTransaction/pay/factory.js +1 -1
  156. package/lib/chevre/service/assetTransaction/pay.js +3 -3
  157. package/lib/chevre/service/assetTransaction/refund/factory.d.ts +1 -1
  158. package/lib/chevre/service/assetTransaction/refund/factory.js +1 -1
  159. package/lib/chevre/service/assetTransaction/refund.js +3 -3
  160. package/lib/chevre/service/assetTransaction/registerService.js +4 -6
  161. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +26 -23
  162. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +4 -1
  163. package/lib/chevre/service/assetTransaction/reserve/start.js +1 -3
  164. package/lib/chevre/service/code.d.ts +0 -4
  165. package/lib/chevre/service/code.js +22 -18
  166. package/lib/chevre/service/event.js +4 -4
  167. package/lib/chevre/service/moneyTransfer.js +3 -5
  168. package/lib/chevre/service/notification.js +2 -2
  169. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
  170. package/lib/chevre/service/offer/event/authorize/factory.js +34 -6
  171. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.d.ts +0 -2
  172. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +22 -22
  173. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -4
  174. package/lib/chevre/service/offer/event/authorize.d.ts +4 -4
  175. package/lib/chevre/service/offer/event/authorize.js +3 -2
  176. package/lib/chevre/service/offer/event/importFromCOA/factory.d.ts +3 -1
  177. package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
  178. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -12
  179. package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
  180. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
  181. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
  182. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +41 -4
  183. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
  184. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +3 -3
  185. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +7 -3
  186. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +10 -5
  187. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +3 -1
  188. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +3 -1
  189. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +14 -6
  190. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
  191. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  192. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
  193. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
  194. package/lib/chevre/service/offer/product/searchProductOffers.js +1 -3
  195. package/lib/chevre/service/offer/product.d.ts +4 -2
  196. package/lib/chevre/service/offer/product.js +12 -12
  197. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
  198. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  199. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  200. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  201. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  202. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -3
  203. package/lib/chevre/service/order/placeOrder.js +1 -1
  204. package/lib/chevre/service/order/returnOrder.js +1 -1
  205. package/lib/chevre/service/order/sendOrder.js +9 -5
  206. package/lib/chevre/service/payment/any/factory.d.ts +1 -1
  207. package/lib/chevre/service/payment/any/onPaid.d.ts +1 -1
  208. package/lib/chevre/service/payment/any/onRefund.d.ts +1 -1
  209. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -6
  210. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +26 -34
  211. package/lib/chevre/service/payment/any.d.ts +3 -3
  212. package/lib/chevre/service/payment/any.js +21 -13
  213. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
  214. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
  215. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
  216. package/lib/chevre/service/payment/creditCard/payCreditCard.js +12 -5
  217. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +13 -3
  218. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  219. package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
  220. package/lib/chevre/service/payment/faceToFace.js +28 -10
  221. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
  222. package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
  223. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
  224. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +12 -4
  225. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +15 -4
  226. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  227. package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
  228. package/lib/chevre/service/payment/paymentCard.js +29 -16
  229. package/lib/chevre/service/payment.d.ts +1 -1
  230. package/lib/chevre/service/report/ownershipInfo.d.ts +3 -1
  231. package/lib/chevre/service/report/telemetry.js +2 -2
  232. package/lib/chevre/service/reserve/cancelReservation.js +1 -1
  233. package/lib/chevre/service/reserve/confirmReservation.js +1 -1
  234. package/lib/chevre/service/task/authorizePayment.js +0 -2
  235. package/lib/chevre/service/task/onAuthorizationCreated.js +20 -16
  236. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -2
  237. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
  238. package/lib/chevre/service/task/onResourceUpdated.js +16 -4
  239. package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
  240. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  241. package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
  242. package/lib/chevre/service/transaction/moneyTransfer.js +4 -4
  243. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +1 -1
  244. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +36 -2
  245. package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -2
  246. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  247. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +2 -2
  248. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -1
  249. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  250. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +2 -2
  251. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  252. package/lib/chevre/service/transaction/returnOrder.js +2 -2
  253. package/lib/chevre/service/transaction.js +1 -1
  254. package/package.json +4 -4
  255. package/example/src/chevre/findTransactionById.ts +0 -23
  256. package/example/src/chevre/findTransactionInProgressById.ts +0 -23
  257. package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
  258. package/example/src/chevre/projectReservationFields.ts +0 -31
  259. package/example/src/chevre/searchActions.ts +0 -40
  260. package/example/src/chevre/searchProducts.ts +0 -28
@@ -8,5 +8,5 @@ declare function createInformTasks(order: IReturnedOrder, settings: Settings): f
8
8
  declare function createOnOrderReturnedTasksByTransaction(params: {
9
9
  order: Pick<factory.order.IOrder, 'project' | 'typeOf' | 'orderNumber' | 'customer' | 'price' | 'priceCurrency' | 'orderDate'>;
10
10
  potentialActions?: factory.action.transfer.returnAction.order.IPotentialActions;
11
- }): (import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
11
+ }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
12
12
  export { createInformTasks, createOnOrderReturnedTasksByTransaction };
@@ -19,7 +19,7 @@ function createPlacingOrderFromExistingTransaction(params) {
19
19
  const confirmationNumber = String(params.confirmationNumber);
20
20
  const orderNumber = params.orderNumber;
21
21
  let order;
22
- const placeOrderTransactions = yield repos.transaction.search({
22
+ const placeOrderTransactions = yield repos.transaction.projectFields({
23
23
  limit: 1,
24
24
  page: 1,
25
25
  project: { id: { $eq: params.project.id } },
@@ -43,7 +43,7 @@ function createPlacingOrderFromExistingTransaction(params) {
43
43
  if (Array.isArray(authorizeActionsAsResult) && authorizeActionsAsResult.length > 0) {
44
44
  const completedAuthorizeActionIds = authorizeActionsAsResult.map(({ id }) => id);
45
45
  if (completedAuthorizeActionIds.length > 0) {
46
- authorizePaymentActions = yield repos.action.search({
46
+ authorizePaymentActions = (yield repos.action.search({
47
47
  typeOf: factory.actionType.AuthorizeAction,
48
48
  purpose: {
49
49
  typeOf: { $in: [factory.transactionType.PlaceOrder] },
@@ -51,7 +51,7 @@ function createPlacingOrderFromExistingTransaction(params) {
51
51
  },
52
52
  object: { typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment } },
53
53
  id: { $in: completedAuthorizeActionIds }
54
- }, ['result'], []);
54
+ }, ['result'], []));
55
55
  authorizeOfferActionsWithInstrument = (yield repos.action.search({
56
56
  typeOf: factory.actionType.AuthorizeAction,
57
57
  purpose: {
@@ -70,7 +70,7 @@ function placeOrder(params) {
70
70
  id: { $in: [orderActionPurpose.id] },
71
71
  typeOf: { $in: [orderActionPurpose.typeOf] }
72
72
  }
73
- }, ['_id'], []);
73
+ }, ['id'], []);
74
74
  if (completedActions.length === 0) {
75
75
  const action = yield repos.action.start(orderActionAttributes);
76
76
  try {
@@ -44,7 +44,7 @@ function returnOrder(params) {
44
44
  throw new factory.errors.Argument('object.orderNumber', `orderStatus not returnable: ${order.orderStatus}`);
45
45
  }
46
46
  // 返品取引検索
47
- const returnOrderTransactions = yield repos.transaction.search({
47
+ const returnOrderTransactions = yield repos.transaction.projectFields({
48
48
  limit: 1,
49
49
  page: 1,
50
50
  project: { id: { $eq: order.project.id } },
@@ -86,7 +86,8 @@ function sendOrder(params) {
86
86
  typeOf: factory.actionType.SendAction
87
87
  };
88
88
  const action = yield repos.action.start(sendOrderActionAttributes);
89
- let ownershipInfos = [];
89
+ let creatingOwnershipInfos = [];
90
+ let createdOwnershipInfos = [];
90
91
  let allOffersDelivered = false;
91
92
  let acceptedOffers;
92
93
  // 所有権生成を最小化(2024-03-01~)
@@ -111,12 +112,15 @@ function sendOrder(params) {
111
112
  debug('delivering...', order.orderNumber, acceptedOffers.map((offer) => `${offer.itemOffered.id}`), params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
112
113
  // 所有権作成
113
114
  if (createOwnerships) {
114
- ownershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
115
+ creatingOwnershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
115
116
  order: Object.assign(Object.assign({}, order), { acceptedOffers }),
116
117
  offerIndexBase
117
118
  });
118
- ownershipInfos = yield Promise.all(ownershipInfos.map((ownershipInfo) => __awaiter(this, void 0, void 0, function* () {
119
- return repos.ownershipInfo.createIfNotExistByIdentifier(ownershipInfo);
119
+ createdOwnershipInfos = yield Promise.all(creatingOwnershipInfos.map((creatingOwnershipInfo) => __awaiter(this, void 0, void 0, function* () {
120
+ const { id } = yield repos.ownershipInfo.createIfNotExistByIdentifier(creatingOwnershipInfo);
121
+ return Object.assign({ id }, (typeof creatingOwnershipInfo.identifier === 'string')
122
+ ? { identifier: creatingOwnershipInfo.identifier }
123
+ : undefined);
120
124
  })));
121
125
  }
122
126
  // const deliveredCount = limit * page;
@@ -140,7 +144,7 @@ function sendOrder(params) {
140
144
  }
141
145
  throw error;
142
146
  }
143
- const result = ownershipInfos;
147
+ const result = createdOwnershipInfos;
144
148
  yield repos.action.completeWithVoid({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, result: result });
145
149
  debug('allOffersDelivered?:', allOffersDelivered, order.orderNumber);
146
150
  if (params.useOnOrderStatusChanged) {
@@ -33,4 +33,4 @@ export declare function createAuthorizeResult(params: {
33
33
  /**
34
34
  * 通知対象としてのアクションを最適化
35
35
  */
36
- export declare function optimizeAction4inform(action: factory.action.trade.pay.IAction | factory.action.trade.refund.IAction): IOnPaymentStatusChangedParams;
36
+ export declare function optimizeAction4inform(action: Pick<factory.action.trade.pay.IAction, 'id' | 'object' | 'project' | 'typeOf'> | Pick<factory.action.trade.refund.IAction, 'id' | 'object' | 'project' | 'typeOf'>): IOnPaymentStatusChangedParams;
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
8
8
  /**
9
9
  * 決済後のアクション
10
10
  */
11
- declare function onPaid(payAction: factory.action.trade.pay.IAction): (repos: {
11
+ declare function onPaid(payAction: Pick<factory.action.trade.pay.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
12
12
  action: ActionRepo;
13
13
  accountingReport: AccountingReportRepo;
14
14
  task: TaskRepo;
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
8
8
  /**
9
9
  * 返金後のアクション
10
10
  */
11
- declare function onRefund(refundAction: factory.action.trade.refund.IAction): (repos: {
11
+ declare function onRefund(refundAction: Pick<factory.action.trade.refund.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
12
12
  action: ActionRepo;
13
13
  accountingReport: AccountingReportRepo;
14
14
  task: TaskRepo;
@@ -1,20 +1,15 @@
1
1
  import * as factory from '../../../factory';
2
2
  import type { AuthorizationRepo } from '../../../repo/authorization';
3
- import type { OwnershipInfoRepo } from '../../../repo/ownershipInfo';
4
3
  import type { TicketRepo } from '../../../repo/ticket';
5
- type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail & {
6
- ticketToken?: string;
7
- };
8
4
  declare function verifyTicketTokenAsNeeded(params: {
9
5
  project: {
10
6
  id: string;
11
7
  };
12
- object: IObjectWithoutDetail;
8
+ object: Pick<factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'issuedThrough' | 'ticketToken'>;
13
9
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
14
10
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
15
11
  }): (repos: {
16
12
  authorization: AuthorizationRepo;
17
- ownershipInfo: OwnershipInfoRepo;
18
13
  ticket: TicketRepo;
19
14
  }) => Promise<{
20
15
  permit: Pick<factory.ownershipInfo.IPermitAsGood, 'identifier'> | undefined;
@@ -13,22 +13,21 @@ exports.verifyTicketTokenAsNeeded = void 0;
13
13
  const factory = require("../../../factory");
14
14
  function verifyTicketTokenAsNeeded(params) {
15
15
  return (repos) => __awaiter(this, void 0, void 0, function* () {
16
- var _a;
16
+ var _a, _b;
17
17
  const { paymentServiceType, object, project } = params;
18
- const { ticketToken } = object;
18
+ const { issuedThrough, ticketToken } = object;
19
19
  let permit;
20
- switch (paymentServiceType) {
21
- case factory.service.paymentService.PaymentServiceType.CreditCard:
22
- case factory.service.paymentService.PaymentServiceType.FaceToFace:
23
- // トークン化されたメンバーシップがリクエストされた場合、実メンバーシップ情報へ変換する
24
- if (typeof ticketToken === 'string' && ticketToken !== '') {
25
- let authorizedObject;
26
- const ticket = (yield repos.ticket.search({
20
+ // メンバーシップチケットが指定された場合、メンバーシップコードへ変換する
21
+ if (typeof ticketToken === 'string' && ticketToken !== '') {
22
+ switch (paymentServiceType) {
23
+ case factory.service.paymentService.PaymentServiceType.CreditCard:
24
+ case factory.service.paymentService.PaymentServiceType.FaceToFace:
25
+ const ticket = (yield repos.ticket.projectFields({
27
26
  limit: 1,
28
27
  page: 1,
29
28
  project: { id: { $eq: project.id } },
30
29
  ticketToken: { $eq: ticketToken }
31
- })).shift();
30
+ }, ['ticketToken'])).shift();
32
31
  if (ticket === undefined) {
33
32
  throw new factory.errors.NotFound('Ticket');
34
33
  }
@@ -37,41 +36,34 @@ function verifyTicketTokenAsNeeded(params) {
37
36
  project: { id: params.project.id },
38
37
  code: ticket.ticketToken
39
38
  });
40
- authorizedObject = validAuthorization.object;
39
+ const authorizedObject = validAuthorization.object;
41
40
  if (authorizedObject.typeOf !== 'OwnershipInfo') {
42
41
  throw new factory.errors.Argument('ticketToken', 'must be OwnershipInfo');
43
42
  }
44
- const ownershipInfoId = authorizedObject.id;
45
- const permitOwnershipInfo = (yield repos.ownershipInfo.search({
46
- limit: 1,
47
- page: 1,
48
- project: { id: { $eq: params.project.id } },
49
- ids: [ownershipInfoId]
50
- })).shift();
51
- if (permitOwnershipInfo === undefined) {
52
- throw new factory.errors.NotFound('OwnershipInfo');
43
+ // audience検証
44
+ if (((_a = validAuthorization.audience) === null || _a === void 0 ? void 0 : _a.typeOf) !== factory.transactionType.PlaceOrder
45
+ || validAuthorization.audience.id !== params.purpose.id) {
46
+ throw new factory.errors.Argument('ticketToken', 'audience not matched with placeOrder');
53
47
  }
54
- const { ownedBy, typeOfGood } = permitOwnershipInfo;
48
+ const { typeOfGood } = authorizedObject;
55
49
  if (typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
56
50
  throw new factory.errors.Argument('ticketToken', 'must be Permit');
57
51
  }
58
- if (((_a = typeOfGood.issuedThrough) === null || _a === void 0 ? void 0 : _a.typeOf) !== paymentServiceType) {
52
+ if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
59
53
  throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
60
54
  }
61
- if (!Array.isArray(ownedBy)) {
62
- throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy must be Array');
63
- }
64
- if (ownedBy[0].typeOf !== factory.transactionType.PlaceOrder) {
65
- throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy.typeOf must be PlaceOrder');
66
- }
67
- if (ownedBy[0].id !== params.purpose.id) {
68
- throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy.id not matched');
55
+ // CreditCardの場合、発行サービスIDを検証
56
+ if (typeOfGood.issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
57
+ if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
58
+ throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
59
+ }
69
60
  }
70
61
  permit = { identifier: typeOfGood.identifier };
71
- }
72
- break;
73
- default:
74
- // no op
62
+ break;
63
+ default:
64
+ // no op
65
+ throw new factory.errors.NotImplemented(`ticketToken issued through ${paymentServiceType} not implemented`);
66
+ }
75
67
  }
76
68
  return { permit };
77
69
  });
@@ -10,7 +10,6 @@ import type { AssetTransactionRepo } from '../../repo/assetTransaction';
10
10
  import type { AuthorizationRepo } from '../../repo/authorization';
11
11
  import type { ConfirmationNumberRepo } from '../../repo/confirmationNumber';
12
12
  import type { EventRepo } from '../../repo/event';
13
- import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
14
13
  import type { PaymentServiceRepo } from '../../repo/paymentService';
15
14
  import type { PaymentServiceProviderRepo } from '../../repo/paymentServiceProvider';
16
15
  import type { ProductRepo } from '../../repo/product';
@@ -80,7 +79,6 @@ interface IAuthorizeRepos {
80
79
  authorization: AuthorizationRepo;
81
80
  confirmationNumber: ConfirmationNumberRepo;
82
81
  event: EventRepo;
83
- ownershipInfo: OwnershipInfoRepo;
84
82
  paymentAccepted: SellerPaymentAcceptedRepo;
85
83
  paymentService: PaymentServiceRepo;
86
84
  paymentServiceProvider: PaymentServiceProviderRepo;
@@ -97,9 +95,11 @@ type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings, crede
97
95
  interface IPublishPaymentUrlRepos {
98
96
  action: ActionRepo;
99
97
  assetTransaction: AssetTransactionRepo;
98
+ authorization: AuthorizationRepo;
100
99
  paymentAccepted: SellerPaymentAcceptedRepo;
101
100
  paymentService: PaymentServiceRepo;
102
101
  paymentServiceProvider: PaymentServiceProviderRepo;
102
+ ticket: TicketRepo;
103
103
  transaction: TransactionRepo;
104
104
  transactionNumber: TransactionNumberRepo;
105
105
  }
@@ -117,7 +117,7 @@ declare function publishPaymentUrl(params: {
117
117
  agent: {
118
118
  id: string;
119
119
  };
120
- object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
120
+ object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'ticketToken'>;
121
121
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
122
122
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
123
123
  location: factory.action.trade.pay.ILocation;
@@ -62,7 +62,7 @@ function invalidatePaymentUrl(params) {
62
62
  if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
63
63
  throw new factory.errors.Argument('purpose.typeOf', `must be ${factory.transactionType.PlaceOrder}`);
64
64
  }
65
- const transaction = yield repos.transaction.findById({
65
+ const transaction = yield repos.transaction.projectFieldsById({
66
66
  typeOf: params.purpose.typeOf,
67
67
  id: params.purpose.id
68
68
  }, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
@@ -129,10 +129,10 @@ function processVoidPayTransaction(params) {
129
129
  let transaction;
130
130
  // アクションID指定の場合、進行中取引検証(2023-02-24~)
131
131
  if (typeof params.id === 'string') {
132
- transaction = (yield repos.transaction.findInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']));
132
+ transaction = (yield repos.transaction.projectFieldsInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']));
133
133
  }
134
134
  else {
135
- transaction = (yield repos.transaction.findById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']));
135
+ transaction = (yield repos.transaction.projectFieldsById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']));
136
136
  }
137
137
  // 承認アクションを取得
138
138
  let authorizeActions;
@@ -228,16 +228,24 @@ exports.processVoidPayTransaction = processVoidPayTransaction;
228
228
  function publishPaymentUrl(params) {
229
229
  return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
230
230
  var _a;
231
- if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
232
- throw new factory.errors.NotImplemented(`purpose.typeOf '${params.purpose.typeOf} not implemented'`);
231
+ const { paymentServiceType, purpose, project } = params;
232
+ if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
233
+ throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
233
234
  }
234
235
  try {
235
- const transaction = yield repos.transaction.findInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['expires', 'seller', 'project']);
236
- const paymentServiceType = params.paymentServiceType;
236
+ const transaction = yield repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['expires', 'seller', 'project']);
237
237
  // 取引番号生成
238
- const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({
239
- startDate: new Date()
240
- });
238
+ let transactionNumber;
239
+ // support ticketToken(2024-08-21~)
240
+ const { permit } = yield (0, verifyTicketTokenAsNeeded_1.verifyTicketTokenAsNeeded)({ project, object: params.object, paymentServiceType, purpose })(repos);
241
+ const paymentMethodIdByPermit = permit === null || permit === void 0 ? void 0 : permit.identifier;
242
+ if (typeof paymentMethodIdByPermit === 'string') {
243
+ transactionNumber = paymentMethodIdByPermit;
244
+ }
245
+ if (typeof transactionNumber !== 'string') {
246
+ const publishTransactionNumberResult = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
247
+ transactionNumber = publishTransactionNumberResult.transactionNumber;
248
+ }
241
249
  let result;
242
250
  // URL発行
243
251
  const authorizeObject = Object.assign(Object.assign({}, params.object), { accountId: '', paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment });
@@ -310,7 +318,7 @@ function authorize(params) {
310
318
  throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
311
319
  }
312
320
  const confirmationNumber = yield (0, fixConfirmationNumberAsNeeded_1.fixConfirmationNumberAsNeeded)({ purpose, paymentServiceType })(repos);
313
- const transaction = yield repos.transaction.findInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
321
+ const transaction = yield repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
314
322
  // 取引番号生成
315
323
  let transactionNumber;
316
324
  let pendingPaymentAgencyTransaction;
@@ -407,9 +415,9 @@ function authorize(params) {
407
415
  const rawError = Array.isArray(error) ? error[1] : undefined;
408
416
  if (rawError !== undefined && rawError.name !== 'AbortError') {
409
417
  yield processVoidPayTransaction({
410
- project: action.project,
418
+ project: actionAttributes.project,
411
419
  id: action.id,
412
- purpose: action.purpose
420
+ purpose: actionAttributes.purpose
413
421
  })(repos);
414
422
  }
415
423
  }
@@ -85,7 +85,7 @@ function processAuthorizeCreditCard(params) {
85
85
  sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
86
86
  };
87
87
  // add action(2024-06-12~)
88
- action = (yield repos.action.start(actionAttributes, { recipe }));
88
+ action = yield repos.action.start(actionAttributes, { recipe });
89
89
  try {
90
90
  entryTranResult = yield repos.creditCardService.entryTran(entryTranArgs);
91
91
  execTranArgs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ accessId: entryTranResult.accessId, accessPass: entryTranResult.accessPass, orderId, method: params.object.method, siteId: (_e = params.availableChannel.credentials) === null || _e === void 0 ? void 0 : _e.siteId, sitePass: (_f = params.availableChannel.credentials) === null || _f === void 0 ? void 0 : _f.sitePass, seqMode: GMO.utils.util.SeqMode.Physics }, (typeof cardNo === 'string') ? { cardNo } : undefined), (typeof cardPass === 'string') ? { cardPass } : undefined), (typeof expire === 'string') ? { expire } : undefined), (typeof token === 'string') ? { token } : undefined), (typeof memberId === 'string') ? { memberId } : undefined), (typeof cardSeq === 'number') ? { cardSeq } : undefined);
@@ -34,7 +34,7 @@ function processAuthorizeCreditCard3ds(params) {
34
34
  sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
35
35
  };
36
36
  // add action(2024-06-12~)
37
- action = (yield repos.action.start(actionAttributes, { recipe }));
37
+ action = yield repos.action.start(actionAttributes, { recipe });
38
38
  try {
39
39
  secureTran2Result = yield repos.creditCardService.secureTran2(secureTran2Args);
40
40
  }
@@ -6,7 +6,6 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
6
6
  import type { TaskRepo } from '../../../repo/task';
7
7
  import * as factory from '../../../factory';
8
8
  import { Settings } from '../../../settings';
9
- type IPayAction = factory.action.trade.pay.IAction;
10
9
  /**
11
10
  * クレジットカード決済
12
11
  */
@@ -17,5 +16,5 @@ declare function payCreditCard(params: factory.action.trade.pay.IAttributes): (r
17
16
  paymentService: PaymentServiceRepo;
18
17
  paymentServiceProvider: PaymentServiceProviderRepo;
19
18
  task: TaskRepo;
20
- }, settings: Settings) => Promise<IPayAction>;
19
+ }, settings: Settings) => Promise<void>;
21
20
  export { payCreditCard };
@@ -38,8 +38,7 @@ function payCreditCard(params) {
38
38
  throw new factory.errors.ArgumentNull('recipient.id');
39
39
  }
40
40
  const { shopId, shopPass } = yield (0, getGMOInfoFromSeller_1.getGMOInfoFromSeller)({ paymentMethodType, seller: { id: sellerId }, paymentServiceId })(repos);
41
- // アクション開始
42
- let action = yield repos.action.start(params);
41
+ const action = yield repos.action.start(params);
43
42
  const alterTranResults = [];
44
43
  const processAlterTranResults = [];
45
44
  let recipe;
@@ -80,9 +79,17 @@ function payCreditCard(params) {
80
79
  const actionResult = {
81
80
  // creditCardSales: alterTranResults // discontinue(2024-06-10~)
82
81
  };
83
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe }));
84
- yield (0, onPaid_1.onPaid)(action)(repos);
85
- return action;
82
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
83
+ yield (0, onPaid_1.onPaid)({
84
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
85
+ id: action.id,
86
+ object: params.object,
87
+ potentialActions: params.potentialActions,
88
+ project: params.project,
89
+ purpose: params.purpose,
90
+ typeOf: action.typeOf
91
+ })(repos);
92
+ // return action;
86
93
  });
87
94
  }
88
95
  exports.payCreditCard = payCreditCard;
@@ -29,6 +29,7 @@ const getGMOInfoFromSeller_1 = require("./getGMOInfoFromSeller");
29
29
  /**
30
30
  * クレジットカード返金
31
31
  */
32
+ // tslint:disable-next-line:max-func-body-length
32
33
  function refundCreditCard(params, options) {
33
34
  return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
34
35
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -59,7 +60,7 @@ function refundCreditCard(params, options) {
59
60
  id: paymentServiceId
60
61
  });
61
62
  const { sameAs } = params, startingActionParams = __rest(params, ["sameAs"]);
62
- let action = yield repos.action.start(Object.assign(Object.assign({}, startingActionParams), (typeof ((_g = params.sameAs) === null || _g === void 0 ? void 0 : _g.id) === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined));
63
+ const action = yield repos.action.start(Object.assign(Object.assign({}, startingActionParams), (typeof ((_g = params.sameAs) === null || _g === void 0 ? void 0 : _g.id) === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined));
63
64
  const alterTranResult = [];
64
65
  let processAlterTranResult;
65
66
  let recipe;
@@ -97,8 +98,17 @@ function refundCreditCard(params, options) {
97
98
  throw error;
98
99
  }
99
100
  const actionResult = {}; // optimize(2024-06-10~)
100
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe })); // add recipe(2024-06-04~)
101
- yield (0, onRefund_1.onRefund)(action)(repos);
101
+ // add recipe(2024-06-04~)
102
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
103
+ yield (0, onRefund_1.onRefund)({
104
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
105
+ id: action.id,
106
+ object: startingActionParams.object,
107
+ potentialActions: startingActionParams.potentialActions,
108
+ project: startingActionParams.project,
109
+ purpose: startingActionParams.purpose,
110
+ typeOf: action.typeOf
111
+ })(repos);
102
112
  // return action;
103
113
  });
104
114
  }
@@ -49,7 +49,7 @@ function voidTransaction(params) {
49
49
  typeOf: { $eq: factory.actionType.AuthorizeAction },
50
50
  object: { paymentMethodId: { $eq: paymentMethodId } },
51
51
  sameAs: { id: { $eq: transaction.id } }
52
- }, ['_id', 'typeOf', 'project'], [])).shift();
52
+ }, ['id', 'typeOf', 'project'], [])).shift();
53
53
  if (authorizeInvoiceAction !== undefined) {
54
54
  const cancelAction = {
55
55
  startTime: new Date(),
@@ -14,11 +14,11 @@ declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (r
14
14
  accountingReport: AccountingReportRepo;
15
15
  product: ProductRepo;
16
16
  task: TaskRepo;
17
- }) => Promise<import("@chevre/factory/lib/action/trade/pay").IAction>;
17
+ }) => Promise<void>;
18
18
  declare function refundFaceToFace(params: factory.task.refund.IData): (repos: {
19
19
  action: ActionRepo;
20
20
  accountingReport: AccountingReportRepo;
21
21
  product: ProductRepo;
22
22
  task: TaskRepo;
23
- }) => Promise<import("@chevre/factory/lib/action/trade/refund").IAction>;
23
+ }) => Promise<void>;
24
24
  export { payFaceToFace, refundFaceToFace, voidTransaction };
@@ -10,6 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.voidTransaction = exports.refundFaceToFace = exports.payFaceToFace = void 0;
13
+ /**
14
+ * 対面決済サービス
15
+ */
16
+ const factory = require("../../factory");
13
17
  const onPaid_1 = require("./any/onPaid");
14
18
  const onRefund_1 = require("./any/onRefund");
15
19
  function voidTransaction(__) {
@@ -20,8 +24,7 @@ function voidTransaction(__) {
20
24
  exports.voidTransaction = voidTransaction;
21
25
  function payFaceToFace(params) {
22
26
  return (repos) => __awaiter(this, void 0, void 0, function* () {
23
- // アクション開始
24
- let action = yield repos.action.start(params);
27
+ const action = yield repos.action.start(params);
25
28
  try {
26
29
  // no op
27
30
  }
@@ -34,17 +37,24 @@ function payFaceToFace(params) {
34
37
  }
35
38
  throw error;
36
39
  }
37
- // アクション完了
38
40
  const actionResult = {};
39
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult }));
40
- yield (0, onPaid_1.onPaid)(action)(repos);
41
- return action;
41
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
42
+ yield (0, onPaid_1.onPaid)({
43
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
44
+ id: action.id,
45
+ object: params.object,
46
+ potentialActions: params.potentialActions,
47
+ project: params.project,
48
+ purpose: params.purpose,
49
+ typeOf: action.typeOf
50
+ })(repos);
51
+ // return action;
42
52
  });
43
53
  }
44
54
  exports.payFaceToFace = payFaceToFace;
45
55
  function refundFaceToFace(params) {
46
56
  return (repos) => __awaiter(this, void 0, void 0, function* () {
47
- let action = yield repos.action.start(params);
57
+ const action = yield repos.action.start(params);
48
58
  try {
49
59
  // no op
50
60
  }
@@ -58,9 +68,17 @@ function refundFaceToFace(params) {
58
68
  throw error;
59
69
  }
60
70
  const actionResult = {};
61
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult }));
62
- yield (0, onRefund_1.onRefund)(action)(repos);
63
- return action;
71
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
72
+ yield (0, onRefund_1.onRefund)({
73
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
74
+ id: action.id,
75
+ object: params.object,
76
+ potentialActions: params.potentialActions,
77
+ project: params.project,
78
+ purpose: params.purpose,
79
+ typeOf: action.typeOf
80
+ })(repos);
81
+ // return action;
64
82
  });
65
83
  }
66
84
  exports.refundFaceToFace = refundFaceToFace;
@@ -10,7 +10,6 @@ import { Settings } from '../../../settings';
10
10
  interface IAuthorizeResult {
11
11
  accountId: string;
12
12
  accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
13
- payAction: factory.action.trade.pay.IAction;
14
13
  }
15
14
  /**
16
15
  * 決済カード承認
@@ -22,7 +22,7 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
22
22
  return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
23
23
  var _a, _b;
24
24
  let accountId;
25
- let payAction;
25
+ // let payAction: factory.action.trade.pay.IAction;
26
26
  let accountsReceivablesByServiceType = [];
27
27
  try {
28
28
  // MovieTicket決済の場合、認証
@@ -64,7 +64,8 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
64
64
  ? { sameAs: { id: options.executor.id, typeOf: 'Task' } } // link sameAs(2024-06-04~)
65
65
  : undefined);
66
66
  // 着券させざるをえないが、informPaymentはしない(注文がまだ存在しないため)
67
- payAction = yield (0, payMovieTicket_1.payMovieTicket)(payActionAttributes)(repos, settings);
67
+ // payAction = await payMovieTicket(payActionAttributes)(repos, settings);
68
+ yield (0, payMovieTicket_1.payMovieTicket)(payActionAttributes)(repos, settings);
68
69
  }
69
70
  catch (error) {
70
71
  // アクション保管用のエラーと両方throw(2024-05-22~)
@@ -76,7 +77,11 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
76
77
  }
77
78
  // throw handleMvtkReserveError(error);
78
79
  }
79
- return { accountId, payAction, accountsReceivablesByServiceType };
80
+ return {
81
+ accountId,
82
+ // payAction, // discontinue(2024-08-28~)
83
+ accountsReceivablesByServiceType
84
+ };
80
85
  });
81
86
  }
82
87
  exports.authorize = authorize;
@@ -17,9 +17,8 @@ interface IPayOperationRepos {
17
17
  task: TaskRepo;
18
18
  }
19
19
  type IPayOperation<T> = (repos: IPayOperationRepos, settings: Settings) => Promise<T>;
20
- type IPayAction = factory.action.trade.pay.IAction;
21
20
  /**
22
21
  * 決済カード決済
23
22
  */
24
- declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<IPayAction>;
23
+ declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<void>;
25
24
  export { payMovieTicket };