@chevre/domain 25.2.0-alpha.9 → 26.0.0-alpha.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.
- package/lib/chevre/eventEmitter/task.d.ts +2 -1
- package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/adminTask.d.ts +37 -0
- package/lib/chevre/repo/adminTask.js +163 -0
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/aggregateTask.d.ts +37 -0
- package/lib/chevre/repo/aggregateTask.js +136 -0
- package/lib/chevre/repo/asyncAction.d.ts +69 -0
- package/lib/chevre/repo/asyncAction.js +237 -0
- package/lib/chevre/repo/concurrentLock.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- package/lib/chevre/repo/credentials.d.ts +2 -1
- package/lib/chevre/repo/customerType.d.ts +2 -3
- package/lib/chevre/repo/event.d.ts +10 -11
- package/lib/chevre/repo/eventOffer.d.ts +4 -5
- package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
- package/lib/chevre/repo/eventSeries.d.ts +4 -5
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +13 -0
- package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.d.ts +16 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/note.d.ts +3 -4
- package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
- package/lib/chevre/repo/offerCatalog.d.ts +2 -3
- package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
- package/lib/chevre/repo/order.d.ts +2 -0
- package/lib/chevre/repo/order.js +14 -14
- package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
- package/lib/chevre/repo/orderInTransaction.js +181 -3
- package/lib/chevre/repo/passport.d.ts +2 -1
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
- package/lib/chevre/repo/place/seat.d.ts +4 -5
- package/lib/chevre/repo/place/section.d.ts +3 -4
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- package/lib/chevre/repo/scheduledTask.d.ts +90 -0
- package/lib/chevre/repo/scheduledTask.js +223 -0
- package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +0 -146
- package/lib/chevre/repo/task.d.ts +30 -71
- package/lib/chevre/repo/task.js +59 -345
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transactionNumberCounter.js +0 -34
- package/lib/chevre/repo/transactionProcess.d.ts +2 -1
- package/lib/chevre/repo/transactionProcess.js +0 -13
- package/lib/chevre/repository.d.ts +20 -0
- package/lib/chevre/repository.js +46 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/system.d.ts +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
- package/lib/chevre/service/asyncAction.d.ts +16 -0
- package/lib/chevre/service/asyncAction.js +36 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
- package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
- package/lib/chevre/service/asyncActionHandler.js +89 -0
- package/lib/chevre/service/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +12 -6
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +20 -9
- package/lib/chevre/service/offer/onEventChanged.js +2 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
- package/lib/chevre/service/order/placeOrder/factory.js +3 -21
- package/lib/chevre/service/order/placeOrder.d.ts +4 -5
- package/lib/chevre/service/order/placeOrder.js +20 -31
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +7 -5
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +18 -21
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
- package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/reserve.d.ts +2 -2
- package/lib/chevre/service/reserve.js +3 -3
- package/lib/chevre/service/scheduledTask.d.ts +11 -0
- package/lib/chevre/service/scheduledTask.js +40 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
- package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
- package/lib/chevre/service/scheduledTaskHandler.js +66 -0
- package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelReservation.js +2 -1
- package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -8
- package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
- package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +10 -9
- package/lib/chevre/service/task/placeOrder.d.ts +2 -2
- package/lib/chevre/service/task/placeOrder.js +6 -3
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/refund.d.ts +2 -2
- package/lib/chevre/service/task/refund.js +4 -10
- package/lib/chevre/service/task/reserve.d.ts +2 -2
- package/lib/chevre/service/task/reserve.js +2 -1
- package/lib/chevre/service/task/returnOrder.d.ts +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/sendOrder.d.ts +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/task/voidPayment.d.ts +2 -2
- package/lib/chevre/service/task/voidPayment.js +2 -1
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
- package/lib/chevre/service/taskHandler.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +36 -37
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +32 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service.d.ts +8 -0
- package/lib/chevre/service.js +23 -1
- package/lib/chevre/taskSettings.d.ts +3 -4
- package/package.json +8 -11
- package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
- package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
- package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
- package/lib/chevre/service/reserve/findReservations.js +0 -61
|
@@ -11,11 +11,8 @@ const voidAcceptedOfferIfNecessary_1 = require("./placeOrder/voidAcceptedOfferIf
|
|
|
11
11
|
*/
|
|
12
12
|
function placeOrder(params) {
|
|
13
13
|
return async (repos, settings) => {
|
|
14
|
-
if (typeof params.useOnOrderStatusChanged !== 'boolean') {
|
|
15
|
-
throw new factory_1.factory.errors.Argument('useOnOrderStatusChanged', 'must be boolean');
|
|
16
|
-
}
|
|
17
14
|
// 注文番号から取引と注文をfixする
|
|
18
|
-
const { order, placeOrderTransaction, serialNumbers } = await (0, createPlacingOrderFromExistingTransaction_1.createPlacingOrderFromExistingTransaction)({
|
|
15
|
+
const { orderNumber, confirmationNumber, order, placeOrderTransaction, serialNumbers } = await (0, createPlacingOrderFromExistingTransaction_1.createPlacingOrderFromExistingTransaction)({
|
|
19
16
|
project: { id: params.project.id },
|
|
20
17
|
confirmationNumber: params.object.confirmationNumber,
|
|
21
18
|
orderNumber: params.object.orderNumber
|
|
@@ -31,14 +28,14 @@ function placeOrder(params) {
|
|
|
31
28
|
}
|
|
32
29
|
const simpleOrder = {
|
|
33
30
|
typeOf: order.typeOf,
|
|
34
|
-
orderNumber
|
|
31
|
+
orderNumber,
|
|
35
32
|
orderDate: order.orderDate
|
|
36
33
|
};
|
|
37
34
|
const orderActionPurpose = {
|
|
38
35
|
typeOf: placeOrderTransaction.typeOf, id: placeOrderTransaction.id
|
|
39
36
|
};
|
|
40
37
|
const orderActionAttributes = {
|
|
41
|
-
agent:
|
|
38
|
+
agent: params.agent,
|
|
42
39
|
object: simpleOrder,
|
|
43
40
|
project: placeOrderTransaction.project,
|
|
44
41
|
purpose: orderActionPurpose,
|
|
@@ -61,7 +58,6 @@ function placeOrder(params) {
|
|
|
61
58
|
try {
|
|
62
59
|
// 冗長なオファーを除外する(念のため)
|
|
63
60
|
await (0, voidAcceptedOfferIfNecessary_1.voidAcceptedOfferIfNecessary)({
|
|
64
|
-
// object: { orderNumber: order.orderNumber },
|
|
65
61
|
placeOrderId: placeOrderTransaction.id,
|
|
66
62
|
serialNumbers
|
|
67
63
|
})(repos);
|
|
@@ -81,38 +77,31 @@ function placeOrder(params) {
|
|
|
81
77
|
if (params.useOnOrderStatusChanged) {
|
|
82
78
|
// 経理レポートを保管->CreateAccountingReportへ移行(2024-02-02~)
|
|
83
79
|
// PaymentDueであればonOrderStatusChangedを実行(2023-08-23~)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
})({
|
|
99
|
-
task: repos.task
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
throw new factory_1.factory.errors.NotImplemented(`placing an order on the status '${order.orderStatus}' not implemented`);
|
|
104
|
-
}
|
|
80
|
+
await (0, onOrderStatusChanged_1.onOrderPaymentDue)({
|
|
81
|
+
order: {
|
|
82
|
+
paymentMethods: order.paymentMethods,
|
|
83
|
+
project: placeOrderTransaction.project,
|
|
84
|
+
orderNumber,
|
|
85
|
+
confirmationNumber,
|
|
86
|
+
orderDate: order.orderDate,
|
|
87
|
+
typeOf: order.typeOf,
|
|
88
|
+
orderStatus: order.orderStatus
|
|
89
|
+
}
|
|
90
|
+
})({
|
|
91
|
+
task: repos.task
|
|
92
|
+
});
|
|
105
93
|
// paymentMethods.length: 0の場合を考慮(2023-08-24~)
|
|
94
|
+
/* istanbul ignore else -- @preserve */
|
|
106
95
|
if (order.paymentMethods.length === 0) {
|
|
107
96
|
// paymentMethods.length: 0の場合に、confirmPayTransactionは実行されないので、ここで強制的にpaymentDue2Processingを実行する必要がある
|
|
108
97
|
await (0, onAssetTransactionStatusChanged_1.paymentDue2Processing)({
|
|
109
98
|
project: { id: placeOrderTransaction.project.id },
|
|
110
|
-
confirmationNumber
|
|
111
|
-
orderNumber
|
|
99
|
+
confirmationNumber,
|
|
100
|
+
orderNumber,
|
|
112
101
|
useOnOrderStatusChanged: params.useOnOrderStatusChanged === true
|
|
113
102
|
})(repos, settings);
|
|
114
103
|
}
|
|
115
104
|
}
|
|
116
|
-
return { order };
|
|
105
|
+
// return { order };
|
|
117
106
|
};
|
|
118
107
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fixOrderAsNeeded = fixOrderAsNeeded;
|
|
4
|
-
const factory_1 = require("../../../../factory");
|
|
5
4
|
const publishConfirmationNumberIfNotExist_1 = require("../../../transaction/placeOrder/publishConfirmationNumberIfNotExist");
|
|
6
5
|
function fixOrderAsNeeded(params) {
|
|
7
6
|
return async (repos) => {
|
|
@@ -12,7 +11,7 @@ function fixOrderAsNeeded(params) {
|
|
|
12
11
|
// if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.MovieTicket) {
|
|
13
12
|
const confirmationNumber = await (0, publishConfirmationNumberIfNotExist_1.publishConfirmationNumberIfNotExist)({
|
|
14
13
|
id: params.purpose.id,
|
|
15
|
-
status: { $in: [
|
|
14
|
+
// status: { $in: [factory.transactionStatusType.InProgress] },
|
|
16
15
|
object: { orderDate }
|
|
17
16
|
})(repos);
|
|
18
17
|
// }
|
|
@@ -3,7 +3,8 @@ import type { AcceptPayActionRepo } from '../../../../repo/action/acceptPay';
|
|
|
3
3
|
import type { AuthorizePaymentMethodActionRepo } from '../../../../repo/action/authorizePaymentMethod';
|
|
4
4
|
import type { AuthorizationRepo } from '../../../../repo/authorization';
|
|
5
5
|
import type { TicketRepo } from '../../../../repo/ticket';
|
|
6
|
-
import type {
|
|
6
|
+
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
7
|
+
import type { ITransactionInProgress } from '../../../../repo/transaction/placeOrder';
|
|
7
8
|
import type { TransactionNumberRepo } from '../../../../repo/transactionNumber';
|
|
8
9
|
import * as PayTransactionService from '../../../assetTransaction/pay';
|
|
9
10
|
import { IInvoiceByTicketToken } from '../factory';
|
|
@@ -13,7 +14,7 @@ interface IFixTransactionNumberRepos {
|
|
|
13
14
|
authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
|
|
14
15
|
authorization: AuthorizationRepo;
|
|
15
16
|
ticket: TicketRepo;
|
|
16
|
-
|
|
17
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
17
18
|
transactionNumber: TransactionNumberRepo;
|
|
18
19
|
}
|
|
19
20
|
type IFixTransactionNumberOperation<T> = (repos: IFixTransactionNumberRepos) => Promise<T>;
|
package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import type { AcceptPayActionRepo } from '../../../../repo/action/acceptPay';
|
|
|
3
3
|
import type { AuthorizePaymentMethodActionRepo } from '../../../../repo/action/authorizePaymentMethod';
|
|
4
4
|
import type { AuthorizationRepo } from '../../../../repo/authorization';
|
|
5
5
|
import type { TicketRepo } from '../../../../repo/ticket';
|
|
6
|
-
import type {
|
|
6
|
+
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
7
|
+
import type { ITransactionInProgress } from '../../../../repo/transaction/placeOrder';
|
|
7
8
|
import * as PayTransactionService from '../../../assetTransaction/pay';
|
|
8
9
|
import type { IInvoiceByTicketToken } from '../factory';
|
|
9
10
|
type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail;
|
|
@@ -17,7 +18,7 @@ interface IHandlePrePublishedPaymentMethodIdOnAuthorizingRepos {
|
|
|
17
18
|
authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
|
|
18
19
|
authorization: AuthorizationRepo;
|
|
19
20
|
ticket: TicketRepo;
|
|
20
|
-
|
|
21
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* 決済承認前の決済採用アクションを参照する
|
|
@@ -29,9 +30,9 @@ declare function handlePrePublishedPaymentMethodIdOnAuthorizing(params: {
|
|
|
29
30
|
}): (repos: IHandlePrePublishedPaymentMethodIdOnAuthorizingRepos) => Promise<{
|
|
30
31
|
authorizeParams?: {
|
|
31
32
|
creditCard: factory.action.authorize.paymentMethod.any.ICreditCard;
|
|
32
|
-
paymentMethodByTransaction: factory.transaction.placeOrder.IPaymentMethodByPaymentUrl;
|
|
33
33
|
pendingPaymentAgencyTransaction: PayTransactionService.IPaymentAgencyTransaction;
|
|
34
34
|
acceptAction2ticketResult?: IAcceptAction2ticketResult;
|
|
35
|
+
paymentMethodByTransaction?: never;
|
|
35
36
|
};
|
|
36
37
|
existingCompletedAuthorizeAction?: never;
|
|
37
38
|
} | {
|
package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js
CHANGED
|
@@ -98,25 +98,8 @@ function handlePrePublishedPaymentMethodIdOnAuthorizing(params) {
|
|
|
98
98
|
let existingCompletedAuthorizeAction;
|
|
99
99
|
let acceptPayAction;
|
|
100
100
|
// transaction.objectへのアクセス回避(2024-05-30~)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (params.prePublishedPaymentMethodId === paymentMethodByTransaction?.paymentMethodId) {
|
|
104
|
-
// check existence of acceptAction when authorizing payment(2024-06-01~)
|
|
105
|
-
// acceptPayAction = (<Pick<IAcceptPayAction, 'object' | 'result' | 'id' | 'instrument'>[]>await repos.action.search<factory.actionType.AcceptAction>(
|
|
106
|
-
// {
|
|
107
|
-
// limit: 1,
|
|
108
|
-
// page: 1,
|
|
109
|
-
// project: { id: { $eq: params.transaction.project.id } },
|
|
110
|
-
// typeOf: { $eq: factory.actionType.AcceptAction },
|
|
111
|
-
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
112
|
-
// purpose: { id: { $in: [params.transaction.id] } },
|
|
113
|
-
// object: {
|
|
114
|
-
// transactionNumber: { $eq: params.prePublishedPaymentMethodId },
|
|
115
|
-
// typeOf: { $eq: factory.assetTransactionType.Pay }
|
|
116
|
-
// }
|
|
117
|
-
// },
|
|
118
|
-
// ['object', 'result', 'instrument']
|
|
119
|
-
// )).shift();
|
|
101
|
+
const paymentMethodIdByTransaction = await repos.orderInTransaction.findInProgressPaymentMethodId({ id: params.transaction.id });
|
|
102
|
+
if (params.prePublishedPaymentMethodId === paymentMethodIdByTransaction) {
|
|
120
103
|
acceptPayAction = (await repos.acceptPayAction.findCompletedAcceptActionsByTransactionNumber({
|
|
121
104
|
project: { id: params.transaction.project.id },
|
|
122
105
|
purpose: { id: params.transaction.id },
|
|
@@ -154,17 +137,6 @@ function handlePrePublishedPaymentMethodIdOnAuthorizing(params) {
|
|
|
154
137
|
throw new factory_1.factory.errors.Argument('paymentMethodId', 'pendingPaymentAgencyTransaction not found');
|
|
155
138
|
}
|
|
156
139
|
// 既に承認済であれば何もしない(2023-05-15~)
|
|
157
|
-
// const existingCompletedAuthorizeActions = <IAuthorizePaymentAction[]>
|
|
158
|
-
// await repos.action.searchByPurpose<factory.actionType.AuthorizeAction>({
|
|
159
|
-
// typeOf: factory.actionType.AuthorizeAction,
|
|
160
|
-
// purpose: { id: params.transaction.id, typeOf: params.transaction.typeOf },
|
|
161
|
-
// actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus },
|
|
162
|
-
// object: {
|
|
163
|
-
// paymentMethodId: { $eq: params.prePublishedPaymentMethodId },
|
|
164
|
-
// typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment }
|
|
165
|
-
// },
|
|
166
|
-
// sort: { startDate: factory.sortType.Ascending }
|
|
167
|
-
// });
|
|
168
140
|
const existingCompletedAuthorizeActions = await repos.authorizePaymentMethodAction.findAuthorizePaymentMethodActionsByPurpose({
|
|
169
141
|
purpose: { id: params.transaction.id, typeOf: params.transaction.typeOf },
|
|
170
142
|
actionStatus: { $eq: factory_1.factory.actionStatusType.CompletedActionStatus },
|
|
@@ -185,7 +157,7 @@ function handlePrePublishedPaymentMethodIdOnAuthorizing(params) {
|
|
|
185
157
|
acceptPayAction
|
|
186
158
|
})(repos);
|
|
187
159
|
return {
|
|
188
|
-
authorizeParams: { creditCard, pendingPaymentAgencyTransaction,
|
|
160
|
+
authorizeParams: { creditCard, pendingPaymentAgencyTransaction, acceptAction2ticketResult }
|
|
189
161
|
};
|
|
190
162
|
}
|
|
191
163
|
else {
|
|
@@ -78,13 +78,15 @@ function authorize(params) {
|
|
|
78
78
|
authorizePaymentMethodAction: repos.authorizePaymentMethodAction,
|
|
79
79
|
authorization: repos.authorization,
|
|
80
80
|
ticket: repos.ticket,
|
|
81
|
-
|
|
81
|
+
orderInTransaction: repos.orderInTransaction,
|
|
82
82
|
transactionNumber: repos.transactionNumber
|
|
83
83
|
});
|
|
84
84
|
if (typeof fixTransactionNumberResult.id === 'string') {
|
|
85
85
|
return { id: fixTransactionNumberResult.id };
|
|
86
86
|
}
|
|
87
|
-
const { transactionNumber, pendingPaymentAgencyTransaction, creditCard,
|
|
87
|
+
const { transactionNumber, pendingPaymentAgencyTransaction, creditCard,
|
|
88
|
+
// invoiceByTicketToken,
|
|
89
|
+
ticketToken } = fixTransactionNumberResult;
|
|
88
90
|
const movieTickets = (Array.isArray(params.object.movieTickets)) ? params.object.movieTickets.map(factory_2.createMovieTicket) : undefined;
|
|
89
91
|
const { accountId } = await fixAccountIdIfPossible({
|
|
90
92
|
object: params.object, project: { id: transaction.project.id }
|
|
@@ -196,10 +198,10 @@ function authorize(params) {
|
|
|
196
198
|
throw error;
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
|
-
const result = (0, factory_2.
|
|
201
|
+
const result = (0, factory_2.payTransaction2actionResult)({
|
|
200
202
|
payTransaction,
|
|
201
|
-
object: authorizeObjectIncludingPaymentMethodDetails,
|
|
202
|
-
invoiceByTicketToken
|
|
203
|
+
// object: authorizeObjectIncludingPaymentMethodDetails,
|
|
204
|
+
// invoiceByTicketToken
|
|
203
205
|
});
|
|
204
206
|
await repos.authorizePaymentMethodAction.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
205
207
|
return { id: action.id };
|
|
@@ -46,16 +46,16 @@ export declare function creatPayTransactionStartParams(params: {
|
|
|
46
46
|
*/
|
|
47
47
|
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
48
48
|
}): factory.assetTransaction.pay.IStartParamsWithoutDetail & {
|
|
49
|
-
instrument: factory.action.trade.pay.
|
|
49
|
+
instrument: factory.action.trade.pay.IPayTransactionInstrument[];
|
|
50
50
|
};
|
|
51
51
|
export declare function createMovieTicket(params: factory.action.trade.pay.IMovieTicket): factory.action.trade.pay.IMovieTicket;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
/**
|
|
53
|
+
* 決済取引から決済承認アクション結果を生成する
|
|
54
|
+
*/
|
|
55
|
+
export declare function payTransaction2actionResult(params: {
|
|
54
56
|
payTransaction: Pick<factory.assetTransaction.pay.ITransaction, 'object'>;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
invoiceByTicketToken?: IInvoiceByTicketToken;
|
|
57
|
+
object?: never;
|
|
58
|
+
invoiceByTicketToken?: never;
|
|
59
59
|
}): factory.action.authorize.paymentMethod.any.IResult;
|
|
60
60
|
/**
|
|
61
61
|
* 通知対象としてのアクションを最適化
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.creatPublishPaymentUrlParams = creatPublishPaymentUrlParams;
|
|
7
7
|
exports.creatPayTransactionStartParams = creatPayTransactionStartParams;
|
|
8
8
|
exports.createMovieTicket = createMovieTicket;
|
|
9
|
-
exports.
|
|
9
|
+
exports.payTransaction2actionResult = payTransaction2actionResult;
|
|
10
10
|
exports.optimizeAction4inform = optimizeAction4inform;
|
|
11
11
|
const moment_1 = __importDefault(require("moment"));
|
|
12
12
|
const util_1 = require("util");
|
|
@@ -193,8 +193,14 @@ function createMovieTicket(params) {
|
|
|
193
193
|
serviceOutput
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
/**
|
|
197
|
+
* 決済取引から決済承認アクション結果を生成する
|
|
198
|
+
*/
|
|
199
|
+
function payTransaction2actionResult(params) {
|
|
200
|
+
const {
|
|
201
|
+
// object,
|
|
202
|
+
payTransaction } = params;
|
|
203
|
+
const payTransactionObject = payTransaction.object;
|
|
198
204
|
const totalPaymentDue = payTransactionObject.paymentMethod?.totalPaymentDue;
|
|
199
205
|
if (typeof totalPaymentDue?.typeOf !== 'string') {
|
|
200
206
|
throw new factory_1.factory.errors.Internal('payTransaction.object.paymentMethod.totalPaymentDue undefined');
|
|
@@ -208,7 +214,8 @@ function createAuthorizeResult(params) {
|
|
|
208
214
|
? payTransactionObject.paymentMethod?.amount?.currency
|
|
209
215
|
: undefined;
|
|
210
216
|
const paymentMethodAsObject = {
|
|
211
|
-
typeOf:
|
|
217
|
+
// typeOf: object.paymentMethod,
|
|
218
|
+
typeOf: payTransactionObject.paymentMethod.identifier,
|
|
212
219
|
// CreditCardIFのカード通貨区分を追加(2023-08-15~)
|
|
213
220
|
...(payTransactionObject.typeOf === factory_1.factory.service.paymentService.PaymentServiceType.CreditCard
|
|
214
221
|
&& typeof paymentMethodAmountCurrencyByPayTransaction === 'string')
|
|
@@ -223,9 +230,11 @@ function createAuthorizeResult(params) {
|
|
|
223
230
|
}
|
|
224
231
|
}
|
|
225
232
|
let invoiceOrderItems;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
// const referencesOrderByObject = object.referencesOrder;
|
|
234
|
+
const referencesOrderByObject = payTransactionObject.serviceOutput?.referencesOrder;
|
|
235
|
+
if (referencesOrderByObject?.typeOf === factory_1.factory.order.OrderType.Order) {
|
|
236
|
+
if (Array.isArray(referencesOrderByObject.orderedItem)) {
|
|
237
|
+
invoiceOrderItems = referencesOrderByObject.orderedItem;
|
|
229
238
|
}
|
|
230
239
|
}
|
|
231
240
|
const referencesOrder = {
|
|
@@ -239,8 +248,6 @@ function createAuthorizeResult(params) {
|
|
|
239
248
|
? payTransactionObject.paymentMethod.accountId
|
|
240
249
|
: '',
|
|
241
250
|
issuedThrough,
|
|
242
|
-
// 完全廃止(paymentMethodAsObjectへ完全移行)(2023-08-16~)
|
|
243
|
-
// paymentMethod: params.object.paymentMethod,
|
|
244
251
|
paymentMethodAsObject,
|
|
245
252
|
paymentStatus,
|
|
246
253
|
paymentMethodId: (typeof payTransactionObject.paymentMethodId === 'string')
|
|
@@ -248,22 +255,12 @@ function createAuthorizeResult(params) {
|
|
|
248
255
|
: '',
|
|
249
256
|
name: (typeof payTransactionObject.paymentMethod?.name === 'string')
|
|
250
257
|
? payTransactionObject.paymentMethod.name
|
|
251
|
-
:
|
|
258
|
+
: payTransactionObject.paymentMethod.identifier,
|
|
252
259
|
totalPaymentDue: totalPaymentDue,
|
|
253
|
-
additionalProperty: (Array.isArray(
|
|
260
|
+
additionalProperty: (Array.isArray(payTransactionObject.paymentMethod.additionalProperty)) ? payTransactionObject.paymentMethod.additionalProperty : [],
|
|
254
261
|
typeOf: factory_1.factory.action.authorize.paymentMethod.any.ResultType.Payment,
|
|
255
262
|
referencesOrder // add(2025-11-23~)
|
|
256
263
|
};
|
|
257
|
-
// eslint-disable-next-line no-warning-comments
|
|
258
|
-
// TODO 保留 resultにメンバーシップを追加(2024-08-13~)
|
|
259
|
-
// let resultAsPermit: factory.action.authorize.paymentMethod.any.IResultAsPermit | undefined;
|
|
260
|
-
// if (typeof params.permit?.identifier === 'string') {
|
|
261
|
-
// resultAsPermit = {
|
|
262
|
-
// typeOf: factory.permit.PermitType.Permit,
|
|
263
|
-
// identifier: params.permit.identifier,
|
|
264
|
-
// issuedThrough: { serviceType: params.permit.issuedThrough?.serviceType }
|
|
265
|
-
// };
|
|
266
|
-
// }
|
|
267
264
|
// Arrayに統一(2023-09-04~)
|
|
268
265
|
// if (resultAsPermit !== undefined) {
|
|
269
266
|
// return [resultAsInvoice, resultAsPermit];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
3
|
+
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
3
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
5
|
interface IFindAcceptActionResult {
|
|
5
6
|
/**
|
|
@@ -18,7 +19,9 @@ interface IFindAcceptActionResult {
|
|
|
18
19
|
name?: string;
|
|
19
20
|
message?: string;
|
|
20
21
|
};
|
|
21
|
-
result?: factory.action.accept.pay.IResult
|
|
22
|
+
result?: Pick<factory.action.accept.pay.IResult, 'paymentMethodId'> & {
|
|
23
|
+
paymentUrl: string;
|
|
24
|
+
};
|
|
22
25
|
}
|
|
23
26
|
declare function findAcceptAction(params: {
|
|
24
27
|
project: {
|
|
@@ -36,8 +39,11 @@ declare function findAcceptAction(params: {
|
|
|
36
39
|
*/
|
|
37
40
|
id: string;
|
|
38
41
|
};
|
|
42
|
+
}, options: {
|
|
43
|
+
useAsyncAction: boolean;
|
|
39
44
|
}): (repos: {
|
|
40
45
|
acceptPayAction: AcceptPayActionRepo;
|
|
46
|
+
asyncAction: AsyncActionRepo;
|
|
41
47
|
task: TaskRepo;
|
|
42
48
|
}) => Promise<IFindAcceptActionResult>;
|
|
43
49
|
export { findAcceptAction, };
|
|
@@ -2,16 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findAcceptAction = findAcceptAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findAcceptAction(params) {
|
|
5
|
+
function findAcceptAction(params, options) {
|
|
6
6
|
return async (repos) => {
|
|
7
|
-
//
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// 非同期アクションに対応(2026-07-28~)
|
|
8
|
+
const { useAsyncAction } = options;
|
|
9
|
+
let task;
|
|
10
|
+
if (useAsyncAction) {
|
|
11
|
+
// まず非同期アクションを参照
|
|
12
|
+
task = await repos.asyncAction.findAsyncActionById({
|
|
13
|
+
id: { $eq: params.sameAs.id },
|
|
14
|
+
project: { id: { $eq: params.project.id } },
|
|
15
|
+
name: factory_1.factory.taskName.PublishPaymentUrl
|
|
16
|
+
}, ['status', 'executionResults']);
|
|
17
|
+
}
|
|
18
|
+
// 非同期アクションが存在しなければタスクを参照
|
|
19
|
+
if (task === undefined) {
|
|
20
|
+
task = await repos.task.findTaskById({
|
|
21
|
+
id: { $eq: params.sameAs.id },
|
|
22
|
+
project: { id: { $eq: params.project.id } },
|
|
23
|
+
name: factory_1.factory.taskName.PublishPaymentUrl
|
|
24
|
+
}, ['status', 'executionResults']);
|
|
25
|
+
}
|
|
15
26
|
if (task === undefined) {
|
|
16
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.PublishPaymentUrl);
|
|
17
28
|
}
|
|
@@ -42,12 +53,20 @@ function findAcceptAction(params) {
|
|
|
42
53
|
if (acceptAction.purpose?.id !== params.purpose.id) {
|
|
43
54
|
throw new factory_1.factory.errors.NotFound('Action');
|
|
44
55
|
}
|
|
45
|
-
|
|
56
|
+
// result.paymentUrl廃止につき、paymentUrlはrecipeを参照する(2026-07-14~)
|
|
57
|
+
// const acceptActionWithResult = await repos.acceptPayAction.findById(
|
|
58
|
+
// { id: acceptAction.id, typeOf: factory.actionType.AcceptAction },
|
|
59
|
+
// ['result', 'object'],
|
|
60
|
+
// []
|
|
61
|
+
// ) as Pick<factory.action.accept.pay.IAction, 'result' | 'object'>;
|
|
62
|
+
const acceptPayResult = await repos.acceptPayAction.findPaymentUrlById({
|
|
63
|
+
project: { id: params.project.id },
|
|
64
|
+
id: acceptAction.id
|
|
65
|
+
});
|
|
46
66
|
action = {
|
|
47
67
|
id: acceptAction.id,
|
|
48
68
|
actionStatus: acceptAction.actionStatus,
|
|
49
|
-
// add object.transactionNumber(2025-08-26~)
|
|
50
|
-
object: { transactionNumber: acceptActionWithResult.object.transactionNumber },
|
|
69
|
+
object: { transactionNumber: acceptPayResult.paymentMethodId }, // add object.transactionNumber(2025-08-26~)
|
|
51
70
|
...(acceptAction.error !== undefined)
|
|
52
71
|
? {
|
|
53
72
|
error: (Array.isArray(acceptAction.error))
|
|
@@ -55,11 +74,11 @@ function findAcceptAction(params) {
|
|
|
55
74
|
: acceptAction.error
|
|
56
75
|
}
|
|
57
76
|
: undefined,
|
|
58
|
-
...(
|
|
77
|
+
...(typeof acceptPayResult.paymentUrl === 'string')
|
|
59
78
|
? {
|
|
60
79
|
result: {
|
|
61
|
-
paymentMethodId:
|
|
62
|
-
paymentUrl:
|
|
80
|
+
paymentMethodId: acceptPayResult.paymentMethodId,
|
|
81
|
+
paymentUrl: acceptPayResult.paymentUrl
|
|
63
82
|
}
|
|
64
83
|
}
|
|
65
84
|
: undefined
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { AuthorizePaymentMethodActionRepo } from '../../../repo/action/authorizePaymentMethod';
|
|
3
|
+
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
3
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
5
|
interface IFindAuthorizeActionResult {
|
|
5
6
|
/**
|
|
@@ -20,6 +21,7 @@ interface IFindAuthorizeActionResult {
|
|
|
20
21
|
}
|
|
21
22
|
interface IFindAuthorizeActionRepos {
|
|
22
23
|
authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
|
|
24
|
+
asyncAction: AsyncActionRepo;
|
|
23
25
|
task: TaskRepo;
|
|
24
26
|
}
|
|
25
27
|
declare function findAuthorizeAction(params: {
|
|
@@ -38,5 +40,7 @@ declare function findAuthorizeAction(params: {
|
|
|
38
40
|
*/
|
|
39
41
|
id: string;
|
|
40
42
|
};
|
|
43
|
+
}, options: {
|
|
44
|
+
useAsyncAction: boolean;
|
|
41
45
|
}): (repos: IFindAuthorizeActionRepos) => Promise<IFindAuthorizeActionResult>;
|
|
42
46
|
export { IFindAuthorizeActionRepos, findAuthorizeAction, };
|
|
@@ -2,16 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findAuthorizeAction = findAuthorizeAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findAuthorizeAction(params) {
|
|
5
|
+
function findAuthorizeAction(params, options) {
|
|
6
6
|
return async (repos) => {
|
|
7
|
-
//
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// 非同期アクションに対応(2026-07-28~)
|
|
8
|
+
const { useAsyncAction } = options;
|
|
9
|
+
let task;
|
|
10
|
+
if (useAsyncAction) {
|
|
11
|
+
// まず非同期アクションを参照
|
|
12
|
+
task = await repos.asyncAction.findAsyncActionById({
|
|
13
|
+
id: { $eq: params.sameAs.id },
|
|
14
|
+
project: { id: { $eq: params.project.id } },
|
|
15
|
+
name: factory_1.factory.taskName.AuthorizePayment
|
|
16
|
+
}, ['status', 'executionResults']);
|
|
17
|
+
}
|
|
18
|
+
// 非同期アクションが存在しなければタスクを参照
|
|
19
|
+
if (task === undefined) {
|
|
20
|
+
task = await repos.task.findTaskById({
|
|
21
|
+
id: { $eq: params.sameAs.id },
|
|
22
|
+
project: { id: { $eq: params.project.id } },
|
|
23
|
+
name: factory_1.factory.taskName.AuthorizePayment
|
|
24
|
+
}, ['status', 'executionResults']);
|
|
25
|
+
}
|
|
15
26
|
if (task === undefined) {
|
|
16
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.AuthorizePayment);
|
|
17
28
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { CheckMovieTicketActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action/checkMovieTicket';
|
|
3
|
+
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
3
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
5
|
interface IFindCheckActionRepos {
|
|
5
6
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
7
|
+
asyncAction: AsyncActionRepo;
|
|
6
8
|
task: TaskRepo;
|
|
7
9
|
}
|
|
8
10
|
interface IFindCheckActionResult {
|
|
@@ -41,5 +43,7 @@ declare function findCheckAction(params: {
|
|
|
41
43
|
*/
|
|
42
44
|
id: string;
|
|
43
45
|
};
|
|
46
|
+
}, options: {
|
|
47
|
+
useAsyncAction: boolean;
|
|
44
48
|
}): (repos: IFindCheckActionRepos) => Promise<IFindCheckActionResult>;
|
|
45
49
|
export { IFindCheckActionRepos, findCheckAction, };
|
|
@@ -2,16 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findCheckAction = findCheckAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findCheckAction(params) {
|
|
5
|
+
function findCheckAction(params, options) {
|
|
6
6
|
return async (repos) => {
|
|
7
|
-
//
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// 非同期アクションに対応(2026-07-28~)
|
|
8
|
+
const { useAsyncAction } = options;
|
|
9
|
+
let task;
|
|
10
|
+
if (useAsyncAction) {
|
|
11
|
+
// まず非同期アクションを参照
|
|
12
|
+
task = await repos.asyncAction.findAsyncActionById({
|
|
13
|
+
id: { $eq: params.sameAs.id },
|
|
14
|
+
project: { id: { $eq: params.project.id } },
|
|
15
|
+
name: factory_1.factory.taskName.CheckMovieTicket
|
|
16
|
+
}, ['status', 'executionResults']);
|
|
17
|
+
}
|
|
18
|
+
// 非同期アクションが存在しなければタスクを参照
|
|
19
|
+
if (task === undefined) {
|
|
20
|
+
task = await repos.task.findTaskById({
|
|
21
|
+
id: { $eq: params.sameAs.id },
|
|
22
|
+
project: { id: { $eq: params.project.id } },
|
|
23
|
+
name: factory_1.factory.taskName.CheckMovieTicket
|
|
24
|
+
}, ['status', 'executionResults']);
|
|
25
|
+
}
|
|
15
26
|
if (task === undefined) {
|
|
16
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.CheckMovieTicket);
|
|
17
28
|
}
|
|
@@ -6,6 +6,7 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
|
6
6
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
7
7
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
8
8
|
import type { TaskRepo } from '../../../repo/task';
|
|
9
|
+
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
9
10
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
10
11
|
interface IInvalidatePaymentUrlRepos {
|
|
11
12
|
accountingReport: AccountingReportRepo;
|
|
@@ -16,6 +17,7 @@ interface IInvalidatePaymentUrlRepos {
|
|
|
16
17
|
paymentService: PaymentServiceRepo;
|
|
17
18
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
18
19
|
task: TaskRepo;
|
|
20
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
19
21
|
placeOrder: PlaceOrderRepo;
|
|
20
22
|
}
|
|
21
23
|
/**
|