@chevre/domain 22.5.0-alpha.9 → 22.5.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 (155) hide show
  1. package/example/src/chevre/activateOptionalAggregationSettings.ts +19 -0
  2. package/example/src/chevre/aggregateAllEvents2.ts +7 -5
  3. package/example/src/chevre/aggregateEventPublicFields.ts +47 -0
  4. package/example/src/chevre/aggregateEventSellerMakesOffer.ts +32 -0
  5. package/example/src/chevre/findReservationByCode.ts +11 -10
  6. package/example/src/chevre/migrateEventSellerMakesOfferAvailableAt.ts +101 -0
  7. package/example/src/chevre/migrateProjectMakesOfferAvailableAt.ts +85 -0
  8. package/example/src/chevre/person/cleanUpCognitoUsers.ts +90 -0
  9. package/example/src/chevre/searchCategoryCodesByAggregate.ts +1 -2
  10. package/example/src/chevre/searchProjects.ts +2 -4
  11. package/example/src/chevre/searchSellersByAggregate.ts +4 -6
  12. package/example/src/chevre/unsetUnnecessaryFields.ts +17 -19
  13. package/example/src/chevre/upsertManyEventsByAdditionalProperty.ts +25 -14
  14. package/example/src/chevre/upsertProductsByProductId.ts +1 -1
  15. package/example/src/createMongooseConnection.ts +26 -0
  16. package/lib/chevre/repo/action.d.ts +41 -41
  17. package/lib/chevre/repo/action.js +5 -39
  18. package/lib/chevre/repo/assetTransaction.d.ts +1 -1
  19. package/lib/chevre/repo/categoryCode.d.ts +4 -8
  20. package/lib/chevre/repo/categoryCode.js +8 -36
  21. package/lib/chevre/repo/creativeWork.js +1 -20
  22. package/lib/chevre/repo/customer.d.ts +1 -1
  23. package/lib/chevre/repo/customer.js +4 -4
  24. package/lib/chevre/repo/event.d.ts +21 -12
  25. package/lib/chevre/repo/event.js +135 -37
  26. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +54 -0
  27. package/lib/chevre/repo/eventSellerMakesOffer.js +73 -0
  28. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -3
  29. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +0 -3
  30. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +0 -3
  31. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +0 -3
  32. package/lib/chevre/repo/mongoose/schemas/customer.js +0 -3
  33. package/lib/chevre/repo/mongoose/schemas/event.js +9 -54
  34. package/lib/chevre/repo/mongoose/schemas/member.js +0 -3
  35. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -3
  36. package/lib/chevre/repo/mongoose/schemas/paymentService.js +0 -3
  37. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +0 -3
  38. package/lib/chevre/repo/mongoose/schemas/productModel.js +0 -3
  39. package/lib/chevre/repo/mongoose/schemas/project.js +0 -3
  40. package/lib/chevre/repo/mongoose/schemas/reservation.js +0 -3
  41. package/lib/chevre/repo/mongoose/schemas/seller.js +0 -3
  42. package/lib/chevre/repo/mongoose/schemas/trip.js +0 -3
  43. package/lib/chevre/repo/paymentService.d.ts +1 -1
  44. package/lib/chevre/repo/paymentService.js +0 -19
  45. package/lib/chevre/repo/place/movieTheater.js +1 -25
  46. package/lib/chevre/repo/product.js +1 -6
  47. package/lib/chevre/repo/project.d.ts +8 -2
  48. package/lib/chevre/repo/project.js +25 -26
  49. package/lib/chevre/repo/projectMakesOffer.d.ts +3 -1
  50. package/lib/chevre/repo/projectMakesOffer.js +5 -2
  51. package/lib/chevre/repo/role.js +0 -7
  52. package/lib/chevre/repo/seller.d.ts +18 -16
  53. package/lib/chevre/repo/seller.js +13 -31
  54. package/lib/chevre/repo/task.d.ts +12 -12
  55. package/lib/chevre/repo/transaction.d.ts +1 -1
  56. package/lib/chevre/repository.d.ts +5 -0
  57. package/lib/chevre/repository.js +15 -2
  58. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +4 -18
  59. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +28 -13
  60. package/lib/chevre/service/aggregation/project.js +1 -2
  61. package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -4
  62. package/lib/chevre/service/assetTransaction/registerService.js +1 -2
  63. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -1
  64. package/lib/chevre/service/assetTransaction/reserve/start.js +11 -38
  65. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +4 -1
  66. package/lib/chevre/service/event.js +2 -2
  67. package/lib/chevre/service/moneyTransfer.js +1 -2
  68. package/lib/chevre/service/notification.d.ts +2 -4
  69. package/lib/chevre/service/notification.js +30 -9
  70. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -1
  71. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +2 -2
  72. package/lib/chevre/service/offer/event/authorize.d.ts +2 -1
  73. package/lib/chevre/service/offer/event/authorize.js +2 -2
  74. package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
  75. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -30
  76. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +21 -113
  77. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.d.ts +38 -0
  78. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +97 -0
  79. package/lib/chevre/service/offer/event/searchOffersByIds.js +26 -20
  80. package/lib/chevre/service/offer/event.d.ts +2 -1
  81. package/lib/chevre/service/offer/event.js +2 -1
  82. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +3 -3
  83. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +1 -1
  84. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +4 -4
  85. package/lib/chevre/service/offer/onEventChanged.d.ts +1 -13
  86. package/lib/chevre/service/offer/onEventChanged.js +64 -71
  87. package/lib/chevre/service/offer.d.ts +6 -0
  88. package/lib/chevre/service/offer.js +12 -15
  89. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  90. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +7 -8
  91. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  92. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +7 -8
  93. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +8 -11
  94. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  95. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +7 -8
  96. package/lib/chevre/service/order/onOrderUpdated/factory.d.ts +1 -4
  97. package/lib/chevre/service/order/onOrderUpdated/factory.js +4 -7
  98. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
  99. package/lib/chevre/service/order/placeOrder.js +1 -1
  100. package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.js +1 -1
  101. package/lib/chevre/service/payment/any.js +1 -1
  102. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  103. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +0 -3
  104. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +1 -1
  105. package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
  106. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  107. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +50 -57
  108. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  109. package/lib/chevre/service/payment/paymentCard.js +0 -5
  110. package/lib/chevre/service/payment.d.ts +1 -1
  111. package/lib/chevre/service/report/telemetry.js +1 -1
  112. package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
  113. package/lib/chevre/service/reserve/cancelReservation.js +14 -6
  114. package/lib/chevre/service/reserve/confirmReservation.js +1 -1
  115. package/lib/chevre/service/reserve/factory.d.ts +2 -61
  116. package/lib/chevre/service/reserve/factory.js +0 -11
  117. package/lib/chevre/service/reserve/findByCode.js +0 -1
  118. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.d.ts +19 -0
  119. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +64 -0
  120. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +0 -4
  121. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +37 -61
  122. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +22 -76
  123. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +26 -28
  124. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +0 -3
  125. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +17 -50
  126. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.d.ts +18 -0
  127. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +66 -0
  128. package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
  129. package/lib/chevre/service/reserve/useReservation.js +4 -4
  130. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +0 -7
  131. package/lib/chevre/service/reserve/verifyToken4reservation.js +17 -12
  132. package/lib/chevre/service/task/aggregateScreeningEvent.js +4 -2
  133. package/lib/chevre/service/task/aggregateUseActionsOnEvent.d.ts +1 -1
  134. package/lib/chevre/service/task/aggregateUseActionsOnEvent.js +1 -5
  135. package/lib/chevre/service/task/deletePerson.d.ts +6 -0
  136. package/lib/chevre/service/task/deletePerson.js +420 -0
  137. package/lib/chevre/service/task/handleNotification.d.ts +3 -0
  138. package/lib/chevre/service/task/handleNotification.js +26 -0
  139. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
  140. package/lib/chevre/service/task/onResourceUpdated.js +1 -1
  141. package/lib/chevre/service/task/triggerWebhook.js +2 -2
  142. package/lib/chevre/service/task.d.ts +3 -0
  143. package/lib/chevre/service/task.js +2 -0
  144. package/lib/chevre/service/transaction/moneyTransfer.js +1 -1
  145. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +1 -3
  146. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +4 -2
  147. package/lib/chevre/service/transaction/returnOrder/preStart.js +4 -3
  148. package/lib/chevre/settings/aggregation.d.ts +23 -0
  149. package/lib/chevre/settings/aggregation.js +17 -0
  150. package/lib/chevre/settings.d.ts +52 -38
  151. package/lib/chevre/settings.js +12 -13
  152. package/package.json +5 -7
  153. package/example/src/chevre/migratePayTransactionRecipes.ts +0 -252
  154. package/example/src/chevre/migrateProductHasOfferCatalog.ts +0 -80
  155. package/example/src/chevre/migrateProjectMakesOffer.ts +0 -78
