@chevre/domain 21.2.0-alpha.12 → 21.2.0-alpha.120
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/example/src/chevre/aggregateEventReservation.ts +1 -1
- package/example/src/chevre/aggregation/aggregateSystem.ts +85 -27
- package/example/src/chevre/countDelayedTasks.ts +7 -2
- package/example/src/chevre/deleteTasksByName.ts +10 -2
- package/example/src/chevre/findMovieTheaterById.ts +40 -0
- package/example/src/chevre/importEventsFromCOA.ts +3 -4
- package/example/src/chevre/lockStockHolder.ts +2 -1
- package/example/src/chevre/migrateOrderAdditionalProperties.ts +85 -0
- package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +79 -0
- package/example/src/chevre/migrateStockHolderKeys.ts +1 -1
- package/example/src/chevre/processPay.ts +5 -1
- package/example/src/chevre/processRegisterMembership.ts +8 -4
- package/example/src/chevre/processRegisterPaymentCard.ts +8 -4
- package/example/src/chevre/processReserve.ts +5 -2
- package/example/src/chevre/saveTasks.ts +13 -10
- package/example/src/chevre/searchAbortedTasks.ts +36 -0
- package/example/src/chevre/searchActions.ts +33 -0
- package/example/src/chevre/searchEventSeats.ts +2 -1
- package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +37 -1
- package/example/src/chevre/searchSendEmailActions.ts +44 -0
- package/example/src/chevre/task/executeTasks.ts +26 -0
- package/example/src/chevre/transaction/findCreditCard.ts +1 -1
- package/example/src/chevre/transaction/orderMembershipService.ts +1 -1
- package/example/src/chevre/transaction/processReturnOrder.ts +40 -0
- package/example/src/chevre/transaction/startExportTasks.ts +20 -0
- package/example/src/chevre/updateScreeningRoom.ts +41 -0
- package/example/src/chevre/updateTransaction.ts +1 -1
- package/example/src/playOnMoment.ts +24 -0
- package/lib/chevre/credentials.d.ts +1 -0
- package/lib/chevre/credentials.js +2 -1
- package/lib/chevre/eventEmitter/assetTransaction.d.ts +21 -0
- package/lib/chevre/eventEmitter/assetTransaction.js +25 -0
- package/lib/chevre/eventEmitter/task.d.ts +18 -0
- package/lib/chevre/eventEmitter/task.js +25 -0
- package/lib/chevre/eventEmitter/transaction.d.ts +21 -0
- package/lib/chevre/eventEmitter/transaction.js +25 -0
- package/lib/chevre/eventEmitter.d.ts +4 -0
- package/lib/chevre/eventEmitter.js +9 -0
- package/lib/chevre/index.d.ts +3 -2
- package/lib/chevre/index.js +5 -3
- package/lib/chevre/repo/account.js +3 -2
- package/lib/chevre/repo/accountTransaction.d.ts +3 -11
- package/lib/chevre/repo/accountTransaction.js +3 -55
- package/lib/chevre/repo/action.d.ts +42 -2
- package/lib/chevre/repo/action.js +130 -57
- package/lib/chevre/repo/additionalProperty.js +2 -1
- package/lib/chevre/repo/aggregation.d.ts +3 -0
- package/lib/chevre/repo/aggregation.js +3 -0
- package/lib/chevre/repo/assetTransaction.d.ts +25 -9
- package/lib/chevre/repo/assetTransaction.js +259 -87
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/categoryCode.js +37 -25
- package/lib/chevre/repo/code.js +3 -2
- package/lib/chevre/repo/comment.d.ts +4 -1
- package/lib/chevre/repo/comment.js +22 -6
- package/lib/chevre/repo/confirmationNumber.d.ts +0 -1
- package/lib/chevre/repo/confirmationNumber.js +3 -15
- package/lib/chevre/repo/creativeWork.d.ts +2 -4
- package/lib/chevre/repo/creativeWork.js +35 -12
- package/lib/chevre/repo/customer.js +2 -1
- package/lib/chevre/repo/emailMessage.d.ts +1 -27
- package/lib/chevre/repo/emailMessage.js +2 -1
- package/lib/chevre/repo/event.d.ts +27 -1
- package/lib/chevre/repo/event.js +67 -33
- package/lib/chevre/repo/member.js +4 -3
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -3
- package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +4 -2
- package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +29 -3
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +31 -3
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +13 -3
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +43 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +19 -1
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +17 -3
- package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +4 -2
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +44 -3
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +32 -19
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +19 -3
- package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +25 -3
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +27 -3
- package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +43 -3
- package/lib/chevre/repo/mongoose/schemas/customer.d.ts +25 -3
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +21 -3
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +71 -3
- package/lib/chevre/repo/mongoose/schemas/holdReservation.d.ts +75 -0
- package/lib/chevre/repo/mongoose/schemas/holdReservation.js +56 -0
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +13 -3
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +21 -3
- package/lib/chevre/repo/mongoose/schemas/offer.d.ts +65 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +27 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +74 -0
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +45 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +51 -3
- package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +25 -3
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +49 -3
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +29 -3
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +31 -3
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +23 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +63 -5
- package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +31 -3
- package/lib/chevre/repo/mongoose/schemas/seller.js +6 -0
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +30 -3
- package/lib/chevre/repo/mongoose/schemas/task.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +21 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +40 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +11 -3
- package/lib/chevre/repo/offer.js +3 -2
- package/lib/chevre/repo/offerCatalog.js +0 -27
- package/lib/chevre/repo/offerItemCondition.d.ts +22 -0
- package/lib/chevre/repo/offerItemCondition.js +121 -0
- package/lib/chevre/repo/order.d.ts +55 -3
- package/lib/chevre/repo/order.js +62 -10
- package/lib/chevre/repo/ownershipInfo.js +2 -7
- package/lib/chevre/repo/place.d.ts +20 -5
- package/lib/chevre/repo/place.js +63 -23
- package/lib/chevre/repo/priceSpecification.js +3 -2
- package/lib/chevre/repo/product.d.ts +1 -3
- package/lib/chevre/repo/product.js +25 -4
- package/lib/chevre/repo/project.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -4
- package/lib/chevre/repo/reservation.js +40 -59
- package/lib/chevre/repo/role.js +3 -2
- package/lib/chevre/repo/seller.d.ts +1 -1
- package/lib/chevre/repo/seller.js +44 -23
- package/lib/chevre/repo/serviceOutput.js +2 -1
- package/lib/chevre/repo/stockHolder.d.ts +35 -5
- package/lib/chevre/repo/stockHolder.js +306 -87
- package/lib/chevre/repo/task.d.ts +45 -2
- package/lib/chevre/repo/task.js +94 -15
- package/lib/chevre/repo/transaction.d.ts +23 -3
- package/lib/chevre/repo/transaction.js +177 -56
- package/lib/chevre/repo/trip.js +2 -1
- package/lib/chevre/repository.d.ts +5 -2
- package/lib/chevre/repository.js +8 -4
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +8 -6
- package/lib/chevre/service/aggregation/system.d.ts +110 -23
- package/lib/chevre/service/aggregation/system.js +213 -91
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -28
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +2 -24
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +17 -1
- package/lib/chevre/service/assetTransaction/pay.d.ts +5 -1
- package/lib/chevre/service/assetTransaction/pay.js +20 -34
- package/lib/chevre/service/assetTransaction/refund.js +2 -24
- package/lib/chevre/service/assetTransaction/registerService.js +1 -25
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +15 -5
- package/lib/chevre/service/assetTransaction/reserve/factory.js +122 -58
- package/lib/chevre/service/assetTransaction/reserve.d.ts +10 -1
- package/lib/chevre/service/assetTransaction/reserve.js +85 -69
- package/lib/chevre/service/assetTransaction.d.ts +6 -0
- package/lib/chevre/service/assetTransaction.js +9 -4
- package/lib/chevre/service/event.js +16 -5
- package/lib/chevre/service/notification/factory.js +2 -2
- package/lib/chevre/service/notification.d.ts +3 -1
- package/lib/chevre/service/notification.js +41 -7
- package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
- package/lib/chevre/service/offer/event/authorize.js +8 -2
- package/lib/chevre/service/offer/event/factory.d.ts +3 -0
- package/lib/chevre/service/offer/event/factory.js +16 -5
- package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction.js +17 -1
- package/lib/chevre/service/offer/eventServiceByCOA.js +7 -9
- package/lib/chevre/service/offer/product.js +2 -2
- package/lib/chevre/service/offer.d.ts +16 -8
- package/lib/chevre/service/offer.js +69 -8
- package/lib/chevre/service/order/deleteOrder.d.ts +3 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -8
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +5 -2
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +41 -81
- package/lib/chevre/service/order/onOrderStatusChanged.js +1 -3
- package/lib/chevre/service/order/onOrderUpdated.d.ts +16 -0
- package/lib/chevre/service/order/onOrderUpdated.js +22 -0
- package/lib/chevre/service/order/placeOrder.d.ts +1 -0
- package/lib/chevre/service/order/placeOrder.js +41 -24
- package/lib/chevre/service/order/returnOrder.d.ts +1 -0
- package/lib/chevre/service/order/returnOrder.js +7 -12
- package/lib/chevre/service/order/sendOrder.d.ts +1 -0
- package/lib/chevre/service/order/sendOrder.js +7 -10
- package/lib/chevre/service/order.d.ts +2 -1
- package/lib/chevre/service/order.js +3 -1
- package/lib/chevre/service/payment/any/onPaid.js +1 -1
- package/lib/chevre/service/payment/any/onRefund.js +1 -1
- package/lib/chevre/service/payment/any.d.ts +9 -5
- package/lib/chevre/service/payment/any.js +80 -18
- package/lib/chevre/service/payment/creditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard.js +23 -17
- package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +8 -7
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -1
- package/lib/chevre/service/payment/movieTicket/validation.d.ts +6 -6
- package/lib/chevre/service/payment/movieTicket/validation.js +55 -32
- package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
- package/lib/chevre/service/payment/movieTicket.js +7 -6
- package/lib/chevre/service/product.js +1 -5
- package/lib/chevre/service/report/telemetry.d.ts +0 -11
- package/lib/chevre/service/report/telemetry.js +21 -24
- package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
- package/lib/chevre/service/reserve/cancelReservation.js +147 -139
- package/lib/chevre/service/reserve/checkInReservation.d.ts +9 -4
- package/lib/chevre/service/reserve/checkInReservation.js +77 -3
- package/lib/chevre/service/reserve/confirmReservation.d.ts +7 -4
- package/lib/chevre/service/reserve/confirmReservation.js +133 -58
- package/lib/chevre/service/reserve/factory.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +17 -5
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +26 -24
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -31
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +7 -3
- package/lib/chevre/service/reserve/useReservation.js +61 -71
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +15 -0
- package/lib/chevre/service/reserve/verifyToken4reservation.js +56 -0
- package/lib/chevre/service/reserve.d.ts +3 -2
- package/lib/chevre/service/reserve.js +4 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.js +6 -2
- package/lib/chevre/service/task/cancelReservation.js +1 -1
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -1
- package/lib/chevre/service/task/deleteTransaction.js +10 -8
- package/lib/chevre/service/task/importOffersFromCOA.js +4 -0
- package/lib/chevre/service/task/onAuthorizationCreated.d.ts +7 -0
- package/lib/chevre/service/task/onAuthorizationCreated.js +108 -0
- package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
- package/lib/chevre/service/task/{deleteOrder.js → onEventChanged.js} +8 -14
- package/lib/chevre/service/task/onResourceUpdated.d.ts +7 -0
- package/lib/chevre/service/task/onResourceUpdated.js +352 -0
- package/lib/chevre/service/task/placeOrder.js +1 -1
- package/lib/chevre/service/task/reserve.js +10 -7
- package/lib/chevre/service/task/returnOrder.js +1 -1
- package/lib/chevre/service/task/returnPayTransaction.js +2 -12
- package/lib/chevre/service/task/sendOrder.js +1 -1
- package/lib/chevre/service/task/useReservation.d.ts +7 -0
- package/lib/chevre/service/task/useReservation.js +36 -0
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
- package/lib/chevre/service/task.d.ts +9 -0
- package/lib/chevre/service/task.js +43 -4
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +21 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +232 -0
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +11 -1
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer/factory.js +3 -1
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -0
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.js +10 -13
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership.js +7 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +42 -30
- package/lib/chevre/service/transaction/placeOrder.js +1 -5
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +3 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +7 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +2 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +23 -17
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -3
- package/lib/chevre/service/transaction/placeOrderInProgress.js +28 -15
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +10 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +25 -17
- package/lib/chevre/service/transaction/returnOrder.d.ts +4 -0
- package/lib/chevre/service/transaction/returnOrder.js +228 -36
- package/lib/chevre/service/transaction.d.ts +8 -13
- package/lib/chevre/service/transaction.js +12 -145
- package/lib/chevre/settings.d.ts +12 -1
- package/lib/chevre/settings.js +53 -6
- package/package.json +5 -5
- package/example/src/chevre/createManyEventsIfNotExist.ts +0 -205
- package/example/src/chevre/eventCatalog2eventService.ts +0 -123
- package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +0 -96
- package/example/src/chevre/migrateMovieAdditionalProperties.ts +0 -98
- package/lib/chevre/service/task/deleteAssetTransaction.d.ts +0 -12
- package/lib/chevre/service/task/deleteAssetTransaction.js +0 -65
- package/lib/chevre/service/task/deleteOrder.d.ts +0 -6
|
@@ -23,7 +23,7 @@ function createOrder(params) {
|
|
|
23
23
|
];
|
|
24
24
|
const orderedItems = [...reservationOrderItems, ...moneyTransferOrderItems, ...productOrderItems];
|
|
25
25
|
// 決済方法をセット
|
|
26
|
-
const { paymentMethods, price } = createPaymentMethods({ transaction: params.transaction });
|
|
26
|
+
const { paymentMethods, price } = createPaymentMethods({ transaction: params.transaction, authorizeActions: params.authorizeActions });
|
|
27
27
|
const discounts = [];
|
|
28
28
|
const name = (typeof params.transaction.object.name === 'string') ? params.transaction.object.name : undefined;
|
|
29
29
|
const broker = (typeof ((_a = params.transaction.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? params.transaction.object.broker : undefined;
|
|
@@ -62,7 +62,7 @@ function createCustomer(params) {
|
|
|
62
62
|
function createPaymentMethods(params) {
|
|
63
63
|
const paymentMethods = [];
|
|
64
64
|
let price = 0;
|
|
65
|
-
const authorizePaymentActions = params.
|
|
65
|
+
const authorizePaymentActions = params.authorizeActions
|
|
66
66
|
.filter((a) => {
|
|
67
67
|
var _a;
|
|
68
68
|
return a.actionStatus === factory.actionStatusType.CompletedActionStatus
|
package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import * as factory from '../../../../factory';
|
|
|
2
2
|
/**
|
|
3
3
|
* 座席予約オファー承認に対してムビチケ承認条件が整っているかどうか検証する
|
|
4
4
|
*/
|
|
5
|
-
export declare function validateMovieTicket(paymentMethodType: string, transaction: factory.transaction.placeOrder.ITransaction): void;
|
|
5
|
+
export declare function validateMovieTicket(paymentMethodType: string, transaction: factory.transaction.placeOrder.ITransaction, authorizeActions: factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>>[]): void;
|
package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js
CHANGED
|
@@ -10,8 +10,8 @@ const debug = createDebug('cinerino-domain:service:validateMovieTicket');
|
|
|
10
10
|
/**
|
|
11
11
|
* 座席予約オファー承認に対してムビチケ承認条件が整っているかどうか検証する
|
|
12
12
|
*/
|
|
13
|
-
function validateMovieTicket(paymentMethodType, transaction) {
|
|
14
|
-
const authorizeActions = transaction.object.authorizeActions;
|
|
13
|
+
function validateMovieTicket(paymentMethodType, transaction, authorizeActions) {
|
|
14
|
+
// const authorizeActions = transaction.object.authorizeActions;
|
|
15
15
|
const authorizeMovieTicketActions = authorizeActions.filter((a) => {
|
|
16
16
|
var _a, _b, _c;
|
|
17
17
|
return a.actionStatus === factory.actionStatusType.CompletedActionStatus
|
|
@@ -7,7 +7,7 @@ export type IUnitPriceSpecification = factory.priceSpecification.IPriceSpecifica
|
|
|
7
7
|
/**
|
|
8
8
|
* 取引が確定可能な状態かどうかをチェックする
|
|
9
9
|
*/
|
|
10
|
-
export declare function validateTransaction(transaction: factory.transaction.placeOrder.ITransaction): void;
|
|
10
|
+
export declare function validateTransaction(transaction: factory.transaction.placeOrder.ITransaction, authorizeActions: factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>>[]): void;
|
|
11
11
|
export type IConfirmationNumberGenerator = (order: factory.order.IOrder) => string;
|
|
12
12
|
export type IOrderURLGenerator = (order: factory.order.IOrder) => string;
|
|
13
13
|
export type IResultOrderParams = factory.transaction.placeOrder.IResultOrderParams & {
|
|
@@ -46,4 +46,5 @@ export declare function validatePaymentMethods(params: {
|
|
|
46
46
|
export declare function validateEventOffers(params: {
|
|
47
47
|
transaction: factory.transaction.placeOrder.ITransaction;
|
|
48
48
|
order: factory.order.IOrder;
|
|
49
|
+
authorizeActions: factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>>[];
|
|
49
50
|
}): void;
|
|
@@ -13,18 +13,18 @@ const debug = createDebug('cinerino-domain:service');
|
|
|
13
13
|
/**
|
|
14
14
|
* 取引が確定可能な状態かどうかをチェックする
|
|
15
15
|
*/
|
|
16
|
-
function validateTransaction(transaction) {
|
|
16
|
+
function validateTransaction(transaction, authorizeActions) {
|
|
17
17
|
validateProfile(transaction);
|
|
18
|
-
validatePrice(transaction);
|
|
18
|
+
validatePrice(transaction, authorizeActions);
|
|
19
19
|
// 利用可能な通貨単位に対して取引検証
|
|
20
|
-
validateMonetaryAmount(
|
|
20
|
+
validateMonetaryAmount(authorizeActions);
|
|
21
21
|
// 利用可能なMovieTicketIF決済方法タイプに対して動的にコーディング
|
|
22
22
|
// 検証すべきMovieTicketIF決済方法タイプのリストは、決済承認アクションのresult.issuedThrough.typeOf: MovieTicketで抽出できるのでは?
|
|
23
|
-
const movieTicketPaymentMethodTypes = findMovieTicketPaymentMethodTypesFromTransaction(
|
|
23
|
+
const movieTicketPaymentMethodTypes = findMovieTicketPaymentMethodTypesFromTransaction(authorizeActions);
|
|
24
24
|
if (Array.isArray(movieTicketPaymentMethodTypes) && movieTicketPaymentMethodTypes.length > 0) {
|
|
25
25
|
movieTicketPaymentMethodTypes.forEach((paymentMethodType) => {
|
|
26
26
|
try {
|
|
27
|
-
(0, validateMovieTicket_1.validateMovieTicket)(paymentMethodType, transaction);
|
|
27
|
+
(0, validateMovieTicket_1.validateMovieTicket)(paymentMethodType, transaction, authorizeActions);
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
30
|
// 検証結果をlog(2022-06-04~)
|
|
@@ -35,11 +35,13 @@ function validateTransaction(transaction) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
// 決済URLが発行されている場合、検証
|
|
38
|
-
validatePaymentUrl(transaction);
|
|
38
|
+
validatePaymentUrl(transaction, authorizeActions);
|
|
39
39
|
}
|
|
40
40
|
exports.validateTransaction = validateTransaction;
|
|
41
|
-
function findMovieTicketPaymentMethodTypesFromTransaction(
|
|
42
|
-
|
|
41
|
+
function findMovieTicketPaymentMethodTypesFromTransaction(
|
|
42
|
+
// transaction: factory.transaction.placeOrder.ITransaction,
|
|
43
|
+
authorizeActions) {
|
|
44
|
+
// const authorizeActions = transaction.object.authorizeActions;
|
|
43
45
|
const authorizeMovieTicketPaymentActions = authorizeActions.filter((a) => {
|
|
44
46
|
var _a, _b;
|
|
45
47
|
return a.actionStatus === factory.actionStatusType.CompletedActionStatus
|
|
@@ -86,8 +88,8 @@ function validateProfile(transaction) {
|
|
|
86
88
|
throw new factory.errors.Argument('Transaction', 'Customer Profile Required');
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
|
-
function validatePrice(transaction) {
|
|
90
|
-
const authorizeActions = transaction.object.authorizeActions;
|
|
91
|
+
function validatePrice(transaction, authorizeActions) {
|
|
92
|
+
// const authorizeActions = transaction.object.authorizeActions;
|
|
91
93
|
let priceByAgent = 0;
|
|
92
94
|
let priceBySeller = 0;
|
|
93
95
|
// 決済承認を確認
|
|
@@ -110,9 +112,9 @@ function validatePrice(transaction) {
|
|
|
110
112
|
throw new factory.errors.Argument('Transaction', 'Transaction cannot be confirmed because prices are not matched');
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
|
-
function validatePaymentUrl(transaction) {
|
|
115
|
+
function validatePaymentUrl(transaction, authorizeActions) {
|
|
116
|
+
// const authorizeActions = transaction.object.authorizeActions;
|
|
114
117
|
var _a, _b;
|
|
115
|
-
const authorizeActions = transaction.object.authorizeActions;
|
|
116
118
|
// 決済URLが発行されている場合、検証
|
|
117
119
|
const paymentMethodId = (_a = transaction.object.paymentMethods) === null || _a === void 0 ? void 0 : _a.paymentMethodId;
|
|
118
120
|
const paymentUrl = (_b = transaction.object.paymentMethods) === null || _b === void 0 ? void 0 : _b.paymentUrl;
|
|
@@ -135,10 +137,10 @@ function validatePaymentUrl(transaction) {
|
|
|
135
137
|
/**
|
|
136
138
|
* JPY以外の通貨について取引を検証する
|
|
137
139
|
*/
|
|
138
|
-
function validateMonetaryAmount(
|
|
139
|
-
//
|
|
140
|
-
) {
|
|
141
|
-
const authorizeActions = transaction.object.authorizeActions;
|
|
140
|
+
function validateMonetaryAmount(
|
|
141
|
+
// transaction: factory.transaction.placeOrder.ITransaction,
|
|
142
|
+
authorizeActions) {
|
|
143
|
+
// const authorizeActions = transaction.object.authorizeActions;
|
|
142
144
|
const authorizeMonetaryAmountActions = authorizeActions
|
|
143
145
|
.filter((a) => {
|
|
144
146
|
var _a, _b;
|
|
@@ -216,7 +218,11 @@ exports.validatePaymentMethods = validatePaymentMethods;
|
|
|
216
218
|
* イベントオファー適用条件確認
|
|
217
219
|
*/
|
|
218
220
|
function validateEventOffers(params) {
|
|
219
|
-
const seatReservationAuthorizeActions =
|
|
221
|
+
// const seatReservationAuthorizeActions = <IAuthorizeSeatReservationOffer[]>
|
|
222
|
+
// params.transaction.object.authorizeActions
|
|
223
|
+
// .filter((a) => a.actionStatus === factory.actionStatusType.CompletedActionStatus)
|
|
224
|
+
// .filter((a) => a.object.typeOf === factory.action.authorize.offer.seatReservation.ObjectType.SeatReservation);
|
|
225
|
+
const seatReservationAuthorizeActions = params.authorizeActions
|
|
220
226
|
.filter((a) => a.actionStatus === factory.actionStatusType.CompletedActionStatus)
|
|
221
227
|
.filter((a) => a.object.typeOf === factory.action.authorize.offer.seatReservation.ObjectType.SeatReservation);
|
|
222
228
|
seatReservationAuthorizeActions.forEach((a) => {
|
|
@@ -13,6 +13,7 @@ exports.voidAward = exports.authorizeAward = exports.publishOrderNumberIfNotExis
|
|
|
13
13
|
/**
|
|
14
14
|
* 進行中注文取引サービス
|
|
15
15
|
*/
|
|
16
|
+
const moment = require("moment");
|
|
16
17
|
const factory = require("../../factory");
|
|
17
18
|
const factory_1 = require("./placeOrderInProgress/factory");
|
|
18
19
|
const potentialActions_1 = require("./placeOrderInProgress/potentialActions");
|
|
@@ -28,10 +29,12 @@ exports.POINT_AWARD_IDENTIFIER_NAME = 'pointAwardIdentifiers';
|
|
|
28
29
|
function start(params) {
|
|
29
30
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
31
|
var _a;
|
|
31
|
-
const seller = yield repos.seller.findById({ id: params.seller.id },
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const seller = yield repos.seller.findById({ id: params.seller.id }, ['name', 'project', 'typeOf', 'makesOffer'], []
|
|
33
|
+
// {
|
|
34
|
+
// hasMerchantReturnPolicy: 0,
|
|
35
|
+
// paymentAccepted: 0
|
|
36
|
+
// }
|
|
37
|
+
);
|
|
35
38
|
let makesOfferFromClient;
|
|
36
39
|
// 販売者オファー検証(2022-10-14~)
|
|
37
40
|
if (params.validateSeller === true) {
|
|
@@ -95,14 +98,15 @@ function confirm(params) {
|
|
|
95
98
|
throw new factory.errors.Forbidden('Transaction not yours');
|
|
96
99
|
}
|
|
97
100
|
// 取引に対する全ての承認アクションをマージ
|
|
98
|
-
|
|
101
|
+
const authorizeActions = yield searchAuthorizeActions(params)(repos);
|
|
102
|
+
// transaction.object.authorizeActions = authorizeActions;
|
|
99
103
|
// 注文番号を発行
|
|
100
104
|
const orderNumber = yield publishOrderNumberIfNotExist({
|
|
101
105
|
project: { id: transaction.project.id },
|
|
102
106
|
id: transaction.id,
|
|
103
107
|
object: { orderDate: params.result.order.orderDate }
|
|
104
108
|
})(repos);
|
|
105
|
-
const result = createResult(Object.assign(Object.assign({}, params), { orderNumber, transaction: transaction }));
|
|
109
|
+
const result = createResult(Object.assign(Object.assign({}, params), { orderNumber, transaction: transaction, authorizeActions }));
|
|
106
110
|
// デフォルトEメールメッセージを検索
|
|
107
111
|
let emailMessageOnOrderSent;
|
|
108
112
|
if (repos.emailMessage !== undefined) {
|
|
@@ -119,14 +123,16 @@ function confirm(params) {
|
|
|
119
123
|
order: result.order,
|
|
120
124
|
potentialActions: params.potentialActions,
|
|
121
125
|
transaction: transaction,
|
|
122
|
-
emailMessage: emailMessageOnOrderSent
|
|
126
|
+
emailMessage: emailMessageOnOrderSent,
|
|
127
|
+
authorizeActions
|
|
123
128
|
});
|
|
124
129
|
// ステータス変更
|
|
125
130
|
try {
|
|
126
131
|
yield repos.transaction.confirm({
|
|
127
132
|
typeOf: transaction.typeOf,
|
|
128
133
|
id: transaction.id,
|
|
129
|
-
|
|
134
|
+
// 保管有無を設定化(2023-05-16~)
|
|
135
|
+
authorizeActions: [],
|
|
130
136
|
result: result,
|
|
131
137
|
potentialActions: potentialActions
|
|
132
138
|
});
|
|
@@ -214,18 +220,20 @@ exports.publishOrderNumberIfNotExist = publishOrderNumberIfNotExist;
|
|
|
214
220
|
function createResult(params) {
|
|
215
221
|
const transaction = params.transaction;
|
|
216
222
|
// 取引の確定条件が全て整っているかどうか確認
|
|
217
|
-
(0, validation_1.validateTransaction)(transaction);
|
|
223
|
+
(0, validation_1.validateTransaction)(transaction, params.authorizeActions);
|
|
218
224
|
// 注文作成
|
|
219
225
|
const order = (0, result_1.createOrder)({
|
|
220
226
|
orderNumber: params.orderNumber,
|
|
221
227
|
transaction: transaction,
|
|
222
228
|
orderDate: params.result.order.orderDate,
|
|
223
229
|
orderStatus: factory.orderStatus.OrderProcessing,
|
|
224
|
-
isGift: false
|
|
230
|
+
isGift: false,
|
|
231
|
+
authorizeActions: params.authorizeActions
|
|
225
232
|
});
|
|
226
233
|
(0, validation_1.validateEventOffers)({
|
|
227
234
|
transaction: transaction,
|
|
228
|
-
order: order
|
|
235
|
+
order: order,
|
|
236
|
+
authorizeActions: params.authorizeActions
|
|
229
237
|
});
|
|
230
238
|
// 注文アイテム数制限確認
|
|
231
239
|
(0, validation_1.validateNumItems)({
|
|
@@ -252,10 +260,15 @@ function searchAuthorizeActions(params) {
|
|
|
252
260
|
purpose: {
|
|
253
261
|
typeOf: factory.transactionType.PlaceOrder,
|
|
254
262
|
id: params.id
|
|
255
|
-
}
|
|
263
|
+
},
|
|
264
|
+
// Completedに絞る(2023-05-16~)
|
|
265
|
+
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
256
266
|
});
|
|
257
267
|
// 万が一このプロセス中に他処理が発生してもそれらを無視するように、endDateでフィルタリング
|
|
258
|
-
authorizeActions = authorizeActions.filter((a) =>
|
|
268
|
+
authorizeActions = authorizeActions.filter((a) => {
|
|
269
|
+
return (a.endDate instanceof Date) && moment(a.endDate)
|
|
270
|
+
.isBefore(moment(params.result.order.orderDate));
|
|
271
|
+
});
|
|
259
272
|
return authorizeActions;
|
|
260
273
|
});
|
|
261
274
|
}
|
|
@@ -311,7 +324,7 @@ function authorizeAward(params) {
|
|
|
311
324
|
if (Array.isArray(givePointAwardParams)) {
|
|
312
325
|
const pointAwardIdentifiers = givePointAwardParams.map((g) => { var _a; return String((_a = g.object) === null || _a === void 0 ? void 0 : _a.identifier); });
|
|
313
326
|
// 取引にインセンティブ付与アクションパラメータを保管する
|
|
314
|
-
yield repos.transaction.
|
|
327
|
+
yield repos.transaction.findByIdAndUpdateInProgress({
|
|
315
328
|
id: transaction.id,
|
|
316
329
|
update: {
|
|
317
330
|
$set: {
|
|
@@ -339,7 +352,7 @@ function voidAward(params) {
|
|
|
339
352
|
if (transaction.agent.id !== params.agent.id) {
|
|
340
353
|
throw new factory.errors.Forbidden('Transaction not yours');
|
|
341
354
|
}
|
|
342
|
-
yield repos.transaction.
|
|
355
|
+
yield repos.transaction.findByIdAndUpdateInProgress({
|
|
343
356
|
id: transaction.id,
|
|
344
357
|
update: {
|
|
345
358
|
$unset: {
|
|
@@ -36,7 +36,16 @@ function createTasks(params) {
|
|
|
36
36
|
numberOfTried: 0,
|
|
37
37
|
executionResults: [],
|
|
38
38
|
data: {
|
|
39
|
-
object:
|
|
39
|
+
object: {
|
|
40
|
+
endDate: transaction.endDate,
|
|
41
|
+
id: transaction.id,
|
|
42
|
+
object: {
|
|
43
|
+
order: transaction.object.order
|
|
44
|
+
},
|
|
45
|
+
project: transaction.project,
|
|
46
|
+
startDate: transaction.startDate,
|
|
47
|
+
typeOf: transaction.typeOf
|
|
48
|
+
}
|
|
40
49
|
}
|
|
41
50
|
};
|
|
42
51
|
taskAttributes.push(deleteTransactionTask);
|
|
@@ -133,31 +133,39 @@ exports.createReturnPaymentMethodActions = createReturnPaymentMethodActions;
|
|
|
133
133
|
function createReturnPaymentMethodIssuedThroughMovieTicketActions(params) {
|
|
134
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
135
|
const order = params.order;
|
|
136
|
-
const
|
|
136
|
+
const returnFeesMovieTicketByTransaction = params.transaction.object.returnPolicy.returnFeesMovieTicket;
|
|
137
137
|
return Promise.all(params.order.paymentMethods
|
|
138
138
|
.filter((paymentMethod) => {
|
|
139
139
|
return paymentMethod.issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket;
|
|
140
140
|
})
|
|
141
|
-
//
|
|
141
|
+
// 決済カード着券取消有無設定を適用
|
|
142
142
|
.filter((paymentMethod) => {
|
|
143
|
-
|
|
143
|
+
// デフォルトで実行する
|
|
144
|
+
let returnPaymentMethod = true;
|
|
144
145
|
const movieTicketIdentifier = paymentMethod.accountId;
|
|
145
|
-
const
|
|
146
|
+
const returnFeesMovieTicketSettingsByIdentifier = returnFeesMovieTicketByTransaction === null || returnFeesMovieTicketByTransaction === void 0 ? void 0 : returnFeesMovieTicketByTransaction.filter((r) => {
|
|
147
|
+
var _a;
|
|
148
|
+
return r.identifier === String(movieTicketIdentifier)
|
|
149
|
+
&& ((_a = r.serviceOutput) === null || _a === void 0 ? void 0 : _a.typeOf) === paymentMethod.typeOf;
|
|
150
|
+
});
|
|
146
151
|
// 設定がなければスルー
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
152
|
+
if (Array.isArray(returnFeesMovieTicketSettingsByIdentifier) && returnFeesMovieTicketSettingsByIdentifier.length > 0) {
|
|
153
|
+
returnFeesMovieTicketSettingsByIdentifier.forEach((returnFeesMovieTicketSetting) => {
|
|
154
|
+
const returnFeesEnumeration = returnFeesMovieTicketSetting.returnFees;
|
|
155
|
+
switch (returnFeesEnumeration) {
|
|
156
|
+
case factory.merchantReturnPolicy.ReturnFeesEnumeration.FreeReturn:
|
|
157
|
+
break;
|
|
158
|
+
// ひとつでも「取消を実行しない」に設定されていれば、実行しない
|
|
159
|
+
case factory.merchantReturnPolicy.ReturnFeesEnumeration.ReturnFeesCustomerResponsibility:
|
|
160
|
+
// 取消実行しない
|
|
161
|
+
returnPaymentMethod = false;
|
|
162
|
+
break;
|
|
163
|
+
default:
|
|
164
|
+
throw new factory.errors.NotImplemented(`returnFees ${returnFeesEnumeration} not implemented`);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
160
167
|
}
|
|
168
|
+
return returnPaymentMethod;
|
|
161
169
|
})
|
|
162
170
|
.map((p) => __awaiter(this, void 0, void 0, function* () {
|
|
163
171
|
const potentialActionsOnRefund = yield createReturnPaymentMethodPotentialActions({
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
import { MongoRepository as EmailMessageRepo } from '../../repo/emailMessage';
|
|
3
|
+
import { MongoRepository as EventRepo } from '../../repo/event';
|
|
3
4
|
import { MongoRepository as MerchantReturnPolicyRepo } from '../../repo/merchantReturnPolicy';
|
|
4
5
|
import { MongoRepository as OfferRepo } from '../../repo/offer';
|
|
6
|
+
import { MongoRepository as OfferItemConditionRepo } from '../../repo/offerItemCondition';
|
|
5
7
|
import { MongoRepository as OrderRepo } from '../../repo/order';
|
|
6
8
|
import { MongoRepository as ReservationRepo } from '../../repo/reservation';
|
|
7
9
|
import { MongoRepository as SellerRepo } from '../../repo/seller';
|
|
8
10
|
import { MongoRepository as TaskRepo } from '../../repo/task';
|
|
9
11
|
import { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
10
12
|
export interface IStartOperationRepos {
|
|
13
|
+
event: EventRepo;
|
|
11
14
|
merchantReturnPolicy: MerchantReturnPolicyRepo;
|
|
12
15
|
offer: OfferRepo;
|
|
16
|
+
offerItemCondition: OfferItemConditionRepo;
|
|
13
17
|
order: OrderRepo;
|
|
14
18
|
reservation: ReservationRepo;
|
|
15
19
|
seller: SellerRepo;
|