@chevre/domain 24.0.0-alpha.40 → 24.0.0-alpha.42

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 (247) hide show
  1. package/lib/chevre/repo/accountTitle.d.ts +3 -3
  2. package/lib/chevre/repo/action/pay.d.ts +25 -0
  3. package/lib/chevre/repo/action/pay.js +54 -0
  4. package/lib/chevre/repo/action/refund.d.ts +9 -0
  5. package/lib/chevre/repo/action/refund.js +13 -0
  6. package/lib/chevre/repo/action.d.ts +5 -14
  7. package/lib/chevre/repo/action.js +20 -13
  8. package/lib/chevre/repo/additionalProperty.js +2 -2
  9. package/lib/chevre/repo/advanceBookingRequirement.d.ts +1 -3
  10. package/lib/chevre/repo/advanceBookingRequirement.js +2 -2
  11. package/lib/chevre/repo/aggregateOffer.d.ts +5 -9
  12. package/lib/chevre/repo/aggregateOffer.js +3 -3
  13. package/lib/chevre/repo/assetTransaction.d.ts +3 -3
  14. package/lib/chevre/repo/assetTransaction.js +12 -6
  15. package/lib/chevre/repo/categoryCode.d.ts +4 -6
  16. package/lib/chevre/repo/categoryCode.js +2 -2
  17. package/lib/chevre/repo/comment.d.ts +3 -3
  18. package/lib/chevre/repo/creativeWork.d.ts +3 -3
  19. package/lib/chevre/repo/creativeWork.js +3 -3
  20. package/lib/chevre/repo/customer.d.ts +3 -3
  21. package/lib/chevre/repo/customer.js +2 -2
  22. package/lib/chevre/repo/emailMessage.js +1 -1
  23. package/lib/chevre/repo/event.d.ts +6 -6
  24. package/lib/chevre/repo/event.js +10 -4
  25. package/lib/chevre/repo/eventSeries.d.ts +6 -6
  26. package/lib/chevre/repo/eventSeries.js +2 -2
  27. package/lib/chevre/repo/identity.d.ts +4 -6
  28. package/lib/chevre/repo/identityProvider.d.ts +4 -6
  29. package/lib/chevre/repo/identityProvider.js +2 -2
  30. package/lib/chevre/repo/issuer.d.ts +3 -3
  31. package/lib/chevre/repo/issuer.js +3 -3
  32. package/lib/chevre/repo/member.d.ts +3 -3
  33. package/lib/chevre/repo/merchantReturnPolicy.d.ts +3 -3
  34. package/lib/chevre/repo/merchantReturnPolicy.js +1 -1
  35. package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.d.ts +2 -2
  36. package/lib/chevre/repo/mongoose/schemas/account.d.ts +2 -2
  37. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +2 -2
  38. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +2 -2
  39. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +2 -2
  40. package/lib/chevre/repo/mongoose/schemas/action.d.ts +2 -2
  41. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +2 -2
  42. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +2 -2
  43. package/lib/chevre/repo/mongoose/schemas/advanceBookingRequirement.d.ts +2 -2
  44. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +2 -2
  45. package/lib/chevre/repo/mongoose/schemas/aggregateOrder.d.ts +2 -2
  46. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +2 -2
  47. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +2 -2
  48. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +2 -2
  49. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +2 -2
  50. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +2 -2
  51. package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +2 -2
  52. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +2 -2
  53. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +2 -2
  54. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +2 -2
  55. package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +2 -2
  56. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +2 -2
  57. package/lib/chevre/repo/mongoose/schemas/event.d.ts +2 -2
  58. package/lib/chevre/repo/mongoose/schemas/eventOffer.d.ts +2 -2
  59. package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +2 -2
  60. package/lib/chevre/repo/mongoose/schemas/identity.d.ts +2 -2
  61. package/lib/chevre/repo/mongoose/schemas/identityProvider.d.ts +2 -2
  62. package/lib/chevre/repo/mongoose/schemas/issuer.d.ts +2 -2
  63. package/lib/chevre/repo/mongoose/schemas/member/global.d.ts +2 -2
  64. package/lib/chevre/repo/mongoose/schemas/member.d.ts +2 -2
  65. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +2 -2
  66. package/lib/chevre/repo/mongoose/schemas/message.d.ts +2 -2
  67. package/lib/chevre/repo/mongoose/schemas/movieTicketTypes.d.ts +2 -2
  68. package/lib/chevre/repo/mongoose/schemas/note.d.ts +2 -2
  69. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +2 -2
  70. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +2 -2
  71. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +2 -2
  72. package/lib/chevre/repo/mongoose/schemas/order.d.ts +2 -2
  73. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +2 -2
  74. package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +2 -2
  75. package/lib/chevre/repo/mongoose/schemas/paymentServiceChannel.d.ts +2 -2
  76. package/lib/chevre/repo/mongoose/schemas/pendingReservation.d.ts +2 -2
  77. package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +2 -2
  78. package/lib/chevre/repo/mongoose/schemas/place.d.ts +2 -2
  79. package/lib/chevre/repo/mongoose/schemas/potentialAction.d.ts +2 -2
  80. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +2 -2
  81. package/lib/chevre/repo/mongoose/schemas/product.d.ts +2 -2
  82. package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +2 -2
  83. package/lib/chevre/repo/mongoose/schemas/productOffer.d.ts +2 -2
  84. package/lib/chevre/repo/mongoose/schemas/project.d.ts +2 -2
  85. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +2 -2
  86. package/lib/chevre/repo/mongoose/schemas/reserveInterface.d.ts +2 -2
  87. package/lib/chevre/repo/mongoose/schemas/role.d.ts +2 -2
  88. package/lib/chevre/repo/mongoose/schemas/schedule.d.ts +2 -2
  89. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +2 -2
  90. package/lib/chevre/repo/mongoose/schemas/sellerReturnPolicy.d.ts +2 -2
  91. package/lib/chevre/repo/mongoose/schemas/service/availableHour.d.ts +2 -2
  92. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +2 -2
  93. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +2 -2
  94. package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -2
  95. package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +2 -2
  96. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -2
  97. package/lib/chevre/repo/mongoose/schemas/transactionNumber.d.ts +2 -2
  98. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +2 -2
  99. package/lib/chevre/repo/mongoose/schemas/webSite.d.ts +2 -2
  100. package/lib/chevre/repo/movieTicketType.d.ts +1 -3
  101. package/lib/chevre/repo/movieTicketType.js +2 -2
  102. package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +1 -3
  103. package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +1 -3
  104. package/lib/chevre/repo/offerCatalog.d.ts +3 -3
  105. package/lib/chevre/repo/offerCatalog.js +5 -4
  106. package/lib/chevre/repo/offerCatalogItem.js +4 -4
  107. package/lib/chevre/repo/offerItemCondition.js +2 -2
  108. package/lib/chevre/repo/order.d.ts +3 -3
  109. package/lib/chevre/repo/ownershipInfo.d.ts +3 -3
  110. package/lib/chevre/repo/passport.js +1 -1
  111. package/lib/chevre/repo/paymentService.d.ts +1 -3
  112. package/lib/chevre/repo/paymentService.js +2 -2
  113. package/lib/chevre/repo/paymentServiceChannel.d.ts +1 -3
  114. package/lib/chevre/repo/paymentServiceChannel.js +2 -2
  115. package/lib/chevre/repo/person.js +2 -2
  116. package/lib/chevre/repo/place/busStop.js +1 -1
  117. package/lib/chevre/repo/place/movieTheater.d.ts +3 -3
  118. package/lib/chevre/repo/place/movieTheater.js +10 -4
  119. package/lib/chevre/repo/place/screeningRoom.d.ts +3 -3
  120. package/lib/chevre/repo/place/screeningRoom.js +2 -2
  121. package/lib/chevre/repo/place/seat.d.ts +2 -4
  122. package/lib/chevre/repo/potentialAction.d.ts +4 -6
  123. package/lib/chevre/repo/potentialAction.js +2 -2
  124. package/lib/chevre/repo/priceSpecification.d.ts +3 -3
  125. package/lib/chevre/repo/priceSpecification.js +2 -2
  126. package/lib/chevre/repo/product.d.ts +5 -9
  127. package/lib/chevre/repo/product.js +3 -3
  128. package/lib/chevre/repo/productModel.js +2 -2
  129. package/lib/chevre/repo/project.d.ts +3 -3
  130. package/lib/chevre/repo/rateLimit/offer.js +1 -1
  131. package/lib/chevre/repo/reservation.d.ts +4 -6
  132. package/lib/chevre/repo/seller.d.ts +5 -9
  133. package/lib/chevre/repo/seller.js +2 -2
  134. package/lib/chevre/repo/sellerReturnPolicy.d.ts +1 -3
  135. package/lib/chevre/repo/sellerReturnPolicy.js +2 -2
  136. package/lib/chevre/repo/task.d.ts +3 -3
  137. package/lib/chevre/repo/task.js +1 -1
  138. package/lib/chevre/repo/transaction.d.ts +3 -3
  139. package/lib/chevre/repo/transactionProcess.js +1 -1
  140. package/lib/chevre/repo/trip.d.ts +4 -12
  141. package/lib/chevre/repo/trip.js +3 -3
  142. package/lib/chevre/repo/webSite.d.ts +1 -3
  143. package/lib/chevre/repo/webSite.js +3 -2
  144. package/lib/chevre/repository.d.ts +10 -0
  145. package/lib/chevre/repository.js +22 -0
  146. package/lib/chevre/service/assetTransaction/moneyTransfer.js +8 -5
  147. package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +1 -1
  148. package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +2 -1
  149. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +2 -1
  150. package/lib/chevre/service/assetTransaction/pay/start/factory.js +2 -1
  151. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +7 -2
  152. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +7 -2
  153. package/lib/chevre/service/assetTransaction/pay/start.d.ts +7 -2
  154. package/lib/chevre/service/assetTransaction/refund.d.ts +5 -2
  155. package/lib/chevre/service/assetTransaction/refund.js +1 -1
  156. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +6 -3
  157. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +3 -2
  158. package/lib/chevre/service/delivery/factory.js +2 -1
  159. package/lib/chevre/service/event/saveScreeningEvents.js +2 -2
  160. package/lib/chevre/service/event.js +1 -1
  161. package/lib/chevre/service/notification/notifyByEmail.d.ts +1 -1
  162. package/lib/chevre/service/notification/triggerWebhook.js +1 -1
  163. package/lib/chevre/service/offer/event/authorize.js +2 -1
  164. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +2 -1
  165. package/lib/chevre/service/offer/event/searchOffersByIds.js +2 -1
  166. package/lib/chevre/service/offer/event/voidTransaction.js +6 -3
  167. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +2 -1
  168. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +14 -11
  169. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +1 -1
  170. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +1 -1
  171. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +2 -1
  172. package/lib/chevre/service/offer/product.js +1 -1
  173. package/lib/chevre/service/order/confirmPayTransaction.d.ts +1 -1
  174. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -1
  175. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +4 -2
  176. package/lib/chevre/service/payment/any/authorize.d.ts +7 -2
  177. package/lib/chevre/service/payment/any/findAcceptAction.js +2 -1
  178. package/lib/chevre/service/payment/any/findAuthorizeAction.js +2 -1
  179. package/lib/chevre/service/payment/any/findCheckAction.js +2 -1
  180. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +2 -1
  181. package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +7 -2
  182. package/lib/chevre/service/payment/any/onPayActionCompleted.js +7 -2
  183. package/lib/chevre/service/payment/any/onPaymentStatusChanged.d.ts +10 -5
  184. package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +21 -11
  185. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +13 -10
  186. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +9 -6
  187. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -1
  188. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +2 -1
  189. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
  190. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +7 -2
  191. package/lib/chevre/service/payment/creditCard/payCreditCard.js +8 -4
  192. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +7 -2
  193. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +11 -7
  194. package/lib/chevre/service/payment/faceToFace.d.ts +12 -3
  195. package/lib/chevre/service/payment/faceToFace.js +16 -8
  196. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +2 -1
  197. package/lib/chevre/service/payment/factory.js +4 -2
  198. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +7 -2
  199. package/lib/chevre/service/payment/movieTicket/authorize.js +1 -1
  200. package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.d.ts +12 -0
  201. package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js +72 -0
  202. package/lib/chevre/service/payment/movieTicket/payMovieTicket/processSeatInfoSync.d.ts +8 -0
  203. package/lib/chevre/service/payment/movieTicket/payMovieTicket/processSeatInfoSync.js +29 -0
  204. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +8 -3
  205. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +14 -77
  206. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncCancelInOnRefund.d.ts +14 -0
  207. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncCancelInOnRefund.js +49 -0
  208. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncInOnRefund.d.ts +14 -0
  209. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncInOnRefund.js +46 -0
  210. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSync.d.ts +12 -0
  211. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSync.js +72 -0
  212. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.d.ts +8 -0
  213. package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.js +60 -0
  214. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +8 -3
  215. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +20 -125
  216. package/lib/chevre/service/payment/movieTicket/validation.d.ts +1 -2
  217. package/lib/chevre/service/payment/movieTicket/validation.js +37 -29
  218. package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +6 -2
  219. package/lib/chevre/service/payment/movieTicket/voidTransaction.js +1 -1
  220. package/lib/chevre/service/payment/paymentCard.d.ts +12 -3
  221. package/lib/chevre/service/payment/paymentCard.js +16 -8
  222. package/lib/chevre/service/permit.js +4 -2
  223. package/lib/chevre/service/reserve/factory.d.ts +1 -1
  224. package/lib/chevre/service/reserve/findByCode.js +2 -1
  225. package/lib/chevre/service/reserve/searchByOrder.js +2 -1
  226. package/lib/chevre/service/reserve/verifyToken4reservation.js +2 -1
  227. package/lib/chevre/service/task/authorizePayment.js +8 -2
  228. package/lib/chevre/service/task/confirmReserveTransaction.js +4 -2
  229. package/lib/chevre/service/task/invalidatePaymentUrl.js +8 -2
  230. package/lib/chevre/service/task/onResourceUpdated.js +1 -1
  231. package/lib/chevre/service/task/pay.js +8 -2
  232. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +7 -2
  233. package/lib/chevre/service/task/payment/payByTask.d.ts +7 -2
  234. package/lib/chevre/service/task/payment/payByTask.js +2 -1
  235. package/lib/chevre/service/task/payment/refundByTask.d.ts +7 -2
  236. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +6 -0
  237. package/lib/chevre/service/task/refund.js +8 -2
  238. package/lib/chevre/service/task/returnPayTransaction.js +5 -2
  239. package/lib/chevre/service/task/returnReserveTransaction.js +2 -1
  240. package/lib/chevre/service/task/voidPayment.js +6 -0
  241. package/lib/chevre/service/transaction/deleteTransaction.js +4 -2
  242. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +2 -1
  243. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +2 -1
  244. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -2
  245. package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.js +5 -3
  246. package/lib/chevre/service/validation/validateOrder.js +4 -2
  247. package/package.json +2 -2