@@ -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").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)[];
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/deletePerson").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 };
@@ -10,24 +10,23 @@ function createInformTasks(params, settings) {
10
10
  const { order } = params;
11
11
  const taskRunsAt = new Date();
12
12
  const informOrder = (_a = settings.onOrderStatusChanged) === null || _a === void 0 ? void 0 : _a.informOrder;
13
- let informTasks = [];
13
+ const informTasks = [];
14
+ const order4inform = creteOrder4inform(order);
15
+ const informIdentifier = `${factory.order.OrderType.Order}:${order4inform.orderNumber}:${order4inform.orderStatus}:${order.acceptedOffers.page}`;
14
16
  if (Array.isArray(informOrder) && informOrder.length > 0) {
15
- const order4inform = creteOrder4inform(order);
16
17
  let recipientId = '';
17
18
  recipientId = order.customer.id;
18
- informTasks = informOrder.map((informOrderParams) => {
19
+ informTasks.push(...informOrder.map((informOrderParams) => {
19
20
  var _a, _b;
20
21
  const informActionAttributes = {
21
- // agent: order.project,
22
22
  object: order4inform,
23
- // project: order.project,
24
23
  recipient: {
25
24
  url: (_a = informOrderParams.recipient) === null || _a === void 0 ? void 0 : _a.url,
26
25
  id: recipientId,
27
26
  name: (_b = informOrderParams.recipient) === null || _b === void 0 ? void 0 : _b.name,
28
27
  typeOf: factory.creativeWorkType.WebApplication
29
- }
30
- // typeOf: factory.actionType.InformAction
28
+ },
29
+ identifier: informIdentifier // add(2024-10-24~)
31
30
  };
32
31
  return {
33
32
  project: order.project,
@@ -39,7 +38,7 @@ function createInformTasks(params, settings) {
39
38
  executionResults: [],
40
39
  data: informActionAttributes
41
40
  };
42
- });
41
+ }));
43
42
  }
44
43
  return informTasks;
45
44
  }
