@chevre/domain 25.2.0-alpha.9 → 26.0.0-alpha.1
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/adminScheduledTask.d.ts +20 -0
- package/lib/chevre/repo/adminScheduledTask.js +95 -0
- 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 +25 -0
- package/lib/chevre/repository.js +57 -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
|
@@ -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
|
/**
|
|
@@ -25,14 +25,6 @@ function invalidatePaymentUrl(params) {
|
|
|
25
25
|
// }
|
|
26
26
|
// support multiple accept actions(2025-02-25~)
|
|
27
27
|
let acceptPayActions = await repos.acceptPayAction.findAcceptActionsByPurpose({
|
|
28
|
-
// project: { id: { $eq: transaction.project.id } },
|
|
29
|
-
// typeOf: { $eq: factory.actionType.AcceptAction },
|
|
30
|
-
// // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }, // all statuses(2025-02-26~)
|
|
31
|
-
// purpose: { id: { $in: [transaction.id] } },
|
|
32
|
-
// object: {
|
|
33
|
-
// // transactionNumber: { $eq: paymentMethodIdByPaymentUrl },
|
|
34
|
-
// typeOf: { $eq: factory.assetTransactionType.Pay }
|
|
35
|
-
// }
|
|
36
28
|
project: { id: transaction.project.id },
|
|
37
29
|
purpose: { id: transaction.id },
|
|
38
30
|
}, ['object']);
|
|
@@ -43,9 +35,10 @@ function invalidatePaymentUrl(params) {
|
|
|
43
35
|
// support OrderCanceled(2025-02-25~)
|
|
44
36
|
const orderCancelled = params.purpose.result?.order?.orderStatus === factory_1.factory.orderStatus.OrderCancelled;
|
|
45
37
|
if (!orderCancelled) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
// 確定取引の場合、注文に紐づいた決済方法IDは除外しなければいけない
|
|
39
|
+
const paymentMethodIdByTransaction = await repos.orderInTransaction.findPaymentMethodId({ id: transaction.id });
|
|
40
|
+
if (typeof paymentMethodIdByTransaction === 'string') {
|
|
41
|
+
acceptPayActions = acceptPayActions.filter(({ object }) => object.transactionNumber !== paymentMethodIdByTransaction);
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
44
|
break;
|
|
@@ -104,62 +97,7 @@ function invalidatePaymentUrl(params) {
|
|
|
104
97
|
}
|
|
105
98
|
}
|
|
106
99
|
if (invalidatePaymentUrlTasks.length > 0) {
|
|
107
|
-
await repos.task.saveMany(invalidatePaymentUrlTasks
|
|
100
|
+
await repos.task.saveMany(invalidatePaymentUrlTasks);
|
|
108
101
|
}
|
|
109
|
-
// const paymentMethodIdByPaymentUrl = transaction.object.paymentMethods?.paymentMethodId;
|
|
110
|
-
// if (typeof paymentMethodIdByPaymentUrl === 'string' && paymentMethodIdByPaymentUrl.length > 0) {
|
|
111
|
-
// const acceptPayAction = (<Pick<IAcceptPayAction, 'object'>[]>await repos.action.search(
|
|
112
|
-
// {
|
|
113
|
-
// limit: 1,
|
|
114
|
-
// page: 1,
|
|
115
|
-
// project: { id: { $eq: transaction.project.id } },
|
|
116
|
-
// typeOf: { $eq: factory.actionType.AcceptAction },
|
|
117
|
-
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
118
|
-
// purpose: { id: { $in: [transaction.id] } },
|
|
119
|
-
// object: {
|
|
120
|
-
// transactionNumber: { $eq: paymentMethodIdByPaymentUrl },
|
|
121
|
-
// typeOf: { $eq: factory.assetTransactionType.Pay }
|
|
122
|
-
// }
|
|
123
|
-
// },
|
|
124
|
-
// ['object']
|
|
125
|
-
// )).shift();
|
|
126
|
-
// if (acceptPayAction !== undefined) {
|
|
127
|
-
// // const paymentMethodType = transaction.object.paymentMethods?.typeOf;
|
|
128
|
-
// const paymentMethodType = acceptPayAction.object.object.paymentMethod.identifier;
|
|
129
|
-
// if (typeof paymentMethodType === 'string' && paymentMethodType.length > 0) {
|
|
130
|
-
// // chevreで決済URL無効化
|
|
131
|
-
// await PayTransactionService.invalidatePaymentUrl({
|
|
132
|
-
// project: transaction.project,
|
|
133
|
-
// typeOf: factory.actionType.RefundAction,
|
|
134
|
-
// agent: {
|
|
135
|
-
// typeOf: transaction.seller.typeOf,
|
|
136
|
-
// name: (typeof transaction.seller.name === 'string')
|
|
137
|
-
// ? transaction.seller.name
|
|
138
|
-
// : String(transaction.seller.name?.ja),
|
|
139
|
-
// id: transaction.seller.id
|
|
140
|
-
// },
|
|
141
|
-
// recipient: {
|
|
142
|
-
// typeOf: transaction.agent.typeOf,
|
|
143
|
-
// id: transaction.agent.id,
|
|
144
|
-
// name: transaction.agent.name
|
|
145
|
-
// },
|
|
146
|
-
// object: [{
|
|
147
|
-
// typeOf: factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
148
|
-
// id: acceptPayAction.object.object.id,
|
|
149
|
-
// paymentMethod: {
|
|
150
|
-
// additionalProperty: [],
|
|
151
|
-
// name: paymentMethodType,
|
|
152
|
-
// typeOf: paymentMethodType,
|
|
153
|
-
// paymentMethodId: paymentMethodIdByPaymentUrl
|
|
154
|
-
// },
|
|
155
|
-
// refundFee: 0
|
|
156
|
-
// }],
|
|
157
|
-
// purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
158
|
-
// instrument: [],
|
|
159
|
-
// ...(typeof params.sameAs?.id === 'string') ? { sameAs: params.sameAs } : undefined
|
|
160
|
-
// })(repos, settings);
|
|
161
|
-
// }
|
|
162
|
-
// }
|
|
163
|
-
// }
|
|
164
102
|
};
|
|
165
103
|
}
|
|
@@ -133,7 +133,7 @@ function onRefundActionCompletedOrFailed(refundAction) {
|
|
|
133
133
|
}));
|
|
134
134
|
}
|
|
135
135
|
// タスク保管
|
|
136
|
-
await repos.task.saveMany(taskAttributes
|
|
136
|
+
await repos.task.saveMany(taskAttributes);
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
139
|
throw new factory_1.factory.errors.NotImplemented(`actionStatus ${refundAction.actionStatus} not implemented`);
|
|
@@ -7,6 +7,7 @@ import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
|
7
7
|
import type { EventRepo } from '../../../repo/event';
|
|
8
8
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
10
|
+
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
10
11
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
11
12
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
12
13
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
@@ -22,6 +23,7 @@ interface IPublishPaymentUrlRepos {
|
|
|
22
23
|
event: EventRepo;
|
|
23
24
|
eventSeries: EventSeriesRepo;
|
|
24
25
|
issuer: IssuerRepo;
|
|
26
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
25
27
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
26
28
|
paymentService: PaymentServiceRepo;
|
|
27
29
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
@@ -58,5 +60,7 @@ declare function publishPaymentUrl(params: {
|
|
|
58
60
|
*/
|
|
59
61
|
identifier?: string;
|
|
60
62
|
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
63
|
+
}, options: {
|
|
64
|
+
savePaymentMethodIdInTransaction: boolean;
|
|
61
65
|
}): IPublishPaymentUrlOperation<Pick<PayTransactionService.IPublishPaymentUrlResult, 'paymentMethodId' | 'paymentUrl'>>;
|
|
62
66
|
export { IPublishPaymentUrlRepos, publishPaymentUrl };
|
|
@@ -41,7 +41,7 @@ const factory_2 = require("./factory");
|
|
|
41
41
|
/**
|
|
42
42
|
* 外部決済ロケーションを発行する
|
|
43
43
|
*/
|
|
44
|
-
function publishPaymentUrl(params) {
|
|
44
|
+
function publishPaymentUrl(params, options) {
|
|
45
45
|
return async (repos, settings) => {
|
|
46
46
|
const { paymentServiceType, purpose, project } = params;
|
|
47
47
|
if (purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
|
|
@@ -104,24 +104,10 @@ function publishPaymentUrl(params) {
|
|
|
104
104
|
executor: (typeof taskId === 'string') ? { id: taskId } : {} // タスク関連付け(2024-05-22~)
|
|
105
105
|
})(repos, settings);
|
|
106
106
|
// 取引に保管
|
|
107
|
-
|
|
108
|
-
// typeOf: params.object.paymentMethod, // discontinue(2024-06-05~)
|
|
109
|
-
paymentMethodId: result.paymentMethodId
|
|
110
|
-
// paymentUrl: result.paymentUrl, // migrate to recipe(2024-06-05~)
|
|
111
|
-
// issuedThrough: {
|
|
112
|
-
// id: (typeof startParams.object.id === 'string') ? startParams.object.id : ''
|
|
113
|
-
// } // migrate to acceptAction(2024-06-05~)
|
|
114
|
-
// GMO IFを保管(2024-01-01~)
|
|
115
|
-
// entryTranArgs: result.entryTranArgs, // migrate to recipe(2024-06-05~)
|
|
116
|
-
// entryTranResult: result.entryTranResult, // migrate to recipe(2024-06-05~)
|
|
117
|
-
// execTranArgs: result.execTranArgs, // migrate to recipe(2024-06-05~)
|
|
118
|
-
// execTranResult: result.execTranResult, // migrate to recipe(2024-06-05~)
|
|
119
|
-
// paymentMethod: startParams.object.paymentMethod // 拡張(2024-01-04~) // migrate to acceptAction(2024-06-05~)
|
|
120
|
-
};
|
|
121
|
-
await repos.placeOrder.findByIdAndUpdateInProgress({
|
|
107
|
+
await repos.orderInTransaction.savePaymentMethodId({
|
|
122
108
|
id: transaction.id,
|
|
123
|
-
|
|
124
|
-
});
|
|
109
|
+
paymentMethod: { paymentMethodId: result.paymentMethodId }
|
|
110
|
+
}, options);
|
|
125
111
|
return {
|
|
126
112
|
paymentMethodId: result.paymentMethodId,
|
|
127
113
|
paymentUrl: result.paymentUrl
|
|
@@ -7,6 +7,7 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
|
7
7
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
8
8
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
9
9
|
import type { TaskRepo } from '../../../repo/task';
|
|
10
|
+
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
10
11
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
11
12
|
/**
|
|
12
13
|
* 決済承認中止
|
|
@@ -29,6 +30,7 @@ declare function voidPayTransaction(params: factory.task.IData<factory.taskName.
|
|
|
29
30
|
paymentService: PaymentServiceRepo;
|
|
30
31
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
31
32
|
task: TaskRepo;
|
|
33
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
32
34
|
placeOrder: PlaceOrderRepo;
|
|
33
35
|
}) => Promise<void>;
|
|
34
36
|
export { voidPayTransaction, };
|
|
@@ -8,29 +8,7 @@ const processVoidPayTransaction_1 = require("./processVoidPayTransaction");
|
|
|
8
8
|
* タスクから決済承認を取り消す
|
|
9
9
|
*/
|
|
10
10
|
function voidPayTransaction(params) {
|
|
11
|
-
return async (repos
|
|
12
|
-
// settings: Settings
|
|
13
|
-
) => {
|
|
14
|
-
// 決済承認アクション確認不要(2024-03-12~)
|
|
15
|
-
// 決済承認アクションを検索
|
|
16
|
-
// let authorizeActions = <factory.action.authorize.paymentMethod.any.IAction[]>
|
|
17
|
-
// await repos.action.searchByPurpose({
|
|
18
|
-
// typeOf: factory.actionType.AuthorizeAction,
|
|
19
|
-
// purpose: {
|
|
20
|
-
// typeOf: params.purpose.typeOf,
|
|
21
|
-
// id: params.purpose.id
|
|
22
|
-
// }
|
|
23
|
-
// });
|
|
24
|
-
// authorizeActions = authorizeActions.filter(
|
|
25
|
-
// (a) => a.object.typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
26
|
-
// );
|
|
27
|
-
// // Chevreを使用した承認を取り消し
|
|
28
|
-
// const authorizeActionsWithChevre = authorizeActions.filter((a) => {
|
|
29
|
-
// return a.instrument?.identifier === factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre;
|
|
30
|
-
// });
|
|
31
|
-
// if (authorizeActionsWithChevre.length > 0) {
|
|
32
|
-
// await processVoidPayTransaction(params)(repos);
|
|
33
|
-
// }
|
|
11
|
+
return async (repos) => {
|
|
34
12
|
await (0, processVoidPayTransaction_1.processVoidPayTransaction)(params)(repos);
|
|
35
13
|
// 決済URL無効化もここで処理
|
|
36
14
|
await (0, invalidatePaymentUrl_1.invalidatePaymentUrl)(params)(repos);
|
|
@@ -26,7 +26,7 @@ declare function processAuthorizeCreditCard(params: {
|
|
|
26
26
|
callbackType3ds?: factory.service.paymentService.ICallbackType3ds;
|
|
27
27
|
orderId: string;
|
|
28
28
|
availableChannel: Pick<factory.serviceChannel.IServiceChannelCreditCard, 'credentials' | 'serviceUrl'>;
|
|
29
|
-
object: factory.assetTransaction.pay.
|
|
29
|
+
object: factory.assetTransaction.pay.IPaymentMethodWithoutDetail;
|
|
30
30
|
/**
|
|
31
31
|
* 決済URL発行処理かどうか
|
|
32
32
|
*/
|
|
@@ -15,6 +15,9 @@ function processAuthorizeCreditCard(params) {
|
|
|
15
15
|
// const { cardSeq, memberId } = creditCard as IUnauthorizedCardOfMember; // 会員カード廃止(2026-04-07~)
|
|
16
16
|
const { cardNo, cardPass, expire } = creditCard;
|
|
17
17
|
const { token } = creditCard;
|
|
18
|
+
if (typeof params.object.amount !== 'number') {
|
|
19
|
+
throw new factory_1.factory.errors.Argument('object.amount', 'must be number');
|
|
20
|
+
}
|
|
18
21
|
const retUrl = creditCard?.retUrl;
|
|
19
22
|
// 3DS拡張(2024-01-02~)
|
|
20
23
|
if (params.processPublishPaymentUrl === true && typeof retUrl === 'string' && retUrl.length > 0) {
|
|
@@ -32,13 +35,8 @@ function processAuthorizeCreditCard(params) {
|
|
|
32
35
|
entryTranArgs = {
|
|
33
36
|
shopId, shopPass, orderId,
|
|
34
37
|
jobCd: gmo_service_1.GMO.factory.util.JobCd.Auth,
|
|
35
|
-
amount:
|
|
36
|
-
? params.object.amount
|
|
37
|
-
: params.object.amount.value,
|
|
38
|
-
// siteId: params.availableChannel.credentials?.siteId,
|
|
39
|
-
// sitePass: params.availableChannel.credentials?.sitePass,
|
|
38
|
+
amount: params.object.amount,
|
|
40
39
|
tdFlag: gmo_service_1.GMO.factory.util.TdFlag.Version2,
|
|
41
|
-
// tdTenantName: '',
|
|
42
40
|
tds2Type: gmo_service_1.GMO.factory.util.Tds2Type.Error
|
|
43
41
|
};
|
|
44
42
|
entryTranResult = await repos.creditCardService.entryTran(entryTranArgs);
|
|
@@ -65,9 +63,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
65
63
|
entryTranArgs = {
|
|
66
64
|
shopId, shopPass, orderId,
|
|
67
65
|
jobCd: gmo_service_1.GMO.factory.util.JobCd.Auth,
|
|
68
|
-
amount:
|
|
69
|
-
? params.object.amount
|
|
70
|
-
: params.object.amount.value,
|
|
66
|
+
amount: params.object.amount,
|
|
71
67
|
siteId: params.availableChannel.credentials?.siteId,
|
|
72
68
|
sitePass: params.availableChannel.credentials?.sitePass
|
|
73
69
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { factory } from '../../factory';
|
|
2
|
+
import type { IKeyOfProjection, ReservationRepo } from '../../repo/reservation';
|
|
3
|
+
/**
|
|
4
|
+
* 予約検索レスポンスとしての予約
|
|
5
|
+
*/
|
|
6
|
+
type IReservationAsFindResult = Pick<factory.reservation.eventReservation.IReservation, 'additionalTicketText' | 'attended' | 'bookingTime' | 'checkedIn' | 'id' | 'reservationFor' | 'reservationNumber' | 'reservationStatus' | 'reservedTicket'>;
|
|
7
|
+
/**
|
|
8
|
+
* 管理者による予約検索
|
|
9
|
+
*/
|
|
10
|
+
export declare function adminFindReservations(params: factory.reservation.eventReservation.ISearchConditions, options: {
|
|
11
|
+
inclusion: Partial<Record<IKeyOfProjection, 1>>;
|
|
12
|
+
}): (repos: {
|
|
13
|
+
reservation: ReservationRepo;
|
|
14
|
+
}) => Promise<IReservationAsFindResult[]>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adminFindReservations = adminFindReservations;
|
|
4
|
+
/**
|
|
5
|
+
* 管理者による予約検索
|
|
6
|
+
*/
|
|
7
|
+
function adminFindReservations(params, options) {
|
|
8
|
+
return async (repos) => {
|
|
9
|
+
const { inclusion } = options;
|
|
10
|
+
const rawReservations = await repos.reservation.findReservations(params, inclusion);
|
|
11
|
+
if (rawReservations.length === 0) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// const requireUnderName = Object.keys(inclusion).includes('underName');
|
|
16
|
+
// const requireReservedTicket = Object.keys(inclusion).includes('reservedTicket');
|
|
17
|
+
// const requireReservationFor = Object.keys(inclusion).includes('reservationFor');
|
|
18
|
+
// const reservationIds = rawReservations.map(({ id }) => id);
|
|
19
|
+
// const subReservations = await repos.assetTransaction.reserve.findSubReservationsById({
|
|
20
|
+
// ids: reservationIds
|
|
21
|
+
// });
|
|
22
|
+
return rawReservations.map((reservation) => {
|
|
23
|
+
// const subReservationByTransaction = subReservations.find((s) => s.id === reservation.id);
|
|
24
|
+
// const underNameByTransaction = subReservationByTransaction?.underName;
|
|
25
|
+
const { reservationFor, issuedThrough: _issuedThrough, priceCurrency: _priceCurrency, numSeats: _numSeats, reservedTicket, ...rawReservation4result } = reservation;
|
|
26
|
+
return {
|
|
27
|
+
...rawReservation4result, // 予約ドキュメントはそのまま返す
|
|
28
|
+
reservedTicket, // 予約検索レスポンスからticketTypeは廃止(2026-06-01~)
|
|
29
|
+
reservationFor // 予約検索レスポンスのreservationForはそのまま返す(2026-06-01~)
|
|
30
|
+
// ...(requireUnderName && underNameByTransaction !== undefined) ? { underName: underNameByTransaction } : undefined, // underNameがあれば上書き
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -81,7 +81,7 @@ reservationFor, cancelAction) {
|
|
|
81
81
|
}
|
|
82
82
|
// タスク保管
|
|
83
83
|
if (taskAttributes.length > 0) {
|
|
84
|
-
await repos.task.saveMany(taskAttributes
|
|
84
|
+
await repos.task.saveMany(taskAttributes);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
if (typeof reservationFor?.id === 'string') {
|
|
@@ -88,7 +88,7 @@ function onReservationCheckedIn(params) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
if (tasks.length > 0) {
|
|
91
|
-
await repos.task.saveMany(tasks
|
|
91
|
+
await repos.task.saveMany(tasks);
|
|
92
92
|
}
|
|
93
93
|
// create AggregateScreeningEvent task -> migrate to agg(2024-10-29~)
|
|
94
94
|
};
|