@chevre/domain 21.2.0-alpha.14 → 21.2.0-alpha.140
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/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 +93 -24
- package/lib/chevre/repo/place.js +224 -78
- 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
package/lib/chevre/repo/place.js
CHANGED
|
@@ -21,9 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
|
+
const createDebug = require("debug");
|
|
24
25
|
const mongoose_1 = require("mongoose");
|
|
25
26
|
const place_1 = require("./mongoose/schemas/place");
|
|
26
27
|
const factory = require("../factory");
|
|
28
|
+
const settings_1 = require("../settings");
|
|
29
|
+
const debug = createDebug('chevre-domain:repo:place');
|
|
27
30
|
/**
|
|
28
31
|
* 施設リポジトリ
|
|
29
32
|
*/
|
|
@@ -220,7 +223,16 @@ class MongoRepository {
|
|
|
220
223
|
else {
|
|
221
224
|
// 上書き禁止属性を除外(2022-08-24~)
|
|
222
225
|
const { id, branchCode, project, typeOf } = params, updateFields = __rest(params, ["id", "branchCode", "project", "typeOf"]);
|
|
223
|
-
doc = yield this.placeModel.findOneAndUpdate({ _id: params.id }, updateFields, {
|
|
226
|
+
doc = yield this.placeModel.findOneAndUpdate({ _id: params.id }, updateFields, {
|
|
227
|
+
upsert: false,
|
|
228
|
+
new: true,
|
|
229
|
+
projection: {
|
|
230
|
+
__v: 0,
|
|
231
|
+
createdAt: 0,
|
|
232
|
+
updatedAt: 0,
|
|
233
|
+
containsPlace: 0
|
|
234
|
+
}
|
|
235
|
+
})
|
|
224
236
|
.exec();
|
|
225
237
|
}
|
|
226
238
|
if (doc === null) {
|
|
@@ -229,50 +241,72 @@ class MongoRepository {
|
|
|
229
241
|
return doc.toObject();
|
|
230
242
|
});
|
|
231
243
|
}
|
|
244
|
+
// void化(2023-06-23~)
|
|
232
245
|
saveMovieTheaterByBranchCode4coa(params) {
|
|
233
246
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
-
|
|
235
|
-
'project.id': { $eq: params.project.id },
|
|
236
|
-
branchCode: { $eq: params.branchCode }
|
|
237
|
-
}, params, { new: true })
|
|
238
|
-
.exec()
|
|
239
|
-
.then((doc) => {
|
|
240
|
-
if (doc === null) {
|
|
241
|
-
throw new factory.errors.NotFound(`${factory.placeType.MovieTheater} ${params.branchCode}`);
|
|
242
|
-
}
|
|
243
|
-
return doc.toObject();
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
findMovieTheaterByBranchCode(params) {
|
|
248
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
-
return this.placeModel.findOne({
|
|
247
|
+
yield this.placeModel.updateOne({
|
|
250
248
|
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
251
249
|
'project.id': { $eq: params.project.id },
|
|
252
250
|
branchCode: { $eq: params.branchCode }
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
createdAt: 0,
|
|
256
|
-
updatedAt: 0
|
|
257
|
-
})
|
|
258
|
-
.exec()
|
|
259
|
-
.then((doc) => {
|
|
260
|
-
if (doc === null) {
|
|
261
|
-
throw new factory.errors.NotFound(`${factory.placeType.MovieTheater} ${params.branchCode}`);
|
|
262
|
-
}
|
|
263
|
-
return doc.toObject();
|
|
264
|
-
});
|
|
251
|
+
}, params)
|
|
252
|
+
.exec();
|
|
265
253
|
});
|
|
266
254
|
}
|
|
255
|
+
// 廃止(2023-06-23~)
|
|
256
|
+
// public async findMovieTheaterByBranchCode(params: {
|
|
257
|
+
// project: { id: string };
|
|
258
|
+
// branchCode: string;
|
|
259
|
+
// }): Promise<factory.place.movieTheater.IPlace> {
|
|
260
|
+
// return this.placeModel.findOne(
|
|
261
|
+
// {
|
|
262
|
+
// typeOf: { $eq: factory.placeType.MovieTheater },
|
|
263
|
+
// 'project.id': { $eq: params.project.id },
|
|
264
|
+
// branchCode: { $eq: params.branchCode }
|
|
265
|
+
// },
|
|
266
|
+
// {
|
|
267
|
+
// __v: 0,
|
|
268
|
+
// createdAt: 0,
|
|
269
|
+
// updatedAt: 0
|
|
270
|
+
// }
|
|
271
|
+
// )
|
|
272
|
+
// .exec()
|
|
273
|
+
// .then((doc) => {
|
|
274
|
+
// if (doc === null) {
|
|
275
|
+
// throw new factory.errors.NotFound(`${factory.placeType.MovieTheater} ${params.branchCode}`);
|
|
276
|
+
// }
|
|
277
|
+
// return doc.toObject();
|
|
278
|
+
// });
|
|
279
|
+
// }
|
|
267
280
|
/**
|
|
268
281
|
* 施設検索
|
|
269
282
|
*/
|
|
270
|
-
searchMovieTheaters(params
|
|
283
|
+
searchMovieTheaters(params,
|
|
284
|
+
// projection明示指定化(2023-06-22~)
|
|
285
|
+
inclusion, exclusion) {
|
|
271
286
|
var _a;
|
|
272
287
|
return __awaiter(this, void 0, void 0, function* () {
|
|
273
288
|
const conditions = MongoRepository.CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params);
|
|
274
|
-
|
|
275
|
-
|
|
289
|
+
let projection = {};
|
|
290
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
291
|
+
inclusion.forEach((field) => {
|
|
292
|
+
projection[field] = 1;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
projection = {
|
|
297
|
+
__v: 0,
|
|
298
|
+
createdAt: 0,
|
|
299
|
+
updatedAt: 0,
|
|
300
|
+
// containsPlaceを含めるとデータサイズが大きくなるので、検索結果には含めない
|
|
301
|
+
containsPlace: 0
|
|
302
|
+
};
|
|
303
|
+
if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
304
|
+
exclusion.forEach((field) => {
|
|
305
|
+
projection[field] = 0;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const query = this.placeModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
276
310
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
277
311
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
278
312
|
query.limit(params.limit)
|
|
@@ -283,33 +317,56 @@ class MongoRepository {
|
|
|
283
317
|
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
|
|
284
318
|
query.sort({ branchCode: params.sort.branchCode });
|
|
285
319
|
}
|
|
286
|
-
return query.setOptions({ maxTimeMS:
|
|
320
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
287
321
|
.exec()
|
|
288
322
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
289
323
|
});
|
|
290
324
|
}
|
|
291
325
|
/**
|
|
292
326
|
* 施設取得
|
|
327
|
+
* 廃止(2023-06-22~)
|
|
293
328
|
*/
|
|
294
|
-
findById(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
329
|
+
// public async findById(
|
|
330
|
+
// params: { id: string },
|
|
331
|
+
// inclusion: string[],
|
|
332
|
+
// exclusion: string[]
|
|
333
|
+
// ): Promise<factory.place.movieTheater.IPlace> {
|
|
334
|
+
// let projection: { [key: string]: number } = {};
|
|
335
|
+
// if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
336
|
+
// inclusion.forEach((field) => {
|
|
337
|
+
// projection[field] = 1;
|
|
338
|
+
// });
|
|
339
|
+
// } else {
|
|
340
|
+
// projection = {
|
|
341
|
+
// __v: 0,
|
|
342
|
+
// createdAt: 0,
|
|
343
|
+
// updatedAt: 0
|
|
344
|
+
// };
|
|
345
|
+
// if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
346
|
+
// exclusion.forEach((field) => {
|
|
347
|
+
// projection[field] = 0;
|
|
348
|
+
// });
|
|
349
|
+
// }
|
|
350
|
+
// }
|
|
351
|
+
// const doc = await this.placeModel.findOne(
|
|
352
|
+
// {
|
|
353
|
+
// typeOf: { $eq: factory.placeType.MovieTheater },
|
|
354
|
+
// _id: { $eq: params.id }
|
|
355
|
+
// },
|
|
356
|
+
// projection
|
|
357
|
+
// )
|
|
358
|
+
// .exec();
|
|
359
|
+
// if (doc === null) {
|
|
360
|
+
// throw new factory.errors.NotFound(this.placeModel.modelName);
|
|
361
|
+
// }
|
|
362
|
+
// return doc.toObject();
|
|
363
|
+
// }
|
|
307
364
|
deleteMovieTheaterById(params) {
|
|
308
365
|
return __awaiter(this, void 0, void 0, function* () {
|
|
309
366
|
yield this.placeModel.findOneAndDelete({
|
|
310
367
|
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
311
368
|
_id: { $eq: params.id }
|
|
312
|
-
})
|
|
369
|
+
}, { projection: { _id: 1 } })
|
|
313
370
|
.exec()
|
|
314
371
|
.then((doc) => {
|
|
315
372
|
if (doc === null) {
|
|
@@ -322,6 +379,7 @@ class MongoRepository {
|
|
|
322
379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
323
380
|
// 施設存在確認
|
|
324
381
|
let doc = yield this.placeModel.findOne({
|
|
382
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
325
383
|
'project.id': { $eq: screeningRoom.project.id },
|
|
326
384
|
branchCode: screeningRoom.containedInPlace.branchCode
|
|
327
385
|
}, {
|
|
@@ -333,6 +391,7 @@ class MongoRepository {
|
|
|
333
391
|
}
|
|
334
392
|
// ルームコードが存在しなければ追加する
|
|
335
393
|
doc = yield this.placeModel.findOneAndUpdate({
|
|
394
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
336
395
|
'project.id': { $eq: screeningRoom.project.id },
|
|
337
396
|
branchCode: screeningRoom.containedInPlace.branchCode,
|
|
338
397
|
'containsPlace.branchCode': { $ne: screeningRoom.branchCode }
|
|
@@ -350,8 +409,9 @@ class MongoRepository {
|
|
|
350
409
|
new: true,
|
|
351
410
|
projection: {
|
|
352
411
|
_id: 1,
|
|
353
|
-
'project.id': 1,
|
|
354
|
-
branchCode: 1
|
|
412
|
+
// 'project.id': 1,
|
|
413
|
+
branchCode: 1,
|
|
414
|
+
typeOf: 1
|
|
355
415
|
}
|
|
356
416
|
})
|
|
357
417
|
.exec();
|
|
@@ -359,11 +419,13 @@ class MongoRepository {
|
|
|
359
419
|
if (doc === null) {
|
|
360
420
|
throw new factory.errors.AlreadyInUse(factory.placeType.ScreeningRoom, ['branchCode']);
|
|
361
421
|
}
|
|
422
|
+
return doc.toObject();
|
|
362
423
|
});
|
|
363
424
|
}
|
|
364
425
|
updateScreeningRoom(screeningRoom, $unset) {
|
|
365
426
|
return __awaiter(this, void 0, void 0, function* () {
|
|
366
427
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
428
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
367
429
|
'project.id': { $eq: screeningRoom.project.id },
|
|
368
430
|
branchCode: screeningRoom.containedInPlace.branchCode,
|
|
369
431
|
'containsPlace.branchCode': screeningRoom.branchCode
|
|
@@ -382,19 +444,22 @@ class MongoRepository {
|
|
|
382
444
|
],
|
|
383
445
|
projection: {
|
|
384
446
|
_id: 1,
|
|
385
|
-
'project.id': 1,
|
|
386
|
-
branchCode: 1
|
|
447
|
+
// 'project.id': 1,
|
|
448
|
+
branchCode: 1,
|
|
449
|
+
typeOf: 1
|
|
387
450
|
}
|
|
388
451
|
})
|
|
389
452
|
.exec();
|
|
390
453
|
if (doc === null) {
|
|
391
454
|
throw new factory.errors.NotFound(factory.placeType.ScreeningRoom);
|
|
392
455
|
}
|
|
456
|
+
return doc.toObject();
|
|
393
457
|
});
|
|
394
458
|
}
|
|
395
459
|
deleteScreeningRoom(screeningRoom) {
|
|
396
460
|
return __awaiter(this, void 0, void 0, function* () {
|
|
397
461
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
462
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
398
463
|
'project.id': { $eq: screeningRoom.project.id },
|
|
399
464
|
branchCode: screeningRoom.containedInPlace.branchCode,
|
|
400
465
|
'containsPlace.branchCode': screeningRoom.branchCode
|
|
@@ -402,11 +467,17 @@ class MongoRepository {
|
|
|
402
467
|
$pull: {
|
|
403
468
|
containsPlace: { branchCode: screeningRoom.branchCode }
|
|
404
469
|
}
|
|
470
|
+
}, {
|
|
471
|
+
projection: {
|
|
472
|
+
_id: 1,
|
|
473
|
+
typeOf: 1
|
|
474
|
+
}
|
|
405
475
|
})
|
|
406
476
|
.exec();
|
|
407
477
|
if (doc === null) {
|
|
408
478
|
throw new factory.errors.NotFound(factory.placeType.ScreeningRoom);
|
|
409
479
|
}
|
|
480
|
+
return doc.toObject();
|
|
410
481
|
});
|
|
411
482
|
}
|
|
412
483
|
createScreeningRoomSection(screeningRoomSection) {
|
|
@@ -421,6 +492,7 @@ class MongoRepository {
|
|
|
421
492
|
}
|
|
422
493
|
// 施設存在確認
|
|
423
494
|
let doc = yield this.placeModel.findOne({
|
|
495
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
424
496
|
'project.id': { $eq: screeningRoomSection.project.id },
|
|
425
497
|
branchCode: movieTheater.branchCode,
|
|
426
498
|
'containsPlace.branchCode': screeningRoom.branchCode
|
|
@@ -430,6 +502,7 @@ class MongoRepository {
|
|
|
430
502
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
431
503
|
}
|
|
432
504
|
doc = yield this.placeModel.findOneAndUpdate({
|
|
505
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
433
506
|
'project.id': { $eq: screeningRoomSection.project.id },
|
|
434
507
|
branchCode: movieTheater.branchCode,
|
|
435
508
|
'containsPlace.branchCode': screeningRoom.branchCode
|
|
@@ -449,7 +522,8 @@ class MongoRepository {
|
|
|
449
522
|
}
|
|
450
523
|
],
|
|
451
524
|
projection: {
|
|
452
|
-
_id: 1
|
|
525
|
+
_id: 1,
|
|
526
|
+
typeOf: 1
|
|
453
527
|
}
|
|
454
528
|
})
|
|
455
529
|
.exec();
|
|
@@ -457,6 +531,7 @@ class MongoRepository {
|
|
|
457
531
|
if (doc === null) {
|
|
458
532
|
throw new factory.errors.AlreadyInUse(factory.placeType.ScreeningRoomSection, ['branchCode']);
|
|
459
533
|
}
|
|
534
|
+
return doc.toObject();
|
|
460
535
|
});
|
|
461
536
|
}
|
|
462
537
|
updateScreeningRoomSection(screeningRoomSection, $unset) {
|
|
@@ -470,6 +545,7 @@ class MongoRepository {
|
|
|
470
545
|
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode');
|
|
471
546
|
}
|
|
472
547
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
548
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
473
549
|
'project.id': { $eq: screeningRoomSection.project.id },
|
|
474
550
|
branchCode: movieTheater.branchCode,
|
|
475
551
|
'containsPlace.branchCode': screeningRoom.branchCode,
|
|
@@ -495,13 +571,15 @@ class MongoRepository {
|
|
|
495
571
|
{ 'screeningRoomSection.branchCode': screeningRoomSection.branchCode }
|
|
496
572
|
],
|
|
497
573
|
projection: {
|
|
498
|
-
_id: 1
|
|
574
|
+
_id: 1,
|
|
575
|
+
typeOf: 1
|
|
499
576
|
}
|
|
500
577
|
})
|
|
501
578
|
.exec();
|
|
502
579
|
if (doc === null) {
|
|
503
580
|
throw new factory.errors.NotFound(factory.placeType.ScreeningRoomSection);
|
|
504
581
|
}
|
|
582
|
+
return doc.toObject();
|
|
505
583
|
});
|
|
506
584
|
}
|
|
507
585
|
// tslint:disable-next-line:max-func-body-length
|
|
@@ -635,6 +713,7 @@ class MongoRepository {
|
|
|
635
713
|
deleteScreeningRoomSection(screeningRoomSection) {
|
|
636
714
|
return __awaiter(this, void 0, void 0, function* () {
|
|
637
715
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
716
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
638
717
|
'project.id': { $eq: screeningRoomSection.project.id },
|
|
639
718
|
branchCode: screeningRoomSection.containedInPlace.containedInPlace.branchCode,
|
|
640
719
|
'containsPlace.branchCode': screeningRoomSection.containedInPlace.branchCode,
|
|
@@ -649,17 +728,22 @@ class MongoRepository {
|
|
|
649
728
|
new: true,
|
|
650
729
|
arrayFilters: [
|
|
651
730
|
{ 'screeningRoom.branchCode': screeningRoomSection.containedInPlace.branchCode }
|
|
652
|
-
]
|
|
731
|
+
],
|
|
732
|
+
projection: {
|
|
733
|
+
_id: 1,
|
|
734
|
+
typeOf: 1
|
|
735
|
+
}
|
|
653
736
|
})
|
|
654
737
|
.exec();
|
|
655
738
|
if (doc === null) {
|
|
656
739
|
throw new factory.errors.NotFound(factory.placeType.ScreeningRoomSection);
|
|
657
740
|
}
|
|
741
|
+
return doc.toObject();
|
|
658
742
|
});
|
|
659
743
|
}
|
|
660
744
|
// tslint:disable-next-line:max-func-body-length
|
|
661
745
|
searchScreeningRooms(searchConditions) {
|
|
662
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
746
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
663
747
|
return __awaiter(this, void 0, void 0, function* () {
|
|
664
748
|
const matchStages = [{ $match: { typeOf: { $eq: factory.placeType.MovieTheater } } }];
|
|
665
749
|
const projectIdEq = (_b = (_a = searchConditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
@@ -692,20 +776,23 @@ class MongoRepository {
|
|
|
692
776
|
}
|
|
693
777
|
}
|
|
694
778
|
}
|
|
695
|
-
|
|
696
|
-
if (
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
$
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
$eq: searchConditions.branchCode.$eq
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
});
|
|
706
|
-
}
|
|
779
|
+
const branchCodeEq = (_e = searchConditions.branchCode) === null || _e === void 0 ? void 0 : _e.$eq;
|
|
780
|
+
if (typeof branchCodeEq === 'string') {
|
|
781
|
+
matchStages.push({
|
|
782
|
+
$match: {
|
|
783
|
+
'containsPlace.branchCode': { $exists: true, $eq: branchCodeEq }
|
|
784
|
+
}
|
|
785
|
+
});
|
|
707
786
|
}
|
|
708
|
-
const
|
|
787
|
+
const branchCodeIn = (_f = searchConditions.branchCode) === null || _f === void 0 ? void 0 : _f.$in;
|
|
788
|
+
if (Array.isArray(branchCodeIn)) {
|
|
789
|
+
matchStages.push({
|
|
790
|
+
$match: {
|
|
791
|
+
'containsPlace.branchCode': { $exists: true, $in: branchCodeIn }
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
const branchCodeRegex = (_g = searchConditions.branchCode) === null || _g === void 0 ? void 0 : _g.$regex;
|
|
709
796
|
if (typeof branchCodeRegex === 'string') {
|
|
710
797
|
matchStages.push({
|
|
711
798
|
$match: {
|
|
@@ -716,7 +803,7 @@ class MongoRepository {
|
|
|
716
803
|
}
|
|
717
804
|
});
|
|
718
805
|
}
|
|
719
|
-
const nameCodeRegex = (
|
|
806
|
+
const nameCodeRegex = (_h = searchConditions.name) === null || _h === void 0 ? void 0 : _h.$regex;
|
|
720
807
|
if (typeof nameCodeRegex === 'string') {
|
|
721
808
|
matchStages.push({
|
|
722
809
|
$match: {
|
|
@@ -748,7 +835,7 @@ class MongoRepository {
|
|
|
748
835
|
}
|
|
749
836
|
});
|
|
750
837
|
}
|
|
751
|
-
const additionalPropertyElemMatch = (
|
|
838
|
+
const additionalPropertyElemMatch = (_j = searchConditions.additionalProperty) === null || _j === void 0 ? void 0 : _j.$elemMatch;
|
|
752
839
|
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
753
840
|
matchStages.push({
|
|
754
841
|
$match: {
|
|
@@ -768,7 +855,7 @@ class MongoRepository {
|
|
|
768
855
|
typeOf: '$typeOf',
|
|
769
856
|
branchCode: '$branchCode',
|
|
770
857
|
name: '$name'
|
|
771
|
-
}, openSeatingAllowed: '$containsPlace.openSeatingAllowed', additionalProperty: '$containsPlace.additionalProperty' }, (((
|
|
858
|
+
}, openSeatingAllowed: '$containsPlace.openSeatingAllowed', additionalProperty: '$containsPlace.additionalProperty', maximumAttendeeCapacity: '$containsPlace.maximumAttendeeCapacity' }, (((_k = searchConditions.$projection) === null || _k === void 0 ? void 0 : _k.sectionCount) === 1)
|
|
772
859
|
? {
|
|
773
860
|
sectionCount: {
|
|
774
861
|
$cond: {
|
|
@@ -778,7 +865,7 @@ class MongoRepository {
|
|
|
778
865
|
}
|
|
779
866
|
}
|
|
780
867
|
}
|
|
781
|
-
: undefined), (((
|
|
868
|
+
: undefined), (((_l = searchConditions.$projection) === null || _l === void 0 ? void 0 : _l.seatCount) === 1)
|
|
782
869
|
? {
|
|
783
870
|
seatCount: {
|
|
784
871
|
$sum: {
|
|
@@ -866,6 +953,7 @@ class MongoRepository {
|
|
|
866
953
|
}
|
|
867
954
|
// 施設存在確認
|
|
868
955
|
let doc = yield this.placeModel.findOne({
|
|
956
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
869
957
|
'project.id': { $eq: seat.project.id },
|
|
870
958
|
branchCode: movieTheater.branchCode,
|
|
871
959
|
'containsPlace.branchCode': screeningRoom.branchCode,
|
|
@@ -878,6 +966,7 @@ class MongoRepository {
|
|
|
878
966
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
879
967
|
}
|
|
880
968
|
doc = yield this.placeModel.findOneAndUpdate({
|
|
969
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
881
970
|
'project.id': { $eq: seat.project.id },
|
|
882
971
|
branchCode: movieTheater.branchCode,
|
|
883
972
|
'containsPlace.branchCode': screeningRoom.branchCode,
|
|
@@ -897,8 +986,9 @@ class MongoRepository {
|
|
|
897
986
|
],
|
|
898
987
|
projection: {
|
|
899
988
|
_id: 1,
|
|
900
|
-
'project.id': 1,
|
|
901
|
-
branchCode: 1
|
|
989
|
+
// 'project.id': 1,
|
|
990
|
+
branchCode: 1,
|
|
991
|
+
typeOf: 1
|
|
902
992
|
}
|
|
903
993
|
})
|
|
904
994
|
.exec();
|
|
@@ -906,6 +996,7 @@ class MongoRepository {
|
|
|
906
996
|
if (doc === null) {
|
|
907
997
|
throw new factory.errors.AlreadyInUse(factory.placeType.Seat, ['branchCode']);
|
|
908
998
|
}
|
|
999
|
+
return doc.toObject();
|
|
909
1000
|
});
|
|
910
1001
|
}
|
|
911
1002
|
updateSeat(seat, $unset) {
|
|
@@ -924,6 +1015,7 @@ class MongoRepository {
|
|
|
924
1015
|
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.containedInPlace.branchCode');
|
|
925
1016
|
}
|
|
926
1017
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
1018
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
927
1019
|
'project.id': { $eq: seat.project.id },
|
|
928
1020
|
branchCode: movieTheater.branchCode,
|
|
929
1021
|
'containsPlace.branchCode': screeningRoom.branchCode,
|
|
@@ -950,14 +1042,16 @@ class MongoRepository {
|
|
|
950
1042
|
],
|
|
951
1043
|
projection: {
|
|
952
1044
|
_id: 1,
|
|
953
|
-
'project.id': 1,
|
|
954
|
-
branchCode: 1
|
|
1045
|
+
// 'project.id': 1,
|
|
1046
|
+
branchCode: 1,
|
|
1047
|
+
typeOf: 1
|
|
955
1048
|
}
|
|
956
1049
|
})
|
|
957
1050
|
.exec();
|
|
958
1051
|
if (doc === null) {
|
|
959
1052
|
throw new factory.errors.NotFound(factory.placeType.Seat);
|
|
960
1053
|
}
|
|
1054
|
+
return doc.toObject();
|
|
961
1055
|
});
|
|
962
1056
|
}
|
|
963
1057
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
@@ -1148,6 +1242,7 @@ class MongoRepository {
|
|
|
1148
1242
|
deleteSeat(seat) {
|
|
1149
1243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1150
1244
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
1245
|
+
typeOf: { $eq: factory.placeType.MovieTheater },
|
|
1151
1246
|
'project.id': { $eq: seat.project.id },
|
|
1152
1247
|
branchCode: seat.containedInPlace.containedInPlace.containedInPlace.branchCode,
|
|
1153
1248
|
'containsPlace.branchCode': seat.containedInPlace.containedInPlace.branchCode,
|
|
@@ -1164,12 +1259,63 @@ class MongoRepository {
|
|
|
1164
1259
|
arrayFilters: [
|
|
1165
1260
|
{ 'screeningRoom.branchCode': seat.containedInPlace.containedInPlace.branchCode },
|
|
1166
1261
|
{ 'screeningRoomSection.branchCode': seat.containedInPlace.branchCode }
|
|
1167
|
-
]
|
|
1262
|
+
],
|
|
1263
|
+
projection: {
|
|
1264
|
+
_id: 1,
|
|
1265
|
+
typeOf: 1
|
|
1266
|
+
}
|
|
1168
1267
|
})
|
|
1169
1268
|
.exec();
|
|
1170
1269
|
if (doc === null) {
|
|
1171
1270
|
throw new factory.errors.NotFound(factory.placeType.Seat);
|
|
1172
1271
|
}
|
|
1272
|
+
return doc.toObject();
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
syncScreeningRooms(params) {
|
|
1276
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1277
|
+
const movieTheater = yield this.placeModel.findOne({ _id: { $eq: params.id } })
|
|
1278
|
+
.select({
|
|
1279
|
+
_id: 1, branchCode: 1, name: 1, project: 1, typeOf: 1, containsPlace: 1
|
|
1280
|
+
})
|
|
1281
|
+
.exec()
|
|
1282
|
+
.then((doc) => {
|
|
1283
|
+
if (doc === null) {
|
|
1284
|
+
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
1285
|
+
}
|
|
1286
|
+
return doc.toObject();
|
|
1287
|
+
});
|
|
1288
|
+
const creatingScreeningRooms = movieTheater.containsPlace.map((place) => {
|
|
1289
|
+
return Object.assign(Object.assign({}, place), { containedInPlace: {
|
|
1290
|
+
id: movieTheater.id,
|
|
1291
|
+
typeOf: movieTheater.typeOf,
|
|
1292
|
+
branchCode: movieTheater.branchCode,
|
|
1293
|
+
name: movieTheater.name
|
|
1294
|
+
}, containsPlace: (Array.isArray(place.containsPlace)) ? place.containsPlace : [], project: movieTheater.project });
|
|
1295
|
+
});
|
|
1296
|
+
debug('sync processing', creatingScreeningRooms.length, 'screeningRooms...', creatingScreeningRooms);
|
|
1297
|
+
yield Promise.all(creatingScreeningRooms.map((createScreeningRoom) => __awaiter(this, void 0, void 0, function* () {
|
|
1298
|
+
const { typeOf, project, branchCode } = createScreeningRoom, setFields = __rest(createScreeningRoom, ["typeOf", "project", "branchCode"]);
|
|
1299
|
+
const upsertScreeningRoomResult = yield this.placeModel.findOneAndUpdate({
|
|
1300
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
1301
|
+
'project.id': { $eq: createScreeningRoom.project.id },
|
|
1302
|
+
'containedInPlace.id': { $exists: true, $eq: createScreeningRoom.containedInPlace.id },
|
|
1303
|
+
branchCode: { $eq: createScreeningRoom.branchCode }
|
|
1304
|
+
}, {
|
|
1305
|
+
$setOnInsert: {
|
|
1306
|
+
typeOf: createScreeningRoom.typeOf,
|
|
1307
|
+
project: createScreeningRoom.project,
|
|
1308
|
+
branchCode: createScreeningRoom.branchCode
|
|
1309
|
+
},
|
|
1310
|
+
$set: setFields
|
|
1311
|
+
}, {
|
|
1312
|
+
upsert: true,
|
|
1313
|
+
new: true,
|
|
1314
|
+
projection: { _id: 1 }
|
|
1315
|
+
})
|
|
1316
|
+
.exec();
|
|
1317
|
+
debug('screeningRoom upserted. upsertScreeningRoomResult:', upsertScreeningRoomResult);
|
|
1318
|
+
})));
|
|
1173
1319
|
});
|
|
1174
1320
|
}
|
|
1175
1321
|
deleteByProject(params) {
|
|
@@ -1235,7 +1381,7 @@ class MongoRepository {
|
|
|
1235
1381
|
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
|
|
1236
1382
|
query.sort({ branchCode: params.sort.branchCode });
|
|
1237
1383
|
}
|
|
1238
|
-
return query.setOptions({ maxTimeMS:
|
|
1384
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
1239
1385
|
.exec()
|
|
1240
1386
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
1241
1387
|
});
|
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const factory = require("../factory");
|
|
25
25
|
const priceSpecification_1 = require("./mongoose/schemas/priceSpecification");
|
|
26
|
+
const settings_1 = require("../settings");
|
|
26
27
|
/**
|
|
27
28
|
* 価格仕様リポジトリ
|
|
28
29
|
*/
|
|
@@ -156,7 +157,7 @@ class MongoRepository {
|
|
|
156
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
158
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
158
159
|
return this.priceSpecificationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
159
|
-
.setOptions({ maxTimeMS:
|
|
160
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
160
161
|
.exec();
|
|
161
162
|
});
|
|
162
163
|
}
|
|
@@ -182,7 +183,7 @@ class MongoRepository {
|
|
|
182
183
|
// const explainResult = await (<any>query).explain();
|
|
183
184
|
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
184
185
|
// return;
|
|
185
|
-
return query.setOptions({ maxTimeMS:
|
|
186
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
186
187
|
.exec()
|
|
187
188
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
188
189
|
});
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
import { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
27
|
export type IProduct = factory.product.IProduct | factory.service.paymentService.IService;
|
|
28
|
+
export type IPaymentServiceByProvider = Pick<factory.service.paymentService.IService, 'name' | 'description' | 'typeOf' | 'id' | 'productID' | 'serviceType' | 'additionalProperty'> & {
|
|
29
|
+
provider?: Pick<factory.service.paymentService.IProvider, 'credentials'>;
|
|
30
|
+
};
|
|
28
31
|
/**
|
|
29
32
|
* プロダクトリポジトリ
|
|
30
33
|
*/
|
|
@@ -37,9 +40,7 @@ export declare class MongoRepository {
|
|
|
37
40
|
}, projection?: {
|
|
38
41
|
[key: string]: number;
|
|
39
42
|
}): Promise<IProduct>;
|
|
40
|
-
search(conditions: factory.product.ISearchConditions,
|
|
41
|
-
[key: string]: number;
|
|
42
|
-
}): Promise<IProduct[]>;
|
|
43
|
+
search(conditions: factory.product.ISearchConditions, inclusion: string[], exclusion: string[]): Promise<IProduct[]>;
|
|
43
44
|
deleteById(params: {
|
|
44
45
|
id: string;
|
|
45
46
|
}): Promise<void>;
|
|
@@ -53,6 +54,20 @@ export declare class MongoRepository {
|
|
|
53
54
|
typeOf: factory.service.paymentService.PaymentServiceType;
|
|
54
55
|
id: string;
|
|
55
56
|
}): Promise<factory.product.IAvailableChannel>;
|
|
57
|
+
searchPaymentServicesByProvider(params: Pick<factory.product.ISearchConditions, 'limit' | 'page' | 'sort' | 'project' | 'provider' | 'typeOf'>): Promise<IPaymentServiceByProvider[]>;
|
|
58
|
+
/**
|
|
59
|
+
* 決済サービスのプロバイダー検索
|
|
60
|
+
*/
|
|
61
|
+
searchProviders(params: {
|
|
62
|
+
limit?: number;
|
|
63
|
+
page?: number;
|
|
64
|
+
project?: {
|
|
65
|
+
id?: {
|
|
66
|
+
$eq?: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
id: string;
|
|
70
|
+
}): Promise<factory.service.paymentService.IProvider[]>;
|
|
56
71
|
/**
|
|
57
72
|
* プロダクトを保管する
|
|
58
73
|
* 作成 or 更新
|