@@ -8,24 +8,23 @@ function createInformTasks(order, settings) {
8
8
  var _a;
9
9
  const taskRunsAt = new Date();
10
10
  const informOrder = (_a = settings.onOrderStatusChanged) === null || _a === void 0 ? void 0 : _a.informOrder;
11
- let informTasks = [];
11
+ const informTasks = [];
12
+ const order4inform = creteOrder4inform(order);
13
+ const informIdentifier = `${factory.order.OrderType.Order}:${order4inform.orderNumber}:${order4inform.orderStatus}`;
12
14
  if (Array.isArray(informOrder) && informOrder.length > 0) {
13
- const order4inform = creteOrder4inform(order);
14
15
  let recipientId = '';
15
16
  recipientId = order.customer.id;
16
- informTasks = informOrder.map((informOrderParams) => {
17
+ informTasks.push(...informOrder.map((informOrderParams) => {
17
18
  var _a, _b;
18
19
  const informActionAttributes = {
19
- // agent: order.project,
20
20
  object: order4inform,
21
- // project: order.project,
22
21
  recipient: {
23
22
  url: (_a = informOrderParams.recipient) === null || _a === void 0 ? void 0 : _a.url,
24
23
  id: recipientId,
25
24
  name: (_b = informOrderParams.recipient) === null || _b === void 0 ? void 0 : _b.name,
26
25
  typeOf: factory.creativeWorkType.WebApplication
27
- }
28
- // typeOf: factory.actionType.InformAction
26
+ },
27
+ identifier: informIdentifier // add(2024-10-24~)
29
28
  };
30
29
  return {
31
30
  project: order.project,
@@ -37,7 +36,7 @@ function createInformTasks(order, settings) {
37
36
  executionResults: [],
38
37
  data: informActionAttributes
39
38
  };
40
- });
39
+ }));
41
40
  }
42
41
  return informTasks;
43
42
  }
