@chevre/domain 21.20.0-alpha.2 → 21.20.0-alpha.22

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 (113) hide show
  1. package/example/src/chevre/onAssetTransactionStatusChanged.ts +36 -0
  2. package/example/src/chevre/retryTasks.ts +39 -0
  3. package/example/src/chevre/searchOrders.ts +13 -15
  4. package/example/src/chevre/searchSlicedAcceptedOffersByOrderNumber.ts +28 -0
  5. package/example/src/chevre/sendOrder.ts +37 -0
  6. package/example/src/chevre/transaction/processAcceptOffer.ts +48 -0
  7. package/example/src/chevre/transaction/processPlaceOrder.ts +82 -53
  8. package/lib/chevre/repo/acceptedOffer.d.ts +21 -1
  9. package/lib/chevre/repo/acceptedOffer.js +32 -2
  10. package/lib/chevre/repo/action.d.ts +13 -7
  11. package/lib/chevre/repo/action.js +33 -11
  12. package/lib/chevre/repo/mongoose/schemas/order.d.ts +1 -1
  13. package/lib/chevre/repo/mongoose/schemas/order.js +20 -11
  14. package/lib/chevre/repo/order.js +28 -9
  15. package/lib/chevre/repo/orderInTransaction.d.ts +27 -0
  16. package/lib/chevre/repo/orderInTransaction.js +77 -0
  17. package/lib/chevre/repo/task.d.ts +0 -2
  18. package/lib/chevre/repo/task.js +56 -46
  19. package/lib/chevre/repo/transaction.d.ts +1 -1
  20. package/lib/chevre/repository.d.ts +5 -0
  21. package/lib/chevre/repository.js +15 -2
  22. package/lib/chevre/service/assetTransaction/pay.d.ts +0 -10
  23. package/lib/chevre/service/assetTransaction/pay.js +4 -4
  24. package/lib/chevre/service/code.js +1 -1
  25. package/lib/chevre/service/delivery.js +2 -2
  26. package/lib/chevre/service/event/createEvent.js +1 -1
  27. package/lib/chevre/service/event.js +2 -2
  28. package/lib/chevre/service/moneyTransfer.js +1 -1
  29. package/lib/chevre/service/notification.js +2 -5
  30. package/lib/chevre/service/offer/any.d.ts +29 -0
  31. package/lib/chevre/service/offer/any.js +55 -0
  32. package/lib/chevre/service/offer/event/authorize.d.ts +7 -0
  33. package/lib/chevre/service/offer/event/authorize.js +11 -0
  34. package/lib/chevre/service/offer/event/cancel.d.ts +2 -0
  35. package/lib/chevre/service/offer/event/cancel.js +12 -1
  36. package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
  37. package/lib/chevre/service/offer/event/voidTransaction.js +12 -5
  38. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +48 -0
  39. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +133 -0
  40. package/lib/chevre/service/offer/eventServiceByCOA/cancel.d.ts +39 -0
  41. package/lib/chevre/service/offer/eventServiceByCOA/cancel.js +58 -0
  42. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +25 -0
  43. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +156 -0
  44. package/lib/chevre/service/offer/eventServiceByCOA.d.ts +4 -89
  45. package/lib/chevre/service/offer/eventServiceByCOA.js +7 -292
  46. package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +6 -1
  47. package/lib/chevre/service/offer/moneyTransfer/authorize.js +2 -1
  48. package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -1
  49. package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +1 -1
  50. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
  51. package/lib/chevre/service/offer/product.js +1 -1
  52. package/lib/chevre/service/order/confirmPayTransaction.js +3 -3
  53. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +11 -1
  54. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +113 -5
  55. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +18 -19
  56. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +38 -25
  57. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +11 -0
  58. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +45 -0
  59. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +14 -0
  60. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +37 -0
  61. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +10 -0
  62. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +86 -0
  63. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +51 -36
  64. package/lib/chevre/service/order/onOrderStatusChanged.d.ts +3 -1
  65. package/lib/chevre/service/order/onOrderStatusChanged.js +5 -1
  66. package/lib/chevre/service/order/placeOrder.d.ts +2 -0
  67. package/lib/chevre/service/order/placeOrder.js +28 -29
  68. package/lib/chevre/service/order/returnOrder.js +25 -16
  69. package/lib/chevre/service/order/sendOrder.d.ts +5 -0
  70. package/lib/chevre/service/order/sendOrder.js +68 -30
  71. package/lib/chevre/service/payment/any.d.ts +6 -8
  72. package/lib/chevre/service/payment/any.js +46 -10
  73. package/lib/chevre/service/payment/creditCard.d.ts +9 -8
  74. package/lib/chevre/service/payment/creditCard.js +102 -133
  75. package/lib/chevre/service/payment/faceToFace.d.ts +0 -4
  76. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +0 -2
  77. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.js +1 -0
  78. package/lib/chevre/service/payment/movieTicket/validation.d.ts +0 -2
  79. package/lib/chevre/service/payment/movieTicket.d.ts +0 -6
  80. package/lib/chevre/service/payment/movieTicket.js +1 -1
  81. package/lib/chevre/service/payment/paymentCard.d.ts +0 -2
  82. package/lib/chevre/service/payment/paymentCard.js +6 -6
  83. package/lib/chevre/service/payment.js +1 -1
  84. package/lib/chevre/service/product.js +1 -1
  85. package/lib/chevre/service/reserve/cancelReservation.js +2 -2
  86. package/lib/chevre/service/reserve/confirmReservation.js +1 -1
  87. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +1 -1
  88. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +4 -4
  89. package/lib/chevre/service/reserve/useReservation.d.ts +1 -2
  90. package/lib/chevre/service/reserve/useReservation.js +4 -4
  91. package/lib/chevre/service/reserve/verifyToken4reservation.js +2 -0
  92. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -1
  93. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +4 -1
  94. package/lib/chevre/service/task/confirmReserveTransaction.js +42 -3
  95. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -7
  96. package/lib/chevre/service/task/placeOrder.js +9 -10
  97. package/lib/chevre/service/task/returnOrder.js +0 -3
  98. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  99. package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
  100. package/lib/chevre/service/task/sendOrder.js +8 -4
  101. package/lib/chevre/service/task/voidPayTransaction.js +2 -2
  102. package/lib/chevre/service/task/voidReserveTransaction.js +8 -12
  103. package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
  104. package/lib/chevre/service/transaction/moneyTransfer.js +1 -5
  105. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +18 -13
  106. package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
  107. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +32 -0
  108. package/lib/chevre/service/transaction/returnOrder/preStart.js +632 -0
  109. package/lib/chevre/service/transaction/returnOrder.d.ts +8 -6
  110. package/lib/chevre/service/transaction/returnOrder.js +4 -616
  111. package/lib/chevre/settings.d.ts +3 -1
  112. package/lib/chevre/settings.js +7 -2
  113. package/package.json +3 -3
