@chevre/domain 22.2.0-alpha.9 → 22.2.0

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 (248) 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/searchActionsByPurpose.ts +38 -0
  11. package/example/src/chevre/searchProjects.ts +9 -4
  12. package/example/src/chevre/searchSellersByAggregate.ts +3 -3
  13. package/example/src/chevre/searchTransactions.ts +1 -1
  14. package/example/src/chevre/unsetUnnecessaryFields.ts +2 -41
  15. package/lib/chevre/repo/accountTitle.d.ts +9 -3
  16. package/lib/chevre/repo/accountingReport.d.ts +2 -15
  17. package/lib/chevre/repo/action.d.ts +110 -47
  18. package/lib/chevre/repo/action.js +170 -133
  19. package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
  20. package/lib/chevre/repo/assetTransaction.d.ts +134 -7
  21. package/lib/chevre/repo/assetTransaction.js +2 -2
  22. package/lib/chevre/repo/categoryCode.d.ts +14 -2
  23. package/lib/chevre/repo/categoryCode.js +47 -19
  24. package/lib/chevre/repo/comment.d.ts +5 -1
  25. package/lib/chevre/repo/creativeWork.d.ts +14 -2
  26. package/lib/chevre/repo/customer.d.ts +5 -1
  27. package/lib/chevre/repo/customerType.d.ts +1 -1
  28. package/lib/chevre/repo/event.d.ts +49 -2
  29. package/lib/chevre/repo/member.d.ts +5 -1
  30. package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
  31. package/lib/chevre/repo/message.d.ts +1 -15
  32. package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
  33. package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
  34. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
  35. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
  36. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
  37. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  38. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
  39. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
  40. package/lib/chevre/repo/mongoose/schemas/action.d.ts +8 -3
  41. package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
  42. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
  43. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
  44. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
  45. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
  46. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
  47. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
  48. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
  49. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
  50. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
  51. package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
  52. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
  53. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
  54. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
  55. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  56. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
  57. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +22 -24
  58. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
  59. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  60. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
  61. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
  62. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
  63. package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
  64. package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
  65. package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
  66. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
  67. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
  68. package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
  69. package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
  70. package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
  71. package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
  72. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
  73. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
  74. package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
  75. package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
  76. package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
  77. package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
  78. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
  79. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
  80. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
  81. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
  82. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
  83. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
  84. package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
  85. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  86. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
  87. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  88. package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
  89. package/lib/chevre/repo/mongoose/schemas/paymentService.js +13 -4
  90. package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
  91. package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
  92. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
  93. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
  94. package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
  95. package/lib/chevre/repo/mongoose/schemas/product.js +6 -13
  96. package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
  97. package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
  98. package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
  99. package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
  100. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
  101. package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
  102. package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
  103. package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
  104. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
  105. package/lib/chevre/repo/mongoose/schemas/seller.js +22 -24
  106. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
  107. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  108. package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
  109. package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
  110. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
  111. package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
  112. package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
  113. package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
  114. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
  115. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
  116. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
  117. package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
  118. package/lib/chevre/repo/offer.d.ts +13 -4
  119. package/lib/chevre/repo/offerCatalog.d.ts +15 -2
  120. package/lib/chevre/repo/order.d.ts +13 -1
  121. package/lib/chevre/repo/ownershipInfo.d.ts +15 -3
  122. package/lib/chevre/repo/ownershipInfo.js +40 -11
  123. package/lib/chevre/repo/paymentService.d.ts +2 -2
  124. package/lib/chevre/repo/paymentService.js +108 -58
  125. package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -10
  126. package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
  127. package/lib/chevre/repo/priceSpecification.d.ts +42 -1
  128. package/lib/chevre/repo/product.d.ts +8 -3
  129. package/lib/chevre/repo/product.js +67 -33
  130. package/lib/chevre/repo/productModel.d.ts +1 -22
  131. package/lib/chevre/repo/project.d.ts +25 -5
  132. package/lib/chevre/repo/project.js +69 -28
  133. package/lib/chevre/repo/reservation.d.ts +35 -3
  134. package/lib/chevre/repo/reservation.js +1 -1
  135. package/lib/chevre/repo/role.d.ts +2 -9
  136. package/lib/chevre/repo/role.js +20 -10
  137. package/lib/chevre/repo/seller.d.ts +64 -14
  138. package/lib/chevre/repo/seller.js +61 -27
  139. package/lib/chevre/repo/task.d.ts +64 -3
  140. package/lib/chevre/repo/telemetry.d.ts +3 -2
  141. package/lib/chevre/repo/ticket.d.ts +4 -20
  142. package/lib/chevre/repo/ticket.js +23 -10
  143. package/lib/chevre/repo/transaction.d.ts +30 -14
  144. package/lib/chevre/repo/transaction.js +106 -77
  145. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
  146. package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
  147. package/lib/chevre/service/aggregation/project.js +1 -1
  148. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
  149. package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
  150. package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
  151. package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
  152. package/lib/chevre/service/assetTransaction/pay.js +3 -3
  153. package/lib/chevre/service/assetTransaction/refund/factory.d.ts +1 -1
  154. package/lib/chevre/service/assetTransaction/refund.js +3 -3
  155. package/lib/chevre/service/assetTransaction/registerService.js +4 -6
  156. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +9 -11
  157. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +1 -1
  158. package/lib/chevre/service/assetTransaction/reserve/start.js +1 -3
  159. package/lib/chevre/service/code.d.ts +0 -4
  160. package/lib/chevre/service/code.js +22 -18
  161. package/lib/chevre/service/event.js +4 -4
  162. package/lib/chevre/service/moneyTransfer.js +3 -5
  163. package/lib/chevre/service/notification.js +2 -2
  164. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
  165. package/lib/chevre/service/offer/event/authorize/factory.js +16 -2
  166. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +2 -2
  167. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -2
  168. package/lib/chevre/service/offer/event/authorize.d.ts +4 -2
  169. package/lib/chevre/service/offer/event/authorize.js +3 -2
  170. package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
  171. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -12
  172. package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
  173. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
  174. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
  175. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +41 -4
  176. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
  177. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +3 -3
  178. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +7 -3
  179. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +10 -5
  180. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +3 -1
  181. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +3 -1
  182. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +14 -6
  183. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
  184. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  185. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
  186. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
  187. package/lib/chevre/service/offer/product/searchProductOffers.js +1 -3
  188. package/lib/chevre/service/offer/product.d.ts +4 -2
  189. package/lib/chevre/service/offer/product.js +12 -12
  190. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
  191. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  192. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  193. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  194. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  195. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -3
  196. package/lib/chevre/service/order/placeOrder.js +1 -1
  197. package/lib/chevre/service/order/returnOrder.js +1 -1
  198. package/lib/chevre/service/payment/any/factory.d.ts +1 -1
  199. package/lib/chevre/service/payment/any/onPaid.d.ts +1 -1
  200. package/lib/chevre/service/payment/any/onRefund.d.ts +1 -1
  201. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -4
  202. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +21 -26
  203. package/lib/chevre/service/payment/any.d.ts +3 -1
  204. package/lib/chevre/service/payment/any.js +21 -13
  205. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
  206. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
  207. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
  208. package/lib/chevre/service/payment/creditCard/payCreditCard.js +12 -5
  209. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +13 -3
  210. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  211. package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
  212. package/lib/chevre/service/payment/faceToFace.js +28 -10
  213. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
  214. package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
  215. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
  216. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +12 -4
  217. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +15 -4
  218. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  219. package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
  220. package/lib/chevre/service/payment/paymentCard.js +29 -16
  221. package/lib/chevre/service/payment.d.ts +1 -1
  222. package/lib/chevre/service/report/telemetry.js +2 -2
  223. package/lib/chevre/service/reserve/cancelReservation.js +1 -1
  224. package/lib/chevre/service/reserve/confirmReservation.js +1 -1
  225. package/lib/chevre/service/task/onAuthorizationCreated.js +20 -16
  226. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -2
  227. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
  228. package/lib/chevre/service/task/onResourceUpdated.js +16 -4
  229. package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
  230. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  231. package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
  232. package/lib/chevre/service/transaction/moneyTransfer.js +4 -4
  233. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
  234. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  235. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +2 -2
  236. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -1
  237. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  238. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +2 -2
  239. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  240. package/lib/chevre/service/transaction/returnOrder.js +2 -2
  241. package/lib/chevre/service/transaction.js +1 -1
  242. package/package.json +4 -4
  243. package/example/src/chevre/findTransactionById.ts +0 -23
  244. package/example/src/chevre/findTransactionInProgressById.ts +0 -23
  245. package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
  246. package/example/src/chevre/projectReservationFields.ts +0 -31
  247. package/example/src/chevre/searchActions.ts +0 -40
  248. package/example/src/chevre/searchProducts.ts +0 -28
