@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
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.call = void 0;
|
|
13
|
+
const factory = require("../../factory");
|
|
14
|
+
const accountTitle_1 = require("../../repo/accountTitle");
|
|
15
|
+
const categoryCode_1 = require("../../repo/categoryCode");
|
|
16
|
+
const creativeWork_1 = require("../../repo/creativeWork");
|
|
17
|
+
const place_1 = require("../../repo/place");
|
|
18
|
+
const product_1 = require("../../repo/product");
|
|
19
|
+
const task_1 = require("../../repo/task");
|
|
20
|
+
const settings_1 = require("../../settings");
|
|
21
|
+
const informResources = settings_1.settings.onResourceUpdated.informResource;
|
|
22
|
+
/**
|
|
23
|
+
* タスク実行関数
|
|
24
|
+
*/
|
|
25
|
+
function call(data) {
|
|
26
|
+
return (connectionSettings) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield onResourceUpdated(data)({
|
|
28
|
+
accountTitle: new accountTitle_1.MongoRepository(connectionSettings.connection),
|
|
29
|
+
categoryCode: new categoryCode_1.MongoRepository(connectionSettings.connection),
|
|
30
|
+
creativeWork: new creativeWork_1.MongoRepository(connectionSettings.connection),
|
|
31
|
+
place: new place_1.MongoRepository(connectionSettings.connection),
|
|
32
|
+
product: new product_1.MongoRepository(connectionSettings.connection),
|
|
33
|
+
task: new task_1.MongoRepository(connectionSettings.connection)
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.call = call;
|
|
38
|
+
function onResourceUpdated(params) {
|
|
39
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (params.useInform === true) {
|
|
41
|
+
switch (params.typeOf) {
|
|
42
|
+
case factory.creativeWorkType.Movie:
|
|
43
|
+
yield createInformMovieTasks({
|
|
44
|
+
project: { id: params.project.id },
|
|
45
|
+
ids: params.id,
|
|
46
|
+
typeOf: params.typeOf
|
|
47
|
+
})(repos);
|
|
48
|
+
break;
|
|
49
|
+
case factory.product.ProductType.EventService:
|
|
50
|
+
yield createInformProductTasks({
|
|
51
|
+
project: { id: params.project.id },
|
|
52
|
+
ids: params.id,
|
|
53
|
+
typeOf: params.typeOf
|
|
54
|
+
})(repos);
|
|
55
|
+
break;
|
|
56
|
+
case 'CategoryCode':
|
|
57
|
+
yield createInformCategoryCodeTasks({
|
|
58
|
+
project: { id: params.project.id },
|
|
59
|
+
ids: params.id,
|
|
60
|
+
typeOf: params.typeOf
|
|
61
|
+
})(repos);
|
|
62
|
+
break;
|
|
63
|
+
case factory.placeType.MovieTheater:
|
|
64
|
+
yield createInformMovieTheaterTasks({
|
|
65
|
+
project: { id: params.project.id },
|
|
66
|
+
ids: params.id,
|
|
67
|
+
typeOf: params.typeOf
|
|
68
|
+
})(repos);
|
|
69
|
+
break;
|
|
70
|
+
case 'AccountTitle':
|
|
71
|
+
yield createInformAccountTitleTasks({
|
|
72
|
+
project: { id: params.project.id },
|
|
73
|
+
ids: params.id,
|
|
74
|
+
typeOf: params.typeOf
|
|
75
|
+
})(repos);
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
// no op
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// switch (params.typeOf) {
|
|
82
|
+
// case factory.placeType.MovieTheater:
|
|
83
|
+
// await syncScreeningRooms({
|
|
84
|
+
// project: { id: params.project.id },
|
|
85
|
+
// ids: params.id,
|
|
86
|
+
// typeOf: params.typeOf
|
|
87
|
+
// })(repos);
|
|
88
|
+
// break;
|
|
89
|
+
// default:
|
|
90
|
+
// // no op
|
|
91
|
+
// }
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function createInformMovieTasks(params) {
|
|
95
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
const movies4inform = yield repos.creativeWork.searchMovies({ id: { $in: params.ids } }, [
|
|
97
|
+
'additionalProperty', 'datePublished', 'duration', 'identifier', 'name', 'project',
|
|
98
|
+
'typeOf', 'distributor', 'contentRating', 'headline', 'thumbnailUrl'
|
|
99
|
+
], []);
|
|
100
|
+
if (movies4inform.length > 0) {
|
|
101
|
+
const taskRunsAt = new Date();
|
|
102
|
+
const informTasks = [];
|
|
103
|
+
informResources === null || informResources === void 0 ? void 0 : informResources.forEach((informResource) => {
|
|
104
|
+
var _a;
|
|
105
|
+
const informUrl = String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.url);
|
|
106
|
+
movies4inform.forEach((movie4inform) => {
|
|
107
|
+
var _a;
|
|
108
|
+
// _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
109
|
+
delete movie4inform._id;
|
|
110
|
+
const informActionAttributes = {
|
|
111
|
+
agent: movie4inform.project,
|
|
112
|
+
object: movie4inform,
|
|
113
|
+
project: movie4inform.project,
|
|
114
|
+
recipient: {
|
|
115
|
+
id: '',
|
|
116
|
+
name: String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.name),
|
|
117
|
+
typeOf: factory.creativeWorkType.WebApplication,
|
|
118
|
+
url: informUrl
|
|
119
|
+
},
|
|
120
|
+
typeOf: factory.actionType.InformAction
|
|
121
|
+
};
|
|
122
|
+
informTasks.push({
|
|
123
|
+
project: movie4inform.project,
|
|
124
|
+
name: factory.taskName.TriggerWebhook,
|
|
125
|
+
status: factory.taskStatus.Ready,
|
|
126
|
+
runsAt: taskRunsAt,
|
|
127
|
+
remainingNumberOfTries: 10,
|
|
128
|
+
numberOfTried: 0,
|
|
129
|
+
executionResults: [],
|
|
130
|
+
data: informActionAttributes
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
if (informTasks.length > 0) {
|
|
135
|
+
yield repos.task.saveMany(informTasks, { emitImmediately: true });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function createInformProductTasks(params) {
|
|
141
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
const products4inform = yield repos.product.search({
|
|
143
|
+
typeOf: { $eq: params.typeOf },
|
|
144
|
+
id: { $in: params.ids }
|
|
145
|
+
}, ['additionalProperty', 'description', 'name', 'productID', 'project', 'typeOf', 'serviceType'], []);
|
|
146
|
+
if (products4inform.length > 0) {
|
|
147
|
+
const taskRunsAt = new Date();
|
|
148
|
+
const informTasks = [];
|
|
149
|
+
informResources === null || informResources === void 0 ? void 0 : informResources.forEach((informResource) => {
|
|
150
|
+
var _a;
|
|
151
|
+
const informUrl = String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.url);
|
|
152
|
+
products4inform.forEach((product4inform) => {
|
|
153
|
+
var _a;
|
|
154
|
+
// _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
155
|
+
delete product4inform._id;
|
|
156
|
+
const informActionAttributes = {
|
|
157
|
+
agent: product4inform.project,
|
|
158
|
+
object: product4inform,
|
|
159
|
+
project: product4inform.project,
|
|
160
|
+
recipient: {
|
|
161
|
+
id: '',
|
|
162
|
+
name: String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.name),
|
|
163
|
+
typeOf: factory.creativeWorkType.WebApplication,
|
|
164
|
+
url: informUrl
|
|
165
|
+
},
|
|
166
|
+
typeOf: factory.actionType.InformAction
|
|
167
|
+
};
|
|
168
|
+
informTasks.push({
|
|
169
|
+
project: product4inform.project,
|
|
170
|
+
name: factory.taskName.TriggerWebhook,
|
|
171
|
+
status: factory.taskStatus.Ready,
|
|
172
|
+
runsAt: taskRunsAt,
|
|
173
|
+
remainingNumberOfTries: 10,
|
|
174
|
+
numberOfTried: 0,
|
|
175
|
+
executionResults: [],
|
|
176
|
+
data: informActionAttributes
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
if (informTasks.length > 0) {
|
|
181
|
+
yield repos.task.saveMany(informTasks, { emitImmediately: true });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function createInformCategoryCodeTasks(params) {
|
|
187
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
const categoryCodes4inform = yield repos.categoryCode.search({
|
|
189
|
+
id: { $in: params.ids },
|
|
190
|
+
// ひとまずDistributorTypeのみ
|
|
191
|
+
inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.DistributorType } }
|
|
192
|
+
}, ['name', 'additionalProperty', 'project', 'typeOf', 'codeValue', 'inCodeSet'], []);
|
|
193
|
+
if (categoryCodes4inform.length > 0) {
|
|
194
|
+
const taskRunsAt = new Date();
|
|
195
|
+
const informTasks = [];
|
|
196
|
+
informResources === null || informResources === void 0 ? void 0 : informResources.forEach((informResource) => {
|
|
197
|
+
var _a;
|
|
198
|
+
const informUrl = String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.url);
|
|
199
|
+
categoryCodes4inform.forEach((categoryCode4inform) => {
|
|
200
|
+
var _a;
|
|
201
|
+
// _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
202
|
+
delete categoryCode4inform._id;
|
|
203
|
+
const informActionAttributes = {
|
|
204
|
+
agent: categoryCode4inform.project,
|
|
205
|
+
object: categoryCode4inform,
|
|
206
|
+
project: categoryCode4inform.project,
|
|
207
|
+
recipient: {
|
|
208
|
+
id: '',
|
|
209
|
+
name: String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.name),
|
|
210
|
+
typeOf: factory.creativeWorkType.WebApplication,
|
|
211
|
+
url: informUrl
|
|
212
|
+
},
|
|
213
|
+
typeOf: factory.actionType.InformAction
|
|
214
|
+
};
|
|
215
|
+
informTasks.push({
|
|
216
|
+
project: categoryCode4inform.project,
|
|
217
|
+
name: factory.taskName.TriggerWebhook,
|
|
218
|
+
status: factory.taskStatus.Ready,
|
|
219
|
+
runsAt: taskRunsAt,
|
|
220
|
+
remainingNumberOfTries: 10,
|
|
221
|
+
numberOfTried: 0,
|
|
222
|
+
executionResults: [],
|
|
223
|
+
data: informActionAttributes
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
if (informTasks.length > 0) {
|
|
228
|
+
yield repos.task.saveMany(informTasks, { emitImmediately: true });
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function createInformMovieTheaterTasks(params) {
|
|
234
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
if (params.ids.length !== 1) {
|
|
236
|
+
throw new factory.errors.Argument('id', 'id.length must be 1');
|
|
237
|
+
}
|
|
238
|
+
const movieTheaters = yield repos.place.searchMovieTheaters({
|
|
239
|
+
limit: 1,
|
|
240
|
+
page: 1,
|
|
241
|
+
project: { id: { $eq: params.project.id } },
|
|
242
|
+
id: { $eq: params.ids[0] }
|
|
243
|
+
}, [
|
|
244
|
+
'additionalProperty',
|
|
245
|
+
'branchCode',
|
|
246
|
+
'hasEntranceGate',
|
|
247
|
+
'hasPOS',
|
|
248
|
+
'kanaName',
|
|
249
|
+
'name',
|
|
250
|
+
'parentOrganization',
|
|
251
|
+
'project',
|
|
252
|
+
'telephone',
|
|
253
|
+
'url',
|
|
254
|
+
'typeOf'
|
|
255
|
+
// 'containsPlace.branchCode',
|
|
256
|
+
// 'containsPlace.name',
|
|
257
|
+
// 'containsPlace.typeOf',
|
|
258
|
+
// 'containsPlace.additionalProperty',
|
|
259
|
+
// 'containsPlace.address'
|
|
260
|
+
], []);
|
|
261
|
+
const movieTheater = movieTheaters.shift();
|
|
262
|
+
if (movieTheater === undefined) {
|
|
263
|
+
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
264
|
+
}
|
|
265
|
+
// ルームを検索
|
|
266
|
+
const screeningRooms = yield repos.place.searchScreeningRooms({
|
|
267
|
+
containedInPlace: { id: { $eq: movieTheater.id } }
|
|
268
|
+
});
|
|
269
|
+
const movieTheaters4inform = [Object.assign(Object.assign({}, movieTheater), { containsPlace: screeningRooms.map((room) => {
|
|
270
|
+
return {
|
|
271
|
+
branchCode: room.branchCode,
|
|
272
|
+
name: room.name,
|
|
273
|
+
typeOf: room.typeOf,
|
|
274
|
+
additionalProperty: room.additionalProperty,
|
|
275
|
+
address: room.address
|
|
276
|
+
};
|
|
277
|
+
}) })];
|
|
278
|
+
if (movieTheaters4inform.length > 0) {
|
|
279
|
+
const taskRunsAt = new Date();
|
|
280
|
+
const informTasks = [];
|
|
281
|
+
informResources === null || informResources === void 0 ? void 0 : informResources.forEach((informResource) => {
|
|
282
|
+
var _a;
|
|
283
|
+
const informUrl = String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.url);
|
|
284
|
+
movieTheaters4inform.forEach((movieTheater4inform) => {
|
|
285
|
+
var _a;
|
|
286
|
+
// _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
287
|
+
delete movieTheater4inform._id;
|
|
288
|
+
const informActionAttributes = {
|
|
289
|
+
agent: movieTheater4inform.project,
|
|
290
|
+
object: movieTheater4inform,
|
|
291
|
+
project: movieTheater4inform.project,
|
|
292
|
+
recipient: {
|
|
293
|
+
id: '',
|
|
294
|
+
name: String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.name),
|
|
295
|
+
typeOf: factory.creativeWorkType.WebApplication,
|
|
296
|
+
url: informUrl
|
|
297
|
+
},
|
|
298
|
+
typeOf: factory.actionType.InformAction
|
|
299
|
+
};
|
|
300
|
+
informTasks.push({
|
|
301
|
+
project: movieTheater4inform.project,
|
|
302
|
+
name: factory.taskName.TriggerWebhook,
|
|
303
|
+
status: factory.taskStatus.Ready,
|
|
304
|
+
runsAt: taskRunsAt,
|
|
305
|
+
remainingNumberOfTries: 10,
|
|
306
|
+
numberOfTried: 0,
|
|
307
|
+
executionResults: [],
|
|
308
|
+
data: informActionAttributes
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
if (informTasks.length > 0) {
|
|
313
|
+
yield repos.task.saveMany(informTasks, { emitImmediately: true });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function createInformAccountTitleTasks(params) {
|
|
319
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
320
|
+
if (params.ids.length !== 1) {
|
|
321
|
+
throw new factory.errors.Argument('id', 'id.length must be 1');
|
|
322
|
+
}
|
|
323
|
+
const accountTitle = yield repos.accountTitle.accountTitleModel.findOne({
|
|
324
|
+
_id: { $eq: params.ids[0] },
|
|
325
|
+
'project.id': { $eq: params.project.id }
|
|
326
|
+
}, {
|
|
327
|
+
additionalProperty: 1,
|
|
328
|
+
codeValue: 1,
|
|
329
|
+
hasCategoryCode: 1,
|
|
330
|
+
name: 1,
|
|
331
|
+
project: 1,
|
|
332
|
+
typeOf: 1
|
|
333
|
+
})
|
|
334
|
+
.exec()
|
|
335
|
+
.then((doc) => {
|
|
336
|
+
if (doc === null) {
|
|
337
|
+
throw new factory.errors.NotFound(params.typeOf);
|
|
338
|
+
}
|
|
339
|
+
return doc.toObject();
|
|
340
|
+
});
|
|
341
|
+
const accountTitles4inform = [accountTitle];
|
|
342
|
+
if (accountTitles4inform.length > 0) {
|
|
343
|
+
const taskRunsAt = new Date();
|
|
344
|
+
const informTasks = [];
|
|
345
|
+
informResources === null || informResources === void 0 ? void 0 : informResources.forEach((informResource) => {
|
|
346
|
+
var _a;
|
|
347
|
+
const informUrl = String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.url);
|
|
348
|
+
accountTitles4inform.forEach((accountTitle4inform) => {
|
|
349
|
+
var _a;
|
|
350
|
+
// _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
351
|
+
delete accountTitle4inform._id;
|
|
352
|
+
const informActionAttributes = {
|
|
353
|
+
agent: accountTitle4inform.project,
|
|
354
|
+
object: accountTitle4inform,
|
|
355
|
+
project: accountTitle4inform.project,
|
|
356
|
+
recipient: {
|
|
357
|
+
id: '',
|
|
358
|
+
name: String((_a = informResource.recipient) === null || _a === void 0 ? void 0 : _a.name),
|
|
359
|
+
typeOf: factory.creativeWorkType.WebApplication,
|
|
360
|
+
url: informUrl
|
|
361
|
+
},
|
|
362
|
+
typeOf: factory.actionType.InformAction
|
|
363
|
+
};
|
|
364
|
+
informTasks.push({
|
|
365
|
+
project: accountTitle4inform.project,
|
|
366
|
+
name: factory.taskName.TriggerWebhook,
|
|
367
|
+
status: factory.taskStatus.Ready,
|
|
368
|
+
runsAt: taskRunsAt,
|
|
369
|
+
remainingNumberOfTries: 10,
|
|
370
|
+
numberOfTried: 0,
|
|
371
|
+
executionResults: [],
|
|
372
|
+
data: informActionAttributes
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
if (informTasks.length > 0) {
|
|
377
|
+
yield repos.task.saveMany(informTasks, { emitImmediately: true });
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* 施設のcontainsPlaceをdocumentとして保管する
|
|
384
|
+
*/
|
|
385
|
+
// function syncScreeningRooms(params: {
|
|
386
|
+
// project: { id: string };
|
|
387
|
+
// ids: string[];
|
|
388
|
+
// typeOf: factory.placeType.MovieTheater;
|
|
389
|
+
// }) {
|
|
390
|
+
// return async (repos: {
|
|
391
|
+
// place: PlaceRepo;
|
|
392
|
+
// }) => {
|
|
393
|
+
// if (params.ids.length !== 1) {
|
|
394
|
+
// throw new factory.errors.Argument('id', 'id.length must be 1');
|
|
395
|
+
// }
|
|
396
|
+
// const movieTheaters = <Pick<
|
|
397
|
+
// factory.place.movieTheater.IPlace,
|
|
398
|
+
// 'id' | 'branchCode' | 'name' | 'project' | 'typeOf' | 'containsPlace'
|
|
399
|
+
// >[]>
|
|
400
|
+
// await repos.place.searchMovieTheaters(
|
|
401
|
+
// { id: { $eq: params.ids[0] } },
|
|
402
|
+
// ['_id', 'branchCode', 'name', 'project', 'typeOf', 'containsPlace'],
|
|
403
|
+
// []
|
|
404
|
+
// );
|
|
405
|
+
// const movieTheater = movieTheaters.shift();
|
|
406
|
+
// if (movieTheater === undefined) {
|
|
407
|
+
// throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
408
|
+
// }
|
|
409
|
+
// const creatingScreeningRooms: factory.place.screeningRoom.IPlace[] = movieTheater.containsPlace.map((place) => {
|
|
410
|
+
// return {
|
|
411
|
+
// ...place,
|
|
412
|
+
// containedInPlace: {
|
|
413
|
+
// id: movieTheater.id,
|
|
414
|
+
// typeOf: movieTheater.typeOf,
|
|
415
|
+
// branchCode: movieTheater.branchCode,
|
|
416
|
+
// name: movieTheater.name
|
|
417
|
+
// },
|
|
418
|
+
// project: movieTheater.project
|
|
419
|
+
// };
|
|
420
|
+
// });
|
|
421
|
+
// debug('sync processing', creatingScreeningRooms.length, 'screeningRooms...');
|
|
422
|
+
// };
|
|
423
|
+
// }
|
|
@@ -32,7 +32,7 @@ function call(data) {
|
|
|
32
32
|
const taskRepo = new task_1.MongoRepository(settings.connection);
|
|
33
33
|
const transactionRepo = new transaction_1.MongoRepository(settings.connection);
|
|
34
34
|
const registerServiceInProgressRepo = new registerServiceInProgress_1.RedisRepository(settings.redisClient);
|
|
35
|
-
yield OrderService.placeOrder(data)({
|
|
35
|
+
yield OrderService.placeOrder(Object.assign(Object.assign({}, data), { useOnOrderStatusChanged: true }))({
|
|
36
36
|
accountingReport: accountingReportRepo,
|
|
37
37
|
action: actionRepo,
|
|
38
38
|
order: orderRepo,
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = void 0;
|
|
13
13
|
const action_1 = require("../../repo/action");
|
|
14
|
+
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
14
15
|
const reservation_1 = require("../../repo/reservation");
|
|
15
16
|
const task_1 = require("../../repo/task");
|
|
16
17
|
const ReserveService = require("../reserve");
|
|
@@ -19,13 +20,15 @@ const ReserveService = require("../reserve");
|
|
|
19
20
|
*/
|
|
20
21
|
function call(data) {
|
|
21
22
|
return (settings) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
yield ReserveService.confirmReservation({
|
|
24
|
+
actionAttributesList: data.actionAttributes,
|
|
25
|
+
useOnReservationConfirmed: true,
|
|
26
|
+
byTask: true
|
|
27
|
+
})({
|
|
28
|
+
action: new action_1.MongoRepository(settings.connection),
|
|
29
|
+
assetTransaction: new assetTransaction_1.MongoRepository(settings.connection),
|
|
30
|
+
reservation: new reservation_1.MongoRepository(settings.connection),
|
|
31
|
+
task: new task_1.MongoRepository(settings.connection)
|
|
29
32
|
});
|
|
30
33
|
});
|
|
31
34
|
}
|
|
@@ -32,7 +32,7 @@ function call(data) {
|
|
|
32
32
|
const taskRepo = new task_1.MongoRepository(settings.connection);
|
|
33
33
|
const transactionRepo = new transaction_1.MongoRepository(settings.connection);
|
|
34
34
|
const registerServiceInProgressRepo = new registerServiceInProgress_1.RedisRepository(settings.redisClient);
|
|
35
|
-
yield OrderService.returnOrder(data)({
|
|
35
|
+
yield OrderService.returnOrder(Object.assign(Object.assign({}, data), { useOnOrderStatusChanged: true }))({
|
|
36
36
|
action: actionRepo,
|
|
37
37
|
order: orderRepo,
|
|
38
38
|
ownershipInfo: ownershipInfoRepo,
|
|
@@ -134,13 +134,7 @@ function refundTransactionAlreadyExists(params) {
|
|
|
134
134
|
typeOf: factory.assetTransactionType.Refund,
|
|
135
135
|
statuses: [factory.transactionStatusType.Confirmed],
|
|
136
136
|
object: { paymentMethodId: { $eq: params.object.paymentMethodId } }
|
|
137
|
-
},
|
|
138
|
-
agent: 0,
|
|
139
|
-
object: 0,
|
|
140
|
-
potentialActions: 0,
|
|
141
|
-
recipient: 0,
|
|
142
|
-
result: 0
|
|
143
|
-
});
|
|
137
|
+
}, ['_id'], []);
|
|
144
138
|
return refundTransactions.length > 0;
|
|
145
139
|
});
|
|
146
140
|
}
|
|
@@ -219,10 +213,6 @@ function onRefund(refundActionAttributes) {
|
|
|
219
213
|
});
|
|
220
214
|
}
|
|
221
215
|
// タスク保管
|
|
222
|
-
|
|
223
|
-
yield repos.task.saveMany(taskAttributes);
|
|
224
|
-
// await Promise.all(taskAttributes.map(async (taskAttribute) => {
|
|
225
|
-
// return repos.task.save(taskAttribute);
|
|
226
|
-
// }));
|
|
216
|
+
yield repos.task.saveMany(taskAttributes, { emitImmediately: true });
|
|
227
217
|
});
|
|
228
218
|
}
|
|
@@ -32,7 +32,7 @@ function call(data) {
|
|
|
32
32
|
const taskRepo = new task_1.MongoRepository(settings.connection);
|
|
33
33
|
const transactionRepo = new transaction_1.MongoRepository(settings.connection);
|
|
34
34
|
const registerServiceInProgressRepo = new registerServiceInProgress_1.RedisRepository(settings.redisClient);
|
|
35
|
-
yield OrderService.sendOrder(data)({
|
|
35
|
+
yield OrderService.sendOrder(Object.assign(Object.assign({}, data), { useOnOrderStatusChanged: true }))({
|
|
36
36
|
action: actionRepo,
|
|
37
37
|
order: orderRepo,
|
|
38
38
|
ownershipInfo: ownershipInfoRepo,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import { IConnectionSettings } from '../task';
|
|
3
|
+
export type IOperation<T> = (settings: IConnectionSettings) => Promise<T>;
|
|
4
|
+
/**
|
|
5
|
+
* タスク実行関数
|
|
6
|
+
*/
|
|
7
|
+
export declare function call(data: factory.task.syncScreeningRooms.IData): IOperation<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.call = void 0;
|
|
13
|
+
const place_1 = require("../../repo/place");
|
|
14
|
+
/**
|
|
15
|
+
* タスク実行関数
|
|
16
|
+
*/
|
|
17
|
+
function call(data) {
|
|
18
|
+
return (connectionSettings) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const placeRepo = new place_1.MongoRepository(connectionSettings.connection);
|
|
20
|
+
yield placeRepo.syncScreeningRooms({ id: data.id });
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.call = call;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import { IConnectionSettings } from '../task';
|
|
3
|
+
export type IOperation<T> = (settings: IConnectionSettings) => Promise<T>;
|
|
4
|
+
/**
|
|
5
|
+
* タスク実行関数
|
|
6
|
+
*/
|
|
7
|
+
export declare function call(data: factory.task.useReservation.IData): IOperation<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.call = void 0;
|
|
13
|
+
const action_1 = require("../../repo/action");
|
|
14
|
+
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
15
|
+
const order_1 = require("../../repo/order");
|
|
16
|
+
const reservation_1 = require("../../repo/reservation");
|
|
17
|
+
const task_1 = require("../../repo/task");
|
|
18
|
+
const reserve_1 = require("../reserve");
|
|
19
|
+
/**
|
|
20
|
+
* タスク実行関数
|
|
21
|
+
*/
|
|
22
|
+
function call(data) {
|
|
23
|
+
return (settings) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
yield (0, reserve_1.useReservation)(Object.assign(Object.assign({ project: data.project, agent: data.agent, object: data.object,
|
|
26
|
+
// タスク作成前に検証済なので検証不要
|
|
27
|
+
verifyToken: false, reserveIfNotYet: data.reserveIfNotYet }, (typeof ((_a = data.instrument) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { instrument: data.instrument } : undefined), (typeof ((_b = data.location) === null || _b === void 0 ? void 0 : _b.typeOf) === 'string') ? { location: data.location } : undefined))({
|
|
28
|
+
action: new action_1.MongoRepository(settings.connection),
|
|
29
|
+
assetTransaction: new assetTransaction_1.MongoRepository(settings.connection),
|
|
30
|
+
order: new order_1.MongoRepository(settings.connection),
|
|
31
|
+
reservation: new reservation_1.MongoRepository(settings.connection),
|
|
32
|
+
task: new task_1.MongoRepository(settings.connection)
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.call = call;
|
|
@@ -17,6 +17,7 @@ const offer_1 = require("../../repo/rateLimit/offer");
|
|
|
17
17
|
const reservation_1 = require("../../repo/reservation");
|
|
18
18
|
const stockHolder_1 = require("../../repo/stockHolder");
|
|
19
19
|
const task_1 = require("../../repo/task");
|
|
20
|
+
const transaction_1 = require("../../repo/transaction");
|
|
20
21
|
const EventOfferService = require("../offer/event");
|
|
21
22
|
/**
|
|
22
23
|
* タスク実行関数
|
|
@@ -28,7 +29,7 @@ function call(data) {
|
|
|
28
29
|
}
|
|
29
30
|
const actionRepo = new action_1.MongoRepository(settings.connection);
|
|
30
31
|
const assetTransactionRepo = new assetTransaction_1.MongoRepository(settings.connection);
|
|
31
|
-
const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
|
|
32
|
+
const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection);
|
|
32
33
|
const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
|
|
33
34
|
const reservationRepo = new reservation_1.MongoRepository(settings.connection);
|
|
34
35
|
const taskRepo = new task_1.MongoRepository(settings.connection);
|
|
@@ -38,7 +39,8 @@ function call(data) {
|
|
|
38
39
|
stockHolder: stockHolderRepo,
|
|
39
40
|
offerRateLimit: offerRateLimitRepo,
|
|
40
41
|
reservation: reservationRepo,
|
|
41
|
-
task: taskRepo
|
|
42
|
+
task: taskRepo,
|
|
43
|
+
transaction: new transaction_1.MongoRepository(settings.connection)
|
|
42
44
|
});
|
|
43
45
|
});
|
|
44
46
|
}
|
|
@@ -18,12 +18,18 @@ export type TaskOperation<T> = (repos: {
|
|
|
18
18
|
export type IOperation<T> = (settings: IConnectionSettings) => Promise<T>;
|
|
19
19
|
export declare function executeById(params: {
|
|
20
20
|
id: string;
|
|
21
|
+
executor?: {
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
21
24
|
}): IOperation<void>;
|
|
22
25
|
/**
|
|
23
26
|
* タスク名でタスクをひとつ実行する
|
|
24
27
|
*/
|
|
25
28
|
export declare function executeByName<T extends factory.taskName>(params: {
|
|
26
29
|
name: T;
|
|
30
|
+
executor?: {
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
27
33
|
}): IOperation<void>;
|
|
28
34
|
/**
|
|
29
35
|
* タスクを実行する
|