@chevre/domain 22.2.0-alpha.9 → 22.3.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/example/src/chevre/createProject.ts +19 -0
- package/example/src/chevre/findValidAuthorization.ts +1 -2
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
- package/example/src/chevre/{migrateMovieTheaterAdditionalProperties.ts → migrateRoomAdditionalProperties.ts} +17 -17
- package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +119 -0
- package/example/src/chevre/playAroundTicket.ts +3 -2
- package/example/src/chevre/processAction.ts +3 -1
- package/example/src/chevre/projectFields.ts +42 -0
- package/example/src/chevre/{projectEventFieldsById.ts → projectFieldsById.ts} +7 -12
- package/example/src/chevre/searchActionsByPurpose.ts +38 -0
- package/example/src/chevre/searchProjects.ts +9 -4
- package/example/src/chevre/searchSellersByAggregate.ts +3 -3
- package/example/src/chevre/searchTransactions.ts +1 -1
- package/example/src/chevre/unsetUnnecessaryFields.ts +2 -41
- package/lib/chevre/repo/accountTitle.d.ts +9 -3
- package/lib/chevre/repo/accountingReport.d.ts +2 -15
- package/lib/chevre/repo/action.d.ts +110 -47
- package/lib/chevre/repo/action.js +170 -133
- package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
- package/lib/chevre/repo/assetTransaction.d.ts +134 -7
- package/lib/chevre/repo/assetTransaction.js +2 -2
- package/lib/chevre/repo/categoryCode.d.ts +14 -2
- package/lib/chevre/repo/categoryCode.js +47 -19
- package/lib/chevre/repo/comment.d.ts +5 -1
- package/lib/chevre/repo/creativeWork.d.ts +14 -2
- package/lib/chevre/repo/customer.d.ts +5 -1
- package/lib/chevre/repo/customerType.d.ts +1 -1
- package/lib/chevre/repo/event.d.ts +49 -2
- package/lib/chevre/repo/member.d.ts +5 -1
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
- package/lib/chevre/repo/message.d.ts +1 -15
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/categoryCode.js +22 -24
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
- package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
- package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
- package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/paymentService.js +13 -4
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
- package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/product.js +6 -13
- package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
- package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
- package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/seller.js +22 -24
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
- package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
- package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
- package/lib/chevre/repo/offer.d.ts +13 -4
- package/lib/chevre/repo/offerCatalog.d.ts +15 -2
- package/lib/chevre/repo/order.d.ts +13 -1
- package/lib/chevre/repo/ownershipInfo.d.ts +15 -3
- package/lib/chevre/repo/ownershipInfo.js +40 -11
- package/lib/chevre/repo/paymentService.d.ts +2 -2
- package/lib/chevre/repo/paymentService.js +108 -58
- package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -10
- package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
- package/lib/chevre/repo/priceSpecification.d.ts +42 -1
- package/lib/chevre/repo/product.d.ts +8 -3
- package/lib/chevre/repo/product.js +67 -33
- package/lib/chevre/repo/productModel.d.ts +1 -22
- package/lib/chevre/repo/project.d.ts +25 -5
- package/lib/chevre/repo/project.js +69 -28
- package/lib/chevre/repo/reservation.d.ts +35 -3
- package/lib/chevre/repo/reservation.js +1 -1
- package/lib/chevre/repo/role.d.ts +2 -9
- package/lib/chevre/repo/role.js +20 -10
- package/lib/chevre/repo/seller.d.ts +64 -14
- package/lib/chevre/repo/seller.js +61 -27
- package/lib/chevre/repo/task.d.ts +64 -3
- package/lib/chevre/repo/telemetry.d.ts +3 -2
- package/lib/chevre/repo/ticket.d.ts +4 -20
- package/lib/chevre/repo/ticket.js +23 -10
- package/lib/chevre/repo/transaction.d.ts +30 -14
- package/lib/chevre/repo/transaction.js +106 -77
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
- package/lib/chevre/service/aggregation/project.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay.js +3 -3
- package/lib/chevre/service/assetTransaction/refund/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +3 -3
- package/lib/chevre/service/assetTransaction/registerService.js +4 -6
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +9 -11
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.js +1 -3
- package/lib/chevre/service/code.d.ts +0 -4
- package/lib/chevre/service/code.js +22 -18
- package/lib/chevre/service/event.js +4 -4
- package/lib/chevre/service/moneyTransfer.js +3 -5
- package/lib/chevre/service/notification.js +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +16 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -2
- package/lib/chevre/service/offer/event/authorize.js +3 -2
- package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -12
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +45 -5
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +7 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +10 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +14 -6
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.js +38 -17
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +1 -3
- package/lib/chevre/service/offer/product.d.ts +4 -2
- package/lib/chevre/service/offer/product.js +12 -12
- package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -3
- package/lib/chevre/service/order/placeOrder.js +1 -1
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaid.d.ts +1 -1
- package/lib/chevre/service/payment/any/onRefund.d.ts +1 -1
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -4
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +21 -26
- package/lib/chevre/service/payment/any.d.ts +3 -1
- package/lib/chevre/service/payment/any.js +21 -13
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +12 -5
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +13 -3
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
- package/lib/chevre/service/payment/faceToFace.js +28 -10
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +12 -4
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +15 -4
- package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
- package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
- package/lib/chevre/service/payment/paymentCard.js +29 -16
- package/lib/chevre/service/payment.d.ts +1 -1
- package/lib/chevre/service/report/telemetry.js +2 -2
- package/lib/chevre/service/reserve/cancelReservation.js +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/task/onAuthorizationCreated.js +20 -16
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +16 -4
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
- package/lib/chevre/service/transaction/moneyTransfer.js +4 -4
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +2 -2
- package/lib/chevre/service/transaction.js +1 -1
- package/package.json +4 -4
- package/example/src/chevre/findTransactionById.ts +0 -23
- package/example/src/chevre/findTransactionInProgressById.ts +0 -23
- package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
- package/example/src/chevre/projectReservationFields.ts +0 -31
- package/example/src/chevre/searchActions.ts +0 -40
- package/example/src/chevre/searchProducts.ts +0 -28
|
@@ -23,7 +23,7 @@ function changeOffers(params) {
|
|
|
23
23
|
// tslint:disable-next-line:max-func-body-length
|
|
24
24
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
var _a, _b, _c, _d;
|
|
26
|
-
const transaction = yield repos.transaction.
|
|
26
|
+
const transaction = yield repos.transaction.projectFieldsInProgressById({
|
|
27
27
|
typeOf: factory.transactionType.PlaceOrder,
|
|
28
28
|
id: params.transaction.id
|
|
29
29
|
}, ['typeOf', 'agent', 'project', 'seller']);
|
|
@@ -40,6 +40,9 @@ function changeOffers(params) {
|
|
|
40
40
|
if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
|
|
41
41
|
throw new factory.errors.Argument('Transaction', 'Action not found in the transaction');
|
|
42
42
|
}
|
|
43
|
+
if (authorizeAction.result === undefined) {
|
|
44
|
+
throw new factory.errors.NotFound('authorizeAction.result');
|
|
45
|
+
}
|
|
43
46
|
const originalAcceptActionId = authorizeAction.object.id;
|
|
44
47
|
if (typeof originalAcceptActionId !== 'string' || originalAcceptActionId === '') {
|
|
45
48
|
throw new factory.errors.NotFound('authorizeAction.object.id');
|
|
@@ -77,15 +80,15 @@ function changeOffers(params) {
|
|
|
77
80
|
'superEvent', 'typeOf', 'identifier', 'name'
|
|
78
81
|
] // optimize(2024-07-18~)
|
|
79
82
|
);
|
|
80
|
-
const availablePaymentMethodTypes = yield repos.categoryCode.
|
|
83
|
+
const availablePaymentMethodTypes = yield repos.categoryCode.projectFields({
|
|
81
84
|
project: { id: { $eq: transaction.project.id } },
|
|
82
85
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
|
|
83
86
|
}, [], []);
|
|
84
|
-
const seatingTypes = yield repos.categoryCode.
|
|
87
|
+
const seatingTypes = yield repos.categoryCode.projectFields({
|
|
85
88
|
project: { id: { $eq: transaction.project.id } },
|
|
86
89
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.SeatingType } }
|
|
87
90
|
}, [], []);
|
|
88
|
-
const videoFormatTypes = yield repos.categoryCode.
|
|
91
|
+
const videoFormatTypes = yield repos.categoryCode.projectFields({
|
|
89
92
|
project: { id: { $eq: transaction.project.id } },
|
|
90
93
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.VideoFormatType } }
|
|
91
94
|
}, [], []);
|
|
@@ -153,12 +156,17 @@ function changeOffers(params) {
|
|
|
153
156
|
}
|
|
154
157
|
throw error;
|
|
155
158
|
}
|
|
156
|
-
//
|
|
157
|
-
|
|
159
|
+
// 承認アクションを再完了
|
|
160
|
+
yield repos.action.reCompleteAuthorizeEventOfferAction({
|
|
158
161
|
id: params.id,
|
|
159
162
|
object: authorizeAction.object,
|
|
160
163
|
result: actionResult
|
|
161
164
|
});
|
|
165
|
+
return {
|
|
166
|
+
id: params.id,
|
|
167
|
+
instrument: authorizeAction.instrument,
|
|
168
|
+
result: actionResult
|
|
169
|
+
};
|
|
162
170
|
});
|
|
163
171
|
}
|
|
164
172
|
exports.changeOffers = changeOffers;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import type * as COAService from '@motionpicture/coa-service';
|
|
1
2
|
import * as factory from '../../../factory';
|
|
2
3
|
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
3
4
|
export import WebAPIIdentifier = factory.service.webAPI.Identifier;
|
|
4
|
-
export type IAcceptedOffer4COA = factory.action.
|
|
5
|
+
export type IAcceptedOffer4COA = factory.action.accept.coaOffer.IAcceptedOffer4COA;
|
|
6
|
+
export type IRequestBody = COAService.factory.reserve.IUpdTmpReserveSeatArgs;
|
|
7
|
+
export type IResponseBody = COAService.factory.reserve.IUpdTmpReserveSeatResult;
|
|
5
8
|
export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
6
9
|
acceptAction: {
|
|
7
10
|
id: string;
|
|
8
11
|
};
|
|
9
|
-
acceptedOffers: factory.action.
|
|
12
|
+
acceptedOffers: factory.action.accept.coaOffer.IAcceptedOffer4COA[];
|
|
10
13
|
event: {
|
|
11
14
|
id: string;
|
|
12
15
|
typeOf: factory.eventType.ScreeningEvent;
|
|
@@ -21,13 +24,13 @@ export declare function offers2resultPrice(offers: IAcceptedOffer4COA[]): {
|
|
|
21
24
|
price: number;
|
|
22
25
|
eligibleMonetaryAmount: factory.offer.IEligibleMonetaryAmount[];
|
|
23
26
|
};
|
|
24
|
-
type IResultAcceptedOffer = factory.
|
|
27
|
+
type IResultAcceptedOffer = factory.order.IAcceptedOffer<factory.order.IReservation>;
|
|
25
28
|
/**
|
|
26
29
|
* COA仮予約結果から注文アイテムを生成する
|
|
27
30
|
*/
|
|
28
31
|
export declare function responseBody2acceptedOffers4result(params: {
|
|
29
|
-
responseBody:
|
|
30
|
-
acceptedOffer: factory.action.
|
|
32
|
+
responseBody: IResponseBody;
|
|
33
|
+
acceptedOffer: factory.action.accept.coaOffer.IAcceptedOffer4COA[];
|
|
31
34
|
event: Pick<IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>, 'coaInfo' | 'doorTime' | 'endDate' | 'id' | 'location' | 'startDate' | 'superEvent' | 'typeOf' | 'identifier' | 'name'>;
|
|
32
35
|
seller: Pick<factory.transaction.placeOrder.ISeller, 'typeOf' | 'name'>;
|
|
33
36
|
bookingTime: Date;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import type { OfferRepo } from '../../../repo/offer';
|
|
3
3
|
import { IAcceptedOffer4COA } from './factory';
|
|
4
|
-
export type IAcceptedOfferBeforeAuthorize4COA = factory.action.
|
|
4
|
+
export type IAcceptedOfferBeforeAuthorize4COA = factory.action.accept.coaOffer.IAcceptedOfferBeforeAuthorize4COA;
|
|
5
5
|
/**
|
|
6
6
|
* 受け入れらたオファーの内容を検証
|
|
7
7
|
*/
|
|
@@ -98,12 +98,44 @@ function createPriceComponent(params) {
|
|
|
98
98
|
eligibleMonetaryAmount = availableUnitPriceOffer.eligibleMonetaryAmount;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
const { disPrice, limitCount, stdPrice } = ticketInfo;
|
|
102
|
+
if (typeof stdPrice !== 'number') {
|
|
103
|
+
throw new factory.errors.Argument('ticketInfo.stdPrice', 'must be number');
|
|
104
|
+
}
|
|
105
|
+
const accountsReceivable = (ticketInfo.mvtkAppPrice > 0) ? ticketInfo.mvtkAppPrice : stdPrice;
|
|
106
|
+
// const maxPrice: number = stdPrice;
|
|
107
|
+
let price = stdPrice;
|
|
108
|
+
// support disPrice(2024-09-02~)
|
|
109
|
+
if (typeof disPrice === 'number' && disPrice > 0) {
|
|
110
|
+
price -= disPrice;
|
|
111
|
+
}
|
|
112
|
+
let referenceQuantity = {
|
|
113
|
+
typeOf: 'QuantitativeValue',
|
|
114
|
+
unitCode: factory.unitCode.C62,
|
|
115
|
+
value: 1
|
|
116
|
+
};
|
|
117
|
+
switch (ticketInfo.limitUnit) {
|
|
118
|
+
case '001':
|
|
119
|
+
referenceQuantity = {
|
|
120
|
+
typeOf: 'QuantitativeValue',
|
|
121
|
+
unitCode: factory.unitCode.C62,
|
|
122
|
+
value: Number(limitCount)
|
|
123
|
+
};
|
|
124
|
+
price = Number(limitCount) * price;
|
|
125
|
+
break;
|
|
126
|
+
case '002':
|
|
127
|
+
referenceQuantity = {
|
|
128
|
+
typeOf: 'QuantitativeValue',
|
|
129
|
+
unitCode: factory.unitCode.C62,
|
|
130
|
+
value: 1,
|
|
131
|
+
minValue: Number(limitCount)
|
|
132
|
+
};
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
// no op
|
|
136
|
+
// referenceQuantity.value = 1;
|
|
137
|
+
}
|
|
138
|
+
const unitPriceSpec = Object.assign({ typeOf: factory.priceSpecificationType.UnitPriceSpecification, name: { ja: ticketInfo.ticketName, en: ticketInfo.ticketNameEng }, price, priceCurrency: factory.priceCurrency.JPY, referenceQuantity, valueAddedTaxIncluded: true, accounting: {
|
|
107
139
|
typeOf: 'Accounting',
|
|
108
140
|
accountsReceivable
|
|
109
141
|
} }, (appliesToMovieTicket !== undefined || appliesToMovieTicket4surfrock !== undefined)
|
|
@@ -114,17 +146,6 @@ function createPriceComponent(params) {
|
|
|
114
146
|
]
|
|
115
147
|
}
|
|
116
148
|
: undefined);
|
|
117
|
-
switch (ticketInfo.limitUnit) {
|
|
118
|
-
case '001':
|
|
119
|
-
unitPriceSpec.referenceQuantity.value = Number(ticketInfo.limitCount);
|
|
120
|
-
unitPriceSpec.price = Number(ticketInfo.limitCount) * Number(ticketInfo.stdPrice);
|
|
121
|
-
break;
|
|
122
|
-
case '002':
|
|
123
|
-
unitPriceSpec.referenceQuantity.minValue = Number(ticketInfo.limitCount);
|
|
124
|
-
break;
|
|
125
|
-
default:
|
|
126
|
-
unitPriceSpec.referenceQuantity.value = 1;
|
|
127
|
-
}
|
|
128
149
|
// 区分加算料金
|
|
129
150
|
const categoryCodeChargeSpecs = [];
|
|
130
151
|
// movieTicketTypeChargePriceSpecにaddPriceが含まれる場合は除く
|
|
@@ -16,7 +16,7 @@ const MoneyTransferAssetTransactionService = require("../../assetTransaction/mon
|
|
|
16
16
|
const any_1 = require("../any");
|
|
17
17
|
function authorize(params) {
|
|
18
18
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const transaction = yield repos.transaction.
|
|
19
|
+
const transaction = yield repos.transaction.projectFieldsInProgressById({
|
|
20
20
|
typeOf: params.purpose.typeOf,
|
|
21
21
|
id: params.purpose.id
|
|
22
22
|
}, ['seller', 'project', 'agent', 'typeOf']);
|
|
@@ -16,7 +16,7 @@ function voidTransaction(params) {
|
|
|
16
16
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
let transaction;
|
|
18
18
|
if (params.agent !== undefined && params.agent !== null && typeof params.agent.id === 'string') {
|
|
19
|
-
transaction = (yield repos.transaction.
|
|
19
|
+
transaction = (yield repos.transaction.projectFieldsInProgressById({
|
|
20
20
|
typeOf: params.purpose.typeOf,
|
|
21
21
|
id: params.purpose.id
|
|
22
22
|
}, ['typeOf']));
|
|
@@ -19,9 +19,7 @@ function searchProductOffers(params) {
|
|
|
19
19
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
var _a, _b;
|
|
21
21
|
// プロダクト検索
|
|
22
|
-
|
|
23
|
-
// await repos.product.findProductById({ id: params.itemOffered.id }, ['hasOfferCatalog', 'project'], []);
|
|
24
|
-
const productWithOffers = (yield repos.product.searchProducts({
|
|
22
|
+
const productWithOffers = (yield repos.product.projectFields({
|
|
25
23
|
limit: 1,
|
|
26
24
|
page: 1,
|
|
27
25
|
id: { $eq: params.itemOffered.id }
|
|
@@ -68,7 +68,7 @@ export declare function search(params: {
|
|
|
68
68
|
productOffer: ProductOfferRepo;
|
|
69
69
|
}) => Promise<{
|
|
70
70
|
offers: factory.product.ITicketOffer[];
|
|
71
|
-
product:
|
|
71
|
+
product: factory.product.IProduct;
|
|
72
72
|
}>;
|
|
73
73
|
export type IAuthorizeOfferAction = factory.action.authorize.offer.product.IAction;
|
|
74
74
|
/**
|
|
@@ -93,7 +93,9 @@ export declare function authorize(params: {
|
|
|
93
93
|
transaction: {
|
|
94
94
|
id: string;
|
|
95
95
|
};
|
|
96
|
-
}): IAuthorizeOperation<IAuthorizeOfferAction
|
|
96
|
+
}): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id'> & {
|
|
97
|
+
result: IAuthorizeOfferAction['result'];
|
|
98
|
+
}>;
|
|
97
99
|
export declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidRegisterServiceTransaction>): (repos: {
|
|
98
100
|
action: ActionRepo;
|
|
99
101
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -27,7 +27,7 @@ function search(params) {
|
|
|
27
27
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
var _a;
|
|
29
29
|
const now = moment();
|
|
30
|
-
const searchProductsResult = yield repos.product.
|
|
30
|
+
const searchProductsResult = yield repos.product.projectFields({
|
|
31
31
|
limit: 1,
|
|
32
32
|
page: 1,
|
|
33
33
|
project: { id: { $eq: params.project.id } },
|
|
@@ -89,7 +89,7 @@ function authorize(params) {
|
|
|
89
89
|
// tslint:disable-next-line:max-func-body-length
|
|
90
90
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
91
91
|
const now = new Date();
|
|
92
|
-
const transaction = yield repos.transaction.
|
|
92
|
+
const transaction = yield repos.transaction.projectFieldsInProgressById({
|
|
93
93
|
typeOf: factory.transactionType.PlaceOrder,
|
|
94
94
|
id: params.transaction.id
|
|
95
95
|
}, ['agent', 'project', 'seller', 'typeOf', 'expires']);
|
|
@@ -127,7 +127,6 @@ function authorize(params) {
|
|
|
127
127
|
const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({
|
|
128
128
|
startDate: new Date()
|
|
129
129
|
});
|
|
130
|
-
// 承認アクション開始
|
|
131
130
|
const actionAttributes = (0, factory_1.createActionAttributes)({
|
|
132
131
|
acceptedOffer: acceptedOffer,
|
|
133
132
|
transaction: transaction,
|
|
@@ -147,8 +146,10 @@ function authorize(params) {
|
|
|
147
146
|
});
|
|
148
147
|
requestBody = startParams;
|
|
149
148
|
responseBody = yield RegisterServiceTransaction.start(startParams)(repos);
|
|
150
|
-
const acceptedOffers4result = (0, factory_1.responseBody2resultAcceptedOffer)({
|
|
151
|
-
|
|
149
|
+
const acceptedOffers4result = (0, factory_1.responseBody2resultAcceptedOffer)({
|
|
150
|
+
project: actionAttributes.project, responseBody, acceptedOffer
|
|
151
|
+
});
|
|
152
|
+
result = (0, factory_1.createResult)({ project: actionAttributes.project, requestBody, responseBody, acceptedOffer });
|
|
152
153
|
yield (0, any_1.acceptOffer)({
|
|
153
154
|
project: transaction.project,
|
|
154
155
|
purpose: { id: transaction.id },
|
|
@@ -164,7 +165,8 @@ function authorize(params) {
|
|
|
164
165
|
}
|
|
165
166
|
throw error;
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
169
|
+
return { id: action.id, result };
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
172
|
exports.authorize = authorize;
|
|
@@ -172,7 +174,7 @@ function fixProductAndOffers(params) {
|
|
|
172
174
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
173
175
|
var _a, _b, _c;
|
|
174
176
|
const productId = String((_b = (_a = params.object[0]) === null || _a === void 0 ? void 0 : _a.itemOffered) === null || _b === void 0 ? void 0 : _b.id);
|
|
175
|
-
const searchProductsResult = yield repos.product.
|
|
177
|
+
const searchProductsResult = yield repos.product.projectFields({
|
|
176
178
|
limit: 1,
|
|
177
179
|
page: 1,
|
|
178
180
|
project: { id: { $eq: params.project.id } },
|
|
@@ -189,7 +191,7 @@ function fixProductAndOffers(params) {
|
|
|
189
191
|
function voidTransaction(params) {
|
|
190
192
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
191
193
|
var _a;
|
|
192
|
-
const transaction = yield repos.transaction.
|
|
194
|
+
const transaction = yield repos.transaction.projectFieldsById({
|
|
193
195
|
typeOf: params.purpose.typeOf,
|
|
194
196
|
id: params.purpose.id
|
|
195
197
|
}, ['agent', 'status', 'typeOf']);
|
|
@@ -344,9 +346,7 @@ function checkIfRegistered(params) {
|
|
|
344
346
|
// メンバーシップについては、登録済かどうか確認する
|
|
345
347
|
if (params.product.typeOf === factory.product.ProductType.MembershipService) {
|
|
346
348
|
// プロダクトによって発行されたPermitを所有していれば、登録済
|
|
347
|
-
const searchOwnershipInfosResult = yield repos.ownershipInfo.
|
|
348
|
-
// iss: params.iss,
|
|
349
|
-
// project: { id: { $eq: params.project.id } },
|
|
349
|
+
const searchOwnershipInfosResult = yield repos.ownershipInfo.projectFields({
|
|
350
350
|
limit: 1,
|
|
351
351
|
page: 1,
|
|
352
352
|
ownedBy: { id: params.agent.id },
|
|
@@ -359,7 +359,7 @@ function checkIfRegistered(params) {
|
|
|
359
359
|
},
|
|
360
360
|
ownedFrom: params.now,
|
|
361
361
|
ownedThrough: params.now
|
|
362
|
-
});
|
|
362
|
+
}, []);
|
|
363
363
|
const ownershipInfos = searchOwnershipInfosResult;
|
|
364
364
|
if (ownershipInfos.length > 0) {
|
|
365
365
|
// Already registered
|
|
@@ -13,7 +13,7 @@ exports.findPlaceOrderTransaction = void 0;
|
|
|
13
13
|
const factory = require("../../factory");
|
|
14
14
|
function findPlaceOrderTransaction(params) {
|
|
15
15
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const placeOrderTransactions = yield repos.transaction.
|
|
16
|
+
const placeOrderTransactions = yield repos.transaction.projectFields({
|
|
17
17
|
limit: 1,
|
|
18
18
|
page: 1,
|
|
19
19
|
project: { id: { $eq: params.project.id } },
|
|
@@ -7,5 +7,5 @@ import * as factory from '../../../../factory';
|
|
|
7
7
|
*/
|
|
8
8
|
declare function createOnOrderCancelledTasksByTransaction(params: {
|
|
9
9
|
transaction?: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf'>;
|
|
10
|
-
}): (import("@chevre/factory/lib/task
|
|
10
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
11
11
|
export { createOnOrderCancelledTasksByTransaction };
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ declare function createInformTasks(params: {
|
|
|
13
13
|
}, settings: Settings): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
|
|
14
14
|
declare function createNextSendOrderTasks(params: {
|
|
15
15
|
order: IInTransitOrder;
|
|
16
|
-
}): (import("@chevre/factory/lib/task
|
|
16
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
17
17
|
export { createInformTasks, createNextSendOrderTasks, IInTransitOrder };
|
|
@@ -80,7 +80,7 @@ function createSendOrderTaskIfNotExist(params) {
|
|
|
80
80
|
function createOnAuthorizationCreatedTask(order) {
|
|
81
81
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
82
82
|
var _a;
|
|
83
|
-
const placeOrderTransaction = (yield repos.transaction.
|
|
83
|
+
const placeOrderTransaction = (yield repos.transaction.projectFields({
|
|
84
84
|
limit: 1,
|
|
85
85
|
page: 1,
|
|
86
86
|
typeOf: factory.transactionType.PlaceOrder,
|
|
@@ -8,5 +8,5 @@ declare function createInformTasks(order: IReturnedOrder, settings: Settings): f
|
|
|
8
8
|
declare function createOnOrderReturnedTasksByTransaction(params: {
|
|
9
9
|
order: Pick<factory.order.IOrder, 'project' | 'typeOf' | 'orderNumber' | 'customer' | 'price' | 'priceCurrency' | 'orderDate'>;
|
|
10
10
|
potentialActions?: factory.action.transfer.returnAction.order.IPotentialActions;
|
|
11
|
-
}): (import("@chevre/factory/lib/task
|
|
11
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
12
12
|
export { createInformTasks, createOnOrderReturnedTasksByTransaction };
|
|
@@ -19,7 +19,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
19
19
|
const confirmationNumber = String(params.confirmationNumber);
|
|
20
20
|
const orderNumber = params.orderNumber;
|
|
21
21
|
let order;
|
|
22
|
-
const placeOrderTransactions = yield repos.transaction.
|
|
22
|
+
const placeOrderTransactions = yield repos.transaction.projectFields({
|
|
23
23
|
limit: 1,
|
|
24
24
|
page: 1,
|
|
25
25
|
project: { id: { $eq: params.project.id } },
|
|
@@ -43,7 +43,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
43
43
|
if (Array.isArray(authorizeActionsAsResult) && authorizeActionsAsResult.length > 0) {
|
|
44
44
|
const completedAuthorizeActionIds = authorizeActionsAsResult.map(({ id }) => id);
|
|
45
45
|
if (completedAuthorizeActionIds.length > 0) {
|
|
46
|
-
authorizePaymentActions = yield repos.action.search({
|
|
46
|
+
authorizePaymentActions = (yield repos.action.search({
|
|
47
47
|
typeOf: factory.actionType.AuthorizeAction,
|
|
48
48
|
purpose: {
|
|
49
49
|
typeOf: { $in: [factory.transactionType.PlaceOrder] },
|
|
@@ -51,7 +51,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
51
51
|
},
|
|
52
52
|
object: { typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment } },
|
|
53
53
|
id: { $in: completedAuthorizeActionIds }
|
|
54
|
-
}, ['result'], []);
|
|
54
|
+
}, ['result'], []));
|
|
55
55
|
authorizeOfferActionsWithInstrument = (yield repos.action.search({
|
|
56
56
|
typeOf: factory.actionType.AuthorizeAction,
|
|
57
57
|
purpose: {
|
|
@@ -70,7 +70,7 @@ function placeOrder(params) {
|
|
|
70
70
|
id: { $in: [orderActionPurpose.id] },
|
|
71
71
|
typeOf: { $in: [orderActionPurpose.typeOf] }
|
|
72
72
|
}
|
|
73
|
-
}, ['
|
|
73
|
+
}, ['id'], []);
|
|
74
74
|
if (completedActions.length === 0) {
|
|
75
75
|
const action = yield repos.action.start(orderActionAttributes);
|
|
76
76
|
try {
|
|
@@ -44,7 +44,7 @@ function returnOrder(params) {
|
|
|
44
44
|
throw new factory.errors.Argument('object.orderNumber', `orderStatus not returnable: ${order.orderStatus}`);
|
|
45
45
|
}
|
|
46
46
|
// 返品取引検索
|
|
47
|
-
const returnOrderTransactions = yield repos.transaction.
|
|
47
|
+
const returnOrderTransactions = yield repos.transaction.projectFields({
|
|
48
48
|
limit: 1,
|
|
49
49
|
page: 1,
|
|
50
50
|
project: { id: { $eq: order.project.id } },
|
|
@@ -33,4 +33,4 @@ export declare function createAuthorizeResult(params: {
|
|
|
33
33
|
/**
|
|
34
34
|
* 通知対象としてのアクションを最適化
|
|
35
35
|
*/
|
|
36
|
-
export declare function optimizeAction4inform(action: factory.action.trade.pay.IAction | factory.action.trade.refund.IAction): IOnPaymentStatusChangedParams;
|
|
36
|
+
export declare function optimizeAction4inform(action: Pick<factory.action.trade.pay.IAction, 'id' | 'object' | 'project' | 'typeOf'> | Pick<factory.action.trade.refund.IAction, 'id' | 'object' | 'project' | 'typeOf'>): IOnPaymentStatusChangedParams;
|
|
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
|
|
|
8
8
|
/**
|
|
9
9
|
* 決済後のアクション
|
|
10
10
|
*/
|
|
11
|
-
declare function onPaid(payAction: factory.action.trade.pay.IAction): (repos: {
|
|
11
|
+
declare function onPaid(payAction: Pick<factory.action.trade.pay.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
|
|
12
12
|
action: ActionRepo;
|
|
13
13
|
accountingReport: AccountingReportRepo;
|
|
14
14
|
task: TaskRepo;
|
|
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
|
|
|
8
8
|
/**
|
|
9
9
|
* 返金後のアクション
|
|
10
10
|
*/
|
|
11
|
-
declare function onRefund(refundAction: factory.action.trade.refund.IAction): (repos: {
|
|
11
|
+
declare function onRefund(refundAction: Pick<factory.action.trade.refund.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
|
|
12
12
|
action: ActionRepo;
|
|
13
13
|
accountingReport: AccountingReportRepo;
|
|
14
14
|
task: TaskRepo;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
3
3
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
4
|
-
type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail & {
|
|
5
|
-
ticketToken?: string;
|
|
6
|
-
};
|
|
7
4
|
declare function verifyTicketTokenAsNeeded(params: {
|
|
8
5
|
project: {
|
|
9
6
|
id: string;
|
|
10
7
|
};
|
|
11
|
-
object: IObjectWithoutDetail
|
|
8
|
+
object: Pick<factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'issuedThrough' | 'ticketToken'>;
|
|
12
9
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
13
10
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
14
11
|
}): (repos: {
|
|
@@ -15,20 +15,19 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
15
15
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
var _a, _b;
|
|
17
17
|
const { paymentServiceType, object, project } = params;
|
|
18
|
-
const { ticketToken } = object;
|
|
18
|
+
const { issuedThrough, ticketToken } = object;
|
|
19
19
|
let permit;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const ticket = (yield repos.ticket.search({
|
|
20
|
+
// メンバーシップチケットが指定された場合、メンバーシップコードへ変換する
|
|
21
|
+
if (typeof ticketToken === 'string' && ticketToken !== '') {
|
|
22
|
+
switch (paymentServiceType) {
|
|
23
|
+
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
24
|
+
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
25
|
+
const ticket = (yield repos.ticket.projectFields({
|
|
27
26
|
limit: 1,
|
|
28
27
|
page: 1,
|
|
29
28
|
project: { id: { $eq: project.id } },
|
|
30
29
|
ticketToken: { $eq: ticketToken }
|
|
31
|
-
})).shift();
|
|
30
|
+
}, ['ticketToken'])).shift();
|
|
32
31
|
if (ticket === undefined) {
|
|
33
32
|
throw new factory.errors.NotFound('Ticket');
|
|
34
33
|
}
|
|
@@ -37,7 +36,7 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
37
36
|
project: { id: params.project.id },
|
|
38
37
|
code: ticket.ticketToken
|
|
39
38
|
});
|
|
40
|
-
authorizedObject = validAuthorization.object;
|
|
39
|
+
const authorizedObject = validAuthorization.object;
|
|
41
40
|
if (authorizedObject.typeOf !== 'OwnershipInfo') {
|
|
42
41
|
throw new factory.errors.Argument('ticketToken', 'must be OwnershipInfo');
|
|
43
42
|
}
|
|
@@ -46,29 +45,25 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
46
45
|
|| validAuthorization.audience.id !== params.purpose.id) {
|
|
47
46
|
throw new factory.errors.Argument('ticketToken', 'audience not matched with placeOrder');
|
|
48
47
|
}
|
|
49
|
-
const
|
|
50
|
-
// const ownershipInfoId = authorizedObject.id;
|
|
51
|
-
// const permitOwnershipInfo = (await repos.ownershipInfo.search({
|
|
52
|
-
// limit: 1,
|
|
53
|
-
// page: 1,
|
|
54
|
-
// project: { id: { $eq: params.project.id } },
|
|
55
|
-
// ids: [ownershipInfoId]
|
|
56
|
-
// })).shift();
|
|
57
|
-
// if (permitOwnershipInfo === undefined) {
|
|
58
|
-
// throw new factory.errors.NotFound('OwnershipInfo');
|
|
59
|
-
// }
|
|
60
|
-
const { typeOfGood } = permitOwnershipInfo;
|
|
48
|
+
const { typeOfGood } = authorizedObject;
|
|
61
49
|
if (typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
|
|
62
50
|
throw new factory.errors.Argument('ticketToken', 'must be Permit');
|
|
63
51
|
}
|
|
64
52
|
if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
|
|
65
53
|
throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
|
|
66
54
|
}
|
|
55
|
+
// CreditCardの場合、発行サービスIDを検証
|
|
56
|
+
if (typeOfGood.issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
57
|
+
if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
|
|
58
|
+
throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
67
61
|
permit = { identifier: typeOfGood.identifier };
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
// no op
|
|
65
|
+
throw new factory.errors.NotImplemented(`ticketToken issued through ${paymentServiceType} not implemented`);
|
|
66
|
+
}
|
|
72
67
|
}
|
|
73
68
|
return { permit };
|
|
74
69
|
});
|
|
@@ -95,9 +95,11 @@ type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings, crede
|
|
|
95
95
|
interface IPublishPaymentUrlRepos {
|
|
96
96
|
action: ActionRepo;
|
|
97
97
|
assetTransaction: AssetTransactionRepo;
|
|
98
|
+
authorization: AuthorizationRepo;
|
|
98
99
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
99
100
|
paymentService: PaymentServiceRepo;
|
|
100
101
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
102
|
+
ticket: TicketRepo;
|
|
101
103
|
transaction: TransactionRepo;
|
|
102
104
|
transactionNumber: TransactionNumberRepo;
|
|
103
105
|
}
|
|
@@ -115,7 +117,7 @@ declare function publishPaymentUrl(params: {
|
|
|
115
117
|
agent: {
|
|
116
118
|
id: string;
|
|
117
119
|
};
|
|
118
|
-
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
120
|
+
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'ticketToken'>;
|
|
119
121
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
120
122
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
121
123
|
location: factory.action.trade.pay.ILocation;
|