@chevre/domain 21.0.0-alpha.8 → 21.0.0-alpha.9
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/repo/account.d.ts +0 -2
- package/lib/chevre/repo/account.js +6 -3
- package/lib/chevre/repo/accountTitle.js +5 -1
- package/lib/chevre/repo/accountTransaction.d.ts +0 -2
- package/lib/chevre/repo/accountTransaction.js +6 -3
- package/lib/chevre/repo/accountingReport.js +6 -2
- package/lib/chevre/repo/action.d.ts +1 -2
- package/lib/chevre/repo/action.js +6 -3
- package/lib/chevre/repo/additionalProperty.js +5 -1
- package/lib/chevre/repo/aggregation.js +5 -1
- package/lib/chevre/repo/assetTransaction.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction.js +6 -3
- package/lib/chevre/repo/categoryCode.js +5 -1
- package/lib/chevre/repo/code.d.ts +1 -1
- package/lib/chevre/repo/code.js +5 -1
- package/lib/chevre/repo/comment.js +5 -1
- package/lib/chevre/repo/creativeWork.d.ts +0 -2
- package/lib/chevre/repo/creativeWork.js +6 -3
- package/lib/chevre/repo/customer.js +5 -1
- package/lib/chevre/repo/emailMessage.js +5 -1
- package/lib/chevre/repo/event.js +5 -1
- package/lib/chevre/repo/member.js +5 -1
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +0 -2
- package/lib/chevre/repo/merchantReturnPolicy.js +6 -3
- package/lib/chevre/repo/mongoose/onIndexCreated.d.ts +2 -0
- package/lib/chevre/repo/mongoose/onIndexCreated.js +11 -0
- package/lib/chevre/repo/offer.js +7 -2
- package/lib/chevre/repo/offerCatalog.js +5 -1
- package/lib/chevre/repo/order.d.ts +0 -2
- package/lib/chevre/repo/order.js +7 -4
- package/lib/chevre/repo/ownershipInfo.d.ts +0 -2
- package/lib/chevre/repo/ownershipInfo.js +7 -4
- package/lib/chevre/repo/permit.js +5 -1
- package/lib/chevre/repo/place.js +5 -1
- package/lib/chevre/repo/priceSpecification.js +5 -1
- package/lib/chevre/repo/product.js +5 -1
- package/lib/chevre/repo/project.js +5 -1
- package/lib/chevre/repo/reservation.js +5 -1
- package/lib/chevre/repo/role.js +5 -1
- package/lib/chevre/repo/seller.js +5 -1
- package/lib/chevre/repo/serviceOutput.js +5 -1
- package/lib/chevre/repo/task.js +5 -1
- package/lib/chevre/repo/telemetry.js +5 -1
- package/lib/chevre/repo/transaction.d.ts +1 -2
- package/lib/chevre/repo/transaction.js +6 -3
- package/lib/chevre/repo/trip.js +5 -1
- package/lib/chevre/service/accountTransaction/deposit.js +0 -5
- package/lib/chevre/service/accountTransaction/transfer.js +0 -5
- package/lib/chevre/service/accountTransaction/withdraw.js +0 -5
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +0 -5
- package/lib/chevre/service/assetTransaction/refund.js +0 -5
- package/lib/chevre/service/assetTransaction/registerService.js +0 -5
- package/lib/chevre/service/assetTransaction/reserve.js +0 -10
- package/lib/chevre/service/transaction/moneyTransfer.js +0 -5
- package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/package.json +1 -1
- /package/lib/chevre/repo/mongoose/{model → schemas}/account.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/account.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/accountTitle.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/accountTitle.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/accountTransaction.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/accountTransaction.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/accountingReport.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/accountingReport.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/action.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/action.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/additionalProperty.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/additionalProperty.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/aggregation.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/aggregation.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/assetTransaction.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/assetTransaction.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/authorization.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/authorization.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/categoryCode.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/categoryCode.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/comments.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/comments.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/creativeWork.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/creativeWork.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/customer.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/customer.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/emailMessages.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/emailMessages.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/event.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/event.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/member.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/member.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/merchantReturnPolicy.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/merchantReturnPolicy.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/offer.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/offer.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/offerCatalog.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/offerCatalog.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/order.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/order.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/ownershipInfo.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/ownershipInfo.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/place.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/place.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/priceSpecification.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/priceSpecification.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/product.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/product.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/project.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/project.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/reservation.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/reservation.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/role.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/role.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/seller.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/seller.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/serviceOutput.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/serviceOutput.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/task.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/task.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/telemetry.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/telemetry.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/transaction.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/transaction.js +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/trip.d.ts +0 -0
- /package/lib/chevre/repo/mongoose/{model → schemas}/trip.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleAWSError = exports.handleMvtkReserveError = exports.handlePecorinoError = exports.handleCOAError = exports.handleMongoError = exports.MongoErrorCode = void 0;
|
|
3
|
+
exports.handleAWSError = exports.handleMvtkReserveError = exports.handlePecorinoError = exports.handleCOAError = exports.handleMongoError = exports.isMongoError = exports.MongoErrorCode = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* エラーハンドラー
|
|
6
6
|
* 外部サービスと連携している場合に、サービス(API)のエラーを本ドメインのエラーに変換する責任を担います。
|
|
@@ -14,9 +14,13 @@ var MongoErrorCode;
|
|
|
14
14
|
MongoErrorCode[MongoErrorCode["MaxTimeMSExpired"] = 50] = "MaxTimeMSExpired";
|
|
15
15
|
MongoErrorCode[MongoErrorCode["ExceededTimeLimit"] = 262] = "ExceededTimeLimit";
|
|
16
16
|
})(MongoErrorCode = exports.MongoErrorCode || (exports.MongoErrorCode = {}));
|
|
17
|
+
function isMongoError(error) {
|
|
18
|
+
return (error instanceof mongoose_1.mongo.MongoError || error instanceof mongoose_1.mongo.MongoServerError);
|
|
19
|
+
}
|
|
20
|
+
exports.isMongoError = isMongoError;
|
|
17
21
|
function handleMongoError(error) {
|
|
18
22
|
let handledError = error;
|
|
19
|
-
if (handledError instanceof mongoose_1.mongo.MongoError) {
|
|
23
|
+
if (handledError instanceof mongoose_1.mongo.MongoError || handledError instanceof mongoose_1.mongo.MongoServerError) {
|
|
20
24
|
switch (handledError.code) {
|
|
21
25
|
case MongoErrorCode.DuplicateKey:
|
|
22
26
|
handledError = new factory_1.errors.AlreadyInUse('', [], `Some fields already in use. code:${handledError.code} message:${handledError.message}`);
|
|
@@ -9,9 +9,9 @@ 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 =
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
exports.MongoRepository = void 0;
|
|
13
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
14
|
+
const account_1 = require("./mongoose/schemas/account");
|
|
15
15
|
const factory = require("../factory");
|
|
16
16
|
/**
|
|
17
17
|
* 口座リポジトリ
|
|
@@ -19,6 +19,9 @@ const factory = require("../factory");
|
|
|
19
19
|
class MongoRepository {
|
|
20
20
|
constructor(connection) {
|
|
21
21
|
this.accountModel = connection.model(account_1.modelName, account_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.accountModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
24
27
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -11,13 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
13
|
const factory = require("../factory");
|
|
14
|
-
const
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const accountTitle_1 = require("./mongoose/schemas/accountTitle");
|
|
15
16
|
/**
|
|
16
17
|
* 科目リポジトリ
|
|
17
18
|
*/
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
21
|
this.accountTitleModel = connection.model(accountTitle_1.modelName, accountTitle_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.accountTitleModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
deleteByProject(params) {
|
|
23
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -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 moment = require("moment");
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const accountTransaction_1 = require("./mongoose/schemas/accountTransaction");
|
|
16
16
|
const factory = require("../factory");
|
|
17
17
|
/**
|
|
18
18
|
* 口座取引リポジトリ
|
|
@@ -20,6 +20,9 @@ const factory = require("../factory");
|
|
|
20
20
|
class MongoRepository {
|
|
21
21
|
constructor(connection) {
|
|
22
22
|
this.transactionModel = connection.model(accountTransaction_1.modelName, accountTransaction_1.schema);
|
|
23
|
+
if (connection.get('autoIndex') === true) {
|
|
24
|
+
this.transactionModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
25
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -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 accountingReport_1 = require("./mongoose/schemas/accountingReport");
|
|
14
15
|
const errorHandler_1 = require("../errorHandler");
|
|
15
16
|
/**
|
|
16
17
|
* 経理レポートリポジトリ
|
|
@@ -18,6 +19,9 @@ const errorHandler_1 = require("../errorHandler");
|
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
21
|
this.accountingReportModel = connection.model(accountingReport_1.modelName, accountingReport_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.accountingReportModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* なければ作成する
|
|
@@ -30,7 +34,7 @@ class MongoRepository {
|
|
|
30
34
|
}
|
|
31
35
|
catch (error) {
|
|
32
36
|
let throwsError = true;
|
|
33
|
-
if (
|
|
37
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
34
38
|
// すでにorderNumberが存在する場合ok
|
|
35
39
|
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
36
40
|
throwsError = false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
import { modelName } from './mongoose/model/action';
|
|
4
3
|
export declare type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
5
4
|
export declare type IPayAction = factory.action.trade.pay.IAction;
|
|
6
5
|
export interface IUseActionCountByOffer {
|
|
@@ -24,7 +23,6 @@ interface IStatus {
|
|
|
24
23
|
interface IAggregateAction {
|
|
25
24
|
statuses: IStatus[];
|
|
26
25
|
}
|
|
27
|
-
export { modelName };
|
|
28
26
|
/**
|
|
29
27
|
* アクションリポジトリ
|
|
30
28
|
*/
|
|
@@ -184,3 +182,4 @@ export declare class MongoRepository {
|
|
|
184
182
|
}): Promise<IAggregateAction>;
|
|
185
183
|
private agggregateByStatus;
|
|
186
184
|
}
|
|
185
|
+
export {};
|
|
@@ -9,16 +9,19 @@ 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 action_1 = require("./mongoose/schemas/action");
|
|
16
16
|
/**
|
|
17
17
|
* アクションリポジトリ
|
|
18
18
|
*/
|
|
19
19
|
class MongoRepository {
|
|
20
20
|
constructor(connection) {
|
|
21
21
|
this.actionModel = connection.model(action_1.modelName, action_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.actionModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
24
27
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -21,7 +21,8 @@ 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 additionalProperty_1 = require("./mongoose/schemas/additionalProperty");
|
|
25
26
|
const factory = require("../factory");
|
|
26
27
|
/**
|
|
27
28
|
* 追加特性リポジトリ
|
|
@@ -29,6 +30,9 @@ const factory = require("../factory");
|
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
32
|
this.additionalPropertyModel = connection.model(additionalProperty_1.modelName, additionalProperty_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.additionalPropertyModel.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) {
|
|
@@ -21,7 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.MongoRepository = exports.AggregationType = void 0;
|
|
24
|
-
const
|
|
24
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
25
|
+
const aggregation_1 = require("./mongoose/schemas/aggregation");
|
|
25
26
|
var AggregationType;
|
|
26
27
|
(function (AggregationType) {
|
|
27
28
|
AggregationType["AggregateAuthorizeEventServiceOfferAction"] = "AggregateAuthorizeEventServiceOfferAction";
|
|
@@ -42,6 +43,9 @@ var AggregationType;
|
|
|
42
43
|
class MongoRepository {
|
|
43
44
|
constructor(connection) {
|
|
44
45
|
this.aggregationModel = connection.model(aggregation_1.modelName, aggregation_1.schema);
|
|
46
|
+
if (connection.get('autoIndex') === true) {
|
|
47
|
+
this.aggregationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
saveAggregation(params) {
|
|
47
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -23,9 +23,7 @@
|
|
|
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/assetTransaction';
|
|
27
26
|
import * as factory from '../factory';
|
|
28
|
-
export { modelName };
|
|
29
27
|
interface IAggregationByStatus {
|
|
30
28
|
transactionCount: number;
|
|
31
29
|
avgDuration: number;
|
|
@@ -181,3 +179,4 @@ export declare class MongoRepository {
|
|
|
181
179
|
}): Promise<IAggregateReserve>;
|
|
182
180
|
private agggregateByStatus;
|
|
183
181
|
}
|
|
182
|
+
export {};
|
|
@@ -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 moment = require("moment");
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const assetTransaction_1 = require("./mongoose/schemas/assetTransaction");
|
|
16
16
|
const factory = require("../factory");
|
|
17
17
|
/**
|
|
18
18
|
* 資産取引リポジトリ
|
|
@@ -20,6 +20,9 @@ const factory = require("../factory");
|
|
|
20
20
|
class MongoRepository {
|
|
21
21
|
constructor(connection) {
|
|
22
22
|
this.transactionModel = connection.model(assetTransaction_1.modelName, assetTransaction_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) {
|
|
@@ -21,7 +21,8 @@ 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 categoryCode_1 = require("./mongoose/schemas/categoryCode");
|
|
25
26
|
const factory = require("../factory");
|
|
26
27
|
/**
|
|
27
28
|
* 区分リポジトリ
|
|
@@ -29,6 +30,9 @@ const factory = require("../factory");
|
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
32
|
this.categoryCodeModel = connection.model(categoryCode_1.modelName, categoryCode_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.categoryCodeModel.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) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
import { modelName } from './mongoose/
|
|
3
|
+
import { modelName } from './mongoose/schemas/authorization';
|
|
4
4
|
export declare type IObject = factory.authorization.IObject;
|
|
5
5
|
export declare type ICode = string;
|
|
6
6
|
export { modelName };
|
package/lib/chevre/repo/code.js
CHANGED
|
@@ -13,7 +13,8 @@ exports.MongoRepository = exports.modelName = void 0;
|
|
|
13
13
|
const moment = require("moment");
|
|
14
14
|
const uuid = require("uuid");
|
|
15
15
|
const factory = require("../factory");
|
|
16
|
-
const
|
|
16
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
17
|
+
const authorization_1 = require("./mongoose/schemas/authorization");
|
|
17
18
|
Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return authorization_1.modelName; } });
|
|
18
19
|
/**
|
|
19
20
|
* 承認コードリポジトリ
|
|
@@ -21,6 +22,9 @@ Object.defineProperty(exports, "modelName", { enumerable: true, get: function ()
|
|
|
21
22
|
class MongoRepository {
|
|
22
23
|
constructor(connection) {
|
|
23
24
|
this.authorizationModel = connection.model(authorization_1.modelName, authorization_1.schema);
|
|
25
|
+
if (connection.get('autoIndex') === true) {
|
|
26
|
+
this.authorizationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
// tslint:disable-next-line:max-func-body-length
|
|
26
30
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -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 comments_1 = require("./mongoose/schemas/comments");
|
|
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.commentModel = connection.model(comments_1.modelName, comments_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.commentModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
23
27
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -23,9 +23,7 @@
|
|
|
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/creativeWork';
|
|
27
26
|
import * as factory from '../factory';
|
|
28
|
-
export { modelName };
|
|
29
27
|
/**
|
|
30
28
|
* コンテンツリポジトリ
|
|
31
29
|
*/
|
|
@@ -20,9 +20,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.MongoRepository =
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
exports.MongoRepository = void 0;
|
|
24
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
25
|
+
const creativeWork_1 = require("./mongoose/schemas/creativeWork");
|
|
26
26
|
const factory = require("../factory");
|
|
27
27
|
/**
|
|
28
28
|
* コンテンツリポジトリ
|
|
@@ -30,6 +30,9 @@ const factory = require("../factory");
|
|
|
30
30
|
class MongoRepository {
|
|
31
31
|
constructor(connection) {
|
|
32
32
|
this.creativeWorkModel = connection.model(creativeWork_1.modelName, creativeWork_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.creativeWorkModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
// tslint:disable-next-line:max-func-body-length
|
|
35
38
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -21,7 +21,8 @@ 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 customer_1 = require("./mongoose/schemas/customer");
|
|
25
26
|
const factory = require("../factory");
|
|
26
27
|
/**
|
|
27
28
|
* 顧客リポジトリ
|
|
@@ -29,6 +30,9 @@ const factory = require("../factory");
|
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
32
|
this.customerModel = connection.model(customer_1.modelName, customer_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.customerModel.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) {
|
|
@@ -21,7 +21,8 @@ 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 emailMessages_1 = require("./mongoose/schemas/emailMessages");
|
|
25
26
|
const factory = require("../factory");
|
|
26
27
|
/**
|
|
27
28
|
* Eメールメッセージリポジトリ
|
|
@@ -29,6 +30,9 @@ const factory = require("../factory");
|
|
|
29
30
|
class MongoRepository {
|
|
30
31
|
constructor(connection) {
|
|
31
32
|
this.emailMessageModel = connection.model(emailMessages_1.modelName, emailMessages_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.emailMessageModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
34
38
|
var _a, _b, _c, _d, _e;
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -23,7 +23,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MongoRepository = exports.PROJECTION_MINIMIZED_EVENT = 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 event_1 = require("./mongoose/schemas/event");
|
|
27
28
|
exports.PROJECTION_MINIMIZED_EVENT = {
|
|
28
29
|
project: 1,
|
|
29
30
|
_id: 1,
|
|
@@ -46,6 +47,9 @@ exports.PROJECTION_MINIMIZED_EVENT = {
|
|
|
46
47
|
class MongoRepository {
|
|
47
48
|
constructor(connection) {
|
|
48
49
|
this.eventModel = connection.model(event_1.modelName, event_1.schema);
|
|
50
|
+
if (connection.get('autoIndex') === true) {
|
|
51
|
+
this.eventModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
51
55
|
static CREATE_MONGO_CONDITIONS(conditions) {
|
|
@@ -11,13 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
13
|
const factory = require("../factory");
|
|
14
|
-
const
|
|
14
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
15
|
+
const member_1 = require("./mongoose/schemas/member");
|
|
15
16
|
/**
|
|
16
17
|
* IAMメンバーリポジトリ
|
|
17
18
|
*/
|
|
18
19
|
class MongoRepository {
|
|
19
20
|
constructor(connection) {
|
|
20
21
|
this.memberModel = connection.model(member_1.modelName, member_1.schema);
|
|
22
|
+
if (connection.get('autoIndex') === true) {
|
|
23
|
+
this.memberModel.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) {
|
|
@@ -23,9 +23,7 @@
|
|
|
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/merchantReturnPolicy';
|
|
27
26
|
import * as factory from '../factory';
|
|
28
|
-
export { modelName };
|
|
29
27
|
/**
|
|
30
28
|
* 返品ポリシーリポジトリ
|
|
31
29
|
*/
|
|
@@ -20,9 +20,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.MongoRepository =
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
exports.MongoRepository = void 0;
|
|
24
|
+
const onIndexCreated_1 = require("./mongoose/onIndexCreated");
|
|
25
|
+
const merchantReturnPolicy_1 = require("./mongoose/schemas/merchantReturnPolicy");
|
|
26
26
|
const factory = require("../factory");
|
|
27
27
|
/**
|
|
28
28
|
* 返品ポリシーリポジトリ
|
|
@@ -30,6 +30,9 @@ const factory = require("../factory");
|
|
|
30
30
|
class MongoRepository {
|
|
31
31
|
constructor(connection) {
|
|
32
32
|
this.merchantReturnPolicyModel = connection.model(merchantReturnPolicy_1.modelName, merchantReturnPolicy_1.schema);
|
|
33
|
+
if (connection.get('autoIndex') === true) {
|
|
34
|
+
this.merchantReturnPolicyModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
// tslint:disable-next-line:max-func-body-length
|
|
35
38
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onIndexCreated = exports.INDEX_EVENT = void 0;
|
|
4
|
+
exports.INDEX_EVENT = 'index';
|
|
5
|
+
function onIndexCreated(error) {
|
|
6
|
+
if (error !== undefined) {
|
|
7
|
+
// tslint:disable-next-line:no-console
|
|
8
|
+
console.error('index event emitted.', error);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.onIndexCreated = onIndexCreated;
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -23,8 +23,9 @@ 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
|
*/
|
|
@@ -32,6 +33,10 @@ class MongoRepository {
|
|
|
32
33
|
constructor(connection) {
|
|
33
34
|
this.offerModel = connection.model(offer_1.modelName, offer_1.schema);
|
|
34
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) {
|
|
@@ -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
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) {
|
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
|
/**
|
|
@@ -21,6 +21,9 @@ const order_2 = require("../factory/order");
|
|
|
21
21
|
class MongoRepository {
|
|
22
22
|
constructor(connection) {
|
|
23
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;
|
|
@@ -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
27
|
export declare type IOwnershipInfo = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>;
|
|
29
|
-
export { modelName };
|
|
30
28
|
/**
|
|
31
29
|
* 所有権リポジトリ
|
|
32
30
|
*/
|