@@ -23,7 +23,7 @@ function changeOffers(params) {
23
23
  // tslint:disable-next-line:max-func-body-length
24
24
  return (repos) => __awaiter(this, void 0, void 0, function* () {
25
25
  var _a, _b, _c, _d;
26
- const transaction = yield repos.transaction.findInProgressById({
26
+ const transaction = yield repos.transaction.projectFieldsInProgressById({
27
27
  typeOf: factory.transactionType.PlaceOrder,
28
28
  id: params.transaction.id
29
29
  }, ['typeOf', 'agent', 'project', 'seller']);
@@ -40,6 +40,9 @@ function changeOffers(params) {
40
40
  if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
41
41
  throw new factory.errors.Argument('Transaction', 'Action not found in the transaction');
42
42
  }
43
+ if (authorizeAction.result === undefined) {
44
+ throw new factory.errors.NotFound('authorizeAction.result');
45
+ }
43
46
  const originalAcceptActionId = authorizeAction.object.id;
44
47
  if (typeof originalAcceptActionId !== 'string' || originalAcceptActionId === '') {
45
48
  throw new factory.errors.NotFound('authorizeAction.object.id');
@@ -77,15 +80,15 @@ function changeOffers(params) {
77
80
  'superEvent', 'typeOf', 'identifier', 'name'
78
81
  ] // optimize(2024-07-18~)
79
82
  );
80
- const availablePaymentMethodTypes = yield repos.categoryCode.search({
83
+ const availablePaymentMethodTypes = yield repos.categoryCode.projectFields({
81
84
  project: { id: { $eq: transaction.project.id } },
82
85
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
83
86
  }, [], []);
84
- const seatingTypes = yield repos.categoryCode.search({
87
+ const seatingTypes = yield repos.categoryCode.projectFields({
85
88
  project: { id: { $eq: transaction.project.id } },
86
89
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.SeatingType } }
87
90
  }, [], []);
88
- const videoFormatTypes = yield repos.categoryCode.search({
91
+ const videoFormatTypes = yield repos.categoryCode.projectFields({
89
92
  project: { id: { $eq: transaction.project.id } },
90
93
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.VideoFormatType } }
91
94
  }, [], []);
@@ -153,12 +156,17 @@ function changeOffers(params) {
153
156
  }
154
157
  throw error;
155
158
  }
156
- // 座席予約承認アクションの供給情報を変更する
157
- return repos.action.updateAuthorizeEventOfferAction({
159
+ // 承認アクションを再完了
160
+ yield repos.action.reCompleteAuthorizeEventOfferAction({
158
161
  id: params.id,
159
162
  object: authorizeAction.object,
160
163
  result: actionResult
161
164
  });
165
+ return {
166
+ id: params.id,
167
+ instrument: authorizeAction.instrument,
168
+ result: actionResult
169
+ };
162
170
  });
163
171
  }
164
172
  exports.changeOffers = changeOffers;
@@ -1,12 +1,15 @@
1
+ import type * as COAService from '@motionpicture/coa-service';
1
2
  import * as factory from '../../../factory';
2
3
  import { IMinimizedIndividualEvent } from '../../../factory/event';
3
4
  export import WebAPIIdentifier = factory.service.webAPI.Identifier;
4
- export type IAcceptedOffer4COA = factory.action.authorize.offer.eventService.IAcceptedOffer4COA;
5
+ export type IAcceptedOffer4COA = factory.action.accept.coaOffer.IAcceptedOffer4COA;
6
+ export type IRequestBody = COAService.factory.reserve.IUpdTmpReserveSeatArgs;
7
+ export type IResponseBody = COAService.factory.reserve.IUpdTmpReserveSeatResult;
5
8
  export declare function createAuthorizeSeatReservationActionAttributes(params: {
6
9
  acceptAction: {
7
10
  id: string;
8
11
  };
9
- acceptedOffers: factory.action.authorize.offer.eventService.IAcceptedOffer4COA[];
12
+ acceptedOffers: factory.action.accept.coaOffer.IAcceptedOffer4COA[];
10
13
  event: {
11
14
  id: string;
12
15
  typeOf: factory.eventType.ScreeningEvent;
@@ -21,13 +24,13 @@ export declare function offers2resultPrice(offers: IAcceptedOffer4COA[]): {
21
24
  price: number;
22
25
  eligibleMonetaryAmount: factory.offer.IEligibleMonetaryAmount[];
23
26
  };
24
- type IResultAcceptedOffer = factory.action.authorize.offer.eventService.IResultAcceptedOffer;
27
+ type IResultAcceptedOffer = factory.order.IAcceptedOffer<factory.order.IReservation>;
25
28
  /**
26
29
  * COA仮予約結果から注文アイテムを生成する
27
30
  */
28
31
  export declare function responseBody2acceptedOffers4result(params: {
29
- responseBody: factory.action.authorize.offer.eventService.IResponseBody<factory.service.webAPI.Identifier.COA>;
30
- acceptedOffer: factory.action.authorize.offer.eventService.IAcceptedOffer4COA[];
32
+ responseBody: IResponseBody;
33
+ acceptedOffer: factory.action.accept.coaOffer.IAcceptedOffer4COA[];
31
34
  event: Pick<IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>, 'coaInfo' | 'doorTime' | 'endDate' | 'id' | 'location' | 'startDate' | 'superEvent' | 'typeOf' | 'identifier' | 'name'>;
32
35
  seller: Pick<factory.transaction.placeOrder.ISeller, 'typeOf' | 'name'>;
33
36
  bookingTime: Date;
@@ -1,7 +1,7 @@
1
1
  import * as factory from '../../../factory';
2
2
  import type { OfferRepo } from '../../../repo/offer';
3
3
  import { IAcceptedOffer4COA } from './factory';
4
- export type IAcceptedOfferBeforeAuthorize4COA = factory.action.authorize.offer.eventService.IAcceptedOfferBeforeAuthorize4COA;
4
+ export type IAcceptedOfferBeforeAuthorize4COA = factory.action.accept.coaOffer.IAcceptedOfferBeforeAuthorize4COA;
5
5
  /**
6
6
  * 受け入れらたオファーの内容を検証
7
7
  */
@@ -16,7 +16,7 @@ const MoneyTransferAssetTransactionService = require("../../assetTransaction/mon
16
16
  const any_1 = require("../any");
17
17
  function authorize(params) {
18
18
  return (repos) => __awaiter(this, void 0, void 0, function* () {
19
- const transaction = yield repos.transaction.findInProgressById({
19
+ const transaction = yield repos.transaction.projectFieldsInProgressById({
20
20
  typeOf: params.purpose.typeOf,
21
21
  id: params.purpose.id
22
22
  }, ['seller', 'project', 'agent', 'typeOf']);
@@ -16,7 +16,7 @@ function voidTransaction(params) {
16
16
  return (repos) => __awaiter(this, void 0, void 0, function* () {
17
17
  let transaction;
18
18
  if (params.agent !== undefined && params.agent !== null && typeof params.agent.id === 'string') {
19
- transaction = (yield repos.transaction.findInProgressById({
19
+ transaction = (yield repos.transaction.projectFieldsInProgressById({
20
20
  typeOf: params.purpose.typeOf,
21
21
  id: params.purpose.id
22
22
  }, ['typeOf']));
@@ -19,9 +19,7 @@ function searchProductOffers(params) {
19
19
  return (repos) => __awaiter(this, void 0, void 0, function* () {
20
20
  var _a, _b;
21
21
  // プロダクト検索
22
- // const productWithOffers = <Pick<factory.product.IProduct, 'hasOfferCatalog' | 'project'>>
23
- // await repos.product.findProductById({ id: params.itemOffered.id }, ['hasOfferCatalog', 'project'], []);
24
- const productWithOffers = (yield repos.product.searchProducts({
22
+ const productWithOffers = (yield repos.product.projectFields({
25
23
  limit: 1,
26
24
  page: 1,
27
25
  id: { $eq: params.itemOffered.id }
@@ -68,7 +68,7 @@ export declare function search(params: {
68
68
  productOffer: ProductOfferRepo;
69
69
  }) => Promise<{
70
70
  offers: factory.product.ITicketOffer[];
71
- product: Omit<factory.product.IProduct, "offers">;
71
+ product: factory.product.IProduct;
72
72
  }>;
73
73
  export type IAuthorizeOfferAction = factory.action.authorize.offer.product.IAction;
74
74
  /**
@@ -93,7 +93,9 @@ export declare function authorize(params: {
93
93
  transaction: {
94
94
  id: string;
95
95
  };
96
- }): IAuthorizeOperation<IAuthorizeOfferAction>;
96
+ }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id'> & {
97
+ result: IAuthorizeOfferAction['result'];
98
+ }>;
97
99
  export declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidRegisterServiceTransaction>): (repos: {
98
100
  action: ActionRepo;
99
101
  assetTransaction: AssetTransactionRepo;
@@ -27,7 +27,7 @@ function search(params) {
27
27
  return (repos) => __awaiter(this, void 0, void 0, function* () {
28
28
  var _a;
29
29
  const now = moment();
30
- const searchProductsResult = yield repos.product.searchProducts({
30
+ const searchProductsResult = yield repos.product.projectFields({
31
31
  limit: 1,
32
32
  page: 1,
33
33
  project: { id: { $eq: params.project.id } },
@@ -89,7 +89,7 @@ function authorize(params) {
89
89
  // tslint:disable-next-line:max-func-body-length
90
90
  return (repos) => __awaiter(this, void 0, void 0, function* () {
91
91
  const now = new Date();
92
- const transaction = yield repos.transaction.findInProgressById({
92
+ const transaction = yield repos.transaction.projectFieldsInProgressById({
93
93
  typeOf: factory.transactionType.PlaceOrder,
94
94
  id: params.transaction.id
95
95
  }, ['agent', 'project', 'seller', 'typeOf', 'expires']);
@@ -127,7 +127,6 @@ function authorize(params) {
127
127
  const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({
128
128
  startDate: new Date()
129
129
  });
130
- // 承認アクション開始
131
130
  const actionAttributes = (0, factory_1.createActionAttributes)({
132
131
  acceptedOffer: acceptedOffer,
133
132
  transaction: transaction,
@@ -147,8 +146,10 @@ function authorize(params) {
147
146
  });
148
147
  requestBody = startParams;
149
148
  responseBody = yield RegisterServiceTransaction.start(startParams)(repos);
150
- const acceptedOffers4result = (0, factory_1.responseBody2resultAcceptedOffer)({ project: action.project, responseBody, acceptedOffer });
151
- result = (0, factory_1.createResult)({ project: action.project, requestBody, responseBody, acceptedOffer });
149
+ const acceptedOffers4result = (0, factory_1.responseBody2resultAcceptedOffer)({
150
+ project: actionAttributes.project, responseBody, acceptedOffer
151
+ });
152
+ result = (0, factory_1.createResult)({ project: actionAttributes.project, requestBody, responseBody, acceptedOffer });
152
153
  yield (0, any_1.acceptOffer)({
153
154
  project: transaction.project,
154
155
  purpose: { id: transaction.id },
@@ -164,7 +165,8 @@ function authorize(params) {
164
165
  }
165
166
  throw error;
166
167
  }
167
- return yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: result });
168
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
169
+ return { id: action.id, result };
168
170
  });
169
171
  }
170
172
  exports.authorize = authorize;
@@ -172,7 +174,7 @@ function fixProductAndOffers(params) {
172
174
  return (repos) => __awaiter(this, void 0, void 0, function* () {
173
175
  var _a, _b, _c;
174
176
  const productId = String((_b = (_a = params.object[0]) === null || _a === void 0 ? void 0 : _a.itemOffered) === null || _b === void 0 ? void 0 : _b.id);
175
- const searchProductsResult = yield repos.product.searchProducts({
177
+ const searchProductsResult = yield repos.product.projectFields({
176
178
  limit: 1,
177
179
  page: 1,
178
180
  project: { id: { $eq: params.project.id } },
@@ -189,7 +191,7 @@ function fixProductAndOffers(params) {
189
191
  function voidTransaction(params) {
190
192
  return (repos) => __awaiter(this, void 0, void 0, function* () {
191
193
  var _a;
192
- const transaction = yield repos.transaction.findById({
194
+ const transaction = yield repos.transaction.projectFieldsById({
193
195
  typeOf: params.purpose.typeOf,
194
196
  id: params.purpose.id
195
197
  }, ['agent', 'status', 'typeOf']);
@@ -344,9 +346,7 @@ function checkIfRegistered(params) {
344
346
  // メンバーシップについては、登録済かどうか確認する
345
347
  if (params.product.typeOf === factory.product.ProductType.MembershipService) {
346
348
  // プロダクトによって発行されたPermitを所有していれば、登録済
347
- const searchOwnershipInfosResult = yield repos.ownershipInfo.search({
348
- // iss: params.iss,
349
- // project: { id: { $eq: params.project.id } },
349
+ const searchOwnershipInfosResult = yield repos.ownershipInfo.projectFields({
350
350
  limit: 1,
351
351
  page: 1,
352
352
  ownedBy: { id: params.agent.id },
@@ -359,7 +359,7 @@ function checkIfRegistered(params) {
359
359
  },
360
360
  ownedFrom: params.now,
361
361
  ownedThrough: params.now
362
- });
362
+ }, []);
363
363
  const ownershipInfos = searchOwnershipInfosResult;
364
364
  if (ownershipInfos.length > 0) {
365
365
  // Already registered
@@ -13,7 +13,7 @@ exports.findPlaceOrderTransaction = void 0;
13
13
  const factory = require("../../factory");
14
14
  function findPlaceOrderTransaction(params) {
15
15
  return (repos) => __awaiter(this, void 0, void 0, function* () {
16
- const placeOrderTransactions = yield repos.transaction.search({
16
+ const placeOrderTransactions = yield repos.transaction.projectFields({
17
17
  limit: 1,
18
18
  page: 1,
19
19
  project: { id: { $eq: params.project.id } },
@@ -7,5 +7,5 @@ import * as factory from '../../../../factory';
7
7
  */
8
8
  declare function createOnOrderCancelledTasksByTransaction(params: {
9
9
  transaction?: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf'>;
10
- }): (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)[];
10
+ }): (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)[];
11
11
  export { createOnOrderCancelledTasksByTransaction };
@@ -13,5 +13,5 @@ declare function createInformTasks(params: {
13
13
  }, settings: Settings): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
14
14
  declare function createNextSendOrderTasks(params: {
15
15
  order: IInTransitOrder;
16
- }): (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)[];
16
+ }): (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)[];
17
17
  export { createInformTasks, createNextSendOrderTasks, IInTransitOrder };
@@ -80,7 +80,7 @@ function createSendOrderTaskIfNotExist(params) {
80
80
  function createOnAuthorizationCreatedTask(order) {
81
81
  return (repos) => __awaiter(this, void 0, void 0, function* () {
82
82
  var _a;
83
- const placeOrderTransaction = (yield repos.transaction.search({
83
+ const placeOrderTransaction = (yield repos.transaction.projectFields({
84
84
  limit: 1,
85
85
  page: 1,
86
86
  typeOf: factory.transactionType.PlaceOrder,
@@ -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 } },
@@ -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,14 +1,11 @@
1
1
  import * as factory from '../../../factory';
2
2
  import type { AuthorizationRepo } from '../../../repo/authorization';
3
3
  import type { TicketRepo } from '../../../repo/ticket';
4
- type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail & {
5
- ticketToken?: string;
6
- };
7
4
  declare function verifyTicketTokenAsNeeded(params: {
8
5
  project: {
9
6
  id: string;
10
7
  };
11
- object: IObjectWithoutDetail;
8
+ object: Pick<factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'issuedThrough' | 'ticketToken'>;
12
9
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
13
10
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
14
11
  }): (repos: {
@@ -15,20 +15,19 @@ function verifyTicketTokenAsNeeded(params) {
15
15
  return (repos) => __awaiter(this, void 0, void 0, function* () {
16
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,7 +36,7 @@ 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
  }
@@ -46,29 +45,25 @@ function verifyTicketTokenAsNeeded(params) {
46
45
  || validAuthorization.audience.id !== params.purpose.id) {
47
46
  throw new factory.errors.Argument('ticketToken', 'audience not matched with placeOrder');
48
47
  }
49
- const permitOwnershipInfo = authorizedObject;
50
- // const ownershipInfoId = authorizedObject.id;
51
- // const permitOwnershipInfo = (await repos.ownershipInfo.search({
52
- // limit: 1,
53
- // page: 1,
54
- // project: { id: { $eq: params.project.id } },
55
- // ids: [ownershipInfoId]
56
- // })).shift();
57
- // if (permitOwnershipInfo === undefined) {
58
- // throw new factory.errors.NotFound('OwnershipInfo');
59
- // }
60
- const { typeOfGood } = permitOwnershipInfo;
48
+ const { typeOfGood } = authorizedObject;
61
49
  if (typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
62
50
  throw new factory.errors.Argument('ticketToken', 'must be Permit');
63
51
  }
64
52
  if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
65
53
  throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
66
54
  }
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
+ }
60
+ }
67
61
  permit = { identifier: typeOfGood.identifier };
68
- }
69
- break;
70
- default:
71
- // no op
62
+ break;
63
+ default:
64
+ // no op
65
+ throw new factory.errors.NotImplemented(`ticketToken issued through ${paymentServiceType} not implemented`);
66
+ }
72
67
  }
73
68
  return { permit };
74
69
  });
@@ -95,9 +95,11 @@ type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings, crede
95
95
  interface IPublishPaymentUrlRepos {
96
96
  action: ActionRepo;
97
97
  assetTransaction: AssetTransactionRepo;
98
+ authorization: AuthorizationRepo;
98
99
  paymentAccepted: SellerPaymentAcceptedRepo;
99
100
  paymentService: PaymentServiceRepo;
100
101
  paymentServiceProvider: PaymentServiceProviderRepo;
102
+ ticket: TicketRepo;
101
103
  transaction: TransactionRepo;
102
104
  transactionNumber: TransactionNumberRepo;
103
105
  }
@@ -115,7 +117,7 @@ declare function publishPaymentUrl(params: {
115
117
  agent: {
116
118
  id: string;
117
119
  };
118
- object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
120
+ object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'ticketToken'>;
119
121
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
120
122
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
121
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
  }