@chevre/domain 21.2.0-alpha.13 → 21.2.0-alpha.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/src/chevre/aggregateEventReservation.ts +1 -1
- package/example/src/chevre/aggregation/aggregateSystem.ts +85 -27
- package/example/src/chevre/countDelayedTasks.ts +7 -2
- package/example/src/chevre/deleteTasksByName.ts +10 -2
- package/example/src/chevre/findMovieTheaterById.ts +40 -0
- package/example/src/chevre/importEventsFromCOA.ts +3 -4
- package/example/src/chevre/lockStockHolder.ts +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/searchReservationNumbersByOrderNumbers.ts +37 -1
- package/example/src/chevre/searchScreeningRooms.ts +23 -0
- package/example/src/chevre/searchSendEmailActions.ts +44 -0
- package/example/src/chevre/task/executeTasks.ts +26 -0
- package/example/src/chevre/transaction/findCreditCard.ts +1 -1
- package/example/src/chevre/transaction/orderMembershipService.ts +1 -1
- package/example/src/chevre/transaction/processReturnOrder.ts +40 -0
- package/example/src/chevre/transaction/startExportTasks.ts +2 -1
- package/example/src/chevre/updateScreeningRoom.ts +41 -0
- package/example/src/chevre/updateTransaction.ts +1 -1
- package/example/src/playOnMoment.ts +24 -0
- package/lib/chevre/credentials.d.ts +1 -0
- package/lib/chevre/credentials.js +2 -1
- package/lib/chevre/eventEmitter/assetTransaction.d.ts +21 -0
- package/lib/chevre/eventEmitter/assetTransaction.js +25 -0
- package/lib/chevre/eventEmitter/task.d.ts +18 -0
- package/lib/chevre/eventEmitter/task.js +25 -0
- package/lib/chevre/eventEmitter/transaction.d.ts +21 -0
- package/lib/chevre/eventEmitter/transaction.js +25 -0
- package/lib/chevre/eventEmitter.d.ts +4 -0
- package/lib/chevre/eventEmitter.js +9 -0
- package/lib/chevre/index.d.ts +3 -2
- package/lib/chevre/index.js +5 -3
- package/lib/chevre/repo/account.js +3 -2
- package/lib/chevre/repo/accountTransaction.d.ts +3 -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 +92 -0
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +13 -3
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +21 -3
- package/lib/chevre/repo/mongoose/schemas/offer.d.ts +65 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +27 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +74 -0
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +45 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +51 -3
- package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +25 -3
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +49 -3
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +29 -3
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +31 -3
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +23 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +63 -5
- package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +31 -3
- package/lib/chevre/repo/mongoose/schemas/seller.js +6 -0
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +30 -3
- package/lib/chevre/repo/mongoose/schemas/task.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +21 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +40 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +11 -3
- package/lib/chevre/repo/offer.js +3 -2
- package/lib/chevre/repo/offerCatalog.js +0 -27
- package/lib/chevre/repo/offerItemCondition.d.ts +22 -0
- package/lib/chevre/repo/offerItemCondition.js +121 -0
- package/lib/chevre/repo/order.d.ts +55 -3
- package/lib/chevre/repo/order.js +62 -10
- package/lib/chevre/repo/ownershipInfo.js +2 -7
- package/lib/chevre/repo/place.d.ts +20 -5
- package/lib/chevre/repo/place.js +63 -23
- package/lib/chevre/repo/priceSpecification.js +3 -2
- package/lib/chevre/repo/product.d.ts +1 -3
- package/lib/chevre/repo/product.js +25 -4
- package/lib/chevre/repo/project.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -4
- package/lib/chevre/repo/reservation.js +40 -59
- package/lib/chevre/repo/role.js +3 -2
- package/lib/chevre/repo/seller.d.ts +1 -1
- package/lib/chevre/repo/seller.js +44 -23
- package/lib/chevre/repo/serviceOutput.js +2 -1
- package/lib/chevre/repo/stockHolder.d.ts +139 -7
- package/lib/chevre/repo/stockHolder.js +569 -102
- package/lib/chevre/repo/task.d.ts +45 -2
- package/lib/chevre/repo/task.js +94 -15
- package/lib/chevre/repo/transaction.d.ts +21 -2
- package/lib/chevre/repo/transaction.js +171 -50
- 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 +8 -6
- package/lib/chevre/service/aggregation/system.d.ts +110 -23
- package/lib/chevre/service/aggregation/system.js +213 -91
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -28
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +2 -24
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +17 -1
- package/lib/chevre/service/assetTransaction/pay.d.ts +5 -1
- package/lib/chevre/service/assetTransaction/pay.js +20 -34
- package/lib/chevre/service/assetTransaction/refund.js +2 -24
- package/lib/chevre/service/assetTransaction/registerService.js +1 -25
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +15 -5
- package/lib/chevre/service/assetTransaction/reserve/factory.js +122 -58
- package/lib/chevre/service/assetTransaction/reserve.d.ts +10 -1
- package/lib/chevre/service/assetTransaction/reserve.js +92 -69
- package/lib/chevre/service/assetTransaction.d.ts +6 -0
- package/lib/chevre/service/assetTransaction.js +9 -4
- package/lib/chevre/service/event.js +25 -6
- 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 +55 -32
- package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
- package/lib/chevre/service/payment/movieTicket.js +7 -6
- package/lib/chevre/service/product.js +1 -5
- package/lib/chevre/service/report/telemetry.d.ts +0 -11
- package/lib/chevre/service/report/telemetry.js +21 -24
- package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
- package/lib/chevre/service/reserve/cancelReservation.js +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 +7 -0
- package/lib/chevre/service/task/onResourceUpdated.js +352 -0
- package/lib/chevre/service/task/placeOrder.js +1 -1
- package/lib/chevre/service/task/reserve.js +10 -7
- package/lib/chevre/service/task/returnOrder.js +1 -1
- package/lib/chevre/service/task/returnPayTransaction.js +2 -12
- package/lib/chevre/service/task/sendOrder.js +1 -1
- package/lib/chevre/service/task/useReservation.d.ts +7 -0
- package/lib/chevre/service/task/useReservation.js +36 -0
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
- package/lib/chevre/service/task.d.ts +9 -0
- package/lib/chevre/service/task.js +43 -4
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +21 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +232 -0
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +11 -1
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer/factory.js +3 -1
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -0
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.js +10 -13
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership.js +7 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +42 -30
- package/lib/chevre/service/transaction/placeOrder.js +1 -5
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +3 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +7 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +2 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +23 -17
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -3
- package/lib/chevre/service/transaction/placeOrderInProgress.js +28 -15
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +10 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +25 -17
- package/lib/chevre/service/transaction/returnOrder.d.ts +4 -0
- package/lib/chevre/service/transaction/returnOrder.js +228 -36
- package/lib/chevre/service/transaction.d.ts +7 -13
- package/lib/chevre/service/transaction.js +12 -139
- package/lib/chevre/settings.d.ts +13 -1
- package/lib/chevre/settings.js +56 -6
- package/package.json +5 -5
- package/example/src/chevre/createManyEventsIfNotExist.ts +0 -205
- package/example/src/chevre/eventCatalog2eventService.ts +0 -123
- package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +0 -96
- package/example/src/chevre/migrateMovieAdditionalProperties.ts +0 -98
- package/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
|
@@ -13,6 +13,7 @@ exports.MongoRepository = void 0;
|
|
|
13
13
|
const moment = require("moment");
|
|
14
14
|
const accountTransaction_1 = require("./mongoose/schemas/accountTransaction");
|
|
15
15
|
const factory = require("../factory");
|
|
16
|
+
const settings_1 = require("../settings");
|
|
16
17
|
/**
|
|
17
18
|
* 口座取引リポジトリ
|
|
18
19
|
*/
|
|
@@ -229,7 +230,7 @@ class MongoRepository {
|
|
|
229
230
|
// ステータスと期限を見て更新
|
|
230
231
|
yield this.transactionModel.updateMany({
|
|
231
232
|
status: factory.transactionStatusType.InProgress,
|
|
232
|
-
expires: { $lt: params.expires }
|
|
233
|
+
expires: { $lt: params.expires.$lt }
|
|
233
234
|
}, {
|
|
234
235
|
status: factory.transactionStatusType.Expired,
|
|
235
236
|
endDate: new Date()
|
|
@@ -260,7 +261,7 @@ class MongoRepository {
|
|
|
260
261
|
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
261
262
|
query.sort({ startDate: params.sort.startDate });
|
|
262
263
|
}
|
|
263
|
-
return query.setOptions({ maxTimeMS:
|
|
264
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
264
265
|
.exec()
|
|
265
266
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
266
267
|
});
|
|
@@ -82,7 +82,18 @@ export declare class MongoRepository {
|
|
|
82
82
|
typeOf?: T;
|
|
83
83
|
purpose: {
|
|
84
84
|
typeOf: factory.transactionType;
|
|
85
|
-
id
|
|
85
|
+
id: string;
|
|
86
|
+
};
|
|
87
|
+
object?: {
|
|
88
|
+
typeOf?: {
|
|
89
|
+
$eq?: factory.action.authorize.offer.seatReservation.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment;
|
|
90
|
+
};
|
|
91
|
+
paymentMethodId?: {
|
|
92
|
+
$eq?: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
actionStatus?: {
|
|
96
|
+
$eq?: factory.actionStatusType;
|
|
86
97
|
};
|
|
87
98
|
sort?: factory.action.ISortOrder;
|
|
88
99
|
}): Promise<IAction<T>[]>;
|
|
@@ -122,6 +133,23 @@ export declare class MongoRepository {
|
|
|
122
133
|
deleteEndDatePassedCertainPeriod(params: {
|
|
123
134
|
$lt: Date;
|
|
124
135
|
}): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* 取引からアクションを削除する
|
|
138
|
+
*/
|
|
139
|
+
deleteByPurpose(params: {
|
|
140
|
+
project: {
|
|
141
|
+
id: string;
|
|
142
|
+
};
|
|
143
|
+
purpose: {
|
|
144
|
+
typeOf: factory.transactionType;
|
|
145
|
+
id: string;
|
|
146
|
+
};
|
|
147
|
+
typeOf: {
|
|
148
|
+
$in: factory.actionType[];
|
|
149
|
+
};
|
|
150
|
+
}): Promise<{
|
|
151
|
+
deletedCount?: number;
|
|
152
|
+
} | null>;
|
|
125
153
|
aggregateAuthorizeEventServiceOfferAction(params: {
|
|
126
154
|
project?: {
|
|
127
155
|
id?: {
|
|
@@ -152,7 +180,19 @@ export declare class MongoRepository {
|
|
|
152
180
|
startThrough: Date;
|
|
153
181
|
typeOf: factory.actionType;
|
|
154
182
|
}): Promise<IAggregateAction>;
|
|
155
|
-
|
|
183
|
+
aggregateCancelReservationAction(params: {
|
|
184
|
+
project?: {
|
|
185
|
+
id?: {
|
|
186
|
+
$ne?: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
startFrom: Date;
|
|
190
|
+
startThrough: Date;
|
|
191
|
+
}): Promise<IAggregateAction>;
|
|
192
|
+
/**
|
|
193
|
+
* アクションタイプによる汎用的な集計
|
|
194
|
+
*/
|
|
195
|
+
aggregateByTypeOf(params: {
|
|
156
196
|
project?: {
|
|
157
197
|
id?: {
|
|
158
198
|
$ne?: string;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
13
|
const factory = require("../factory");
|
|
14
14
|
const action_1 = require("./mongoose/schemas/action");
|
|
15
|
+
const settings_1 = require("../settings");
|
|
15
16
|
/**
|
|
16
17
|
* アクションリポジトリ
|
|
17
18
|
*/
|
|
@@ -21,7 +22,7 @@ class MongoRepository {
|
|
|
21
22
|
}
|
|
22
23
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
23
24
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65;
|
|
25
26
|
const andConditions = [];
|
|
26
27
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
27
28
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -75,9 +76,27 @@ class MongoRepository {
|
|
|
75
76
|
}
|
|
76
77
|
});
|
|
77
78
|
}
|
|
79
|
+
const objectMovieTicketsIdentifierEq = (_o = (_m = (_l = params.object) === null || _l === void 0 ? void 0 : _l.movieTickets) === null || _m === void 0 ? void 0 : _m.identifier) === null || _o === void 0 ? void 0 : _o.$eq;
|
|
80
|
+
if (typeof objectMovieTicketsIdentifierEq === 'string') {
|
|
81
|
+
andConditions.push({
|
|
82
|
+
'object.movieTickets.identifier': {
|
|
83
|
+
$exists: true,
|
|
84
|
+
$eq: objectMovieTicketsIdentifierEq
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const objectMovieTicketsServiceOutputReservationForIdEq = (_t = (_s = (_r = (_q = (_p = params.object) === null || _p === void 0 ? void 0 : _p.movieTickets) === null || _q === void 0 ? void 0 : _q.serviceOutput) === null || _r === void 0 ? void 0 : _r.reservationFor) === null || _s === void 0 ? void 0 : _s.id) === null || _t === void 0 ? void 0 : _t.$eq;
|
|
89
|
+
if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
|
|
90
|
+
andConditions.push({
|
|
91
|
+
'object.movieTickets.serviceOutput.reservationFor.id': {
|
|
92
|
+
$exists: true,
|
|
93
|
+
$eq: objectMovieTicketsServiceOutputReservationForIdEq
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
78
97
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
79
98
|
/* istanbul ignore else */
|
|
80
|
-
const objectPaymentMethodIdEq = (
|
|
99
|
+
const objectPaymentMethodIdEq = (_v = (_u = params.object) === null || _u === void 0 ? void 0 : _u.paymentMethodId) === null || _v === void 0 ? void 0 : _v.$eq;
|
|
81
100
|
if (typeof objectPaymentMethodIdEq === 'string') {
|
|
82
101
|
andConditions.push({
|
|
83
102
|
'object.paymentMethodId': {
|
|
@@ -86,7 +105,7 @@ class MongoRepository {
|
|
|
86
105
|
}
|
|
87
106
|
});
|
|
88
107
|
}
|
|
89
|
-
const objectObjectPaymentMethodIdEq = (
|
|
108
|
+
const objectObjectPaymentMethodIdEq = (_y = (_x = (_w = params.object) === null || _w === void 0 ? void 0 : _w.object) === null || _x === void 0 ? void 0 : _x.paymentMethodId) === null || _y === void 0 ? void 0 : _y.$eq;
|
|
90
109
|
if (typeof objectObjectPaymentMethodIdEq === 'string') {
|
|
91
110
|
andConditions.push({
|
|
92
111
|
'object.object.paymentMethodId': {
|
|
@@ -95,7 +114,7 @@ class MongoRepository {
|
|
|
95
114
|
}
|
|
96
115
|
});
|
|
97
116
|
}
|
|
98
|
-
const objectReservationForIdEq = (
|
|
117
|
+
const objectReservationForIdEq = (_1 = (_0 = (_z = params.object) === null || _z === void 0 ? void 0 : _z.reservationFor) === null || _0 === void 0 ? void 0 : _0.id) === null || _1 === void 0 ? void 0 : _1.$eq;
|
|
99
118
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
100
119
|
/* istanbul ignore else */
|
|
101
120
|
if (typeof objectReservationForIdEq === 'string') {
|
|
@@ -106,7 +125,25 @@ class MongoRepository {
|
|
|
106
125
|
}
|
|
107
126
|
});
|
|
108
127
|
}
|
|
109
|
-
const
|
|
128
|
+
const objectReservationNumberEq = (_3 = (_2 = params.object) === null || _2 === void 0 ? void 0 : _2.reservationNumber) === null || _3 === void 0 ? void 0 : _3.$eq;
|
|
129
|
+
if (typeof objectReservationNumberEq === 'string') {
|
|
130
|
+
andConditions.push({
|
|
131
|
+
'object.reservationNumber': {
|
|
132
|
+
$exists: true,
|
|
133
|
+
$eq: objectReservationNumberEq
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const objectReservationNumberIn = (_5 = (_4 = params.object) === null || _4 === void 0 ? void 0 : _4.reservationNumber) === null || _5 === void 0 ? void 0 : _5.$in;
|
|
138
|
+
if (Array.isArray(objectReservationNumberIn)) {
|
|
139
|
+
andConditions.push({
|
|
140
|
+
'object.reservationNumber': {
|
|
141
|
+
$exists: true,
|
|
142
|
+
$in: objectReservationNumberIn
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const objectPaymentMethodAccountIdEq = (_8 = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.paymentMethod) === null || _7 === void 0 ? void 0 : _7.accountId) === null || _8 === void 0 ? void 0 : _8.$eq;
|
|
110
147
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
111
148
|
/* istanbul ignore else */
|
|
112
149
|
if (typeof objectPaymentMethodAccountIdEq === 'string') {
|
|
@@ -117,7 +154,7 @@ class MongoRepository {
|
|
|
117
154
|
}
|
|
118
155
|
});
|
|
119
156
|
}
|
|
120
|
-
const objectPaymentMethodPaymentMethodIdEq = (
|
|
157
|
+
const objectPaymentMethodPaymentMethodIdEq = (_11 = (_10 = (_9 = params.object) === null || _9 === void 0 ? void 0 : _9.paymentMethod) === null || _10 === void 0 ? void 0 : _10.paymentMethodId) === null || _11 === void 0 ? void 0 : _11.$eq;
|
|
121
158
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
122
159
|
/* istanbul ignore else */
|
|
123
160
|
if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
|
|
@@ -128,7 +165,7 @@ class MongoRepository {
|
|
|
128
165
|
}
|
|
129
166
|
});
|
|
130
167
|
}
|
|
131
|
-
const objectPaymentMethodPaymentMethodIdIn = (
|
|
168
|
+
const objectPaymentMethodPaymentMethodIdIn = (_14 = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.paymentMethod) === null || _13 === void 0 ? void 0 : _13.paymentMethodId) === null || _14 === void 0 ? void 0 : _14.$in;
|
|
132
169
|
if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
|
|
133
170
|
andConditions.push({
|
|
134
171
|
'object.paymentMethod.paymentMethodId': {
|
|
@@ -137,7 +174,7 @@ class MongoRepository {
|
|
|
137
174
|
}
|
|
138
175
|
});
|
|
139
176
|
}
|
|
140
|
-
const objectPaymentMethodTypeOfEq = (
|
|
177
|
+
const objectPaymentMethodTypeOfEq = (_17 = (_16 = (_15 = params.object) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.typeOf) === null || _17 === void 0 ? void 0 : _17.$eq;
|
|
141
178
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
142
179
|
/* istanbul ignore else */
|
|
143
180
|
if (typeof objectPaymentMethodTypeOfEq === 'string') {
|
|
@@ -148,7 +185,7 @@ class MongoRepository {
|
|
|
148
185
|
}
|
|
149
186
|
});
|
|
150
187
|
}
|
|
151
|
-
const objectTypeOfEq = (
|
|
188
|
+
const objectTypeOfEq = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.typeOf) === null || _19 === void 0 ? void 0 : _19.$eq;
|
|
152
189
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
153
190
|
/* istanbul ignore else */
|
|
154
191
|
if (typeof objectTypeOfEq === 'string') {
|
|
@@ -159,7 +196,7 @@ class MongoRepository {
|
|
|
159
196
|
}
|
|
160
197
|
});
|
|
161
198
|
}
|
|
162
|
-
const objectTypeOfIn = (
|
|
199
|
+
const objectTypeOfIn = (_21 = (_20 = params.object) === null || _20 === void 0 ? void 0 : _20.typeOf) === null || _21 === void 0 ? void 0 : _21.$in;
|
|
163
200
|
if (Array.isArray(objectTypeOfIn)) {
|
|
164
201
|
andConditions.push({
|
|
165
202
|
'object.typeOf': {
|
|
@@ -168,7 +205,7 @@ class MongoRepository {
|
|
|
168
205
|
}
|
|
169
206
|
});
|
|
170
207
|
}
|
|
171
|
-
const objectIdEq = (
|
|
208
|
+
const objectIdEq = (_23 = (_22 = params.object) === null || _22 === void 0 ? void 0 : _22.id) === null || _23 === void 0 ? void 0 : _23.$eq;
|
|
172
209
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
173
210
|
/* istanbul ignore else */
|
|
174
211
|
if (typeof objectIdEq === 'string') {
|
|
@@ -179,7 +216,7 @@ class MongoRepository {
|
|
|
179
216
|
}
|
|
180
217
|
});
|
|
181
218
|
}
|
|
182
|
-
const objectIdIn = (
|
|
219
|
+
const objectIdIn = (_25 = (_24 = params.object) === null || _24 === void 0 ? void 0 : _24.id) === null || _25 === void 0 ? void 0 : _25.$in;
|
|
183
220
|
if (Array.isArray(objectIdIn)) {
|
|
184
221
|
andConditions.push({
|
|
185
222
|
'object.id': {
|
|
@@ -188,7 +225,7 @@ class MongoRepository {
|
|
|
188
225
|
}
|
|
189
226
|
});
|
|
190
227
|
}
|
|
191
|
-
const objectOrderNumberIn = (
|
|
228
|
+
const objectOrderNumberIn = (_27 = (_26 = params.object) === null || _26 === void 0 ? void 0 : _26.orderNumber) === null || _27 === void 0 ? void 0 : _27.$in;
|
|
192
229
|
if (Array.isArray(objectOrderNumberIn)) {
|
|
193
230
|
andConditions.push({
|
|
194
231
|
'object.orderNumber': {
|
|
@@ -197,7 +234,7 @@ class MongoRepository {
|
|
|
197
234
|
}
|
|
198
235
|
});
|
|
199
236
|
}
|
|
200
|
-
const objectEventIdIn = (
|
|
237
|
+
const objectEventIdIn = (_30 = (_29 = (_28 = params.object) === null || _28 === void 0 ? void 0 : _28.event) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$in;
|
|
201
238
|
if (Array.isArray(objectEventIdIn)) {
|
|
202
239
|
andConditions.push({
|
|
203
240
|
'object.event.id': {
|
|
@@ -206,7 +243,7 @@ class MongoRepository {
|
|
|
206
243
|
}
|
|
207
244
|
});
|
|
208
245
|
}
|
|
209
|
-
const objectAcceptedOfferSeatNumberIn = (
|
|
246
|
+
const objectAcceptedOfferSeatNumberIn = (_37 = (_36 = (_35 = (_34 = (_33 = (_32 = (_31 = params.object) === null || _31 === void 0 ? void 0 : _31.acceptedOffer) === null || _32 === void 0 ? void 0 : _32.itemOffered) === null || _33 === void 0 ? void 0 : _33.serviceOutput) === null || _34 === void 0 ? void 0 : _34.reservedTicket) === null || _35 === void 0 ? void 0 : _35.ticketedSeat) === null || _36 === void 0 ? void 0 : _36.seatNumber) === null || _37 === void 0 ? void 0 : _37.$in;
|
|
210
247
|
if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
|
|
211
248
|
andConditions.push({
|
|
212
249
|
'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
|
|
@@ -223,7 +260,7 @@ class MongoRepository {
|
|
|
223
260
|
});
|
|
224
261
|
}
|
|
225
262
|
else {
|
|
226
|
-
const typeOfEq = (
|
|
263
|
+
const typeOfEq = (_38 = params.typeOf) === null || _38 === void 0 ? void 0 : _38.$eq;
|
|
227
264
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
228
265
|
/* istanbul ignore else */
|
|
229
266
|
if (typeof typeOfEq === 'string') {
|
|
@@ -232,7 +269,7 @@ class MongoRepository {
|
|
|
232
269
|
});
|
|
233
270
|
}
|
|
234
271
|
}
|
|
235
|
-
const actionStatusIn = (
|
|
272
|
+
const actionStatusIn = (_39 = params.actionStatus) === null || _39 === void 0 ? void 0 : _39.$in;
|
|
236
273
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
237
274
|
/* istanbul ignore else */
|
|
238
275
|
if (Array.isArray(actionStatusIn)) {
|
|
@@ -263,7 +300,7 @@ class MongoRepository {
|
|
|
263
300
|
startDate: { $lte: startDateLte }
|
|
264
301
|
});
|
|
265
302
|
}
|
|
266
|
-
const fromLocationTypeOfIn = (
|
|
303
|
+
const fromLocationTypeOfIn = (_41 = (_40 = params.fromLocation) === null || _40 === void 0 ? void 0 : _40.typeOf) === null || _41 === void 0 ? void 0 : _41.$in;
|
|
267
304
|
if (Array.isArray(fromLocationTypeOfIn)) {
|
|
268
305
|
andConditions.push({
|
|
269
306
|
'fromLocation.typeOf': {
|
|
@@ -272,7 +309,7 @@ class MongoRepository {
|
|
|
272
309
|
}
|
|
273
310
|
});
|
|
274
311
|
}
|
|
275
|
-
const fromLocationAccountNumberIn = (
|
|
312
|
+
const fromLocationAccountNumberIn = (_43 = (_42 = params.fromLocation) === null || _42 === void 0 ? void 0 : _42.accountNumber) === null || _43 === void 0 ? void 0 : _43.$in;
|
|
276
313
|
if (Array.isArray(fromLocationAccountNumberIn)) {
|
|
277
314
|
andConditions.push({
|
|
278
315
|
'fromLocation.accountNumber': {
|
|
@@ -281,7 +318,7 @@ class MongoRepository {
|
|
|
281
318
|
}
|
|
282
319
|
});
|
|
283
320
|
}
|
|
284
|
-
const fromLocationAccountTypeIn = (
|
|
321
|
+
const fromLocationAccountTypeIn = (_45 = (_44 = params.fromLocation) === null || _44 === void 0 ? void 0 : _44.accountType) === null || _45 === void 0 ? void 0 : _45.$in;
|
|
285
322
|
if (Array.isArray(fromLocationAccountTypeIn)) {
|
|
286
323
|
andConditions.push({
|
|
287
324
|
'fromLocation.accountType': {
|
|
@@ -290,7 +327,7 @@ class MongoRepository {
|
|
|
290
327
|
}
|
|
291
328
|
});
|
|
292
329
|
}
|
|
293
|
-
const toLocationTypeOfIn = (
|
|
330
|
+
const toLocationTypeOfIn = (_47 = (_46 = params.toLocation) === null || _46 === void 0 ? void 0 : _46.typeOf) === null || _47 === void 0 ? void 0 : _47.$in;
|
|
294
331
|
if (Array.isArray(toLocationTypeOfIn)) {
|
|
295
332
|
andConditions.push({
|
|
296
333
|
'toLocation.typeOf': {
|
|
@@ -299,7 +336,7 @@ class MongoRepository {
|
|
|
299
336
|
}
|
|
300
337
|
});
|
|
301
338
|
}
|
|
302
|
-
const toLocationAccountNumberIn = (
|
|
339
|
+
const toLocationAccountNumberIn = (_49 = (_48 = params.toLocation) === null || _48 === void 0 ? void 0 : _48.accountNumber) === null || _49 === void 0 ? void 0 : _49.$in;
|
|
303
340
|
if (Array.isArray(toLocationAccountNumberIn)) {
|
|
304
341
|
andConditions.push({
|
|
305
342
|
'toLocation.accountNumber': {
|
|
@@ -308,7 +345,7 @@ class MongoRepository {
|
|
|
308
345
|
}
|
|
309
346
|
});
|
|
310
347
|
}
|
|
311
|
-
const toLocationAccountTypeIn = (
|
|
348
|
+
const toLocationAccountTypeIn = (_51 = (_50 = params.toLocation) === null || _50 === void 0 ? void 0 : _50.accountType) === null || _51 === void 0 ? void 0 : _51.$in;
|
|
312
349
|
if (Array.isArray(toLocationAccountTypeIn)) {
|
|
313
350
|
andConditions.push({
|
|
314
351
|
'toLocation.accountType': {
|
|
@@ -317,7 +354,7 @@ class MongoRepository {
|
|
|
317
354
|
}
|
|
318
355
|
});
|
|
319
356
|
}
|
|
320
|
-
const purposeTypeOfIn = (
|
|
357
|
+
const purposeTypeOfIn = (_53 = (_52 = params.purpose) === null || _52 === void 0 ? void 0 : _52.typeOf) === null || _53 === void 0 ? void 0 : _53.$in;
|
|
321
358
|
if (Array.isArray(purposeTypeOfIn)) {
|
|
322
359
|
andConditions.push({
|
|
323
360
|
'purpose.typeOf': {
|
|
@@ -326,7 +363,7 @@ class MongoRepository {
|
|
|
326
363
|
}
|
|
327
364
|
});
|
|
328
365
|
}
|
|
329
|
-
const purposeIdIn = (
|
|
366
|
+
const purposeIdIn = (_55 = (_54 = params.purpose) === null || _54 === void 0 ? void 0 : _54.id) === null || _55 === void 0 ? void 0 : _55.$in;
|
|
330
367
|
if (Array.isArray(purposeIdIn)) {
|
|
331
368
|
andConditions.push({
|
|
332
369
|
'purpose.id': {
|
|
@@ -335,7 +372,7 @@ class MongoRepository {
|
|
|
335
372
|
}
|
|
336
373
|
});
|
|
337
374
|
}
|
|
338
|
-
const purposeOrderNumberIn = (
|
|
375
|
+
const purposeOrderNumberIn = (_57 = (_56 = params.purpose) === null || _56 === void 0 ? void 0 : _56.orderNumber) === null || _57 === void 0 ? void 0 : _57.$in;
|
|
339
376
|
if (Array.isArray(purposeOrderNumberIn)) {
|
|
340
377
|
andConditions.push({
|
|
341
378
|
'purpose.orderNumber': {
|
|
@@ -344,7 +381,7 @@ class MongoRepository {
|
|
|
344
381
|
}
|
|
345
382
|
});
|
|
346
383
|
}
|
|
347
|
-
const resultTypeOfIn = (
|
|
384
|
+
const resultTypeOfIn = (_59 = (_58 = params.result) === null || _58 === void 0 ? void 0 : _58.typeOf) === null || _59 === void 0 ? void 0 : _59.$in;
|
|
348
385
|
if (Array.isArray(resultTypeOfIn)) {
|
|
349
386
|
andConditions.push({
|
|
350
387
|
'result.typeOf': {
|
|
@@ -353,7 +390,7 @@ class MongoRepository {
|
|
|
353
390
|
}
|
|
354
391
|
});
|
|
355
392
|
}
|
|
356
|
-
const resultIdIn = (
|
|
393
|
+
const resultIdIn = (_61 = (_60 = params.result) === null || _60 === void 0 ? void 0 : _60.id) === null || _61 === void 0 ? void 0 : _61.$in;
|
|
357
394
|
if (Array.isArray(resultIdIn)) {
|
|
358
395
|
andConditions.push({
|
|
359
396
|
'result.id': {
|
|
@@ -362,7 +399,7 @@ class MongoRepository {
|
|
|
362
399
|
}
|
|
363
400
|
});
|
|
364
401
|
}
|
|
365
|
-
const resultOrderNumberIn = (
|
|
402
|
+
const resultOrderNumberIn = (_63 = (_62 = params.result) === null || _62 === void 0 ? void 0 : _62.orderNumber) === null || _63 === void 0 ? void 0 : _63.$in;
|
|
366
403
|
if (Array.isArray(resultOrderNumberIn)) {
|
|
367
404
|
andConditions.push({
|
|
368
405
|
'result.orderNumber': {
|
|
@@ -371,7 +408,7 @@ class MongoRepository {
|
|
|
371
408
|
}
|
|
372
409
|
});
|
|
373
410
|
}
|
|
374
|
-
const resultCodeIn = (
|
|
411
|
+
const resultCodeIn = (_65 = (_64 = params.result) === null || _64 === void 0 ? void 0 : _64.code) === null || _65 === void 0 ? void 0 : _65.$in;
|
|
375
412
|
if (Array.isArray(resultCodeIn)) {
|
|
376
413
|
andConditions.push({
|
|
377
414
|
'result.code': {
|
|
@@ -420,7 +457,7 @@ class MongoRepository {
|
|
|
420
457
|
}
|
|
421
458
|
// const explainResult = await (<any>query).explain();
|
|
422
459
|
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
423
|
-
return query.setOptions({ maxTimeMS:
|
|
460
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
424
461
|
.exec()
|
|
425
462
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
426
463
|
});
|
|
@@ -528,32 +565,16 @@ class MongoRepository {
|
|
|
528
565
|
* 取引に対するアクション検索時などに使用
|
|
529
566
|
*/
|
|
530
567
|
searchByPurpose(params) {
|
|
531
|
-
var _a;
|
|
568
|
+
var _a, _b, _c, _d, _e, _f;
|
|
532
569
|
return __awaiter(this, void 0, void 0, function* () {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
$
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
if (params.purpose.id !== undefined) {
|
|
543
|
-
conditions['purpose.id'] = {
|
|
544
|
-
$exists: true,
|
|
545
|
-
$eq: params.purpose.id
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
const query = this.actionModel.find(conditions)
|
|
549
|
-
.select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
550
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
551
|
-
/* istanbul ignore else */
|
|
552
|
-
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
|
|
553
|
-
query.sort({ startDate: params.sort.startDate });
|
|
554
|
-
}
|
|
555
|
-
return query.exec()
|
|
556
|
-
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
570
|
+
return this.search(Object.assign(Object.assign(Object.assign({ purpose: {
|
|
571
|
+
id: { $in: [params.purpose.id] },
|
|
572
|
+
typeOf: { $in: [params.purpose.typeOf] }
|
|
573
|
+
}, object: Object.assign(Object.assign({}, (typeof ((_b = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf) === null || _b === void 0 ? void 0 : _b.$eq) === 'string')
|
|
574
|
+
? { typeOf: { $eq: params.object.typeOf.$eq } }
|
|
575
|
+
: undefined), (typeof ((_d = (_c = params.object) === null || _c === void 0 ? void 0 : _c.paymentMethodId) === null || _d === void 0 ? void 0 : _d.$eq) === 'string')
|
|
576
|
+
? { paymentMethodId: { $eq: params.object.paymentMethodId.$eq } }
|
|
577
|
+
: undefined) }, (typeof ((_e = params.actionStatus) === null || _e === void 0 ? void 0 : _e.$eq) === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined), (typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined), (typeof ((_f = params.sort) === null || _f === void 0 ? void 0 : _f.startDate) === 'number') ? { sort: params.sort } : undefined), [], []);
|
|
557
578
|
});
|
|
558
579
|
}
|
|
559
580
|
/**
|
|
@@ -691,6 +712,29 @@ class MongoRepository {
|
|
|
691
712
|
.exec();
|
|
692
713
|
});
|
|
693
714
|
}
|
|
715
|
+
/**
|
|
716
|
+
* 取引からアクションを削除する
|
|
717
|
+
*/
|
|
718
|
+
deleteByPurpose(params) {
|
|
719
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
720
|
+
return this.actionModel.deleteMany({
|
|
721
|
+
'project.id': { $eq: params.project.id },
|
|
722
|
+
typeOf: { $in: params.typeOf.$in },
|
|
723
|
+
'purpose.id': { $exists: true, $eq: params.purpose.id },
|
|
724
|
+
'purpose.typeOf': { $exists: true, $eq: params.purpose.typeOf }
|
|
725
|
+
})
|
|
726
|
+
.exec()
|
|
727
|
+
.then((result) => {
|
|
728
|
+
return {
|
|
729
|
+
// n: result?.n,
|
|
730
|
+
// opTime: result.opTime,
|
|
731
|
+
// ok: result?.ok,
|
|
732
|
+
// operationTime,
|
|
733
|
+
deletedCount: result === null || result === void 0 ? void 0 : result.deletedCount
|
|
734
|
+
};
|
|
735
|
+
});
|
|
736
|
+
});
|
|
737
|
+
}
|
|
694
738
|
aggregateAuthorizeEventServiceOfferAction(params) {
|
|
695
739
|
return __awaiter(this, void 0, void 0, function* () {
|
|
696
740
|
const statuses = yield Promise.all([
|
|
@@ -757,7 +801,36 @@ class MongoRepository {
|
|
|
757
801
|
return { statuses };
|
|
758
802
|
});
|
|
759
803
|
}
|
|
760
|
-
|
|
804
|
+
aggregateCancelReservationAction(params) {
|
|
805
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
806
|
+
const statuses = yield Promise.all([
|
|
807
|
+
factory.actionStatusType.CompletedActionStatus,
|
|
808
|
+
factory.actionStatusType.CanceledActionStatus,
|
|
809
|
+
factory.actionStatusType.FailedActionStatus
|
|
810
|
+
].map((actionStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
811
|
+
var _a, _b;
|
|
812
|
+
const matchConditions = Object.assign({ startDate: {
|
|
813
|
+
$gte: params.startFrom,
|
|
814
|
+
$lte: params.startThrough
|
|
815
|
+
}, typeOf: { $eq: factory.actionType.CancelAction }, actionStatus: { $eq: actionStatus }, 'object.typeOf': {
|
|
816
|
+
$exists: true,
|
|
817
|
+
$in: [
|
|
818
|
+
factory.reservationType.BusReservation,
|
|
819
|
+
factory.reservationType.EventReservation,
|
|
820
|
+
factory.reservationType.ReservationPackage
|
|
821
|
+
]
|
|
822
|
+
} }, (typeof ((_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$ne) === 'string')
|
|
823
|
+
? { 'project.id': { $ne: params.project.id.$ne } }
|
|
824
|
+
: undefined);
|
|
825
|
+
return this.agggregateByStatus({ matchConditions, actionStatus });
|
|
826
|
+
})));
|
|
827
|
+
return { statuses };
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* アクションタイプによる汎用的な集計
|
|
832
|
+
*/
|
|
833
|
+
aggregateByTypeOf(params) {
|
|
761
834
|
return __awaiter(this, void 0, void 0, function* () {
|
|
762
835
|
const statuses = yield Promise.all([
|
|
763
836
|
factory.actionStatusType.CompletedActionStatus,
|
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const additionalProperty_1 = require("./mongoose/schemas/additionalProperty");
|
|
25
25
|
const factory = require("../factory");
|
|
26
|
+
const settings_1 = require("../settings");
|
|
26
27
|
/**
|
|
27
28
|
* 追加特性リポジトリ
|
|
28
29
|
*/
|
|
@@ -145,7 +146,7 @@ class MongoRepository {
|
|
|
145
146
|
if (params.sort !== undefined) {
|
|
146
147
|
query.sort(params.sort);
|
|
147
148
|
}
|
|
148
|
-
return query.setOptions({ maxTimeMS:
|
|
149
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
149
150
|
.exec()
|
|
150
151
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
151
152
|
});
|
|
@@ -4,12 +4,15 @@ export declare enum AggregationType {
|
|
|
4
4
|
AggregateAuthorizeEventServiceOfferAction = "AggregateAuthorizeEventServiceOfferAction",
|
|
5
5
|
AggregateAuthorizeOrderAction = "AggregateAuthorizeOrderAction",
|
|
6
6
|
AggregateAuthorizePaymentAction = "AggregateAuthorizePaymentAction",
|
|
7
|
+
AggregateCancelReservationAction = "AggregateCancelReservationAction",
|
|
7
8
|
AggregateCheckMovieTicketAction = "AggregateCheckMovieTicketAction",
|
|
8
9
|
AggregateEvent = "AggregateEvent",
|
|
10
|
+
AggregateOrderAction = "AggregateOrderAction",
|
|
9
11
|
AggregatePay = "AggregatePay",
|
|
10
12
|
AggregatePayMovieTicketAction = "AggregatePayMovieTicketAction",
|
|
11
13
|
AggregatePlaceOrder = "AggregatePlaceOrder",
|
|
12
14
|
AggregateReserve = "AggregateReserve",
|
|
15
|
+
AggregateReserveAction = "AggregateReserveAction",
|
|
13
16
|
AggregateTask = "AggregateTask",
|
|
14
17
|
AggregateUseAction = "AggregateUseAction"
|
|
15
18
|
}
|
|
@@ -27,12 +27,15 @@ var AggregationType;
|
|
|
27
27
|
AggregationType["AggregateAuthorizeEventServiceOfferAction"] = "AggregateAuthorizeEventServiceOfferAction";
|
|
28
28
|
AggregationType["AggregateAuthorizeOrderAction"] = "AggregateAuthorizeOrderAction";
|
|
29
29
|
AggregationType["AggregateAuthorizePaymentAction"] = "AggregateAuthorizePaymentAction";
|
|
30
|
+
AggregationType["AggregateCancelReservationAction"] = "AggregateCancelReservationAction";
|
|
30
31
|
AggregationType["AggregateCheckMovieTicketAction"] = "AggregateCheckMovieTicketAction";
|
|
31
32
|
AggregationType["AggregateEvent"] = "AggregateEvent";
|
|
33
|
+
AggregationType["AggregateOrderAction"] = "AggregateOrderAction";
|
|
32
34
|
AggregationType["AggregatePay"] = "AggregatePay";
|
|
33
35
|
AggregationType["AggregatePayMovieTicketAction"] = "AggregatePayMovieTicketAction";
|
|
34
36
|
AggregationType["AggregatePlaceOrder"] = "AggregatePlaceOrder";
|
|
35
37
|
AggregationType["AggregateReserve"] = "AggregateReserve";
|
|
38
|
+
AggregationType["AggregateReserveAction"] = "AggregateReserveAction";
|
|
36
39
|
AggregationType["AggregateTask"] = "AggregateTask";
|
|
37
40
|
AggregationType["AggregateUseAction"] = "AggregateUseAction";
|
|
38
41
|
})(AggregationType = exports.AggregationType || (exports.AggregationType = {}));
|