@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
|
@@ -27,7 +27,7 @@ declare const modelName = "Trip";
|
|
|
27
27
|
/**
|
|
28
28
|
* トリップスキーマ
|
|
29
29
|
*/
|
|
30
|
-
declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {},
|
|
30
|
+
declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
31
31
|
collection: string;
|
|
32
32
|
id: true;
|
|
33
33
|
read: string;
|
|
@@ -51,8 +51,16 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
|
|
|
51
51
|
minimize: false;
|
|
52
52
|
versionKey: false;
|
|
53
53
|
};
|
|
54
|
-
}
|
|
54
|
+
}, {
|
|
55
55
|
typeOf: string;
|
|
56
56
|
project?: any;
|
|
57
|
-
}
|
|
57
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
58
|
+
typeOf: string;
|
|
59
|
+
project?: any;
|
|
60
|
+
}>> & Omit<import("mongoose").FlatRecord<{
|
|
61
|
+
typeOf: string;
|
|
62
|
+
project?: any;
|
|
63
|
+
}> & {
|
|
64
|
+
_id: import("mongoose").Types.ObjectId;
|
|
65
|
+
}, never>>;
|
|
58
66
|
export { modelName, schema };
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -25,6 +25,7 @@ const uniqid = require("uniqid");
|
|
|
25
25
|
const factory = require("../factory");
|
|
26
26
|
const offer_1 = require("./mongoose/schemas/offer");
|
|
27
27
|
const offerCatalog_1 = require("./mongoose/schemas/offerCatalog");
|
|
28
|
+
const settings_1 = require("../settings");
|
|
28
29
|
/**
|
|
29
30
|
* オファーリポジトリ
|
|
30
31
|
*/
|
|
@@ -409,7 +410,7 @@ class MongoRepository {
|
|
|
409
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
411
|
const conditions = MongoRepository.CREATE_OFFER_MONGO_CONDITIONS(params);
|
|
411
412
|
return this.offerModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
412
|
-
.setOptions({ maxTimeMS:
|
|
413
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
413
414
|
.exec();
|
|
414
415
|
});
|
|
415
416
|
}
|
|
@@ -434,7 +435,7 @@ class MongoRepository {
|
|
|
434
435
|
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a['priceSpecification.price']) !== undefined) {
|
|
435
436
|
query.sort({ 'priceSpecification.price': params.sort['priceSpecification.price'] });
|
|
436
437
|
}
|
|
437
|
-
return query.setOptions({ maxTimeMS:
|
|
438
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
438
439
|
.exec()
|
|
439
440
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
440
441
|
});
|
|
@@ -178,33 +178,6 @@ class MongoRepository {
|
|
|
178
178
|
.exec();
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
// public async findById(params: {
|
|
182
|
-
// id: string;
|
|
183
|
-
// }): Promise<factory.offerCatalog.IOfferCatalog> {
|
|
184
|
-
// const doc = await this.offerCatalogModel.findOne(
|
|
185
|
-
// {
|
|
186
|
-
// _id: params.id
|
|
187
|
-
// },
|
|
188
|
-
// {
|
|
189
|
-
// __v: 0,
|
|
190
|
-
// createdAt: 0,
|
|
191
|
-
// updatedAt: 0
|
|
192
|
-
// }
|
|
193
|
-
// )
|
|
194
|
-
// .exec();
|
|
195
|
-
// if (doc === null) {
|
|
196
|
-
// throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
|
|
197
|
-
// }
|
|
198
|
-
// return doc.toObject();
|
|
199
|
-
// }
|
|
200
|
-
// public async count(
|
|
201
|
-
// params: factory.offerCatalog.ISearchConditions
|
|
202
|
-
// ): Promise<number> {
|
|
203
|
-
// const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
204
|
-
// return this.offerCatalogModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
205
|
-
// .setOptions({ maxTimeMS: 10000 })
|
|
206
|
-
// .exec();
|
|
207
|
-
// }
|
|
208
181
|
search(params) {
|
|
209
182
|
var _a;
|
|
210
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Connection } from 'mongoose';
|
|
2
|
+
import * as factory from '../factory';
|
|
3
|
+
interface IProjection {
|
|
4
|
+
[key: string]: 0 | 1;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* アイテムコンディションリポジトリ
|
|
8
|
+
*/
|
|
9
|
+
export declare class MongoRepository {
|
|
10
|
+
private readonly offerItemConditionModel;
|
|
11
|
+
constructor(connection: Connection);
|
|
12
|
+
static CREATE_MONGO_CONDITIONS(params: factory.offerItemCondition.ISearchConditions): any[];
|
|
13
|
+
findById(params: {
|
|
14
|
+
id: string;
|
|
15
|
+
}): Promise<factory.offerItemCondition.IOfferItemCondition>;
|
|
16
|
+
search(params: factory.offerItemCondition.ISearchConditions, projection?: IProjection): Promise<factory.offerItemCondition.IOfferItemCondition[]>;
|
|
17
|
+
save(params: factory.offerItemCondition.IOfferItemCondition): Promise<factory.offerItemCondition.IOfferItemCondition>;
|
|
18
|
+
deleteById(params: {
|
|
19
|
+
id: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.MongoRepository = void 0;
|
|
24
|
+
const factory = require("../factory");
|
|
25
|
+
const offerItemCondition_1 = require("./mongoose/schemas/offerItemCondition");
|
|
26
|
+
const settings_1 = require("../settings");
|
|
27
|
+
/**
|
|
28
|
+
* アイテムコンディションリポジトリ
|
|
29
|
+
*/
|
|
30
|
+
class MongoRepository {
|
|
31
|
+
constructor(connection) {
|
|
32
|
+
this.offerItemConditionModel = connection.model(offerItemCondition_1.modelName, offerItemCondition_1.schema);
|
|
33
|
+
}
|
|
34
|
+
static CREATE_MONGO_CONDITIONS(params) {
|
|
35
|
+
var _a, _b, _c, _d, _e, _f;
|
|
36
|
+
const andConditions = [];
|
|
37
|
+
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
38
|
+
if (typeof projectIdEq === 'string') {
|
|
39
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
40
|
+
}
|
|
41
|
+
const idEq = (_c = params.id) === null || _c === void 0 ? void 0 : _c.$eq;
|
|
42
|
+
if (typeof idEq === 'string') {
|
|
43
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
44
|
+
}
|
|
45
|
+
const idIn = (_d = params.id) === null || _d === void 0 ? void 0 : _d.$in;
|
|
46
|
+
if (Array.isArray(idIn)) {
|
|
47
|
+
andConditions.push({ _id: { $in: idIn } });
|
|
48
|
+
}
|
|
49
|
+
const identifierEq = (_e = params.identifier) === null || _e === void 0 ? void 0 : _e.$eq;
|
|
50
|
+
if (typeof identifierEq === 'string') {
|
|
51
|
+
andConditions.push({ identifier: { $eq: identifierEq } });
|
|
52
|
+
}
|
|
53
|
+
const identifierIn = (_f = params.identifier) === null || _f === void 0 ? void 0 : _f.$in;
|
|
54
|
+
if (Array.isArray(identifierIn)) {
|
|
55
|
+
andConditions.push({ identifier: { $in: identifierIn } });
|
|
56
|
+
}
|
|
57
|
+
return andConditions;
|
|
58
|
+
}
|
|
59
|
+
findById(params) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const doc = yield this.offerItemConditionModel.findOne({ _id: params.id }, {
|
|
62
|
+
__v: 0,
|
|
63
|
+
createdAt: 0,
|
|
64
|
+
updatedAt: 0
|
|
65
|
+
})
|
|
66
|
+
.exec();
|
|
67
|
+
if (doc === null) {
|
|
68
|
+
throw new factory.errors.NotFound(this.offerItemConditionModel.modelName);
|
|
69
|
+
}
|
|
70
|
+
return doc.toObject();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
search(params, projection) {
|
|
74
|
+
var _a;
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
77
|
+
const positiveProjectionExists = (projection !== undefined && projection !== null)
|
|
78
|
+
? Object.values(projection)
|
|
79
|
+
.some((value) => value !== 0)
|
|
80
|
+
: false;
|
|
81
|
+
const query = this.offerItemConditionModel.find((conditions.length > 0) ? { $and: conditions } : {}, (positiveProjectionExists)
|
|
82
|
+
? projection
|
|
83
|
+
: Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
|
|
84
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
85
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
86
|
+
query.limit(params.limit)
|
|
87
|
+
.skip(params.limit * (page - 1));
|
|
88
|
+
}
|
|
89
|
+
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) {
|
|
90
|
+
query.sort({ identifier: params.sort.identifier });
|
|
91
|
+
}
|
|
92
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
93
|
+
.exec()
|
|
94
|
+
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
save(params) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
let doc;
|
|
100
|
+
if (params.id === '') {
|
|
101
|
+
doc = yield this.offerItemConditionModel.create(params);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
const { id, identifier, project, typeOf } = params, updateFields = __rest(params, ["id", "identifier", "project", "typeOf"]);
|
|
105
|
+
doc = yield this.offerItemConditionModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
|
|
106
|
+
.exec();
|
|
107
|
+
}
|
|
108
|
+
if (doc === null) {
|
|
109
|
+
throw new factory.errors.NotFound(this.offerItemConditionModel.modelName);
|
|
110
|
+
}
|
|
111
|
+
return doc.toObject();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
deleteById(params) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
yield this.offerItemConditionModel.findOneAndRemove({ _id: params.id })
|
|
117
|
+
.exec();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.MongoRepository = MongoRepository;
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
/**
|
|
@@ -34,7 +58,9 @@ export declare class MongoRepository {
|
|
|
34
58
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
35
59
|
name?: string;
|
|
36
60
|
orderNumber: string;
|
|
37
|
-
}): Promise<
|
|
61
|
+
}): Promise<{
|
|
62
|
+
updatedAt: Date;
|
|
63
|
+
}>;
|
|
38
64
|
findById(params: {
|
|
39
65
|
id: string;
|
|
40
66
|
inclusion: string[];
|
|
@@ -62,7 +88,9 @@ export declare class MongoRepository {
|
|
|
62
88
|
/**
|
|
63
89
|
* 注文を検索する
|
|
64
90
|
*/
|
|
65
|
-
search(params: factory.order.ISearchConditions, projection?:
|
|
91
|
+
search(params: factory.order.ISearchConditions, projection?: {
|
|
92
|
+
[key: string]: 0 | 1;
|
|
93
|
+
}): Promise<factory.order.IOrder[]>;
|
|
66
94
|
/**
|
|
67
95
|
* 注文の受入オファーIDリストを検索する
|
|
68
96
|
*/
|
|
@@ -70,7 +98,11 @@ export declare class MongoRepository {
|
|
|
70
98
|
/**
|
|
71
99
|
* オファー展開の注文検索
|
|
72
100
|
*/
|
|
73
|
-
searchWithUnwoundAcceptedOffer(params: factory.order.ISearchConditions, projection?:
|
|
101
|
+
searchWithUnwoundAcceptedOffer(params: factory.order.ISearchConditions, projection?: {
|
|
102
|
+
[key: string]: any;
|
|
103
|
+
}): Promise<Omit<factory.order.IOrder[], 'acceptedOffers'> & {
|
|
104
|
+
acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered> | factory.order.IAcceptedOffer<factory.order.IItemOffered>[];
|
|
105
|
+
}>;
|
|
74
106
|
/**
|
|
75
107
|
* 特典口座情報が未保管であれば保管する
|
|
76
108
|
*/
|
|
@@ -86,4 +118,24 @@ export declare class MongoRepository {
|
|
|
86
118
|
$in: string[];
|
|
87
119
|
};
|
|
88
120
|
}): Promise<(string)[]>;
|
|
121
|
+
/**
|
|
122
|
+
* 注文に含まれるイベントIDを検索する
|
|
123
|
+
*/
|
|
124
|
+
searchReservationForIdsByOrderNumbers(params: {
|
|
125
|
+
orderNumber: {
|
|
126
|
+
$in: string[];
|
|
127
|
+
};
|
|
128
|
+
}): Promise<string[]>;
|
|
129
|
+
/**
|
|
130
|
+
* 注文に含まれるacceptedOffersを検索する
|
|
131
|
+
*/
|
|
132
|
+
searchAcceptedOffersByOrderNumbers(params: {
|
|
133
|
+
orderNumber: {
|
|
134
|
+
$in: string[];
|
|
135
|
+
};
|
|
136
|
+
}): Promise<{
|
|
137
|
+
id: string;
|
|
138
|
+
priceSpecification: factory.order.ITicketPriceSpecification;
|
|
139
|
+
}[]>;
|
|
140
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
89
141
|
}
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -14,6 +14,7 @@ const factory = require("../factory");
|
|
|
14
14
|
const order_1 = require("./mongoose/schemas/order");
|
|
15
15
|
const errorHandler_1 = require("../errorHandler");
|
|
16
16
|
const order_2 = require("../factory/order");
|
|
17
|
+
const settings_1 = require("../settings");
|
|
17
18
|
/**
|
|
18
19
|
* 注文リポジトリ
|
|
19
20
|
*/
|
|
@@ -779,14 +780,17 @@ class MongoRepository {
|
|
|
779
780
|
const doc = yield this.orderModel.findOneAndUpdate({ orderNumber: { $eq: params.orderNumber } }, {
|
|
780
781
|
$set: Object.assign(Object.assign({}, (Array.isArray(params.additionalProperty)) ? { additionalProperty: params.additionalProperty } : undefined), (typeof params.name === 'string') ? { name: params.name } : undefined)
|
|
781
782
|
}, {
|
|
783
|
+
new: true,
|
|
782
784
|
projection: {
|
|
783
|
-
_id: 1
|
|
785
|
+
_id: 1,
|
|
786
|
+
updatedAt: 1
|
|
784
787
|
}
|
|
785
788
|
})
|
|
786
789
|
.exec();
|
|
787
790
|
if (doc === null) {
|
|
788
791
|
throw new factory.errors.NotFound(this.orderModel.modelName);
|
|
789
792
|
}
|
|
793
|
+
return { updatedAt: doc.updatedAt };
|
|
790
794
|
});
|
|
791
795
|
}
|
|
792
796
|
findById(params) {
|
|
@@ -885,7 +889,7 @@ class MongoRepository {
|
|
|
885
889
|
return __awaiter(this, void 0, void 0, function* () {
|
|
886
890
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
887
891
|
return this.orderModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
888
|
-
.setOptions({ maxTimeMS:
|
|
892
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
889
893
|
.exec();
|
|
890
894
|
});
|
|
891
895
|
}
|
|
@@ -896,8 +900,15 @@ class MongoRepository {
|
|
|
896
900
|
var _a;
|
|
897
901
|
return __awaiter(this, void 0, void 0, function* () {
|
|
898
902
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
903
|
+
const projectionSpecified = projection !== undefined && projection !== null;
|
|
904
|
+
const positiveProjectionExists = (projectionSpecified)
|
|
905
|
+
? Object.values(projection)
|
|
906
|
+
.some((value) => value !== 0)
|
|
907
|
+
: false;
|
|
899
908
|
const query = this.orderModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
900
|
-
.select(
|
|
909
|
+
.select((projectionSpecified && positiveProjectionExists)
|
|
910
|
+
? projection
|
|
911
|
+
: Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
901
912
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
902
913
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
903
914
|
query.limit(params.limit)
|
|
@@ -910,7 +921,7 @@ class MongoRepository {
|
|
|
910
921
|
}
|
|
911
922
|
// const explainResult = await (<any>query).explain();
|
|
912
923
|
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
913
|
-
return query.setOptions({ maxTimeMS:
|
|
924
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
914
925
|
.exec()
|
|
915
926
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
916
927
|
});
|
|
@@ -925,7 +936,7 @@ class MongoRepository {
|
|
|
925
936
|
.select({
|
|
926
937
|
'acceptedOffers.id': 1
|
|
927
938
|
});
|
|
928
|
-
const orders = yield query.setOptions({ maxTimeMS:
|
|
939
|
+
const orders = yield query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
929
940
|
.exec()
|
|
930
941
|
.then((docs) => docs.map((doc) => {
|
|
931
942
|
return doc.toObject();
|
|
@@ -975,7 +986,7 @@ class MongoRepository {
|
|
|
975
986
|
.skip(params.limit * (page - 1));
|
|
976
987
|
}
|
|
977
988
|
return aggregate.allowDiskUse(true)
|
|
978
|
-
.option({ maxTimeMS:
|
|
989
|
+
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
979
990
|
.exec();
|
|
980
991
|
});
|
|
981
992
|
}
|
|
@@ -1002,13 +1013,54 @@ class MongoRepository {
|
|
|
1002
1013
|
if (!Array.isArray(params.orderNumber.$in) || params.orderNumber.$in.length === 0) {
|
|
1003
1014
|
return [];
|
|
1004
1015
|
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1016
|
+
return this.orderModel.distinct('acceptedOffers.itemOffered.reservationNumber', {
|
|
1017
|
+
'acceptedOffers.itemOffered.reservationNumber': { $exists: true },
|
|
1018
|
+
orderNumber: { $in: params.orderNumber.$in }
|
|
1007
1019
|
})
|
|
1008
|
-
.setOptions({ maxTimeMS:
|
|
1020
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
1009
1021
|
.exec();
|
|
1010
|
-
return [...new Set(reservationNumbers)];
|
|
1011
1022
|
});
|
|
1012
1023
|
}
|
|
1024
|
+
/**
|
|
1025
|
+
* 注文に含まれるイベントIDを検索する
|
|
1026
|
+
*/
|
|
1027
|
+
searchReservationForIdsByOrderNumbers(params) {
|
|
1028
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1029
|
+
if (!Array.isArray(params.orderNumber.$in) || params.orderNumber.$in.length === 0) {
|
|
1030
|
+
return [];
|
|
1031
|
+
}
|
|
1032
|
+
return this.orderModel.distinct('acceptedOffers.itemOffered.reservationFor.id', {
|
|
1033
|
+
'acceptedOffers.itemOffered.reservationFor.id': { $exists: true },
|
|
1034
|
+
orderNumber: { $in: params.orderNumber.$in }
|
|
1035
|
+
})
|
|
1036
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
1037
|
+
.exec();
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* 注文に含まれるacceptedOffersを検索する
|
|
1042
|
+
*/
|
|
1043
|
+
searchAcceptedOffersByOrderNumbers(params) {
|
|
1044
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1045
|
+
if (!Array.isArray(params.orderNumber.$in) || params.orderNumber.$in.length === 0) {
|
|
1046
|
+
return [];
|
|
1047
|
+
}
|
|
1048
|
+
const aggregate = this.orderModel.aggregate();
|
|
1049
|
+
aggregate.unwind('$acceptedOffers');
|
|
1050
|
+
aggregate.match({ orderNumber: { $in: params.orderNumber.$in } });
|
|
1051
|
+
aggregate.project({
|
|
1052
|
+
_id: 0,
|
|
1053
|
+
id: '$acceptedOffers.id',
|
|
1054
|
+
priceSpecification: '$acceptedOffers.priceSpecification'
|
|
1055
|
+
});
|
|
1056
|
+
return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
1057
|
+
.exec();
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
getCursor(conditions, projection) {
|
|
1061
|
+
return this.orderModel.find(conditions, projection)
|
|
1062
|
+
.sort({ orderDate: factory.sortType.Descending })
|
|
1063
|
+
.cursor();
|
|
1064
|
+
}
|
|
1013
1065
|
}
|
|
1014
1066
|
exports.MongoRepository = MongoRepository;
|
|
@@ -14,6 +14,7 @@ const uuid = require("uuid");
|
|
|
14
14
|
const ownershipInfo_1 = require("./mongoose/schemas/ownershipInfo");
|
|
15
15
|
const errorHandler_1 = require("../errorHandler");
|
|
16
16
|
const factory = require("../factory");
|
|
17
|
+
const settings_1 = require("../settings");
|
|
17
18
|
/**
|
|
18
19
|
* 所有権リポジトリ
|
|
19
20
|
*/
|
|
@@ -276,12 +277,6 @@ class MongoRepository {
|
|
|
276
277
|
return doc.toObject();
|
|
277
278
|
});
|
|
278
279
|
}
|
|
279
|
-
// public async count(params: factory.ownershipInfo.ISearchConditions): Promise<number> {
|
|
280
|
-
// const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
281
|
-
// return this.ownershipInfoModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
282
|
-
// .setOptions({ maxTimeMS: 10000 })
|
|
283
|
-
// .exec();
|
|
284
|
-
// }
|
|
285
280
|
/**
|
|
286
281
|
* 所有権を検索する
|
|
287
282
|
*/
|
|
@@ -300,7 +295,7 @@ class MongoRepository {
|
|
|
300
295
|
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.ownedFrom) !== undefined) {
|
|
301
296
|
query.sort({ ownedFrom: params.sort.ownedFrom });
|
|
302
297
|
}
|
|
303
|
-
return query.setOptions({ maxTimeMS:
|
|
298
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
304
299
|
.exec()
|
|
305
300
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
306
301
|
});
|
|
@@ -37,7 +37,7 @@ export declare class MongoRepository {
|
|
|
37
37
|
/**
|
|
38
38
|
* 施設を保管する
|
|
39
39
|
*/
|
|
40
|
-
saveMovieTheater(params: factory.place.movieTheater.
|
|
40
|
+
saveMovieTheater(params: factory.place.movieTheater.IPlaceWithoutScreeningRoom): Promise<factory.place.movieTheater.IPlaceWithoutScreeningRoom>;
|
|
41
41
|
saveMovieTheaterByBranchCode4coa(params: factory.place.movieTheater.IPlace): Promise<factory.place.movieTheater.IPlace>;
|
|
42
42
|
findMovieTheaterByBranchCode(params: {
|
|
43
43
|
project: {
|
|
@@ -58,12 +58,22 @@ export declare class MongoRepository {
|
|
|
58
58
|
*/
|
|
59
59
|
findById(params: {
|
|
60
60
|
id: string;
|
|
61
|
-
},
|
|
61
|
+
}, inclusion: string[], exclusion: string[]): Promise<factory.place.movieTheater.IPlace>;
|
|
62
62
|
deleteMovieTheaterById(params: {
|
|
63
63
|
id: string;
|
|
64
64
|
}): Promise<void>;
|
|
65
|
-
createScreeningRoom(screeningRoom: factory.place.screeningRoom.IPlace): Promise<
|
|
66
|
-
|
|
65
|
+
createScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>): Promise<{
|
|
66
|
+
/**
|
|
67
|
+
* 施設ID
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
}>;
|
|
71
|
+
updateScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>, $unset: any): Promise<{
|
|
72
|
+
/**
|
|
73
|
+
* 施設ID
|
|
74
|
+
*/
|
|
75
|
+
id: string;
|
|
76
|
+
}>;
|
|
67
77
|
deleteScreeningRoom(screeningRoom: {
|
|
68
78
|
project: {
|
|
69
79
|
id: string;
|
|
@@ -78,7 +88,12 @@ export declare class MongoRepository {
|
|
|
78
88
|
*/
|
|
79
89
|
branchCode: string;
|
|
80
90
|
};
|
|
81
|
-
}): Promise<
|
|
91
|
+
}): Promise<{
|
|
92
|
+
/**
|
|
93
|
+
* 施設ID
|
|
94
|
+
*/
|
|
95
|
+
id: string;
|
|
96
|
+
}>;
|
|
82
97
|
createScreeningRoomSection(screeningRoomSection: IScreeningRoomSectionWithoutContainsPlace): Promise<void>;
|
|
83
98
|
updateScreeningRoomSection(screeningRoomSection: factory.place.screeningRoomSection.IPlace, $unset: any): Promise<void>;
|
|
84
99
|
searchScreeningRoomSections(searchConditions: factory.place.screeningRoomSection.ISearchConditions & {
|