@chevre/domain 21.0.0-alpha.1 → 21.0.0-alpha.11
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/lib/chevre/errorHandler.d.ts +1 -0
- package/lib/chevre/errorHandler.js +6 -2
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/account.d.ts +0 -2
- package/lib/chevre/repo/account.js +10 -6
- package/lib/chevre/repo/accountTitle.js +6 -2
- package/lib/chevre/repo/accountTransaction.d.ts +0 -2
- package/lib/chevre/repo/accountTransaction.js +9 -6
- package/lib/chevre/repo/accountingReport.d.ts +1 -1
- package/lib/chevre/repo/accountingReport.js +7 -3
- package/lib/chevre/repo/action/registerServiceInProgress.js +1 -1
- package/lib/chevre/repo/action.d.ts +3 -4
- package/lib/chevre/repo/action.js +9 -6
- package/lib/chevre/repo/additionalProperty.js +8 -4
- package/lib/chevre/repo/aggregation.js +6 -2
- package/lib/chevre/repo/assetTransaction.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction.js +9 -6
- package/lib/chevre/repo/categoryCode.js +8 -4
- package/lib/chevre/repo/code.d.ts +3 -3
- package/lib/chevre/repo/code.js +10 -5
- package/lib/chevre/repo/comment.js +8 -4
- package/lib/chevre/repo/confirmationNumber.js +1 -1
- package/lib/chevre/repo/creativeWork.d.ts +0 -2
- package/lib/chevre/repo/creativeWork.js +9 -6
- package/lib/chevre/repo/customer.js +8 -4
- package/lib/chevre/repo/emailMessage.d.ts +1 -1
- package/lib/chevre/repo/emailMessage.js +8 -4
- package/lib/chevre/repo/event.d.ts +1 -1
- package/lib/chevre/repo/event.js +8 -4
- package/lib/chevre/repo/itemAvailability/screeningEvent.js +1 -1
- package/lib/chevre/repo/member.js +16 -9
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +0 -2
- package/lib/chevre/repo/merchantReturnPolicy.js +9 -6
- package/lib/chevre/repo/mongoose/onIndexCreated.d.ts +2 -0
- package/lib/chevre/repo/mongoose/onIndexCreated.js +11 -0
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +54 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/account.js +4 -14
- package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +64 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/accountTitle.js +10 -35
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +67 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/accountTransaction.js +9 -19
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +58 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/accountingReport.js +7 -17
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +73 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/action.js +17 -27
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +60 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/additionalProperty.js +7 -17
- package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +54 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/aggregation.js +4 -14
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +72 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/assetTransaction.js +13 -23
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +61 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/authorization.js +6 -16
- package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +64 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/categoryCode.js +9 -19
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +65 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/comments.js +9 -19
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +73 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/creativeWork.js +10 -20
- package/lib/chevre/repo/mongoose/schemas/customer.d.ts +64 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/customer.js +8 -18
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +62 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/emailMessages.js +8 -18
- package/lib/chevre/repo/mongoose/{model → schemas}/event.d.ts +26 -2
- package/lib/chevre/repo/mongoose/{model → schemas}/event.js +24 -34
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +58 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/member.js +6 -16
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +62 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/merchantReturnPolicy.js +7 -17
- package/lib/chevre/repo/mongoose/schemas/offer.d.ts +83 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/offer.js +28 -38
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +64 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/offerCatalog.js +11 -21
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +77 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/order.js +15 -25
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +64 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/ownershipInfo.js +9 -19
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +76 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/place.js +17 -27
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +66 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/priceSpecification.js +9 -19
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +67 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/product.js +14 -24
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +63 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/project.js +7 -17
- package/lib/chevre/repo/mongoose/{model → schemas}/reservation.d.ts +26 -2
- package/lib/chevre/repo/mongoose/{model → schemas}/reservation.js +15 -25
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +57 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/role.js +4 -14
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +67 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/seller.js +12 -22
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +57 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/serviceOutput.js +5 -15
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +65 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/task.js +7 -17
- package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +62 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/telemetry.js +9 -19
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +70 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/transaction.js +12 -22
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +57 -0
- package/lib/chevre/repo/mongoose/{model → schemas}/trip.js +5 -15
- package/lib/chevre/repo/mongoose/writeConcern.d.ts +3 -0
- package/lib/chevre/repo/mongoose/writeConcern.js +5 -0
- package/lib/chevre/repo/offer.js +11 -6
- package/lib/chevre/repo/offerCatalog.js +8 -4
- package/lib/chevre/repo/order.d.ts +0 -2
- package/lib/chevre/repo/order.js +12 -9
- package/lib/chevre/repo/orderNumber.js +1 -1
- package/lib/chevre/repo/ownershipInfo.d.ts +1 -3
- package/lib/chevre/repo/ownershipInfo.js +10 -7
- package/lib/chevre/repo/paymentMethod/creditCard.d.ts +3 -3
- package/lib/chevre/repo/permit.js +6 -2
- package/lib/chevre/repo/person.d.ts +2 -2
- package/lib/chevre/repo/place.d.ts +2 -2
- package/lib/chevre/repo/place.js +16 -12
- package/lib/chevre/repo/priceSpecification.js +8 -4
- package/lib/chevre/repo/product.d.ts +1 -1
- package/lib/chevre/repo/product.js +8 -4
- package/lib/chevre/repo/project.js +7 -3
- package/lib/chevre/repo/rateLimit/offer.js +1 -1
- package/lib/chevre/repo/reservation.d.ts +1 -1
- package/lib/chevre/repo/reservation.js +8 -21
- package/lib/chevre/repo/role.js +8 -4
- package/lib/chevre/repo/seller.d.ts +1 -1
- package/lib/chevre/repo/seller.js +8 -4
- package/lib/chevre/repo/serviceOutput.js +8 -4
- package/lib/chevre/repo/serviceOutputIdentifier.js +1 -1
- package/lib/chevre/repo/task.js +8 -4
- package/lib/chevre/repo/telemetry.js +6 -2
- package/lib/chevre/repo/transaction.d.ts +1 -2
- package/lib/chevre/repo/transaction.js +9 -6
- package/lib/chevre/repo/transactionNumber.js +1 -1
- package/lib/chevre/repo/trip.d.ts +1 -1
- package/lib/chevre/repo/trip.js +8 -4
- package/lib/chevre/service/account.d.ts +1 -1
- package/lib/chevre/service/accountTransaction/deposit.d.ts +1 -1
- package/lib/chevre/service/accountTransaction/deposit.js +0 -5
- package/lib/chevre/service/accountTransaction/transfer.d.ts +1 -1
- package/lib/chevre/service/accountTransaction/transfer.js +0 -5
- package/lib/chevre/service/accountTransaction/withdraw.d.ts +1 -1
- package/lib/chevre/service/accountTransaction/withdraw.js +0 -5
- package/lib/chevre/service/accountTransaction.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +1 -1
- package/lib/chevre/service/aggregation/project.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +3 -3
- package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +4 -4
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +0 -5
- package/lib/chevre/service/assetTransaction/pay/potentialActions.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay.d.ts +7 -7
- package/lib/chevre/service/assetTransaction/refund.d.ts +4 -4
- package/lib/chevre/service/assetTransaction/refund.js +0 -5
- package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/registerService.d.ts +4 -4
- package/lib/chevre/service/assetTransaction/registerService.js +0 -5
- package/lib/chevre/service/assetTransaction/reserve/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/reserve.d.ts +6 -6
- package/lib/chevre/service/assetTransaction/reserve.js +0 -10
- package/lib/chevre/service/code.d.ts +2 -2
- package/lib/chevre/service/code.js +6 -1
- package/lib/chevre/service/delivery/factory.d.ts +1 -1
- package/lib/chevre/service/delivery/product/factory.d.ts +1 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
- package/lib/chevre/service/iam.d.ts +1 -1
- package/lib/chevre/service/moneyTransfer.d.ts +1 -1
- package/lib/chevre/service/notification.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/factory.d.ts +5 -5
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA.d.ts +2 -2
- package/lib/chevre/service/offer/factory.d.ts +2 -2
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +1 -1
- package/lib/chevre/service/offer/product.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged.d.ts +2 -2
- package/lib/chevre/service/order/placeOrder.d.ts +1 -1
- package/lib/chevre/service/order/sendOrder.d.ts +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +1 -1
- package/lib/chevre/service/payment/any.d.ts +3 -3
- package/lib/chevre/service/payment/creditCard.js +5 -0
- package/lib/chevre/service/payment/movieTicket.d.ts +4 -4
- package/lib/chevre/service/payment/paymentCard.d.ts +1 -1
- package/lib/chevre/service/permit.d.ts +1 -1
- package/lib/chevre/service/report/ownershipInfo.js +4 -0
- package/lib/chevre/service/report/telemetry.d.ts +7 -7
- package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/reserve/factory.d.ts +5 -5
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +1 -1
- package/lib/chevre/service/task/aggregateUseActionsOnEvent.d.ts +1 -1
- package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.d.ts +1 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.d.ts +1 -1
- package/lib/chevre/service/task/importOffersFromCOA.d.ts +1 -1
- package/lib/chevre/service/task/moneyTransfer.d.ts +1 -1
- package/lib/chevre/service/task/registerService.d.ts +1 -1
- package/lib/chevre/service/task/reserve.d.ts +1 -1
- package/lib/chevre/service/task.d.ts +2 -2
- package/lib/chevre/service/task.js +1 -1
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +6 -6
- package/lib/chevre/service/transaction/moneyTransfer.js +0 -5
- package/lib/chevre/service/transaction/orderProgramMembership.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +8 -8
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +7 -7
- package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service/transaction/validation.d.ts +2 -2
- package/lib/chevre/service/transaction.d.ts +2 -2
- package/lib/chevre/settings.d.ts +1 -1
- package/package.json +11 -11
- package/lib/chevre/repo/mongoose/model/account.d.ts +0 -30
- package/lib/chevre/repo/mongoose/model/accountTitle.d.ts +0 -40
- package/lib/chevre/repo/mongoose/model/accountTransaction.d.ts +0 -43
- package/lib/chevre/repo/mongoose/model/accountingReport.d.ts +0 -34
- package/lib/chevre/repo/mongoose/model/action.d.ts +0 -49
- package/lib/chevre/repo/mongoose/model/additionalProperty.d.ts +0 -36
- package/lib/chevre/repo/mongoose/model/aggregation.d.ts +0 -30
- package/lib/chevre/repo/mongoose/model/assetTransaction.d.ts +0 -48
- package/lib/chevre/repo/mongoose/model/authorization.d.ts +0 -37
- package/lib/chevre/repo/mongoose/model/categoryCode.d.ts +0 -40
- package/lib/chevre/repo/mongoose/model/comments.d.ts +0 -41
- package/lib/chevre/repo/mongoose/model/creativeWork.d.ts +0 -49
- package/lib/chevre/repo/mongoose/model/customer.d.ts +0 -40
- package/lib/chevre/repo/mongoose/model/emailMessages.d.ts +0 -38
- package/lib/chevre/repo/mongoose/model/member.d.ts +0 -34
- package/lib/chevre/repo/mongoose/model/merchantReturnPolicy.d.ts +0 -38
- package/lib/chevre/repo/mongoose/model/offer.d.ts +0 -59
- package/lib/chevre/repo/mongoose/model/offerCatalog.d.ts +0 -40
- package/lib/chevre/repo/mongoose/model/order.d.ts +0 -53
- package/lib/chevre/repo/mongoose/model/ownershipInfo.d.ts +0 -40
- package/lib/chevre/repo/mongoose/model/place.d.ts +0 -52
- package/lib/chevre/repo/mongoose/model/priceSpecification.d.ts +0 -42
- package/lib/chevre/repo/mongoose/model/product.d.ts +0 -43
- package/lib/chevre/repo/mongoose/model/project.d.ts +0 -39
- package/lib/chevre/repo/mongoose/model/role.d.ts +0 -33
- package/lib/chevre/repo/mongoose/model/seller.d.ts +0 -43
- package/lib/chevre/repo/mongoose/model/serviceOutput.d.ts +0 -33
- package/lib/chevre/repo/mongoose/model/task.d.ts +0 -41
- package/lib/chevre/repo/mongoose/model/telemetry.d.ts +0 -38
- package/lib/chevre/repo/mongoose/model/transaction.d.ts +0 -46
- package/lib/chevre/repo/mongoose/model/trip.d.ts +0 -33
|
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.MongoRepository =
|
|
12
|
+
exports.MongoRepository = void 0;
|
|
13
13
|
const uuid = require("uuid");
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const ownershipInfo_1 = require("./mongoose/schemas/ownershipInfo");
|
|
16
16
|
const errorHandler_1 = require("../errorHandler");
|
|
17
17
|
const factory = require("../factory");
|
|
18
18
|
/**
|
|
@@ -20,7 +20,10 @@ const factory = require("../factory");
|
|
|
20
20
|
*/
|
|
21
21
|
class MongoRepository {
|
|
22
22
|
constructor(connection) {
|
|
23
|
-
this.ownershipInfoModel = connection.model(ownershipInfo_1.modelName);
|
|
23
|
+
this.ownershipInfoModel = connection.model(ownershipInfo_1.modelName, ownershipInfo_1.schema);
|
|
24
|
+
if (connection.get('autoIndex') === true) {
|
|
25
|
+
this.ownershipInfoModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
26
29
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -242,7 +245,7 @@ class MongoRepository {
|
|
|
242
245
|
.exec();
|
|
243
246
|
}
|
|
244
247
|
catch (error) {
|
|
245
|
-
if (
|
|
248
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
246
249
|
// すでに所有権が存在する場合ok
|
|
247
250
|
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
248
251
|
duplicate = true;
|
|
@@ -291,8 +294,8 @@ class MongoRepository {
|
|
|
291
294
|
return __awaiter(this, void 0, void 0, function* () {
|
|
292
295
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
293
296
|
const query = this.ownershipInfoModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
294
|
-
if (typeof params.limit === 'number') {
|
|
295
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
297
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
298
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
296
299
|
query.limit(params.limit)
|
|
297
300
|
.skip(params.limit * (page - 1));
|
|
298
301
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as GMO from '@motionpicture/gmo-service';
|
|
2
2
|
import * as factory from '../../factory';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type IUncheckedCardRaw = factory.paymentMethod.paymentCard.creditCard.IUncheckedCardRaw;
|
|
4
|
+
export type IUncheckedCardTokenized = factory.paymentMethod.paymentCard.creditCard.IUncheckedCardTokenized;
|
|
5
|
+
export type ISearchCardResult = GMO.factory.card.ISearchCardResult;
|
|
6
6
|
export interface IOptions {
|
|
7
7
|
/**
|
|
8
8
|
* GMOサイトID
|
|
@@ -10,14 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
|
-
const
|
|
13
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
14
|
+
const serviceOutput_1 = require("./mongoose/schemas/serviceOutput");
|
|
14
15
|
const factory = require("../factory");
|
|
15
16
|
/**
|
|
16
17
|
* 許可証リポジトリ
|
|
17
18
|
*/
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
|
-
this.serviceOutputModel = connection.model(serviceOutput_1.modelName);
|
|
21
|
+
this.serviceOutputModel = connection.model(serviceOutput_1.modelName, serviceOutput_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.serviceOutputModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
findByIdentifier(params, projection) {
|
|
23
27
|
var _a, _b;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as AWS from 'aws-sdk';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type AttributeListType = AWS.CognitoIdentityServiceProvider.AttributeListType;
|
|
4
|
+
export type IPerson = factory.person.IPerson;
|
|
5
5
|
/**
|
|
6
6
|
* 会員リポジトリ
|
|
7
7
|
*/
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
-
|
|
28
|
-
export
|
|
27
|
+
type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
|
|
28
|
+
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace'>;
|
|
29
29
|
/**
|
|
30
30
|
* 施設リポジトリ
|
|
31
31
|
*/
|
package/lib/chevre/repo/place.js
CHANGED
|
@@ -22,14 +22,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const mongoose_1 = require("mongoose");
|
|
25
|
-
const
|
|
25
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
26
|
+
const place_1 = require("./mongoose/schemas/place");
|
|
26
27
|
const factory = require("../factory");
|
|
27
28
|
/**
|
|
28
29
|
* 施設リポジトリ
|
|
29
30
|
*/
|
|
30
31
|
class MongoRepository {
|
|
31
32
|
constructor(connection) {
|
|
32
|
-
this.placeModel = connection.model(place_1.modelName);
|
|
33
|
+
this.placeModel = connection.model(place_1.modelName, place_1.schema);
|
|
34
|
+
if (connection.get('autoIndex') === true) {
|
|
35
|
+
this.placeModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
// tslint:disable-next-line:max-func-body-length
|
|
35
39
|
static CREATE_BUS_STOP_MONGO_CONDITIONS(params) {
|
|
@@ -278,8 +282,8 @@ class MongoRepository {
|
|
|
278
282
|
updatedAt: 0,
|
|
279
283
|
containsPlace: 0
|
|
280
284
|
});
|
|
281
|
-
if (typeof params.limit === 'number') {
|
|
282
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
285
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
286
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
283
287
|
query.limit(params.limit)
|
|
284
288
|
.skip(params.limit * (page - 1));
|
|
285
289
|
}
|
|
@@ -629,8 +633,8 @@ class MongoRepository {
|
|
|
629
633
|
]);
|
|
630
634
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
631
635
|
/* istanbul ignore else */
|
|
632
|
-
if (typeof searchConditions.limit === 'number') {
|
|
633
|
-
const page = (typeof searchConditions.page === 'number') ? searchConditions.page : 1;
|
|
636
|
+
if (typeof searchConditions.limit === 'number' && searchConditions.limit > 0) {
|
|
637
|
+
const page = (typeof searchConditions.page === 'number' && searchConditions.page > 0) ? searchConditions.page : 1;
|
|
634
638
|
aggregate.limit(searchConditions.limit * page)
|
|
635
639
|
.skip(searchConditions.limit * (page - 1));
|
|
636
640
|
}
|
|
@@ -805,8 +809,8 @@ class MongoRepository {
|
|
|
805
809
|
]);
|
|
806
810
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
807
811
|
/* istanbul ignore else */
|
|
808
|
-
if (typeof searchConditions.limit === 'number') {
|
|
809
|
-
const page = (typeof searchConditions.page === 'number') ? searchConditions.page : 1;
|
|
812
|
+
if (typeof searchConditions.limit === 'number' && searchConditions.limit > 0) {
|
|
813
|
+
const page = (typeof searchConditions.page === 'number' && searchConditions.page > 0) ? searchConditions.page : 1;
|
|
810
814
|
aggregate.limit(searchConditions.limit * page)
|
|
811
815
|
.skip(searchConditions.limit * (page - 1));
|
|
812
816
|
}
|
|
@@ -1142,8 +1146,8 @@ class MongoRepository {
|
|
|
1142
1146
|
}
|
|
1143
1147
|
}
|
|
1144
1148
|
]);
|
|
1145
|
-
if (typeof params.limit === 'number') {
|
|
1146
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
1149
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
1150
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
1147
1151
|
aggregate.limit(params.limit * page)
|
|
1148
1152
|
.skip(params.limit * (page - 1));
|
|
1149
1153
|
}
|
|
@@ -1230,8 +1234,8 @@ class MongoRepository {
|
|
|
1230
1234
|
updatedAt: 0,
|
|
1231
1235
|
containsPlace: 0
|
|
1232
1236
|
});
|
|
1233
|
-
if (typeof params.limit === 'number') {
|
|
1234
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
1237
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
1238
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
1235
1239
|
query.limit(params.limit)
|
|
1236
1240
|
.skip(params.limit * (page - 1));
|
|
1237
1241
|
}
|
|
@@ -22,13 +22,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const factory = require("../factory");
|
|
25
|
-
const
|
|
25
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
26
|
+
const priceSpecification_1 = require("./mongoose/schemas/priceSpecification");
|
|
26
27
|
/**
|
|
27
28
|
* 価格仕様リポジトリ
|
|
28
29
|
*/
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
|
-
this.priceSpecificationModel = connection.model(priceSpecification_1.modelName);
|
|
32
|
+
this.priceSpecificationModel = connection.model(priceSpecification_1.modelName, priceSpecification_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.priceSpecificationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
34
38
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -169,8 +173,8 @@ class MongoRepository {
|
|
|
169
173
|
createdAt: 0,
|
|
170
174
|
updatedAt: 0
|
|
171
175
|
});
|
|
172
|
-
if (typeof params.limit === 'number') {
|
|
173
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
176
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
177
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
174
178
|
query.limit(params.limit)
|
|
175
179
|
.skip(params.limit * (page - 1));
|
|
176
180
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
-
export
|
|
27
|
+
export type IProduct = factory.product.IProduct | factory.service.paymentService.IService;
|
|
28
28
|
/**
|
|
29
29
|
* プロダクトリポジトリ
|
|
30
30
|
*/
|
|
@@ -21,14 +21,18 @@ 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
|
|
24
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
25
|
+
const product_1 = require("./mongoose/schemas/product");
|
|
25
26
|
const factory = require("../factory");
|
|
26
27
|
/**
|
|
27
28
|
* プロダクトリポジトリ
|
|
28
29
|
*/
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
|
-
this.productModel = connection.model(product_1.modelName);
|
|
32
|
+
this.productModel = connection.model(product_1.modelName, product_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.productModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
// tslint:disable-next-line:max-func-body-length
|
|
34
38
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -160,8 +164,8 @@ class MongoRepository {
|
|
|
160
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
165
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
162
166
|
const query = this.productModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
163
|
-
if (typeof conditions.limit === 'number') {
|
|
164
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
167
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
168
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
165
169
|
query.limit(conditions.limit)
|
|
166
170
|
.skip(conditions.limit * (page - 1));
|
|
167
171
|
}
|
|
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
|
-
const
|
|
13
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
14
|
+
const project_1 = require("./mongoose/schemas/project");
|
|
14
15
|
const factory = require("../factory");
|
|
15
16
|
/**
|
|
16
17
|
* プロジェクトリポジトリ
|
|
@@ -18,6 +19,9 @@ const factory = require("../factory");
|
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
21
|
this.projectModel = connection.model(project_1.modelName, project_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.projectModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
23
27
|
// MongoDB検索条件
|
|
@@ -79,8 +83,8 @@ class MongoRepository {
|
|
|
79
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
84
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
81
85
|
const query = this.projectModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
82
|
-
if (typeof conditions.limit === 'number') {
|
|
83
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
86
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
87
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
84
88
|
query.limit(conditions.limit)
|
|
85
89
|
.skip(conditions.limit * (page - 1));
|
|
86
90
|
}
|
|
@@ -10,14 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
|
-
const
|
|
13
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
14
|
+
const reservation_1 = require("./mongoose/schemas/reservation");
|
|
14
15
|
const factory = require("../factory");
|
|
15
16
|
/**
|
|
16
17
|
* 予約リポジトリ
|
|
17
18
|
*/
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
|
-
this.reservationModel = connection.model(reservation_1.modelName);
|
|
21
|
+
this.reservationModel = connection.model(reservation_1.modelName, reservation_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.reservationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
23
27
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -867,8 +871,8 @@ class MongoRepository {
|
|
|
867
871
|
createdAt: 0,
|
|
868
872
|
updatedAt: 0
|
|
869
873
|
});
|
|
870
|
-
if (typeof params.limit === 'number') {
|
|
871
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
874
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
875
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
872
876
|
query.limit(params.limit)
|
|
873
877
|
.skip(params.limit * (page - 1));
|
|
874
878
|
}
|
|
@@ -882,23 +886,6 @@ class MongoRepository {
|
|
|
882
886
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
883
887
|
});
|
|
884
888
|
}
|
|
885
|
-
// public stream<T extends factory.reservationType>(params: factory.reservation.ISearchConditions<T>): QueryCursor<Document> {
|
|
886
|
-
// const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
887
|
-
// const query = this.reservationModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
888
|
-
// .select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
889
|
-
// // tslint:disable-next-line:no-single-line-block-comment
|
|
890
|
-
// /* istanbul ignore else */
|
|
891
|
-
// if (params.limit !== undefined && params.page !== undefined) {
|
|
892
|
-
// query.limit(params.limit)
|
|
893
|
-
// .skip(params.limit * (params.page - 1));
|
|
894
|
-
// }
|
|
895
|
-
// // tslint:disable-next-line:no-single-line-block-comment
|
|
896
|
-
// /* istanbul ignore else */
|
|
897
|
-
// if (params.sort !== undefined) {
|
|
898
|
-
// query.sort(params.sort);
|
|
899
|
-
// }
|
|
900
|
-
// return query.cursor();
|
|
901
|
-
// }
|
|
902
889
|
findById(params) {
|
|
903
890
|
return __awaiter(this, void 0, void 0, function* () {
|
|
904
891
|
let projection = {};
|
package/lib/chevre/repo/role.js
CHANGED
|
@@ -11,7 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = exports.RoleType = void 0;
|
|
13
13
|
const factory = require("../factory");
|
|
14
|
-
const
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const role_1 = require("./mongoose/schemas/role");
|
|
15
16
|
var RoleType;
|
|
16
17
|
(function (RoleType) {
|
|
17
18
|
RoleType["OrganizationRole"] = "OrganizationRole";
|
|
@@ -21,7 +22,10 @@ var RoleType;
|
|
|
21
22
|
*/
|
|
22
23
|
class MongoRepository {
|
|
23
24
|
constructor(connection) {
|
|
24
|
-
this.roleModel = connection.model(role_1.modelName);
|
|
25
|
+
this.roleModel = connection.model(role_1.modelName, role_1.schema);
|
|
26
|
+
if (connection.get('autoIndex') === true) {
|
|
27
|
+
this.roleModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
27
31
|
var _a, _b, _c;
|
|
@@ -79,8 +83,8 @@ class MongoRepository {
|
|
|
79
83
|
createdAt: 0,
|
|
80
84
|
updatedAt: 0
|
|
81
85
|
});
|
|
82
|
-
if (typeof params.limit === 'number') {
|
|
83
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
86
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
87
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
84
88
|
query.limit(params.limit)
|
|
85
89
|
.skip(params.limit * (page - 1));
|
|
86
90
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
-
export
|
|
27
|
+
export type ISeller = factory.seller.ISeller;
|
|
28
28
|
/**
|
|
29
29
|
* 販売者リポジトリ
|
|
30
30
|
*/
|
|
@@ -21,14 +21,18 @@ 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
|
|
24
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
25
|
+
const seller_1 = require("./mongoose/schemas/seller");
|
|
25
26
|
const factory = require("../factory");
|
|
26
27
|
/**
|
|
27
28
|
* 販売者リポジトリ
|
|
28
29
|
*/
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
|
-
this.organizationModel = connection.model(seller_1.modelName);
|
|
32
|
+
this.organizationModel = connection.model(seller_1.modelName, seller_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.organizationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
// tslint:disable-next-line:max-func-body-length
|
|
34
38
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -172,8 +176,8 @@ class MongoRepository {
|
|
|
172
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
173
177
|
const andConditions = MongoRepository.CREATE_MONGO_CONDITIONS(conditions);
|
|
174
178
|
const query = this.organizationModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
175
|
-
if (typeof conditions.limit === 'number') {
|
|
176
|
-
const page = (typeof conditions.page === 'number') ? conditions.page : 1;
|
|
179
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
180
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
177
181
|
query.limit(conditions.limit)
|
|
178
182
|
.skip(conditions.limit * (page - 1));
|
|
179
183
|
}
|
|
@@ -10,14 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
|
-
const
|
|
13
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
14
|
+
const serviceOutput_1 = require("./mongoose/schemas/serviceOutput");
|
|
14
15
|
const factory = require("../factory");
|
|
15
16
|
/**
|
|
16
17
|
* サービスアウトプットリポジトリ
|
|
17
18
|
*/
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
|
-
this.serviceOutputModel = connection.model(serviceOutput_1.modelName);
|
|
21
|
+
this.serviceOutputModel = connection.model(serviceOutput_1.modelName, serviceOutput_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.serviceOutputModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
// tslint:disable-next-line:max-func-body-length
|
|
23
27
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -118,8 +122,8 @@ class MongoRepository {
|
|
|
118
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
123
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
120
124
|
const query = this.serviceOutputModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
121
|
-
if (typeof params.limit === 'number') {
|
|
122
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
125
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
126
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
123
127
|
query.limit(params.limit)
|
|
124
128
|
.skip(params.limit * (page - 1));
|
|
125
129
|
}
|
package/lib/chevre/repo/task.js
CHANGED
|
@@ -12,7 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
13
|
const moment = require("moment");
|
|
14
14
|
const factory = require("../factory");
|
|
15
|
-
const
|
|
15
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
16
|
+
const task_1 = require("./mongoose/schemas/task");
|
|
16
17
|
/**
|
|
17
18
|
* タスク実行時のソート条件
|
|
18
19
|
*/
|
|
@@ -25,7 +26,10 @@ const sortOrder4executionOfTasks = {
|
|
|
25
26
|
*/
|
|
26
27
|
class MongoRepository {
|
|
27
28
|
constructor(connection) {
|
|
28
|
-
this.taskModel = connection.model(task_1.modelName);
|
|
29
|
+
this.taskModel = connection.model(task_1.modelName, task_1.schema);
|
|
30
|
+
if (connection.get('autoIndex') === true) {
|
|
31
|
+
this.taskModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
// tslint:disable-next-line:max-func-body-length
|
|
31
35
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -309,8 +313,8 @@ class MongoRepository {
|
|
|
309
313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
310
314
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
311
315
|
const query = this.taskModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
312
|
-
if (typeof params.limit === 'number') {
|
|
313
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
316
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
317
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
314
318
|
query.limit(params.limit)
|
|
315
319
|
.skip(params.limit * (page - 1));
|
|
316
320
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MongoRepository = void 0;
|
|
4
|
-
const
|
|
4
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
5
|
+
const telemetry_1 = require("./mongoose/schemas/telemetry");
|
|
5
6
|
/**
|
|
6
7
|
* 測定リポジトリ
|
|
7
8
|
*/
|
|
8
9
|
class MongoRepository {
|
|
9
10
|
constructor(connection) {
|
|
10
|
-
this.telemetryModel = connection.model(telemetry_1.modelName);
|
|
11
|
+
this.telemetryModel = connection.model(telemetry_1.modelName, telemetry_1.schema);
|
|
12
|
+
if (connection.get('autoIndex') === true) {
|
|
13
|
+
this.telemetryModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
}
|
|
13
17
|
exports.MongoRepository = MongoRepository;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
import { modelName } from './mongoose/model/transaction';
|
|
4
|
-
export { modelName };
|
|
5
3
|
interface IAggregationByStatus {
|
|
6
4
|
transactionCount: number;
|
|
7
5
|
avgDuration: number;
|
|
@@ -185,3 +183,4 @@ export declare class MongoRepository {
|
|
|
185
183
|
}): Promise<IAggregatePlaceOrder>;
|
|
186
184
|
private agggregateByStatus;
|
|
187
185
|
}
|
|
186
|
+
export {};
|
|
@@ -9,17 +9,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.MongoRepository =
|
|
12
|
+
exports.MongoRepository = void 0;
|
|
13
13
|
const moment = require("moment");
|
|
14
14
|
const factory = require("../factory");
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
16
|
+
const transaction_1 = require("./mongoose/schemas/transaction");
|
|
17
17
|
/**
|
|
18
18
|
* 取引リポジトリ
|
|
19
19
|
*/
|
|
20
20
|
class MongoRepository {
|
|
21
21
|
constructor(connection) {
|
|
22
|
-
this.transactionModel = connection.model(transaction_1.modelName);
|
|
22
|
+
this.transactionModel = connection.model(transaction_1.modelName, transaction_1.schema);
|
|
23
|
+
if (connection.get('autoIndex') === true) {
|
|
24
|
+
this.transactionModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
25
28
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -592,8 +595,8 @@ class MongoRepository {
|
|
|
592
595
|
}
|
|
593
596
|
const query = this.transactionModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
594
597
|
.select(projection);
|
|
595
|
-
if (typeof params.limit === 'number') {
|
|
596
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
598
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
599
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
597
600
|
query.limit(params.limit)
|
|
598
601
|
.skip(params.limit * (page - 1));
|
|
599
602
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
export
|
|
3
|
+
export type ISearchConditions<T extends factory.tripType> = factory.trip.ISearchConditions<T>;
|
|
4
4
|
export interface IAttributes4patchUpdate<T extends factory.tripType> {
|
|
5
5
|
typeOf: T;
|
|
6
6
|
}
|
package/lib/chevre/repo/trip.js
CHANGED
|
@@ -22,13 +22,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const factory = require("../factory");
|
|
25
|
-
const
|
|
25
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
26
|
+
const trip_1 = require("./mongoose/schemas/trip");
|
|
26
27
|
/**
|
|
27
28
|
* トリップリポジトリ
|
|
28
29
|
*/
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
|
-
this.tripModel = connection.model(trip_1.modelName);
|
|
32
|
+
this.tripModel = connection.model(trip_1.modelName, trip_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.tripModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
34
38
|
static CREATE_MONGO_CONDITIONS(conditions) {
|
|
@@ -175,8 +179,8 @@ class MongoRepository {
|
|
|
175
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
176
180
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
177
181
|
const query = this.tripModel.find({ $and: conditions }, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
178
|
-
if (typeof params.limit === 'number') {
|
|
179
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
182
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
183
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
180
184
|
query.limit(params.limit)
|
|
181
185
|
.skip(params.limit * (page - 1));
|
|
182
186
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as factory from '../factory';
|
|
6
6
|
import { MongoRepository as AccountRepo } from '../repo/account';
|
|
7
7
|
import { MongoRepository as AccountTransactionRepo } from '../repo/accountTransaction';
|
|
8
|
-
export
|
|
8
|
+
export type IOpenOperation<T> = (repos: {
|
|
9
9
|
account: AccountRepo;
|
|
10
10
|
}) => Promise<T>;
|
|
11
11
|
/**
|