@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
|
@@ -0,0 +1,65 @@
|
|
|
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" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
declare const modelName = "Task";
|
|
27
|
+
/**
|
|
28
|
+
* タスクスキーマ
|
|
29
|
+
*/
|
|
30
|
+
declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
|
|
31
|
+
collection: string;
|
|
32
|
+
id: true;
|
|
33
|
+
read: string;
|
|
34
|
+
writeConcern: import("mongodb").WriteConcern;
|
|
35
|
+
strict: true;
|
|
36
|
+
useNestedStrict: boolean;
|
|
37
|
+
timestamps: {
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
};
|
|
41
|
+
toJSON: {
|
|
42
|
+
getters: false;
|
|
43
|
+
virtuals: false;
|
|
44
|
+
minimize: false;
|
|
45
|
+
versionKey: false;
|
|
46
|
+
};
|
|
47
|
+
toObject: {
|
|
48
|
+
getters: false;
|
|
49
|
+
virtuals: true;
|
|
50
|
+
minimize: false;
|
|
51
|
+
versionKey: false;
|
|
52
|
+
};
|
|
53
|
+
}>, {
|
|
54
|
+
executionResults: any[];
|
|
55
|
+
name?: string | undefined;
|
|
56
|
+
status?: string | undefined;
|
|
57
|
+
data?: any;
|
|
58
|
+
project?: any;
|
|
59
|
+
runsAt?: Date | undefined;
|
|
60
|
+
remainingNumberOfTries?: number | undefined;
|
|
61
|
+
lastTriedAt?: Date | undefined;
|
|
62
|
+
numberOfTried?: number | undefined;
|
|
63
|
+
dateAborted?: Date | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
export { modelName, schema };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schema = exports.modelName = void 0;
|
|
4
|
-
const
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const writeConcern_1 = require("../writeConcern");
|
|
5
6
|
const modelName = 'Task';
|
|
6
7
|
exports.modelName = modelName;
|
|
7
|
-
const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
|
|
8
8
|
/**
|
|
9
9
|
* タスクスキーマ
|
|
10
10
|
*/
|
|
11
|
-
const schema = new
|
|
12
|
-
project:
|
|
11
|
+
const schema = new mongoose_1.Schema({
|
|
12
|
+
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
13
|
name: String,
|
|
14
14
|
status: String,
|
|
15
15
|
runsAt: Date,
|
|
16
16
|
remainingNumberOfTries: Number,
|
|
17
17
|
lastTriedAt: Date,
|
|
18
18
|
numberOfTried: Number,
|
|
19
|
-
executionResults: [
|
|
20
|
-
data:
|
|
19
|
+
executionResults: [mongoose_1.SchemaTypes.Mixed],
|
|
20
|
+
data: mongoose_1.SchemaTypes.Mixed,
|
|
21
21
|
dateAborted: Date
|
|
22
22
|
}, {
|
|
23
23
|
collection: 'tasks',
|
|
24
24
|
id: true,
|
|
25
25
|
read: 'primaryPreferred',
|
|
26
|
-
writeConcern: writeConcern,
|
|
26
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
27
27
|
strict: true,
|
|
28
28
|
useNestedStrict: true,
|
|
29
29
|
timestamps: {
|
|
@@ -148,13 +148,3 @@ schema.index({ 'data.transactionId': 1, runsAt: -1 }, {
|
|
|
148
148
|
'data.transactionId': { $exists: true }
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
|
-
mongoose.model(modelName, schema)
|
|
152
|
-
.on('index',
|
|
153
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
154
|
-
/* istanbul ignore next */
|
|
155
|
-
(error) => {
|
|
156
|
-
if (error !== undefined) {
|
|
157
|
-
// tslint:disable-next-line:no-console
|
|
158
|
-
console.error(error);
|
|
159
|
-
}
|
|
160
|
-
});
|
|
@@ -0,0 +1,62 @@
|
|
|
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" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
declare const modelName = "Telemetry";
|
|
27
|
+
/**
|
|
28
|
+
* 測定スキーマ
|
|
29
|
+
*/
|
|
30
|
+
declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
|
|
31
|
+
collection: string;
|
|
32
|
+
id: true;
|
|
33
|
+
read: string;
|
|
34
|
+
writeConcern: import("mongodb").WriteConcern;
|
|
35
|
+
strict: true;
|
|
36
|
+
useNestedStrict: boolean;
|
|
37
|
+
timestamps: {
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
};
|
|
41
|
+
toJSON: {
|
|
42
|
+
getters: false;
|
|
43
|
+
virtuals: false;
|
|
44
|
+
minimize: false;
|
|
45
|
+
versionKey: false;
|
|
46
|
+
};
|
|
47
|
+
toObject: {
|
|
48
|
+
getters: false;
|
|
49
|
+
virtuals: true;
|
|
50
|
+
minimize: false;
|
|
51
|
+
versionKey: false;
|
|
52
|
+
};
|
|
53
|
+
}>, {
|
|
54
|
+
object?: any;
|
|
55
|
+
error?: any;
|
|
56
|
+
project?: any;
|
|
57
|
+
startDate?: Date | undefined;
|
|
58
|
+
endDate?: Date | undefined;
|
|
59
|
+
result?: any;
|
|
60
|
+
purpose?: any;
|
|
61
|
+
}>;
|
|
62
|
+
export { modelName, schema };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schema = exports.modelName = void 0;
|
|
4
|
-
const
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const writeConcern_1 = require("../writeConcern");
|
|
5
6
|
const modelName = 'Telemetry';
|
|
6
7
|
exports.modelName = modelName;
|
|
7
|
-
const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
|
|
8
8
|
/**
|
|
9
9
|
* 測定スキーマ
|
|
10
10
|
*/
|
|
11
|
-
const schema = new
|
|
12
|
-
project:
|
|
13
|
-
result:
|
|
14
|
-
error:
|
|
15
|
-
object:
|
|
11
|
+
const schema = new mongoose_1.Schema({
|
|
12
|
+
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
|
+
result: mongoose_1.SchemaTypes.Mixed,
|
|
14
|
+
error: mongoose_1.SchemaTypes.Mixed,
|
|
15
|
+
object: mongoose_1.SchemaTypes.Mixed,
|
|
16
16
|
startDate: Date,
|
|
17
17
|
endDate: Date,
|
|
18
|
-
purpose:
|
|
18
|
+
purpose: mongoose_1.SchemaTypes.Mixed
|
|
19
19
|
}, {
|
|
20
20
|
collection: 'telemetries',
|
|
21
21
|
id: true,
|
|
22
22
|
read: 'primaryPreferred',
|
|
23
|
-
writeConcern: writeConcern,
|
|
23
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
24
24
|
strict: true,
|
|
25
25
|
useNestedStrict: true,
|
|
26
26
|
timestamps: {
|
|
@@ -57,13 +57,3 @@ schema.index({ 'purpose.typeOf': 1, 'object.scope': 1, 'object.measuredAt': 1 },
|
|
|
57
57
|
'object.measuredAt': { $exists: true }
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
mongoose.model(modelName, schema)
|
|
61
|
-
.on('index',
|
|
62
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
63
|
-
/* istanbul ignore next */
|
|
64
|
-
(error) => {
|
|
65
|
-
if (error !== undefined) {
|
|
66
|
-
// tslint:disable-next-line:no-console
|
|
67
|
-
console.error(error);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
@@ -0,0 +1,70 @@
|
|
|
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" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
declare const modelName = "Transaction";
|
|
27
|
+
/**
|
|
28
|
+
* 取引スキーマ
|
|
29
|
+
*/
|
|
30
|
+
declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
|
|
31
|
+
collection: string;
|
|
32
|
+
id: true;
|
|
33
|
+
read: string;
|
|
34
|
+
writeConcern: import("mongodb").WriteConcern;
|
|
35
|
+
strict: true;
|
|
36
|
+
useNestedStrict: boolean;
|
|
37
|
+
timestamps: {
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
};
|
|
41
|
+
toJSON: {
|
|
42
|
+
getters: false;
|
|
43
|
+
virtuals: false;
|
|
44
|
+
minimize: false;
|
|
45
|
+
versionKey: false;
|
|
46
|
+
};
|
|
47
|
+
toObject: {
|
|
48
|
+
getters: false;
|
|
49
|
+
virtuals: true;
|
|
50
|
+
minimize: false;
|
|
51
|
+
versionKey: false;
|
|
52
|
+
};
|
|
53
|
+
}>, {
|
|
54
|
+
object?: any;
|
|
55
|
+
typeOf?: string | undefined;
|
|
56
|
+
status?: string | undefined;
|
|
57
|
+
error?: any;
|
|
58
|
+
expires?: Date | undefined;
|
|
59
|
+
project?: any;
|
|
60
|
+
agent?: any;
|
|
61
|
+
recipient?: any;
|
|
62
|
+
startDate?: Date | undefined;
|
|
63
|
+
endDate?: Date | undefined;
|
|
64
|
+
potentialActions?: any;
|
|
65
|
+
tasksExportationStatus?: string | undefined;
|
|
66
|
+
tasksExportedAt?: Date | undefined;
|
|
67
|
+
result?: any;
|
|
68
|
+
seller?: any;
|
|
69
|
+
}>;
|
|
70
|
+
export { modelName, schema };
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schema = exports.modelName = void 0;
|
|
4
|
-
const
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
5
|
const factory = require("../../../factory");
|
|
6
|
+
const writeConcern_1 = require("../writeConcern");
|
|
6
7
|
const modelName = 'Transaction';
|
|
7
8
|
exports.modelName = modelName;
|
|
8
|
-
const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
|
|
9
9
|
/**
|
|
10
10
|
* 取引スキーマ
|
|
11
11
|
*/
|
|
12
|
-
const schema = new
|
|
13
|
-
project:
|
|
12
|
+
const schema = new mongoose_1.Schema({
|
|
13
|
+
project: mongoose_1.SchemaTypes.Mixed,
|
|
14
14
|
status: String,
|
|
15
15
|
typeOf: String,
|
|
16
|
-
agent:
|
|
17
|
-
recipient:
|
|
18
|
-
seller:
|
|
19
|
-
error:
|
|
20
|
-
result:
|
|
21
|
-
object:
|
|
16
|
+
agent: mongoose_1.SchemaTypes.Mixed,
|
|
17
|
+
recipient: mongoose_1.SchemaTypes.Mixed,
|
|
18
|
+
seller: mongoose_1.SchemaTypes.Mixed,
|
|
19
|
+
error: mongoose_1.SchemaTypes.Mixed,
|
|
20
|
+
result: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
+
object: mongoose_1.SchemaTypes.Mixed,
|
|
22
22
|
expires: Date,
|
|
23
23
|
startDate: Date,
|
|
24
24
|
endDate: Date,
|
|
25
25
|
tasksExportedAt: Date,
|
|
26
26
|
tasksExportationStatus: String,
|
|
27
|
-
potentialActions:
|
|
27
|
+
potentialActions: mongoose_1.SchemaTypes.Mixed
|
|
28
28
|
}, {
|
|
29
29
|
collection: 'transactions',
|
|
30
30
|
id: true,
|
|
31
31
|
read: 'primaryPreferred',
|
|
32
|
-
writeConcern: writeConcern,
|
|
32
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
33
33
|
strict: true,
|
|
34
34
|
useNestedStrict: true,
|
|
35
35
|
timestamps: {
|
|
@@ -218,13 +218,3 @@ schema.index({ 'project.id': 1, status: 1, expires: 1 }, {
|
|
|
218
218
|
'project.id': { $exists: true }
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
|
-
mongoose.model(modelName, schema)
|
|
222
|
-
.on('index',
|
|
223
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
224
|
-
/* istanbul ignore next */
|
|
225
|
-
(error) => {
|
|
226
|
-
if (error !== undefined) {
|
|
227
|
-
// tslint:disable-next-line:no-console
|
|
228
|
-
console.error(error);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
@@ -0,0 +1,57 @@
|
|
|
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" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
declare const modelName = "Trip";
|
|
27
|
+
/**
|
|
28
|
+
* トリップスキーマ
|
|
29
|
+
*/
|
|
30
|
+
declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
|
|
31
|
+
collection: string;
|
|
32
|
+
id: true;
|
|
33
|
+
read: string;
|
|
34
|
+
writeConcern: import("mongodb").WriteConcern;
|
|
35
|
+
strict: false;
|
|
36
|
+
useNestedStrict: boolean;
|
|
37
|
+
timestamps: {
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
};
|
|
41
|
+
toJSON: {
|
|
42
|
+
getters: false;
|
|
43
|
+
virtuals: false;
|
|
44
|
+
minimize: false;
|
|
45
|
+
versionKey: false;
|
|
46
|
+
};
|
|
47
|
+
toObject: {
|
|
48
|
+
getters: false;
|
|
49
|
+
virtuals: true;
|
|
50
|
+
minimize: false;
|
|
51
|
+
versionKey: false;
|
|
52
|
+
};
|
|
53
|
+
}>, {
|
|
54
|
+
typeOf: string;
|
|
55
|
+
project?: any;
|
|
56
|
+
}>;
|
|
57
|
+
export { modelName, schema };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schema = exports.modelName = void 0;
|
|
4
|
-
const
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const writeConcern_1 = require("../writeConcern");
|
|
5
6
|
const modelName = 'Trip';
|
|
6
7
|
exports.modelName = modelName;
|
|
7
|
-
const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
|
|
8
8
|
/**
|
|
9
9
|
* トリップスキーマ
|
|
10
10
|
*/
|
|
11
|
-
const schema = new
|
|
12
|
-
project:
|
|
11
|
+
const schema = new mongoose_1.Schema({
|
|
12
|
+
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
13
|
typeOf: {
|
|
14
14
|
type: String,
|
|
15
15
|
required: true
|
|
@@ -18,7 +18,7 @@ const schema = new mongoose.Schema({
|
|
|
18
18
|
collection: 'trips',
|
|
19
19
|
id: true,
|
|
20
20
|
read: 'primaryPreferred',
|
|
21
|
-
writeConcern: writeConcern,
|
|
21
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
22
22
|
strict: false,
|
|
23
23
|
useNestedStrict: true,
|
|
24
24
|
timestamps: {
|
|
@@ -39,13 +39,3 @@ const schema = new mongoose.Schema({
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
exports.schema = schema;
|
|
42
|
-
mongoose.model(modelName, schema)
|
|
43
|
-
.on('index',
|
|
44
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
45
|
-
/* istanbul ignore next */
|
|
46
|
-
(error) => {
|
|
47
|
-
if (error !== undefined) {
|
|
48
|
-
// tslint:disable-next-line:no-console
|
|
49
|
-
console.error(error);
|
|
50
|
-
}
|
|
51
|
-
});
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -23,15 +23,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const uniqid = require("uniqid");
|
|
25
25
|
const factory = require("../factory");
|
|
26
|
-
const
|
|
27
|
-
const
|
|
26
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
27
|
+
const offer_1 = require("./mongoose/schemas/offer");
|
|
28
|
+
const offerCatalog_1 = require("./mongoose/schemas/offerCatalog");
|
|
28
29
|
/**
|
|
29
30
|
* オファーリポジトリ
|
|
30
31
|
*/
|
|
31
32
|
class MongoRepository {
|
|
32
33
|
constructor(connection) {
|
|
33
|
-
this.offerModel = connection.model(offer_1.modelName);
|
|
34
|
-
this.offerCatalogModel = connection.model(offerCatalog_1.modelName);
|
|
34
|
+
this.offerModel = connection.model(offer_1.modelName, offer_1.schema);
|
|
35
|
+
this.offerCatalogModel = connection.model(offerCatalog_1.modelName, offerCatalog_1.schema);
|
|
36
|
+
if (connection.get('autoIndex') === true) {
|
|
37
|
+
this.offerModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
38
|
+
this.offerCatalogModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
37
42
|
static CREATE_OFFER_MONGO_CONDITIONS(params) {
|
|
@@ -424,8 +429,8 @@ class MongoRepository {
|
|
|
424
429
|
const query = this.offerModel.find((conditions.length > 0) ? { $and: conditions } : {}, (positiveProjectionExists)
|
|
425
430
|
? projection
|
|
426
431
|
: Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
|
|
427
|
-
if (typeof params.limit === 'number') {
|
|
428
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
432
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
433
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
429
434
|
query.limit(params.limit)
|
|
430
435
|
.skip(params.limit * (page - 1));
|
|
431
436
|
}
|
|
@@ -23,13 +23,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const uniqid = require("uniqid");
|
|
25
25
|
const factory = require("../factory");
|
|
26
|
-
const
|
|
26
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
27
|
+
const offerCatalog_1 = require("./mongoose/schemas/offerCatalog");
|
|
27
28
|
/**
|
|
28
29
|
* オファーカタログリポジトリ
|
|
29
30
|
*/
|
|
30
31
|
class MongoRepository {
|
|
31
32
|
constructor(connection) {
|
|
32
|
-
this.offerCatalogModel = connection.model(offerCatalog_1.modelName);
|
|
33
|
+
this.offerCatalogModel = connection.model(offerCatalog_1.modelName, offerCatalog_1.schema);
|
|
34
|
+
if (connection.get('autoIndex') === true) {
|
|
35
|
+
this.offerCatalogModel.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_MONGO_CONDITIONS(params) {
|
|
@@ -238,8 +242,8 @@ class MongoRepository {
|
|
|
238
242
|
}
|
|
239
243
|
}
|
|
240
244
|
]);
|
|
241
|
-
if (typeof params.limit === 'number') {
|
|
242
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
245
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
246
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
243
247
|
aggregate.limit(params.limit * page)
|
|
244
248
|
.skip(params.limit * (page - 1));
|
|
245
249
|
}
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -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 factory = require("../factory");
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const order_1 = require("./mongoose/schemas/order");
|
|
16
16
|
const errorHandler_1 = require("../errorHandler");
|
|
17
17
|
const order_2 = require("../factory/order");
|
|
18
18
|
/**
|
|
@@ -20,7 +20,10 @@ const order_2 = require("../factory/order");
|
|
|
20
20
|
*/
|
|
21
21
|
class MongoRepository {
|
|
22
22
|
constructor(connection) {
|
|
23
|
-
this.orderModel = connection.model(order_1.modelName);
|
|
23
|
+
this.orderModel = connection.model(order_1.modelName, order_1.schema);
|
|
24
|
+
if (connection.get('autoIndex') === true) {
|
|
25
|
+
this.orderModel.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) {
|
|
@@ -678,7 +681,7 @@ class MongoRepository {
|
|
|
678
681
|
}
|
|
679
682
|
catch (error) {
|
|
680
683
|
let throwsError = true;
|
|
681
|
-
if (
|
|
684
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
682
685
|
// すでにorderNumberが存在する場合ok
|
|
683
686
|
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
684
687
|
throwsError = false;
|
|
@@ -899,8 +902,8 @@ class MongoRepository {
|
|
|
899
902
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
900
903
|
const query = this.orderModel.find((conditions.length > 0) ? { $and: conditions } : {})
|
|
901
904
|
.select(Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
|
|
902
|
-
if (typeof params.limit === 'number') {
|
|
903
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
905
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
906
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
904
907
|
query.limit(params.limit)
|
|
905
908
|
.skip(params.limit * (page - 1));
|
|
906
909
|
}
|
|
@@ -970,8 +973,8 @@ class MongoRepository {
|
|
|
970
973
|
createdAt: 0,
|
|
971
974
|
updatedAt: 0
|
|
972
975
|
});
|
|
973
|
-
if (typeof params.limit === 'number') {
|
|
974
|
-
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
976
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
977
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
975
978
|
aggregate.limit(params.limit * page)
|
|
976
979
|
.skip(params.limit * (page - 1));
|
|
977
980
|
}
|
|
@@ -23,10 +23,8 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Connection } from 'mongoose';
|
|
26
|
-
import { modelName } from './mongoose/model/ownershipInfo';
|
|
27
26
|
import * as factory from '../factory';
|
|
28
|
-
export
|
|
29
|
-
export { modelName };
|
|
27
|
+
export type IOwnershipInfo = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>;
|
|
30
28
|
/**
|
|
31
29
|
* 所有権リポジトリ
|
|
32
30
|
*/
|