@@ -22,7 +22,6 @@ const validation_1 = require("./placeOrderInProgress/validation");
22
22
  const validateSeller_1 = require("./placeOrderInProgress/validation/validateSeller");
23
23
  const validation_2 = require("./validation");
24
24
  const errorHandler_1 = require("../../errorHandler");
25
- const settings_1 = require("../../settings");
26
25
  exports.POINT_AWARD_IDENTIFIER_NAME = 'pointAwardIdentifiers';
27
26
  /**
28
27
  * 取引開始
@@ -220,7 +219,8 @@ function createResult(params) {
220
219
  orderDate: params.result.order.orderDate,
221
220
  // OrderPaymentDueオプションを追加(2023-08-25~)
222
221
  // 注文作成時のステータスとなる
223
- orderStatus: (settings_1.USE_ORDER_PAYMENT_DUE_ON_PLACED) ? factory.orderStatus.OrderPaymentDue : factory.orderStatus.OrderProcessing,
222
+ // orderStatus: (USE_ORDER_PAYMENT_DUE_ON_PLACED) ? factory.orderStatus.OrderPaymentDue : factory.orderStatus.OrderProcessing,
223
+ orderStatus: factory.orderStatus.OrderPaymentDue,
224
224
  isGift: false,
225
225
  authorizeActions: params.authorizeActions
226
226
  });
@@ -0,0 +1,32 @@
1
+ import * as factory from '../../../factory';
2
+ import type { MongoRepository as AcceptedOfferRepo } from '../../../repo/acceptedOffer';
3
+ import type { MongoRepository as EventRepo } from '../../../repo/event';
4
+ import type { MongoRepository as MerchantReturnPolicyRepo } from '../../../repo/merchantReturnPolicy';
5
+ import type { MongoRepository as OfferRepo } from '../../../repo/offer';
6
+ import type { MongoRepository as OfferItemConditionRepo } from '../../../repo/offerItemCondition';
7
+ import type { MongoRepository as OrderRepo } from '../../../repo/order';
8
+ import type { MongoRepository as ProjectRepo } from '../../../repo/project';
9
+ import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
10
+ import type { MongoRepository as SellerRepo } from '../../../repo/seller';
11
+ interface IPreStartOperationRepos {
12
+ acceptedOffer: AcceptedOfferRepo;
13
+ event: EventRepo;
14
+ merchantReturnPolicy: MerchantReturnPolicyRepo;
15
+ offer: OfferRepo;
16
+ offerItemCondition: OfferItemConditionRepo;
17
+ order: OrderRepo;
18
+ project: ProjectRepo;
19
+ reservation: ReservationRepo;
20
+ seller: SellerRepo;
21
+ }
22
+ type IPreStartOperation<T> = (repos: IPreStartOperationRepos) => Promise<T>;
23
+ type IFixedSeller = Pick<factory.seller.ISeller, 'id' | 'name' | 'project' | 'hasMerchantReturnPolicy' | 'typeOf'>;
24
+ /**
25
+ * 返品取引開始前処理
26
+ */
27
+ declare function preStart(params: factory.transaction.returnOrder.IStartParamsWithoutDetail): IPreStartOperation<{
28
+ transactionObject: factory.transaction.returnOrder.IObject;
29
+ seller: IFixedSeller;
30
+ expiresInSeconds: number;
31
+ }>;
32
+ export { preStart };