@chevre/domain 21.2.0-alpha.14 → 21.2.0-alpha.141
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/importEventsFromCOA.ts +3 -4
- package/example/src/chevre/lockStockHolder.ts +5 -2
- package/example/src/chevre/migrateOrderAdditionalProperties.ts +85 -0
- package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +79 -0
- 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 +34 -0
- package/example/src/chevre/searchActions.ts +33 -0
- package/example/src/chevre/searchEventSeats.ts +5 -2
- package/example/src/chevre/searchHoldReservations.ts +38 -0
- package/example/src/chevre/searchPaymentServiceProviders.ts +38 -0
- package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +37 -1
- package/example/src/chevre/searchScreeningRooms.ts +23 -0
- package/example/src/chevre/searchSendEmailActions.ts +44 -0
- package/example/src/chevre/syncScreeningRooms.ts +21 -0
- package/example/src/chevre/syncScreeningRoomsAll.ts +41 -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 +2 -1
- 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 +2 -1
- package/lib/chevre/eventEmitter/task.js +1 -4
- package/lib/chevre/eventEmitter/transaction.d.ts +1 -1
- package/lib/chevre/eventEmitter/transaction.js +1 -4
- package/lib/chevre/eventEmitter.d.ts +2 -1
- package/lib/chevre/eventEmitter.js +3 -1
- package/lib/chevre/index.d.ts +1 -1
- package/lib/chevre/index.js +2 -2
- package/lib/chevre/repo/account.js +3 -2
- package/lib/chevre/repo/accountTransaction.d.ts +3 -1
- package/lib/chevre/repo/accountTransaction.js +3 -2
- 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 +23 -8
- package/lib/chevre/repo/assetTransaction.js +253 -80
- 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 +93 -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 +55 -3
- package/lib/chevre/repo/mongoose/schemas/place.js +16 -1
- 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/product.js +6 -0
- 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 +97 -24
- package/lib/chevre/repo/place.js +266 -76
- package/lib/chevre/repo/priceSpecification.js +3 -2
- package/lib/chevre/repo/product.d.ts +18 -3
- package/lib/chevre/repo/product.js +139 -5
- 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 +143 -7
- package/lib/chevre/repo/stockHolder.js +622 -104
- package/lib/chevre/repo/task.d.ts +42 -2
- package/lib/chevre/repo/task.js +68 -20
- package/lib/chevre/repo/transaction.d.ts +21 -2
- package/lib/chevre/repo/transaction.js +160 -48
- 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/aggregateScreeningEvent.js +6 -2
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +19 -8
- 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 +92 -69
- package/lib/chevre/service/assetTransaction.d.ts +6 -0
- package/lib/chevre/service/assetTransaction.js +9 -4
- package/lib/chevre/service/event.d.ts +3 -0
- package/lib/chevre/service/event.js +54 -22
- 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 +71 -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 +65 -37
- 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 +162 -142
- 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 +10 -0
- package/lib/chevre/service/task/onResourceUpdated.js +423 -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/syncScreeningRooms.d.ts +7 -0
- package/lib/chevre/service/task/syncScreeningRooms.js +23 -0
- 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 +6 -0
- package/lib/chevre/service/task.js +22 -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 +7 -13
- package/lib/chevre/service/transaction.js +12 -139
- package/lib/chevre/settings.d.ts +13 -2
- package/lib/chevre/settings.js +56 -7
- 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/example/src/chevre/migrateStockHolderKeys.ts +0 -89
- 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
|
@@ -62,6 +62,7 @@ interface IConfirmRepo {
|
|
|
62
62
|
task: TaskRepo;
|
|
63
63
|
}
|
|
64
64
|
export type IConfirmOperation<T> = (repos: IConfirmRepo) => Promise<T>;
|
|
65
|
+
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
65
66
|
type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail & {
|
|
66
67
|
/**
|
|
67
68
|
* 承認アクションを介した場合に検索済のイベント
|
|
@@ -94,7 +95,15 @@ type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail &
|
|
|
94
95
|
/**
|
|
95
96
|
* 取引開始
|
|
96
97
|
*/
|
|
97
|
-
export declare function start(params: IStartParams
|
|
98
|
+
export declare function start(params: IStartParams & {
|
|
99
|
+
disablePendingReservations: boolean;
|
|
100
|
+
useHoldStockByTransactionNumber: boolean;
|
|
101
|
+
stockHoldUntilDaysAfterEventEnd: number;
|
|
102
|
+
}): IStartOperation<{
|
|
103
|
+
transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>;
|
|
104
|
+
objectSubReservations: IObjectSubReservation[];
|
|
105
|
+
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
106
|
+
}>;
|
|
98
107
|
/**
|
|
99
108
|
* 取引確定
|
|
100
109
|
*/
|
|
@@ -27,7 +27,7 @@ const validateStartRequest_1 = require("./reserve/validateStartRequest");
|
|
|
27
27
|
*/
|
|
28
28
|
function start(params) {
|
|
29
29
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
var _a, _b, _c, _d
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
31
|
const now = new Date();
|
|
32
32
|
// 自動発行廃止(2022-05-17~)
|
|
33
33
|
const reservationNumber = params.transactionNumber;
|
|
@@ -35,7 +35,8 @@ function start(params) {
|
|
|
35
35
|
throw new factory.errors.ArgumentNull('transactionNumber');
|
|
36
36
|
}
|
|
37
37
|
// eventをfix
|
|
38
|
-
|
|
38
|
+
const reservationForId = (_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.id;
|
|
39
|
+
if (typeof reservationForId !== 'string' || reservationForId.length === 0) {
|
|
39
40
|
throw new factory.errors.ArgumentNull('object.reservationFor.id');
|
|
40
41
|
}
|
|
41
42
|
let event;
|
|
@@ -43,7 +44,7 @@ function start(params) {
|
|
|
43
44
|
event = params.preSearchedEvent;
|
|
44
45
|
}
|
|
45
46
|
else {
|
|
46
|
-
event = yield repos.event.findMinimizedIndividualEventById({ id:
|
|
47
|
+
event = yield repos.event.findMinimizedIndividualEventById({ id: reservationForId });
|
|
47
48
|
}
|
|
48
49
|
// validationを承認アクション開始前から移行(2023-01-27~)
|
|
49
50
|
(0, validateStartRequest_1.validateStartRequest)({
|
|
@@ -63,19 +64,24 @@ function start(params) {
|
|
|
63
64
|
catch (error) {
|
|
64
65
|
throw error;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
transaction
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
let objectSubReservations = [];
|
|
68
|
+
const addReservationsResult = yield addReservations({
|
|
69
|
+
id: transaction.id,
|
|
70
|
+
object: params.object,
|
|
71
|
+
event,
|
|
72
|
+
preSearchedTicketOffers: params.preSearchedTicketOffers,
|
|
73
|
+
preSearchedUnitPriceOffers: params.preSearchedUnitPriceOffers,
|
|
74
|
+
availableAtOrFrom: { id: (_d = params.availableAtOrFrom) === null || _d === void 0 ? void 0 : _d.id },
|
|
75
|
+
validateAppliesToMovieTicket: params.validateAppliesToMovieTicket,
|
|
76
|
+
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
77
|
+
})(repos);
|
|
78
|
+
transaction = addReservationsResult.transaction;
|
|
79
|
+
objectSubReservations = addReservationsResult.objectSubReservations;
|
|
80
|
+
return {
|
|
81
|
+
transaction,
|
|
82
|
+
objectSubReservations,
|
|
83
|
+
issuedThrough: addReservationsResult.issuedThrough
|
|
84
|
+
};
|
|
79
85
|
});
|
|
80
86
|
}
|
|
81
87
|
exports.start = start;
|
|
@@ -132,6 +138,21 @@ function addReservations(params) {
|
|
|
132
138
|
})(repos);
|
|
133
139
|
// 予約イベント最適化
|
|
134
140
|
const reservationFor = (0, factory_1.createReservationFor)(event);
|
|
141
|
+
const { issuedThrough } = (0, factory_1.createIssuedThrough)({ reservationFor: event });
|
|
142
|
+
// const minimizedObjectSubReservations: factory.assetTransaction.reserve.IMinimizedObjectSubReservation[] =
|
|
143
|
+
// objectSubReservations.map((r) => {
|
|
144
|
+
// return {
|
|
145
|
+
// id: r.id,
|
|
146
|
+
// typeOf: r.typeOf,
|
|
147
|
+
// reservedTicket: {
|
|
148
|
+
// ticketType: r.reservedTicket.ticketType,
|
|
149
|
+
// ...(typeof r.reservedTicket.ticketedSeat?.typeOf === 'string')
|
|
150
|
+
// ? { ticketedSeat: r.reservedTicket.ticketedSeat }
|
|
151
|
+
// : undefined
|
|
152
|
+
// },
|
|
153
|
+
// ...(Array.isArray(r.subReservation)) ? { subReservation: r.subReservation } : undefined
|
|
154
|
+
// };
|
|
155
|
+
// });
|
|
135
156
|
// 取引に予約追加
|
|
136
157
|
let lockedOfferRateLimitKeys = [];
|
|
137
158
|
try {
|
|
@@ -140,12 +161,13 @@ function addReservations(params) {
|
|
|
140
161
|
typeOf: factory.assetTransactionType.Reserve,
|
|
141
162
|
id: transaction.id,
|
|
142
163
|
object: {
|
|
143
|
-
project: transaction.project,
|
|
144
164
|
acceptedOffer: acceptedOffers4transactionObject,
|
|
165
|
+
// issuedThroughを追加(2023-06-05~)
|
|
166
|
+
issuedThrough,
|
|
145
167
|
reservationFor,
|
|
146
168
|
// subReservationにreservationForを保管しない(2021-10-19~)
|
|
147
|
-
subReservation: objectSubReservations
|
|
148
|
-
|
|
169
|
+
subReservation: objectSubReservations
|
|
170
|
+
// subReservation: minimizedObjectSubReservations
|
|
149
171
|
}
|
|
150
172
|
});
|
|
151
173
|
}
|
|
@@ -162,13 +184,20 @@ function addReservations(params) {
|
|
|
162
184
|
yield processLockSeats({
|
|
163
185
|
event: event,
|
|
164
186
|
reservations: objectSubReservations,
|
|
165
|
-
transaction:
|
|
187
|
+
transaction: {
|
|
188
|
+
id: transaction.id,
|
|
189
|
+
transactionNumber: transaction.transactionNumber,
|
|
190
|
+
object: { useHoldStockByTransactionNumber: transaction.object.useHoldStockByTransactionNumber === true }
|
|
191
|
+
},
|
|
192
|
+
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
166
193
|
})(repos);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
194
|
+
if (transaction.object.disablePendingReservations !== true) {
|
|
195
|
+
// 予約作成(insertManyで実装)
|
|
196
|
+
yield repos.reservation.createMany({ reservationFor, reservations: objectSubReservations });
|
|
197
|
+
}
|
|
198
|
+
// ストックホルダー処理(stockHolderで残席数を集計しているので必要)
|
|
170
199
|
yield onReservationsCreated({ event })(repos);
|
|
171
|
-
return transaction;
|
|
200
|
+
return { transaction, objectSubReservations, issuedThrough };
|
|
172
201
|
});
|
|
173
202
|
}
|
|
174
203
|
/**
|
|
@@ -210,9 +239,11 @@ function searchEventSeatOffers(params) {
|
|
|
210
239
|
});
|
|
211
240
|
if (seats.length > 0) {
|
|
212
241
|
const availabilities = yield repos.stockHolder.searchHolders({
|
|
242
|
+
project: { id: params.event.project.id },
|
|
213
243
|
eventId: params.event.id,
|
|
214
244
|
startDate: moment(params.event.startDate)
|
|
215
245
|
.toDate(),
|
|
246
|
+
hasTicketedSeat: true,
|
|
216
247
|
offers: seats.map((s) => {
|
|
217
248
|
var _a;
|
|
218
249
|
return {
|
|
@@ -385,7 +416,7 @@ function createReservations4transactionObject(params) {
|
|
|
385
416
|
id: reservationId,
|
|
386
417
|
reserveDate: params.now,
|
|
387
418
|
agent: params.transaction.agent,
|
|
388
|
-
broker: params.transaction.object.broker,
|
|
419
|
+
// broker: params.transaction.object.broker,
|
|
389
420
|
reservationNumber: reservationNumber,
|
|
390
421
|
reservationFor: params.event,
|
|
391
422
|
reservedTicket: reservedTicket,
|
|
@@ -596,7 +627,7 @@ function processLockOfferRateLimit(params) {
|
|
|
596
627
|
*/
|
|
597
628
|
function processLockSeats(params) {
|
|
598
629
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
599
|
-
var _a;
|
|
630
|
+
var _a, _b, _c, _d, _e;
|
|
600
631
|
const offers = [];
|
|
601
632
|
params.reservations.forEach((r) => {
|
|
602
633
|
var _a, _b;
|
|
@@ -636,15 +667,24 @@ function processLockSeats(params) {
|
|
|
636
667
|
}
|
|
637
668
|
});
|
|
638
669
|
const expires = moment(params.event.endDate)
|
|
639
|
-
|
|
670
|
+
// 設定化(2023-06-05~)
|
|
671
|
+
// .add(1, 'month')
|
|
672
|
+
.add(params.stockHoldUntilDaysAfterEventEnd, 'days')
|
|
640
673
|
.toDate();
|
|
641
|
-
|
|
642
|
-
|
|
674
|
+
// holder:取引番号に対応(2023-06-05~)
|
|
675
|
+
let holder = params.transaction.id;
|
|
676
|
+
if (((_a = params.transaction.object) === null || _a === void 0 ? void 0 : _a.useHoldStockByTransactionNumber) === true) {
|
|
677
|
+
holder = params.transaction.transactionNumber;
|
|
678
|
+
}
|
|
679
|
+
const hasTicketedSeat = ((_d = (_c = (_b = params.event.offers.itemOffered.serviceOutput) === null || _b === void 0 ? void 0 : _b.reservedTicket) === null || _c === void 0 ? void 0 : _c.ticketedSeat) === null || _d === void 0 ? void 0 : _d.typeOf) === factory.placeType.Seat;
|
|
680
|
+
const maximumAttendeeCapacity4event = (_e = params.event.location) === null || _e === void 0 ? void 0 : _e.maximumAttendeeCapacity;
|
|
643
681
|
if (typeof maximumAttendeeCapacity4event === 'number') {
|
|
644
682
|
yield repos.stockHolder.lockIfNotLimitExceeded({
|
|
683
|
+
project: { id: params.event.project.id },
|
|
645
684
|
eventId: params.event.id,
|
|
646
685
|
startDate: moment(params.event.startDate)
|
|
647
686
|
.toDate(),
|
|
687
|
+
hasTicketedSeat,
|
|
648
688
|
offers,
|
|
649
689
|
expires,
|
|
650
690
|
holder
|
|
@@ -652,9 +692,11 @@ function processLockSeats(params) {
|
|
|
652
692
|
}
|
|
653
693
|
else {
|
|
654
694
|
yield repos.stockHolder.lock({
|
|
695
|
+
project: { id: params.event.project.id },
|
|
655
696
|
eventId: params.event.id,
|
|
656
697
|
startDate: moment(params.event.startDate)
|
|
657
698
|
.toDate(),
|
|
699
|
+
hasTicketedSeat,
|
|
658
700
|
offers,
|
|
659
701
|
expires,
|
|
660
702
|
holder
|
|
@@ -698,20 +740,22 @@ function confirm(params) {
|
|
|
698
740
|
throw new factory.errors.ArgumentNull('Transaction ID or Transaction Number');
|
|
699
741
|
}
|
|
700
742
|
const order = yield fixOrderAsPurpose(params, transaction)(repos);
|
|
701
|
-
const potentialActions = (0, factory_1.createPotentialActions)(Object.assign(Object.assign({}, params), { transaction
|
|
743
|
+
const { potentialActions, underName } = (0, factory_1.createPotentialActions)(Object.assign(Object.assign({}, params), { transaction,
|
|
744
|
+
order }));
|
|
702
745
|
// 取引確定
|
|
703
746
|
const result = {};
|
|
704
|
-
yield repos.assetTransaction.confirm({
|
|
705
|
-
typeOf: factory.assetTransactionType.Reserve,
|
|
706
|
-
id: transaction.id,
|
|
707
|
-
result: result,
|
|
708
|
-
potentialActions: (settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING)
|
|
747
|
+
yield repos.assetTransaction.confirm(Object.assign({ typeOf: factory.assetTransactionType.Reserve, id: transaction.id, result: result, potentialActions: (settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING)
|
|
709
748
|
? { reserve: [] }
|
|
710
|
-
: potentialActions
|
|
711
|
-
|
|
749
|
+
: potentialActions }, (typeof (underName === null || underName === void 0 ? void 0 : underName.typeOf) === 'string')
|
|
750
|
+
? { object: { underName } }
|
|
751
|
+
: undefined));
|
|
712
752
|
if (settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING) {
|
|
713
753
|
// sync対応(2023-01-13~)
|
|
714
|
-
yield (0, confirmReservation_1.confirmReservation)(
|
|
754
|
+
yield (0, confirmReservation_1.confirmReservation)({
|
|
755
|
+
actionAttributesList: potentialActions.reserve,
|
|
756
|
+
useOnReservationConfirmed: true,
|
|
757
|
+
byTask: true
|
|
758
|
+
})(repos);
|
|
715
759
|
}
|
|
716
760
|
});
|
|
717
761
|
}
|
|
@@ -732,7 +776,7 @@ function fixOrderAsPurpose(params, transaction) {
|
|
|
732
776
|
project: { id: { $eq: transaction.project.id } },
|
|
733
777
|
confirmationNumbers: [payPurposeConfirmationNumber],
|
|
734
778
|
orderNumbers: [payPurposeOrderNumber]
|
|
735
|
-
});
|
|
779
|
+
}, { customer: 1, orderNumber: 1, typeOf: 1 });
|
|
736
780
|
order = orders.shift();
|
|
737
781
|
if (order === undefined) {
|
|
738
782
|
throw new factory.errors.NotFound('Order as purpose');
|
|
@@ -754,8 +798,8 @@ function cancel(params) {
|
|
|
754
798
|
});
|
|
755
799
|
// 本来非同期でタスクが実行されるが、同期的に仮予約取消が実行されていないと、サービス利用側が困る可能性があるので、
|
|
756
800
|
// 同期的にもcancelPendingReservationを実行しておく
|
|
757
|
-
const cancelActionAttributes = (0, factory_1.
|
|
758
|
-
if (cancelActionAttributes
|
|
801
|
+
const cancelActionAttributes = (0, factory_1.createCancelPendingReservationAction)({ transaction });
|
|
802
|
+
if (cancelActionAttributes !== undefined) {
|
|
759
803
|
yield (0, cancelReservation_1.cancelPendingReservation)(cancelActionAttributes)(repos);
|
|
760
804
|
}
|
|
761
805
|
});
|
|
@@ -773,27 +817,6 @@ function exportTasksById(params) {
|
|
|
773
817
|
});
|
|
774
818
|
const potentialActions = transaction.potentialActions;
|
|
775
819
|
const taskAttributes = [];
|
|
776
|
-
// 資産取引削除タスクを作成
|
|
777
|
-
const deleteTransactionTask = {
|
|
778
|
-
project: transaction.project,
|
|
779
|
-
name: factory.taskName.DeleteAssetTransaction,
|
|
780
|
-
status: factory.taskStatus.Ready,
|
|
781
|
-
runsAt: moment(transaction.endDate)
|
|
782
|
-
.add(settings_1.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS, 'days')
|
|
783
|
-
.toDate(),
|
|
784
|
-
remainingNumberOfTries: 3,
|
|
785
|
-
numberOfTried: 0,
|
|
786
|
-
executionResults: [],
|
|
787
|
-
data: {
|
|
788
|
-
object: {
|
|
789
|
-
project: transaction.project,
|
|
790
|
-
id: transaction.id,
|
|
791
|
-
transactionNumber: transaction.transactionNumber,
|
|
792
|
-
typeOf: transaction.typeOf
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
taskAttributes.push(deleteTransactionTask);
|
|
797
820
|
switch (transaction.status) {
|
|
798
821
|
case factory.transactionStatusType.Confirmed:
|
|
799
822
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -821,8 +844,8 @@ function exportTasksById(params) {
|
|
|
821
844
|
case factory.transactionStatusType.Canceled:
|
|
822
845
|
// sync対応(2023-01-13~)
|
|
823
846
|
if (!settings_1.USE_ASSET_TRANSACTION_SYNC_PROCESSING) {
|
|
824
|
-
const cancelActionAttributes4canceled = (0, factory_1.
|
|
825
|
-
if (cancelActionAttributes4canceled
|
|
847
|
+
const cancelActionAttributes4canceled = (0, factory_1.createCancelPendingReservationAction)({ transaction });
|
|
848
|
+
if (cancelActionAttributes4canceled !== undefined) {
|
|
826
849
|
const cancelPendingReservationTask = {
|
|
827
850
|
project: transaction.project,
|
|
828
851
|
name: factory.taskName.CancelPendingReservation,
|
|
@@ -832,7 +855,7 @@ function exportTasksById(params) {
|
|
|
832
855
|
numberOfTried: 0,
|
|
833
856
|
executionResults: [],
|
|
834
857
|
data: {
|
|
835
|
-
actionAttributes: cancelActionAttributes4canceled
|
|
858
|
+
actionAttributes: [cancelActionAttributes4canceled]
|
|
836
859
|
}
|
|
837
860
|
};
|
|
838
861
|
taskAttributes.push(cancelPendingReservationTask);
|
|
@@ -840,8 +863,8 @@ function exportTasksById(params) {
|
|
|
840
863
|
}
|
|
841
864
|
break;
|
|
842
865
|
case factory.transactionStatusType.Expired:
|
|
843
|
-
const cancelActionAttributes = (0, factory_1.
|
|
844
|
-
if (cancelActionAttributes
|
|
866
|
+
const cancelActionAttributes = (0, factory_1.createCancelPendingReservationAction)({ transaction });
|
|
867
|
+
if (cancelActionAttributes !== undefined) {
|
|
845
868
|
const cancelPendingReservationTask = {
|
|
846
869
|
project: transaction.project,
|
|
847
870
|
name: factory.taskName.CancelPendingReservation,
|
|
@@ -851,7 +874,7 @@ function exportTasksById(params) {
|
|
|
851
874
|
numberOfTried: 0,
|
|
852
875
|
executionResults: [],
|
|
853
876
|
data: {
|
|
854
|
-
actionAttributes: cancelActionAttributes
|
|
877
|
+
actionAttributes: [cancelActionAttributes]
|
|
855
878
|
}
|
|
856
879
|
};
|
|
857
880
|
taskAttributes.push(cancelPendingReservationTask);
|
|
@@ -860,7 +883,7 @@ function exportTasksById(params) {
|
|
|
860
883
|
default:
|
|
861
884
|
throw new factory.errors.NotImplemented(`Transaction status "${transaction.status}" not implemented.`);
|
|
862
885
|
}
|
|
863
|
-
return repos.task.saveMany(taskAttributes);
|
|
886
|
+
return repos.task.saveMany(taskAttributes, { emitImmediately: true });
|
|
864
887
|
});
|
|
865
888
|
}
|
|
866
889
|
exports.exportTasksById = exportTasksById;
|
|
@@ -28,6 +28,12 @@ export declare function exportTasks<T extends factory.assetTransactionType>(para
|
|
|
28
28
|
typeOf?: {
|
|
29
29
|
$in: T[];
|
|
30
30
|
};
|
|
31
|
+
id?: string;
|
|
32
|
+
tasksExportAction?: {
|
|
33
|
+
agent: {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
31
37
|
}): (repos: {
|
|
32
38
|
task: TaskRepo;
|
|
33
39
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -20,6 +20,7 @@ const PayTransactionService = require("./assetTransaction/pay");
|
|
|
20
20
|
const RefundTransactionService = require("./assetTransaction/refund");
|
|
21
21
|
const RegisterServiceTransactionService = require("./assetTransaction/registerService");
|
|
22
22
|
const ReserveTransactionService = require("./assetTransaction/reserve");
|
|
23
|
+
const settings_1 = require("../settings");
|
|
23
24
|
exports.cancelReservation = CancelReservationTransactionService;
|
|
24
25
|
exports.moneyTransfer = MoneyTransferTransactionService;
|
|
25
26
|
exports.pay = PayTransactionService;
|
|
@@ -31,10 +32,14 @@ exports.reserve = ReserveTransactionService;
|
|
|
31
32
|
*/
|
|
32
33
|
function exportTasks(params) {
|
|
33
34
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
var _a;
|
|
36
|
+
const transaction = yield repos.assetTransaction.startExportTasks(Object.assign({ typeOf: params.typeOf, status: params.status, tasksExportAction: {
|
|
37
|
+
agent: {
|
|
38
|
+
name: (typeof ((_a = params.tasksExportAction) === null || _a === void 0 ? void 0 : _a.agent.name) === 'string')
|
|
39
|
+
? params.tasksExportAction.agent.name
|
|
40
|
+
: settings_1.DEFAULT_TASKS_EXPORT_AGENT_NAME
|
|
41
|
+
}
|
|
42
|
+
} }, (typeof params.id === 'string') ? { id: params.id } : undefined));
|
|
38
43
|
if (transaction === null) {
|
|
39
44
|
return;
|
|
40
45
|
}
|
|
@@ -22,7 +22,6 @@ const moment = require("moment-timezone");
|
|
|
22
22
|
const credentials_1 = require("../credentials");
|
|
23
23
|
const factory = require("../factory");
|
|
24
24
|
const offer_1 = require("./offer");
|
|
25
|
-
// const customsearch = google.customsearch('v1');
|
|
26
25
|
const debug = createDebug('chevre-domain:service:event');
|
|
27
26
|
const coaAuthClient = new COA.auth.RefreshToken({
|
|
28
27
|
endpoint: credentials_1.credentials.coa.endpoint,
|
|
@@ -99,18 +98,29 @@ function importFromCOA(params) {
|
|
|
99
98
|
if (typeof (seller === null || seller === void 0 ? void 0 : seller.id) !== 'string') {
|
|
100
99
|
throw new factory.errors.NotFound('Seller', `Seller with branchCod '${params.locationBranchCode}' not found`);
|
|
101
100
|
}
|
|
102
|
-
// 施設取得
|
|
103
|
-
let movieTheater = createMovieTheaterFromCOA(project, { id: seller.id }, yield masterService.theater({ theaterCode: params.locationBranchCode }), yield masterService.screen({ theaterCode: params.locationBranchCode }));
|
|
104
101
|
// saveMovieTheater:trueの場合のみ、施設保管(2022-10-10~)
|
|
105
102
|
if (params.saveMovieTheater === true) {
|
|
106
|
-
|
|
103
|
+
const savingMovieTheater = createMovieTheaterFromCOA(project, { id: seller.id }, yield masterService.theater({ theaterCode: params.locationBranchCode }), yield masterService.screen({ theaterCode: params.locationBranchCode }));
|
|
104
|
+
yield repos.place.saveMovieTheaterByBranchCode4coa(savingMovieTheater);
|
|
105
|
+
// } else {
|
|
106
|
+
// movieTheater = await repos.place.findMovieTheaterByBranchCode({
|
|
107
|
+
// project: { id: project.id },
|
|
108
|
+
// branchCode: creatingMovieTheater.branchCode
|
|
109
|
+
// });
|
|
107
110
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
111
|
+
const movieTheaters = yield repos.place.searchMovieTheaters({
|
|
112
|
+
limit: 1,
|
|
113
|
+
page: 1,
|
|
114
|
+
project: { id: { $eq: project.id } },
|
|
115
|
+
branchCode: { $eq: params.locationBranchCode }
|
|
116
|
+
}, ['_id', 'typeOf', 'branchCode', 'name', 'kanaName'], []);
|
|
117
|
+
const movieTheater = movieTheaters.shift();
|
|
118
|
+
if (movieTheater === undefined) {
|
|
119
|
+
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
113
120
|
}
|
|
121
|
+
const screeningRooms = yield repos.place.searchScreeningRooms({
|
|
122
|
+
containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
|
|
123
|
+
});
|
|
114
124
|
const targetImportFrom = moment(`${moment(params.importFrom)
|
|
115
125
|
.tz('Asia/Tokyo')
|
|
116
126
|
.format('YYYY-MM-DD')}T00:00:00+09:00`);
|
|
@@ -121,16 +131,17 @@ function importFromCOA(params) {
|
|
|
121
131
|
debug('importing screening events...', targetImportFrom, targetImportThrough);
|
|
122
132
|
const { screeningEventSerieses, savedEventsCount } = yield saveScreeningEventSeries({
|
|
123
133
|
locationBranchCode: params.locationBranchCode,
|
|
124
|
-
movieTheater
|
|
134
|
+
movieTheater,
|
|
125
135
|
project: project,
|
|
126
136
|
saveScreeningEventSeries: params.saveScreeningEventSeries
|
|
127
137
|
})(repos);
|
|
128
138
|
savedScreeningEventSeriesCount = savedEventsCount;
|
|
129
139
|
try {
|
|
130
|
-
//
|
|
140
|
+
// イベント永続化
|
|
131
141
|
const screeningEvents = yield saveScreeningEvents({
|
|
132
142
|
locationBranchCode: params.locationBranchCode,
|
|
133
|
-
movieTheater: movieTheater,
|
|
143
|
+
// movieTheater: movieTheater,
|
|
144
|
+
screeningRooms,
|
|
134
145
|
screeningEventSerieses: screeningEventSerieses,
|
|
135
146
|
project: project,
|
|
136
147
|
targetImportFrom: targetImportFrom.toDate(),
|
|
@@ -154,6 +165,8 @@ function importFromCOA(params) {
|
|
|
154
165
|
// "message": "ESOCKETTIMEDOUT",
|
|
155
166
|
if (error.name === 'COAServiceError') {
|
|
156
167
|
if (error.message === 'ESOCKETTIMEDOUT') {
|
|
168
|
+
// tslint:disable-next-line:no-console
|
|
169
|
+
console.error('saveScreeningEvents throwed an error', error.name, error.message);
|
|
157
170
|
throwsError = false;
|
|
158
171
|
}
|
|
159
172
|
}
|
|
@@ -181,7 +194,6 @@ function importFromCOA(params) {
|
|
|
181
194
|
exports.importFromCOA = importFromCOA;
|
|
182
195
|
function saveScreeningEventSeries(params) {
|
|
183
196
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
const movieTheater = params.movieTheater;
|
|
185
197
|
const project = params.project;
|
|
186
198
|
const masterService = new COA.service.Master({
|
|
187
199
|
endpoint: credentials_1.credentials.coa.endpoint,
|
|
@@ -212,12 +224,12 @@ function saveScreeningEventSeries(params) {
|
|
|
212
224
|
const availablePaymentMethodTypes = yield repos.categoryCode.search({
|
|
213
225
|
project: { id: { $eq: params.project.id } },
|
|
214
226
|
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
|
|
215
|
-
});
|
|
227
|
+
}, [], []);
|
|
216
228
|
const screeningEventSerieses = filmsFromCOA.map((filmFromCOA) => {
|
|
217
229
|
return createScreeningEventSeriesFromCOA({
|
|
218
230
|
project: project,
|
|
219
231
|
filmFromCOA: filmFromCOA,
|
|
220
|
-
movieTheater: movieTheater,
|
|
232
|
+
movieTheater: params.movieTheater,
|
|
221
233
|
eirinKubuns: eirinKubuns,
|
|
222
234
|
eizouKubuns: eizouKubuns,
|
|
223
235
|
joueihousikiKubuns: joueihousikiKubuns,
|
|
@@ -291,7 +303,7 @@ function saveScreeningEvents(params) {
|
|
|
291
303
|
}
|
|
292
304
|
function createScreeningEvents(params) {
|
|
293
305
|
return () => __awaiter(this, void 0, void 0, function* () {
|
|
294
|
-
const movieTheater = params.movieTheater;
|
|
306
|
+
// const movieTheater = params.movieTheater;
|
|
295
307
|
const screeningEventSerieses = params.screeningEventSerieses;
|
|
296
308
|
const project = params.project;
|
|
297
309
|
const masterService = new COA.service.Master({
|
|
@@ -327,8 +339,11 @@ function createScreeningEvents(params) {
|
|
|
327
339
|
titleCode: scheduleFromCOA.titleCode,
|
|
328
340
|
titleBranchNum: scheduleFromCOA.titleBranchNum
|
|
329
341
|
});
|
|
330
|
-
//
|
|
331
|
-
const screenRoom =
|
|
342
|
+
// ルーム存在チェック
|
|
343
|
+
const screenRoom = params.screeningRooms.find((place) => place.branchCode === scheduleFromCOA.screenCode);
|
|
344
|
+
// const screenRoom = <factory.place.screeningRoom.IPlace | undefined>movieTheater.containsPlace.find(
|
|
345
|
+
// (place) => place.branchCode === scheduleFromCOA.screenCode
|
|
346
|
+
// );
|
|
332
347
|
if (screenRoom === undefined) {
|
|
333
348
|
// tslint:disable-next-line:no-console
|
|
334
349
|
console.error('screenRoom not found.', scheduleFromCOA.screenCode);
|
|
@@ -446,7 +461,15 @@ function createScreeningEventFromCOA(params) {
|
|
|
446
461
|
typeOf: 'WebAPI',
|
|
447
462
|
identifier: factory.service.webAPI.Identifier.COA
|
|
448
463
|
},
|
|
449
|
-
priceCurrency: factory.priceCurrency.JPY
|
|
464
|
+
priceCurrency: factory.priceCurrency.JPY,
|
|
465
|
+
itemOffered: {
|
|
466
|
+
serviceOutput: {
|
|
467
|
+
reservedTicket: {
|
|
468
|
+
typeOf: 'Ticket',
|
|
469
|
+
ticketedSeat: { typeOf: factory.placeType.Seat }
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
450
473
|
};
|
|
451
474
|
const { additionalProperty, coaInfo } = createScreeningEventAdditionalPropertyFromCOA(params);
|
|
452
475
|
return {
|
|
@@ -584,7 +607,10 @@ function createScreeningEventSeriesFromCOA(params) {
|
|
|
584
607
|
endDate: endDate,
|
|
585
608
|
startDate: startDate,
|
|
586
609
|
coaInfo,
|
|
587
|
-
offers: Object.assign({
|
|
610
|
+
offers: Object.assign({
|
|
611
|
+
// 不要なので廃止(2023-06-09~)
|
|
612
|
+
// project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
613
|
+
typeOf: factory.offerType.Offer, priceCurrency: factory.priceCurrency.JPY }, (Array.isArray(unacceptedPaymentMethod)) ? { unacceptedPaymentMethod: unacceptedPaymentMethod } : undefined),
|
|
588
614
|
additionalProperty
|
|
589
615
|
};
|
|
590
616
|
}
|
|
@@ -765,8 +791,14 @@ function updateEvent4ttts(params) {
|
|
|
765
791
|
throw error;
|
|
766
792
|
}
|
|
767
793
|
// アクション完了
|
|
768
|
-
yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: {} });
|
|
769
|
-
yield (0, offer_1.onEventChanged)({
|
|
794
|
+
yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: { id: event.id } });
|
|
795
|
+
yield (0, offer_1.onEventChanged)({
|
|
796
|
+
id: [event.id],
|
|
797
|
+
project: { id: event.project.id },
|
|
798
|
+
typeOf: event.typeOf,
|
|
799
|
+
isNew: false,
|
|
800
|
+
useInform: true
|
|
801
|
+
})({
|
|
770
802
|
event: repos.event,
|
|
771
803
|
project: repos.project,
|
|
772
804
|
task: repos.task
|
|
@@ -12,7 +12,7 @@ function task2lineNotify(params) {
|
|
|
12
12
|
const lastExecutionResult = (task.executionResults.length > 0) ? task.executionResults.slice(-1)[0] : undefined;
|
|
13
13
|
let lastError = lastExecutionResult === null || lastExecutionResult === void 0 ? void 0 : lastExecutionResult.error;
|
|
14
14
|
if (typeof lastError === 'string') {
|
|
15
|
-
lastError = { message: lastError };
|
|
15
|
+
lastError = { message: lastError, name: 'Error' };
|
|
16
16
|
}
|
|
17
17
|
const lastMessage = `${String(lastError === null || lastError === void 0 ? void 0 : lastError.name)} ${String(lastError === null || lastError === void 0 ? void 0 : lastError.message)}`;
|
|
18
18
|
const content = `project:${(_a = task.project) === null || _a === void 0 ? void 0 : _a.id}
|
|
@@ -38,7 +38,7 @@ function tasks2lineNotify(params) {
|
|
|
38
38
|
const lastExecutionResult = (task.executionResults.length > 0) ? task.executionResults.slice(-1)[0] : undefined;
|
|
39
39
|
let lastError = lastExecutionResult === null || lastExecutionResult === void 0 ? void 0 : lastExecutionResult.error;
|
|
40
40
|
if (typeof lastError === 'string') {
|
|
41
|
-
lastError = { message: lastError };
|
|
41
|
+
lastError = { message: lastError, name: 'Error' };
|
|
42
42
|
}
|
|
43
43
|
const lastMessage = `${String(lastError === null || lastError === void 0 ? void 0 : lastError.name)} ${String(lastError === null || lastError === void 0 ? void 0 : lastError.message)}`;
|
|
44
44
|
return `project:${(_a = task.project) === null || _a === void 0 ? void 0 : _a.id}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
2
|
import { MongoRepository as ActionRepo } from '../repo/action';
|
|
3
3
|
import { MongoRepository as ProjectRepo } from '../repo/project';
|
|
4
|
-
export type Operation<T> = (
|
|
4
|
+
export type Operation<T> = (repos: {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
}) => Promise<T>;
|
|
5
7
|
/**
|
|
6
8
|
* Eメールメッセージを送信する
|
|
7
9
|
* https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html
|