@@ -28,12 +28,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.refundMovieTicket = refundMovieTicket;
30
30
  const surfrock = __importStar(require("@surfrock/sdk"));
31
- const http_status_1 = require("http-status");
32
31
  const moment_1 = __importDefault(require("moment"));
33
32
  const errorHandler_1 = require("../../../errorHandler");
34
33
  const factory = __importStar(require("../../../factory"));
35
34
  const onRefundActionCompletedOrFailed_1 = require("../any/onRefundActionCompletedOrFailed");
36
35
  const factory_1 = require("./factory");
36
+ const createSeatInfoSyncCancelInOnRefund_1 = require("./refundMovieTicket/createSeatInfoSyncCancelInOnRefund");
37
+ const createSeatInfoSyncInOnRefund_1 = require("./refundMovieTicket/createSeatInfoSyncInOnRefund");
38
+ const processSeatInfoSync_1 = require("./refundMovieTicket/processSeatInfoSync");
39
+ const processSeatInfoSyncCancel_1 = require("./refundMovieTicket/processSeatInfoSyncCancel");
37
40
  function wait4payActionDelayIfNeeded(params) {
38
41
  return async (settings) => {
39
42
  const { payAction } = params;
@@ -66,7 +69,7 @@ function refundMovieTicket(params, options) {
66
69
  const paymentServiceId = params.object[0]?.id;
67
70
  // 本アクションに対応するPayActionを取り出す
68
71
  // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
69
- const payAction = await repos.action.findPayAction({
72
+ const payAction = await repos.actions.pay.findPayActionByPaymentMethodId({
70
73
  project: { id: params.project.id },
71
74
  paymentMethodId,
72
75
  actionStatus: {
@@ -99,18 +102,18 @@ function refundMovieTicket(params, options) {
99
102
  let seatInfoSyncIn;
100
103
  const useSeatInfoSyncCancel = availableChannel.credentials?.useSeatInfoSyncCancel === true;
101
104
  if (useSeatInfoSyncCancel) {
102
- seatInfoSyncCancelIn = await createSeatInfoSyncCancelInOnRefund({
105
+ seatInfoSyncCancelIn = await (0, createSeatInfoSyncCancelInOnRefund_1.createSeatInfoSyncCancelInOnRefund)({
103
106
  project: { id: params.project.id },
104
107
  paymentMethodId,
105
108
  payAction: { id: payAction.id }
106
- })({ action: repos.action });
109
+ })({ actions: repos.actions });
107
110
  }
108
111
  else {
109
- seatInfoSyncIn = await createSeatInfoSyncInOnRefund({
112
+ seatInfoSyncIn = await (0, createSeatInfoSyncInOnRefund_1.createSeatInfoSyncInOnRefund)({
110
113
  project: { id: params.project.id },
111
114
  paymentMethodId,
112
115
  payAction: { id: payAction.id }
113
- })({ action: repos.action });
116
+ })({ actions: repos.actions });
114
117
  }
115
118
  let recipe = (0, factory_1.processSeatInfoSyncResult2refundRecipe)({
116
119
  project: { id: params.project.id },
@@ -123,7 +126,7 @@ function refundMovieTicket(params, options) {
123
126
  instrument: (Array.isArray(instrument)) ? instrument : [], // add(2025-02-18~)
124
127
  ...(typeof sameAs?.id === 'string') ? { sameAs: { id: sameAs.id, typeOf: 'Task' } } : undefined
125
128
  };
126
- const action = await repos.action.start(refundActionAttributes, { recipe });
129
+ const action = await repos.actions.refund.start(refundActionAttributes, { recipe });
127
130
  let processSeatInfoSyncCancelResult;
128
131
  let processSeatInfoSyncResult;
129
132
  try {
@@ -131,13 +134,13 @@ function refundMovieTicket(params, options) {
131
134
  if (seatInfoSyncCancelIn === undefined) {
132
135
  throw new factory.errors.Internal('seatInfoSyncCancelIn must be set');
133
136
  }
134
- processSeatInfoSyncCancelResult = await processSeatInfoSyncCancel({ seatInfoSyncCancelIn })({ seatService });
137
+ processSeatInfoSyncCancelResult = await (0, processSeatInfoSyncCancel_1.processSeatInfoSyncCancel)({ seatInfoSyncCancelIn })({ seatService });
135
138
  }
136
139
  else {
137
140
  if (seatInfoSyncIn === undefined) {
138
141
  throw new factory.errors.Internal('seatInfoSyncIn must be set');
139
142
  }
140
- processSeatInfoSyncResult = await processSeatInfoSync({
143
+ processSeatInfoSyncResult = await (0, processSeatInfoSync_1.processSeatInfoSync)({
141
144
  seatInfoSyncIn, paymentMethodId, purpose: params.purpose
142
145
  })({ seatService });
143
146
  }
@@ -147,7 +150,7 @@ function refundMovieTicket(params, options) {
147
150
  message += `決済ID:${paymentMethodId}`; // エラー通知先で情報を読み取りやすくするために、messageに情報付加
148
151
  try {
149
152
  const actionError = { ...error, message: message, name: error.name };
150
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
153
+ await repos.actions.refund.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
151
154
  }
152
155
  catch (__) {
153
156
  // 失敗したら仕方ない
@@ -159,7 +162,7 @@ function refundMovieTicket(params, options) {
159
162
  const seatInfoSyncResultAsError = processSeatInfoSyncResult?.seatInfoSyncResultAsError;
160
163
  let actionStatus;
161
164
  if (seatInfoSyncResultAsError !== undefined) {
162
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: seatInfoSyncResultAsError });
165
+ await repos.actions.refund.giveUp({ typeOf: action.typeOf, id: action.id, error: seatInfoSyncResultAsError });
163
166
  actionStatus = factory.actionStatusType.FailedActionStatus;
164
167
  }
165
168
  else {
@@ -170,7 +173,7 @@ function refundMovieTicket(params, options) {
170
173
  ...(processSeatInfoSyncCancelResult !== undefined) ? { processSeatInfoSyncCancelResult } : undefined
171
174
  });
172
175
  const actionResult = {};
173
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
176
+ await repos.actions.refund.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
174
177
  actionStatus = factory.actionStatusType.CompletedActionStatus;
175
178
  }
176
179
  if (callOnPayActionCompleted) {
@@ -182,119 +185,11 @@ function refundMovieTicket(params, options) {
182
185
  project: refundActionAttributes.project,
183
186
  purpose: refundActionAttributes.purpose,
184
187
  typeOf: action.typeOf
185
- })(repos);
186
- }
187
- };
188
- }
189
- function createSeatInfoSyncInOnRefund(params) {
190
- return async (repos) => {
191
- const recipe = await repos.action.findRecipeByAction({
192
- project: { id: params.project.id },
193
- recipeFor: { id: params.payAction.id }
194
- });
195
- const seatInfoSyncInOnPay = recipe?.step[0]?.itemListElement[0]?.itemListElement[0]?.beforeMedia;
196
- if (seatInfoSyncInOnPay === undefined) {
197
- throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
198
- }
199
- // 着券時のseatInfoSyncInに対してtrkshFlgだけ変更してリクエストする
200
- const seatInfoSyncIn = {
201
- ...seatInfoSyncInOnPay,
202
- trkshFlg: surfrock.factory.service.seat.seatInfoSync.DeleteFlag.True // 取消フラグ
203
- };
204
- return seatInfoSyncIn;
205
- };
206
- }
207
- function createSeatInfoSyncCancelInOnRefund(params) {
208
- return async (repos) => {
209
- const recipe = await repos.action.findRecipeByAction({
210
- project: { id: params.project.id },
211
- recipeFor: { id: params.payAction.id }
212
- });
213
- const seatInfoSyncInOnPay = recipe?.step[0]?.itemListElement[0]?.itemListElement[0]?.beforeMedia;
214
- if (seatInfoSyncInOnPay === undefined) {
215
- throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
216
- }
217
- const seatInfoSyncCancelIn = {
218
- kgygishCd: seatInfoSyncInOnPay.kgygishCd,
219
- kgysystmzskyykNo: seatInfoSyncInOnPay.kgygishSstmZskyykNo,
220
- kgysystmzskyykNoIkktsCnclFlg: '1',
221
- jyuTyp: surfrock.service.seat.factory.seatInfoSyncCancel.JyuTyp.JyuTyp05,
222
- jyuTypRmk: ''
223
- // knyknrNoInfoIn: [],
224
- };
225
- return seatInfoSyncCancelIn;
226
- };
227
- }
228
- function processSeatInfoSyncCancel(params) {
229
- return async (repos) => {
230
- let seatInfoSyncCancelResult;
231
- const { seatInfoSyncCancelIn } = params;
232
- try {
233
- seatInfoSyncCancelResult = await repos.seatService.seatInfoSyncCancel(seatInfoSyncCancelIn);
234
- }
235
- catch (error) {
236
- let throwsError = true;
237
- if (error.name === errorHandler_1.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME) {
238
- if (error.code === http_status_1.BAD_REQUEST) {
239
- if (Array.isArray(error.errors) && error.errors.length > 0) {
240
- const mvtkReserveServiceError = error.errors[0];
241
- // 興行会社システム座席予約番号存在無の場合、取消済なのでok
242
- if (mvtkReserveServiceError.status === surfrock.factory.ResultStatus.Success) {
243
- const cnclResult = mvtkReserveServiceError.rawResult?.cnclResult;
244
- if (cnclResult === surfrock.service.seat.factory.seatInfoSyncCancel.CancelResult.CancelResult02) {
245
- seatInfoSyncCancelResult = error;
246
- throwsError = false;
247
- }
248
- }
249
- }
250
- }
251
- }
252
- if (throwsError) {
253
- throw error;
254
- }
255
- }
256
- return { seatInfoSyncCancelIn, seatInfoSyncCancelResult };
257
- };
258
- }
259
- function processSeatInfoSync(params) {
260
- return async (repos) => {
261
- let seatInfoSyncResult;
262
- let seatInfoSyncResultAsError;
263
- const { seatInfoSyncIn, paymentMethodId, purpose } = params;
264
- try {
265
- seatInfoSyncResult = await repos.seatService.seatInfoSync(seatInfoSyncIn);
266
- }
267
- catch (error) {
268
- let throwsError = true;
269
- // 「存在しない興行会社システム座席予約番号が入力されました」の場合、取消済なのでok
270
- if (error.name === errorHandler_1.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME) {
271
- if (error.code === http_status_1.BAD_REQUEST && error.message === factory_1.MovieticketReserveRequestErrorMessage.NotFound) {
272
- seatInfoSyncResult = error;
273
- throwsError = false;
274
- }
275
- // ReservationResult 19の内容が不明だがリトライする意味はおそらくないパターン
276
- if (error.code === http_status_1.BAD_REQUEST && error.message === factory_1.MovieticketReserveRequestErrorMessage.ReservationResult19) {
277
- seatInfoSyncResult = error;
278
- throwsError = false;
279
- }
280
- // surfrock: bookingNoが存在しないケースをハンドル(2024-03-13~)
281
- const expectedMessage4surfrockNotFound = JSON.stringify({ message: `bookingNo:"${paymentMethodId}" が見つかりません。` });
282
- if (error.code === http_status_1.BAD_REQUEST && error.message === expectedMessage4surfrockNotFound) {
283
- seatInfoSyncResult = error;
284
- throwsError = false;
285
- }
286
- // 着券取消可能期間超過を認識した上でのあえての返金の場合(注文からしばらく経って返品など)(2024-03-19~)
287
- if (error.code === http_status_1.BAD_REQUEST && error.message === factory_1.MovieticketReserveRequestErrorMessage.CancellationPeriodPassed) {
288
- if (purpose.typeOf === factory.actionType.ReturnAction) {
289
- seatInfoSyncResultAsError = error;
290
- throwsError = false;
291
- }
292
- }
293
- }
294
- if (throwsError) {
295
- throw error;
296
- }
188
+ })({
189
+ actions: repos.actions,
190
+ accountingReport: repos.accountingReport,
191
+ task: repos.task
192
+ });
297
193
  }
298
- return { seatInfoSyncIn, seatInfoSyncResult, seatInfoSyncResultAsError };
299
194
  };
300
195
  }
@@ -6,7 +6,6 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
6
6
  import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
7
7
  import type { TaskRepo } from '../../../repo/task';
8
8
  import * as factory from '../../../factory';
9
- import { Settings } from '../../../settings';
10
9
  export interface IValidateMovieTicketRepos {
11
10
  checkMovieTicketAction: CheckMovieTicketActionRepo;
12
11
  credentials: CredentialsRepo;
@@ -23,6 +22,6 @@ export declare function validateMovieTicket(params: factory.assetTransaction.pay
23
22
  * placeOrder ID
24
23
  */
25
24
  id?: string;
26
- }): (repos: IValidateMovieTicketRepos, settings: Settings) => Promise<{
25
+ }): (repos: IValidateMovieTicketRepos) => Promise<{
27
26
  accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
28
27
  }>;
@@ -29,12 +29,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.validateMovieTicket = validateMovieTicket;
30
30
  const debug_1 = __importDefault(require("debug"));
31
31
  const factory = __importStar(require("../../../factory"));
32
- const processPurchaseNumberAuth_1 = require("./processPurchaseNumberAuth");
33
32
  const debug = (0, debug_1.default)('chevre-domain:service:payment');
34
33
  function validateMovieTicket(params, paymentServiceId,
35
34
  // useCheckByIdentifierIfNotYet: boolean,
36
35
  checkedAction, purpose) {
37
- return async (repos, settings) => {
36
+ return async (repos) => {
38
37
  const movieTickets = params.object.paymentMethod?.movieTickets;
39
38
  if (!Array.isArray(movieTickets)) {
40
39
  throw new factory.errors.Argument('movieTickets', 'object.paymentMethod.movieTickets must be an array');
@@ -100,7 +99,7 @@ checkedAction, purpose) {
100
99
  // useCheckByIdentifierIfNotYet,
101
100
  checkedAction,
102
101
  purpose
103
- })(repos, settings);
102
+ })(repos);
104
103
  const accountsReceivablesByServiceType = [];
105
104
  // 券種ごとに枚数が足りているか
106
105
  const serviceTypes = [...new Set(movieTickets.map((t) => t.serviceType))];
@@ -130,7 +129,7 @@ checkedAction, purpose) {
130
129
  };
131
130
  }
132
131
  function checkByIdentifierIfNotYet(params) {
133
- return async (repos, settings) => {
132
+ return async (repos) => {
134
133
  let checkResult;
135
134
  let alreadyCheckedAction; // すでにCheckActionが存在すれば認証しない(2023-06-06~)
136
135
  const placeOrderId = params.purpose.id;
@@ -138,8 +137,10 @@ function checkByIdentifierIfNotYet(params) {
138
137
  // no op
139
138
  }
140
139
  else {
141
- // 注文取引IDの未指定ケースがあるかどうか確認するためにlog
142
- console.log('checkByIdentifierIfNotYet: placeOrderId undefined. params:', JSON.stringify(params));
140
+ // 注文取引IDの未指定ケースは廃止(2026-03-21~)
141
+ throw new factory.errors.ArgumentNull('purpose.id');
142
+ // // 注文取引IDの未指定ケースがあるかどうか確認するためにlog
143
+ // console.log('checkByIdentifierIfNotYet: placeOrderId undefined. params:', JSON.stringify(params));
143
144
  }
144
145
  const specifiedCheckedActionId = params.checkedAction?.id;
145
146
  if (typeof specifiedCheckedActionId === 'string' && specifiedCheckedActionId !== '') {
@@ -157,27 +158,31 @@ function checkByIdentifierIfNotYet(params) {
157
158
  }
158
159
  }
159
160
  else {
160
- // 認証IDの未指定ケースがあるかどうか確認するためにlog
161
- console.log('checkByIdentifierIfNotYet: specifiedCheckedActionId undefined. params:', JSON.stringify(params));
162
- alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions({
163
- // limit: 1,
164
- // page: 1,
165
- sort: { startDate: factory.sortType.Descending },
166
- // typeOf: { $eq: factory.actionType.CheckAction },
167
- // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
168
- object: {
169
- typeOf: { $eq: factory.service.paymentService.PaymentServiceType.MovieTicket },
170
- id: { $eq: params.paymentServiceId }, // 指定の決済サービスにおいて
171
- movieTickets: {
172
- identifier: { $eq: params.movieTicketIdentifier }, // 指定の決済カードコードを
173
- serviceOutput: {
174
- reservationFor: { id: { $eq: params.screeningEvent.id } } // 指定のイベントにおいて
175
- }
176
- }
177
- },
178
- // ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
179
- ...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
180
- })).shift();
161
+ // 認証IDの未指定ケースは廃止(2026-03-21~)
162
+ throw new factory.errors.ArgumentNull('checkedAction.id');
163
+ // // 認証IDの未指定ケースがあるかどうか確認するためにlog
164
+ // console.log('checkByIdentifierIfNotYet: specifiedCheckedActionId undefined. params:', JSON.stringify(params));
165
+ // alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions(
166
+ // {
167
+ // // limit: 1,
168
+ // // page: 1,
169
+ // sort: { startDate: factory.sortType.Descending },
170
+ // // typeOf: { $eq: factory.actionType.CheckAction },
171
+ // // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
172
+ // object: {
173
+ // typeOf: { $eq: factory.service.paymentService.PaymentServiceType.MovieTicket },
174
+ // id: { $eq: params.paymentServiceId }, // 指定の決済サービスにおいて
175
+ // movieTickets: {
176
+ // identifier: { $eq: params.movieTicketIdentifier }, // 指定の決済カードコードを
177
+ // serviceOutput: {
178
+ // reservationFor: { id: { $eq: params.screeningEvent.id } } // 指定のイベントにおいて
179
+ // }
180
+ // }
181
+ // },
182
+ // // ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
183
+ // ...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
184
+ // }
185
+ // )).shift();
181
186
  }
182
187
  debug('checkByIdentifierIfNotYet: alreadyCheckedAction:', JSON.stringify(alreadyCheckedAction), 'params:', JSON.stringify(params));
183
188
  if (alreadyCheckedAction !== undefined) {
@@ -194,8 +199,11 @@ function checkByIdentifierIfNotYet(params) {
194
199
  }
195
200
  }
196
201
  if (checkResult === undefined) {
197
- debug('checkByIdentifier processing because movieTickets not checked yet...', checkResult);
198
- checkResult = await (0, processPurchaseNumberAuth_1.processPurchaseNumberAuth)(params)(repos, settings);
202
+ // 認証IDの未指定ケースは廃止(2026-03-21~)
203
+ console.error('checkByIdentifierIfNotYet: checkResult undefined. params:', JSON.stringify(params));
204
+ throw new factory.errors.NotFound('checkResult');
205
+ // debug('checkByIdentifier processing because movieTickets not checked yet...', checkResult);
206
+ // checkResult = await processPurchaseNumberAuth(params)(repos, settings);
199
207
  }
200
208
  return checkResult;
201
209
  };
@@ -1,12 +1,16 @@
1
1
  import type { AccountingReportRepo } from '../../../repo/accountingReport';
2
- import type { ActionRepo } from '../../../repo/action';
2
+ import type { PayActionRepo } from '../../../repo/action/pay';
3
+ import type { RefundActionRepo } from '../../../repo/action/refund';
3
4
  import type { CredentialsRepo } from '../../../repo/credentials';
4
5
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
5
6
  import type { TaskRepo } from '../../../repo/task';
6
7
  import * as factory from '../../../factory';
7
8
  import { Settings } from '../../../settings';
8
9
  declare function voidTransaction(params: factory.task.voidPayment.IData): (repos: {
9
- action: ActionRepo;
10
+ actions: {
11
+ pay: PayActionRepo;
12
+ refund: RefundActionRepo;
13
+ };
10
14
  accountingReport: AccountingReportRepo;
11
15
  credentials: CredentialsRepo;
12
16
  paymentService: PaymentServiceRepo;
@@ -40,7 +40,7 @@ function voidTransaction(params) {
40
40
  }
41
41
  // 決済開始時に着券していれば、取消
42
42
  // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
43
- const payAction = await repos.action.findPayAction({
43
+ const payAction = await repos.actions.pay.findPayActionByPaymentMethodId({
44
44
  project: { id: transaction.project.id },
45
45
  paymentMethodId,
46
46
  actionStatus: {
@@ -1,6 +1,7 @@
1
1
  import * as factory from '../../factory';
2
2
  import type { AccountingReportRepo } from '../../repo/accountingReport';
3
- import type { ActionRepo } from '../../repo/action';
3
+ import type { PayActionRepo } from '../../repo/action/pay';
4
+ import type { RefundActionRepo } from '../../repo/action/refund';
4
5
  import type { AssetTransactionRepo } from '../../repo/assetTransaction';
5
6
  import type { ProductRepo } from '../../repo/product';
6
7
  import type { TaskRepo } from '../../repo/task';
@@ -17,13 +18,21 @@ declare function voidTransaction(params: factory.task.voidPayment.IData): (repos
17
18
  product: ProductRepo;
18
19
  }) => Promise<void>;
19
20
  declare function payPaymentCard(params: factory.action.trade.pay.IAttributes): (repos: {
20
- action: ActionRepo;
21
+ action?: never;
22
+ actions: {
23
+ pay: PayActionRepo;
24
+ refund: RefundActionRepo;
25
+ };
21
26
  accountingReport: AccountingReportRepo;
22
27
  product: ProductRepo;
23
28
  task: TaskRepo;
24
29
  }) => Promise<void>;
25
30
  declare function refundPaymentCard(params: factory.task.refund.IData): (repos: {
26
- action: ActionRepo;
31
+ action?: never;
32
+ actions: {
33
+ pay: PayActionRepo;
34
+ refund: RefundActionRepo;
35
+ };
27
36
  accountingReport: AccountingReportRepo;
28
37
  product: ProductRepo;
29
38
  task: TaskRepo;
@@ -250,7 +250,7 @@ function payPaymentCard(params) {
250
250
  return async (repos) => {
251
251
  const payObject = params.object;
252
252
  const paymentServiceId = payObject[0].id;
253
- const action = await repos.action.start(params);
253
+ const action = await repos.actions.pay.start(params);
254
254
  try {
255
255
  const transactionNumber = payObject[0].paymentMethod.paymentMethodId;
256
256
  const availableChannel = await repos.product.findAvailableChannel({
@@ -272,7 +272,7 @@ function payPaymentCard(params) {
272
272
  }
273
273
  catch (error) {
274
274
  try {
275
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
275
+ await repos.actions.pay.giveUp({ typeOf: action.typeOf, id: action.id, error });
276
276
  }
277
277
  catch (__) {
278
278
  // no op
@@ -280,7 +280,7 @@ function payPaymentCard(params) {
280
280
  throw error;
281
281
  }
282
282
  const actionResult = {};
283
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
283
+ await repos.actions.pay.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
284
284
  await (0, onPayActionCompleted_1.onPayActionCompleted)({
285
285
  // actionStatus: factory.actionStatusType.CompletedActionStatus,
286
286
  id: action.id,
@@ -289,7 +289,11 @@ function payPaymentCard(params) {
289
289
  project: params.project,
290
290
  purpose: params.purpose,
291
291
  typeOf: action.typeOf
292
- })(repos);
292
+ })({
293
+ actions: repos.actions,
294
+ accountingReport: repos.accountingReport,
295
+ task: repos.task
296
+ });
293
297
  // return action;
294
298
  };
295
299
  }
@@ -306,7 +310,7 @@ function refundPaymentCard(params) {
306
310
  if (typeof accountNumber !== 'string') {
307
311
  throw new factory.errors.ArgumentNull('serviceOutput.paymentAccount.accountNumber');
308
312
  }
309
- const action = await repos.action.start(params);
313
+ const action = await repos.actions.refund.start(params);
310
314
  let accountTransactionNumber4refund;
311
315
  try {
312
316
  const availableChannel = await repos.product.findAvailableChannel({
@@ -388,7 +392,7 @@ function refundPaymentCard(params) {
388
392
  }
389
393
  catch (error) {
390
394
  try {
391
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
395
+ await repos.actions.refund.giveUp({ typeOf: action.typeOf, id: action.id, error });
392
396
  }
393
397
  catch (__) {
394
398
  // no op
@@ -398,7 +402,7 @@ function refundPaymentCard(params) {
398
402
  const result = {
399
403
  accountTransaction: { transactionNumber: accountTransactionNumber4refund }
400
404
  };
401
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
405
+ await repos.actions.refund.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
402
406
  await (0, onRefundActionCompletedOrFailed_1.onRefundActionCompletedOrFailed)({
403
407
  actionStatus: factory.actionStatusType.CompletedActionStatus,
404
408
  id: action.id,
@@ -407,7 +411,11 @@ function refundPaymentCard(params) {
407
411
  project: params.project,
408
412
  purpose: params.purpose,
409
413
  typeOf: action.typeOf
410
- })(repos);
414
+ })({
415
+ actions: repos.actions,
416
+ accountingReport: repos.accountingReport,
417
+ task: repos.task
418
+ });
411
419
  // return action;
412
420
  };
413
421
  }
@@ -37,7 +37,7 @@ const AccountService = __importStar(require("./account"));
37
37
  function issue(params) {
38
38
  return async (repos) => {
39
39
  switch (params.issuedThrough.typeOf) {
40
- case factory.product.ProductType.PaymentCard:
40
+ case factory.product.ProductType.PaymentCard: {
41
41
  // 口座開設
42
42
  const openAccountParams = params.serviceOutputs.map((serviceOutput) => {
43
43
  const accountTypeOf = serviceOutput?.paymentAccount?.typeOf;
@@ -76,6 +76,7 @@ function issue(params) {
76
76
  account: repos.account
77
77
  });
78
78
  break;
79
+ }
79
80
  default:
80
81
  // no op
81
82
  }
@@ -105,7 +106,7 @@ function search(project, params, projection) {
105
106
  };
106
107
  const productType = params.issuedThrough?.typeOf?.$eq;
107
108
  switch (productType) {
108
- case factory.product.ProductType.PaymentCard:
109
+ case factory.product.ProductType.PaymentCard: {
109
110
  const permits = await repos.serviceOutput.search(searchConditions, projection);
110
111
  permitsWithAccountDetail = permits;
111
112
  // 口座詳細取得
@@ -138,6 +139,7 @@ function search(project, params, projection) {
138
139
  });
139
140
  }
140
141
  break;
142
+ }
141
143
  default:
142
144
  permitsWithAccountDetail = await repos.serviceOutput.search(searchConditions, projection);
143
145
  }
@@ -3,7 +3,7 @@ export declare function optimizeUnderName4inform(params: {
3
3
  underName: factory.reservation.IUnderName<factory.reservationType.EventReservation>;
4
4
  }): factory.notification.reservation.IMaskedUnderName;
5
5
  export type IPotentialInformReservationAction = factory.task.triggerWebhook.IPotentialInformReservationAction;
6
- export declare const NUM_TRY_INFORM_RESERVATION: number;
6
+ export declare const NUM_TRY_INFORM_RESERVATION = 10;
7
7
  export declare function createMoneyTransferActions(params: {
8
8
  acceptedOffer?: factory.assetTransaction.reserve.IAcceptedOffer4object;
9
9
  reservation: Pick<factory.assetTransaction.reserve.IObjectSubReservation, 'reservedTicket'>;
@@ -39,7 +39,7 @@ function findByCode(params) {
39
39
  code: params.code
40
40
  });
41
41
  switch (authorization.object.typeOf) {
42
- case factory.order.OrderType.Order:
42
+ case factory.order.OrderType.Order: {
43
43
  const { orderNumber } = authorization.object;
44
44
  if (typeof orderNumber === 'string' && orderNumber.length > 0) {
45
45
  // reservationIdを含む注文の存在を確認するだけでよい
@@ -51,6 +51,7 @@ function findByCode(params) {
51
51
  });
52
52
  }
53
53
  break;
54
+ }
54
55
  default:
55
56
  throw new factory.errors.NotImplemented(`authorization object typeOf: ${authorization.object.typeOf} not implemented`);
56
57
  }
@@ -52,7 +52,7 @@ function searchByOrder(params) {
52
52
  if (reservationIds.length > 0) {
53
53
  switch (offeredThroughIdentifier) {
54
54
  // COA対応
55
- case factory.service.webAPI.Identifier.COA:
55
+ case factory.service.webAPI.Identifier.COA: {
56
56
  const order = (await repos.order.projectFields({
57
57
  limit: 1,
58
58
  page: 1,
@@ -102,6 +102,7 @@ function searchByOrder(params) {
102
102
  });
103
103
  }
104
104
  break;
105
+ }
105
106
  default:
106
107
  reservations = await repos.reservation.projectFields({
107
108
  project: { id: { $eq: params.project.id } },
@@ -44,7 +44,7 @@ function verifyToken4reservation(params) {
44
44
  throw new factory.errors.ArgumentNull('ticket.token or ticket.ticketToken');
45
45
  }
46
46
  switch (payload.typeOf) {
47
- case factory.order.OrderType.Order:
47
+ case factory.order.OrderType.Order: {
48
48
  orderNumber = payload.orderNumber;
49
49
  if (typeof orderNumber !== 'string' || orderNumber.length === 0) {
50
50
  throw new factory.errors.NotFound('payload.orderNumber');
@@ -66,6 +66,7 @@ function verifyToken4reservation(params) {
66
66
  throw new factory.errors.Argument('token', `invalid orderStatus '${order.orderStatus}'`);
67
67
  }
68
68
  break;
69
+ }
69
70
  default:
70
71
  throw new factory.errors.NotImplemented(`Payload type ${payload.typeOf} not implemented`);
71
72
  }
@@ -27,7 +27,9 @@ exports.call = call;
27
27
  const factory = __importStar(require("../../factory"));
28
28
  const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
29
29
  const accountingReport_1 = require("../../repo/accountingReport");
30
- const action_1 = require("../../repo/action");
30
+ // import { ActionRepo } from '../../repo/action';
31
+ const pay_1 = require("../../repo/action/pay");
32
+ const refund_1 = require("../../repo/action/refund");
31
33
  const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
32
34
  const acceptPay_1 = require("../../repo/action/acceptPay");
33
35
  const authorizeInvoice_1 = require("../../repo/action/authorizeInvoice");
@@ -80,7 +82,11 @@ function call(params) {
80
82
  })({
81
83
  acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
82
84
  accountingReport: new accountingReport_1.AccountingReportRepo(connection),
83
- action: new action_1.ActionRepo(connection),
85
+ // action: new ActionRepo(connection),
86
+ actions: {
87
+ pay: new pay_1.PayActionRepo(connection),
88
+ refund: new refund_1.RefundActionRepo(connection),
89
+ },
84
90
  checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
85
91
  acceptPayAction: new acceptPay_1.AcceptPayActionRepo(connection),
86
92
  authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
@@ -176,7 +176,7 @@ function confirmReserveTransaction(params, options) {
176
176
  // let updReserveResult: COA.factory.reserve.IUpdReserveResult | undefined;
177
177
  let recipe;
178
178
  switch (params.object.typeOf) {
179
- case factory.assetTransactionType.COAReserveTransaction:
179
+ case factory.assetTransactionType.COAReserveTransaction: {
180
180
  // 最適化されたタスクに対応するため、ここでIObject4COAを注文から生成する(2024-01-24~)
181
181
  const order = await fixOrderAsPurpose({
182
182
  project: { id: params.project.id },
@@ -194,6 +194,7 @@ function confirmReserveTransaction(params, options) {
194
194
  project: { id: params.project.id }
195
195
  });
196
196
  break;
197
+ }
197
198
  default:
198
199
  confirmActionObject = params.object;
199
200
  }
@@ -210,7 +211,7 @@ function confirmReserveTransaction(params, options) {
210
211
  try {
211
212
  const object = confirmActionAttributes.object;
212
213
  switch (object.typeOf) {
213
- case factory.assetTransactionType.COAReserveTransaction:
214
+ case factory.assetTransactionType.COAReserveTransaction: {
214
215
  // COA本予約
215
216
  const processConfirmCOAReserveResult = await (0, reserveCOA_1.confirm)({
216
217
  project: { id: confirmActionAttributes.project.id },
@@ -223,6 +224,7 @@ function confirmReserveTransaction(params, options) {
223
224
  project: { id: confirmActionAttributes.project.id }
224
225
  });
225
226
  break;
227
+ }
226
228
  default:
227
229
  // 予約取引確定
228
230
  await (0, confirm_1.confirm)({