@@ -56,9 +55,7 @@ function createMaskedCustomer(order) {
56
55
  function creteOrder4inform(order) {
57
56
  return Object.assign({
58
57
  // whitelistで作成する(2022-07-19~)
59
- project: order.project, typeOf: order.typeOf, seller: order.seller, price: order.price, priceCurrency: order.priceCurrency, confirmationNumber: order.confirmationNumber, orderNumber: order.orderNumber, acceptedOffers: [],
60
- // numAcceptedOffers: order.acceptedOffers.length,
61
- numAcceptedOffers: order.numAcceptedOffers, orderStatus: order.orderStatus, orderDate: order.orderDate,
58
+ project: order.project, typeOf: order.typeOf, seller: order.seller, price: order.price, priceCurrency: order.priceCurrency, confirmationNumber: order.confirmationNumber, orderNumber: order.orderNumber, acceptedOffers: [], numAcceptedOffers: order.numAcceptedOffers, orderStatus: order.orderStatus, orderDate: order.orderDate,
62
59
  // mask
63
60
  customer: Object.assign(Object.assign({}, createMaskedCustomer(order)), { additionalProperty: (Array.isArray(order.customer.additionalProperty)) ? order.customer.additionalProperty : [],
64
61
  // identifierは必要
@@ -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").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
+ }): (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/deletePerson").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 };
@@ -6,27 +6,26 @@ function createInformTasks(order, settings) {
6
6
  var _a, _b;
7
7
  const taskRunsAt = new Date();
8
8
  const informOrder = (_a = settings.onOrderStatusChanged) === null || _a === void 0 ? void 0 : _a.informOrder;
9
- let informTasks = [];
9
+ const informTasks = [];
10
+ const order4inform = creteOrder4inform(order);
11
+ const informIdentifier = `${factory.order.OrderType.Order}:${order4inform.orderNumber}:${order4inform.orderStatus}`;
10
12
  if (Array.isArray(informOrder) && informOrder.length > 0) {
11
- const order4inform = creteOrder4inform(order);
12
13
  let recipientId = '';
13
14
  recipientId = order.customer.id;
14
15
  if (typeof ((_b = order.returner) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
15
16
  recipientId = order.returner.id;
16
17
  }
17
- informTasks = informOrder.map((informOrderParams) => {
18
+ informTasks.push(...informOrder.map((informOrderParams) => {
18
19
  var _a, _b;
19
20
  const informActionAttributes = {
20
- // agent: order.project,
21
21
  object: order4inform,
22
- // project: order.project,
23
22
  recipient: {
24
23
  url: (_a = informOrderParams.recipient) === null || _a === void 0 ? void 0 : _a.url,
25
24
  id: recipientId,
26
25
  name: (_b = informOrderParams.recipient) === null || _b === void 0 ? void 0 : _b.name,
27
26
  typeOf: factory.creativeWorkType.WebApplication
28
- }
29
- // typeOf: factory.actionType.InformAction
27
+ },
28
+ identifier: informIdentifier // add(2024-10-24~)
30
29
  };
31
30
  return {
32
31
  project: order.project,
@@ -38,7 +37,7 @@ function createInformTasks(order, settings) {
38
37
  executionResults: [],
39
38
  data: informActionAttributes
40
39
  };
41
- });
40
+ }));
42
41
  }
43
42
  return informTasks;
44
43
  }
@@ -1,7 +1,4 @@
1
1
  import * as factory from '../../../factory';
2
2
  import { Settings } from '../../../settings';
3
- export type IUpdatedOrder4inform = Pick<factory.order.IOrder, 'typeOf' | 'orderNumber' | 'name' | 'project'> & {
4
- updatedAt: Date;
5
- };
6
- declare function createInformTasks(order: IUpdatedOrder4inform, settings: Settings): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
3
+ declare function createInformTasks(order: factory.notification.order.IUpdatedOrder4inform, settings: Settings): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
7
4
  export { createInformTasks };
@@ -6,23 +6,20 @@ function createInformTasks(order, settings) {
6
6
  var _a;
7
7
  const taskRunsAt = new Date();
8
8
  const informOrder = (_a = settings.onOrderStatusChanged) === null || _a === void 0 ? void 0 : _a.informOrder;
9
- let informTasks = [];
9
+ const informTasks = [];
10
+ const order4inform = creteOrder4inform(order);
10
11
  if (Array.isArray(informOrder) && informOrder.length > 0) {
11
- const order4inform = creteOrder4inform(order);
12
12
  const recipientId = '';
13
- informTasks = informOrder.map((informOrderParams) => {
13
+ informTasks.push(...informOrder.map((informOrderParams) => {
14
14
  var _a, _b;
15
15
  const informActionAttributes = {
16
- // agent: order.project,
17
16
  object: order4inform,
18
- // project: order.project,
19
17
  recipient: {
20
18
  url: (_a = informOrderParams.recipient) === null || _a === void 0 ? void 0 : _a.url,
21
19
  id: recipientId,
22
20
  name: (_b = informOrderParams.recipient) === null || _b === void 0 ? void 0 : _b.name,
23
21
  typeOf: factory.creativeWorkType.WebApplication
24
22
  }
25
- // typeOf: factory.actionType.InformAction
26
23
  };
27
24
  return {
28
25
  project: order.project,
@@ -34,7 +31,7 @@ function createInformTasks(order, settings) {
34
31
  executionResults: [],
35
32
  data: informActionAttributes
36
33
  };
37
- });
34
+ }));
38
35
  }
39
36
  return informTasks;
40
37
  }
@@ -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: {
@@ -67,7 +67,7 @@ function createPlacingOrderFromExistingTransaction(params) {
67
67
  }
68
68
  },
69
69
  id: { $in: completedAuthorizeActionIds }
70
- }, ['instrument'], []));
70
+ }, ['instrument']));
71
71
  }
72
72
  }
73
73
  // orderedItem生成のためにacceptedOffersを取得
@@ -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 {
@@ -68,7 +68,7 @@ function handlePrePublishedPaymentMethodIdOnAuthorizing(params) {
68
68
  transactionNumber: { $eq: params.prePublishedPaymentMethodId },
69
69
  typeOf: { $eq: factory.assetTransactionType.Pay }
70
70
  }
71
- }, ['object', 'result'], [])).shift();
71
+ }, ['object', 'result'])).shift();
72
72
  if (acceptPayAction === undefined) {
73
73
  throw new factory.errors.NotFound(factory.actionType.AcceptAction);
74
74
  }
@@ -84,7 +84,7 @@ function invalidatePaymentUrl(params) {
84
84
  transactionNumber: { $eq: paymentMethodIdByPaymentUrl },
85
85
  typeOf: { $eq: factory.assetTransactionType.Pay }
86
86
  }
87
- }, ['object'], [])).shift();
87
+ }, ['object'])).shift();
88
88
  if (acceptPayAction !== undefined) {
89
89
  // const paymentMethodType = transaction.object.paymentMethods?.typeOf;
90
90
  const paymentMethodType = acceptPayAction.object.object.paymentMethod.identifier;
@@ -20,7 +20,7 @@ declare function processAuthorizeCreditCard(params: {
20
20
  returnUrls3ds: string[];
21
21
  callbackType3ds?: factory.service.paymentService.ICallbackType3ds;
22
22
  orderId: string;
23
- availableChannel: factory.product.IAvailableChannel;
23
+ availableChannel: factory.service.paymentService.IAvailableChannel;
24
24
  object: factory.assetTransaction.pay.IPaymentMethod;
25
25
  /**
26
26
  * 決済URL発行処理かどうか
@@ -24,9 +24,6 @@ function processAuthorizeCreditCard(params) {
24
24
  const { shopId, shopPass, orderId } = params;
25
25
  const creditCard = params.object.creditCard;
26
26
  const { cardSeq, memberId } = creditCard;
27
- if (typeof memberId === 'string' && memberId.length > 0 && typeof cardSeq === 'number') {
28
- // 決済承認時のuseUsernameAsGMOMemberId判定を廃止(2024-01-04~)
29
- }
30
27
  const { cardNo, cardPass, expire } = creditCard;
31
28
  const { token } = creditCard;
32
29
  const retUrl = creditCard === null || creditCard === void 0 ? void 0 : creditCard.retUrl;
@@ -15,7 +15,7 @@ declare function processAuthorizeCreditCard3ds(params: {
15
15
  payTransaction: {
16
16
  id: string;
17
17
  };
18
- availableChannel: factory.product.IAvailableChannel;
18
+ availableChannel: factory.service.paymentService.IAvailableChannel;
19
19
  pendingPaymentAgencyTransaction: Pick<ICreditCardPaymentAgencyTransaction3ds, 'entryTranArgs' | 'entryTranResult' | 'execTranArgs' | 'execTranResult'>;
20
20
  }): (repos: {
21
21
  action: ActionRepo;
@@ -6,7 +6,7 @@ import { Settings } from '../../../settings';
6
6
  * 存在しない場合NotFoundエラー
7
7
  */
8
8
  declare function searchGMOTrade(params: {
9
- availableChannel: factory.product.IAvailableChannel;
9
+ availableChannel: factory.service.paymentService.IAvailableChannel;
10
10
  paymentMethodId: string;
11
11
  shopId: string;
12
12
  shopPass: string;
@@ -49,7 +49,7 @@ function voidTransaction(params) {
49
49
  typeOf: { $eq: factory.actionType.AuthorizeAction },
50
50
  object: { paymentMethodId: { $eq: paymentMethodId } },
51
51
  sameAs: { id: { $eq: transaction.id } }
52
- }, ['id', 'typeOf', 'project'], [])).shift();
52
+ }, ['id', 'typeOf', 'project'])).shift();
53
53
  if (authorizeInvoiceAction !== undefined) {
54
54
  const cancelAction = {
55
55
  startTime: new Date(),
@@ -12,10 +12,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.refundMovieTicket = void 0;
13
13
  const surfrock = require("@surfrock/sdk");
14
14
  const http_status_1 = require("http-status");
15
+ const moment = require("moment");
15
16
  const errorHandler_1 = require("../../../errorHandler");
16
17
  const factory = require("../../../factory");
17
18
  const onRefund_1 = require("../any/onRefund");
18
19
  const factory_1 = require("./factory");
20
+ function wait4payActionDelayIfNeeded(params) {
21
+ return (settings) => __awaiter(this, void 0, void 0, function* () {
22
+ const { payAction } = params;
23
+ const minIntervalBetweenPayAndRefund = settings.movieticketReserve.minIntervalBetweenPayAndRefund;
24
+ let waitingNecessary = false;
25
+ if (typeof minIntervalBetweenPayAndRefund === 'number' && minIntervalBetweenPayAndRefund > 0) {
26
+ if (payAction.actionStatus !== factory.actionStatusType.CompletedActionStatus) {
27
+ const payStartExpected = moment()
28
+ .add(-minIntervalBetweenPayAndRefund, 'milliseconds');
29
+ waitingNecessary = moment(payAction.startDate)
30
+ .isAfter(payStartExpected);
31
+ }
32
+ }
33
+ if (waitingNecessary) {
34
+ // tslint:disable-next-line:no-console
35
+ console.log('wait4payActionDelayIfNeeded: waiting... minIntervalBetweenPayAndRefund:', minIntervalBetweenPayAndRefund);
36
+ yield new Promise((resolve) => {
37
+ setTimeout(() => {
38
+ resolve();
39
+ }, minIntervalBetweenPayAndRefund);
40
+ });
41
+ }
42
+ });
43
+ }
19
44
  /**
20
45
  * 決済カード返金
21
46
  */
@@ -25,6 +50,24 @@ function refundMovieTicket(params) {
25
50
  var _a, _b, _c, _d, _e, _f;
26
51
  const paymentMethodId = (_a = params.object[0]) === null || _a === void 0 ? void 0 : _a.paymentMethod.paymentMethodId;
27
52
  const paymentServiceId = (_b = params.object[0]) === null || _b === void 0 ? void 0 : _b.id;
53
+ // 本アクションに対応するPayActionを取り出す
54
+ // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
55
+ const payAction = yield repos.action.findPayAction({
56
+ project: { id: params.project.id },
57
+ paymentMethodId,
58
+ actionStatus: {
59
+ $in: [
60
+ factory.actionStatusType.ActiveActionStatus,
61
+ factory.actionStatusType.CompletedActionStatus,
62
+ factory.actionStatusType.FailedActionStatus
63
+ ]
64
+ }
65
+ });
66
+ if (payAction === undefined) {
67
+ throw new factory.errors.NotFound(factory.actionType.PayAction);
68
+ }
69
+ // handle delays in the side of payment service(2024-10-23~)
70
+ yield wait4payActionDelayIfNeeded({ payAction })(settings);
28
71
  const availableChannel = yield repos.paymentService.findAvailableChannel({
29
72
  project: params.project,
30
73
  typeOf: factory.service.paymentService.PaymentServiceType.MovieTicket,
@@ -44,13 +87,15 @@ function refundMovieTicket(params) {
44
87
  if (useSeatInfoSyncCancel) {
45
88
  seatInfoSyncCancelIn = yield createSeatInfoSyncCancelInOnRefund({
46
89
  project: { id: params.project.id },
47
- paymentMethodId
90
+ paymentMethodId,
91
+ payAction: { id: payAction.id }
48
92
  })({ action: repos.action });
49
93
  }
50
94
  else {
51
95
  seatInfoSyncIn = yield createSeatInfoSyncInOnRefund({
52
96
  project: { id: params.project.id },
53
- paymentMethodId
97
+ paymentMethodId,
98
+ payAction: { id: payAction.id }
54
99
  })({ action: repos.action });
55
100
  }
56
101
  let recipe = (0, factory_1.processSeatInfoSyncResult2refundRecipe)(Object.assign(Object.assign({ project: { id: params.project.id } }, (seatInfoSyncIn !== undefined) ? { processSeatInfoSyncResult: { seatInfoSyncIn } } : undefined), (seatInfoSyncCancelIn !== undefined) ? { processSeatInfoSyncCancelResult: { seatInfoSyncCancelIn } } : undefined));
@@ -100,15 +145,7 @@ function refundMovieTicket(params) {
100
145
  else {
101
146
  // add recipe(2024-06-04~)
102
147
  recipe = (0, factory_1.processSeatInfoSyncResult2refundRecipe)(Object.assign(Object.assign({ project: { id: params.project.id } }, (processSeatInfoSyncResult !== undefined) ? { processSeatInfoSyncResult } : undefined), (processSeatInfoSyncCancelResult !== undefined) ? { processSeatInfoSyncCancelResult } : undefined));
103
- const actionResult = {
104
- // ...(seatInfoSyncIn !== undefined) ? { seatInfoSyncIn } : undefined, // instrumentへ移行(2024-04-30~)
105
- // ...(processSeatInfoSyncResult?.seatInfoSyncResult !== undefined) // discontinue(2024-06-10~)
106
- // ? { seatInfoSyncResult: processSeatInfoSyncResult.seatInfoSyncResult }
107
- // : undefined,
108
- // ...(processSeatInfoSyncCancelResult?.seatInfoSyncCancelResult !== undefined) // discontinue(2024-06-10~)
109
- // ? { seatInfoSyncCancelResult: processSeatInfoSyncCancelResult.seatInfoSyncCancelResult }
110
- // : undefined
111
- };
148
+ const actionResult = {};
112
149
  yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
113
150
  actionStatus = factory.actionStatusType.CompletedActionStatus;
114
151
  }
@@ -127,34 +164,12 @@ exports.refundMovieTicket = refundMovieTicket;
127
164
  function createSeatInfoSyncInOnRefund(params) {
128
165
  return (repos) => __awaiter(this, void 0, void 0, function* () {
129
166
  var _a, _b, _c;
130
- // 本アクションに対応するPayActionを取り出す
131
- // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
132
- const payAction = yield repos.action.findPayAction({
133
- project: { id: params.project.id },
134
- paymentMethodId: params.paymentMethodId,
135
- actionStatus: {
136
- $in: [
137
- factory.actionStatusType.ActiveActionStatus,
138
- factory.actionStatusType.CompletedActionStatus,
139
- factory.actionStatusType.FailedActionStatus
140
- ]
141
- }
142
- });
143
- if (payAction === undefined) {
144
- throw new factory.errors.NotFound('PayAction');
145
- }
146
167
  const recipe = yield repos.action.findRecipeByAction({
147
168
  project: { id: params.project.id },
148
- recipeFor: { id: payAction.id }
169
+ recipeFor: { id: params.payAction.id }
149
170
  });
150
- // const seatInfoSyncInOnPay: surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn | undefined =
151
- // payAction.instrument?.seatInfoSyncIn;
152
171
  const seatInfoSyncInOnPay = (_c = (_b = (_a = recipe === null || recipe === void 0 ? void 0 : recipe.step[0]) === null || _a === void 0 ? void 0 : _a.itemListElement[0]) === null || _b === void 0 ? void 0 : _b.itemListElement[0]) === null || _c === void 0 ? void 0 : _c.beforeMedia;
153
- // if (seatInfoSyncInOnPay === undefined && payAction.instrument?.seatInfoSyncIn !== undefined) {
154
- // seatInfoSyncInOnPay = payAction.instrument.seatInfoSyncIn; // compatibility
155
- // }
156
172
  if (seatInfoSyncInOnPay === undefined) {
157
- // throw new factory.errors.NotFound('PayAction.instrument?.seatInfoSyncIn');
158
173
  throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
159
174
  }
160
175
  let seatInfoSyncIn;
@@ -167,34 +182,12 @@ function createSeatInfoSyncInOnRefund(params) {
167
182
  function createSeatInfoSyncCancelInOnRefund(params) {
168
183
  return (repos) => __awaiter(this, void 0, void 0, function* () {
169
184
  var _a, _b, _c;
170
- // 本アクションに対応するPayActionを取り出す
171
- // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
172
- const payAction = yield repos.action.findPayAction({
173
- project: { id: params.project.id },
174
- paymentMethodId: params.paymentMethodId,
175
- actionStatus: {
176
- $in: [
177
- factory.actionStatusType.ActiveActionStatus,
178
- factory.actionStatusType.CompletedActionStatus,
179
- factory.actionStatusType.FailedActionStatus
180
- ]
181
- }
182
- });
183
- if (payAction === undefined) {
184
- throw new factory.errors.NotFound('PayAction');
185
- }
186
185
  const recipe = yield repos.action.findRecipeByAction({
187
186
  project: { id: params.project.id },
188
- recipeFor: { id: payAction.id }
187
+ recipeFor: { id: params.payAction.id }
189
188
  });
190
- // const seatInfoSyncInOnPay: surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn | undefined =
191
- // payAction.instrument?.seatInfoSyncIn;
192
189
  const seatInfoSyncInOnPay = (_c = (_b = (_a = recipe === null || recipe === void 0 ? void 0 : recipe.step[0]) === null || _a === void 0 ? void 0 : _a.itemListElement[0]) === null || _b === void 0 ? void 0 : _b.itemListElement[0]) === null || _c === void 0 ? void 0 : _c.beforeMedia;
193
- // if (seatInfoSyncInOnPay === undefined && payAction.instrument?.seatInfoSyncIn !== undefined) {
194
- // seatInfoSyncInOnPay = payAction.instrument.seatInfoSyncIn; // compatibility
195
- // }
196
190
  if (seatInfoSyncInOnPay === undefined) {
197
- // throw new factory.errors.NotFound('PayAction.instrument?.seatInfoSyncIn');
198
191
  throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
199
192
  }
200
193
  let seatInfoSyncCancelIn;
@@ -150,7 +150,7 @@ function checkByIdentifierIfNotYet(params) {
150
150
  reservationFor: { id: { $eq: params.screeningEvent.id } } // 指定のイベントにおいて
151
151
  }
152
152
  }
153
- } }, (typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined), ['id'], [])).shift();
153
+ } }, (typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined), ['id'])).shift();
154
154
  debug('alreadyCheckedAction:', JSON.stringify(alreadyCheckedAction), 'placeOrderId:', placeOrderId);
155
155
  if (alreadyCheckedAction !== undefined) {
156
156
  const recipe = yield repos.action.findRecipeByAction({
@@ -22,11 +22,6 @@ const onRefund_1 = require("./any/onRefund");
22
22
  const accountTransactionIdentifier_1 = require("../../factory/accountTransactionIdentifier");
23
23
  function authorize(params, paymentServiceId) {
24
24
  return (repos) => __awaiter(this, void 0, void 0, function* () {
25
- // const project = <Pick<factory.project.IProject, 'id' | 'typeOf'>>await repos.project.findById({
26
- // id: params.project.id,
27
- // inclusion: ['_id', 'typeOf'],
28
- // exclusion: []
29
- // });
30
25
  var _a;
31
26
  const transactionNumber = params.transactionNumber;
32
27
  if (typeof transactionNumber !== 'string') {
@@ -29,7 +29,7 @@ export declare function fixOrderAsPurpose(params: {
29
29
  }, transaction: factory.assetTransaction.pay.ITransaction): (repos: {
30
30
  acceptedOffer: AcceptedOfferRepo;
31
31
  order: OrderRepo;
32
- }) => Promise<Pick<factory.order.IOrder, "confirmationNumber" | "typeOf" | "orderNumber"> & {
32
+ }) => Promise<Pick<factory.order.IOrder, "typeOf" | "orderNumber" | "confirmationNumber"> & {
33
33
  acceptedOffersMovieTicketUsed: IAcceptedOfferMovieTicketUsed[];
34
34
  }>;
35
35
  /**
@@ -181,7 +181,7 @@ function createSellerFlow(measuredFrom, measuredThrough, sellerId) {
181
181
  const actionsOnExpiredTransactions = yield repos.action.search({
182
182
  typeOf: { $eq: factory.actionType.AuthorizeAction },
183
183
  purpose: { id: { $in: expiredTransactionIds } }
184
- }, [], []);
184
+ }, []);
185
185
  debug(actionsOnExpiredTransactions.length, 'actionsOnExpiredTransactions found.');
186
186
  const numbersOfActionsOnExpired = expiredTransactionIds.map((transactionId) => {
187
187
  return actionsOnExpiredTransactions.filter((action) => { var _a; return ((_a = action.purpose) === null || _a === void 0 ? void 0 : _a.id) === transactionId; }).length;
@@ -7,7 +7,7 @@ import { ReservationRepo } from '../../repo/reservation';
7
7
  import { StockHolderRepo } from '../../repo/stockHolder';
8
8
  import type { TaskRepo } from '../../repo/task';
9
9
  /**
10
- * 進行中の予約をキャンセルする
10
+ * 保留予約取消
11
11
  */
12
12
  declare function cancelPendingReservation(actionAttributes: factory.task.cancelPendingReservation.IData): (repos: {
13
13
  action: ActionRepo;
@@ -16,18 +16,24 @@ exports.processUnlockOfferRateLimit = exports.cancelReservation = exports.cancel
16
16
  const moment = require("moment");
17
17
  const factory = require("../../factory");
18
18
  const factory_1 = require("./factory");
19
+ const onPendingReservationCanceled_1 = require("./potentialActions/onPendingReservationCanceled");
19
20
  const onReservationCanceled_1 = require("./potentialActions/onReservationCanceled");
20
21
  /**
21
- * 進行中の予約をキャンセルする
22
+ * 保留予約取消
22
23
  */
23
24
  function cancelPendingReservation(actionAttributes) {
24
25
  return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
25
26
  var _a;
26
27
  const { reserveTransaction } = yield cancelPengindIfNotYet(actionAttributes)(repos);
27
- yield (0, onReservationCanceled_1.onReservationCanceled)([], // PendingReservationはドキュメントとして存在しないので空でok
28
- false, {
28
+ yield (0, onPendingReservationCanceled_1.onPendingReservationCanceled)(
29
+ // [], // PendingReservationはドキュメントとして存在しないので空でok
30
+ // false,
31
+ {
29
32
  project: { id: reserveTransaction.project.id },
30
- id: String((_a = reserveTransaction.object.reservationFor) === null || _a === void 0 ? void 0 : _a.id)
33
+ reservationFor: {
34
+ id: String((_a = reserveTransaction.object.reservationFor) === null || _a === void 0 ? void 0 : _a.id)
35
+ },
36
+ reservationNumber: reserveTransaction.object.reservationNumber
31
37
  })({ task: repos.task }, settings);
32
38
  });
33
39
  }
@@ -61,7 +67,7 @@ function cancelPengindIfNotYet(params) {
61
67
  id: { $in: [params.purpose.id] },
62
68
  typeOf: { $in: [params.purpose.typeOf] }
63
69
  }
64
- }, ['id'], []);
70
+ }, ['id']);
65
71
  if (completedActions.length === 0) {
66
72
  const actionAttributes = (0, factory_1.createCancelPendingReservationAction)({ transaction: reserveTransaction });
67
73
  if (actionAttributes !== undefined) {
@@ -306,7 +312,9 @@ function cancelReservation(actionAttributesList) {
306
312
  });
307
313
  canceledReservations = [canceledReservation];
308
314
  }
309
- yield (0, onReservationCanceled_1.onReservationCanceled)(canceledReservations, true, {
315
+ yield (0, onReservationCanceled_1.onReservationCanceled)(canceledReservations,
316
+ // true,
317
+ {
310
318
  project: { id: actionAttributes.project.id },
311
319
  id: canceledReservationForId
312
320
  })({ task: repos.task }, settings);
@@ -133,7 +133,7 @@ params, options) {
133
133
  id: { $in: [actionAttributes.purpose.id] },
134
134
  typeOf: { $in: [actionAttributes.purpose.typeOf] }
135
135
  }
136
- }, ['id'], []);
136
+ }, ['id']);
137
137
  debug(completedActions.length, 'completed reserveAction found. byTask:', options === null || options === void 0 ? void 0 : options.byTask, 'reservationNumber:', reservationPackage.reservationNumber);
138
138
  if (completedActions.length === 0) {
139
139
  const action = yield repos.action.start(actionAttributes);