@chevre/domain 21.0.0-alpha.7 → 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 +9 -5
- package/lib/chevre/repo/accountTitle.js +5 -1
- package/lib/chevre/repo/accountTransaction.d.ts +0 -2
- package/lib/chevre/repo/accountTransaction.js +8 -5
- package/lib/chevre/repo/accountingReport.js +6 -2
- package/lib/chevre/repo/action.d.ts +1 -2
- package/lib/chevre/repo/action.js +8 -5
- package/lib/chevre/repo/additionalProperty.js +7 -3
- package/lib/chevre/repo/aggregation.js +5 -1
- package/lib/chevre/repo/assetTransaction.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction.js +8 -5
- package/lib/chevre/repo/categoryCode.js +7 -3
- package/lib/chevre/repo/code.d.ts +1 -1
- package/lib/chevre/repo/code.js +7 -3
- package/lib/chevre/repo/comment.js +7 -3
- package/lib/chevre/repo/creativeWork.d.ts +0 -2
- package/lib/chevre/repo/creativeWork.js +8 -5
- package/lib/chevre/repo/customer.js +7 -3
- package/lib/chevre/repo/emailMessage.js +7 -3
- package/lib/chevre/repo/event.js +7 -3
- package/lib/chevre/repo/member.js +15 -8
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +0 -2
- package/lib/chevre/repo/merchantReturnPolicy.js +8 -5
- 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 +9 -4
- package/lib/chevre/repo/offerCatalog.js +7 -3
- package/lib/chevre/repo/order.d.ts +0 -2
- package/lib/chevre/repo/order.js +11 -8
- package/lib/chevre/repo/ownershipInfo.d.ts +0 -2
- package/lib/chevre/repo/ownershipInfo.js +9 -6
- package/lib/chevre/repo/permit.js +5 -1
- package/lib/chevre/repo/place.js +15 -11
- package/lib/chevre/repo/priceSpecification.js +7 -3
- package/lib/chevre/repo/product.js +7 -3
- package/lib/chevre/repo/project.js +7 -3
- package/lib/chevre/repo/reservation.js +7 -20
- package/lib/chevre/repo/role.js +7 -3
- package/lib/chevre/repo/seller.js +7 -3
- package/lib/chevre/repo/serviceOutput.js +7 -3
- package/lib/chevre/repo/task.js +7 -3
- package/lib/chevre/repo/telemetry.js +5 -1
- package/lib/chevre/repo/transaction.d.ts +1 -2
- package/lib/chevre/repo/transaction.js +8 -5
- package/lib/chevre/repo/trip.js +7 -3
- 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
|
@@ -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
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
|
}
|
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
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
|
}
|
|
@@ -45,11 +45,6 @@ function start(params) {
|
|
|
45
45
|
transaction = yield repos.accountTransaction.startByIdentifier(startParams);
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
49
|
-
/* istanbul ignore next */
|
|
50
|
-
if (error.name === 'MongoError') {
|
|
51
|
-
// no op
|
|
52
|
-
}
|
|
53
48
|
throw error;
|
|
54
49
|
}
|
|
55
50
|
const pendingTransaction = {
|
|
@@ -70,11 +70,6 @@ function start(params) {
|
|
|
70
70
|
transaction = yield repos.accountTransaction.startByIdentifier(startParams);
|
|
71
71
|
}
|
|
72
72
|
catch (error) {
|
|
73
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
74
|
-
/* istanbul ignore next */
|
|
75
|
-
if (error.name === 'MongoError') {
|
|
76
|
-
// no op
|
|
77
|
-
}
|
|
78
73
|
throw error;
|
|
79
74
|
}
|
|
80
75
|
const pendingTransaction = {
|
|
@@ -52,11 +52,6 @@ function start(params) {
|
|
|
52
52
|
transaction = yield repos.accountTransaction.startByIdentifier(startParams);
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
56
|
-
/* istanbul ignore next */
|
|
57
|
-
if (error.name === 'MongoError') {
|
|
58
|
-
// no op
|
|
59
|
-
}
|
|
60
55
|
throw error;
|
|
61
56
|
}
|
|
62
57
|
const pendingTransaction = {
|
|
@@ -71,11 +71,6 @@ function start(params) {
|
|
|
71
71
|
transaction = yield repos.assetTransaction.start(startParams);
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
75
|
-
/* istanbul ignore next */
|
|
76
|
-
if (error.name === 'MongoError') {
|
|
77
|
-
// no op
|
|
78
|
-
}
|
|
79
74
|
throw error;
|
|
80
75
|
}
|
|
81
76
|
// 必要あれば在庫確認など
|
|
@@ -61,11 +61,6 @@ function start(params) {
|
|
|
61
61
|
transaction = yield repos.assetTransaction.start(startParams);
|
|
62
62
|
}
|
|
63
63
|
catch (error) {
|
|
64
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
65
|
-
/* istanbul ignore next */
|
|
66
|
-
if (error.name === 'MongoError') {
|
|
67
|
-
// no op
|
|
68
|
-
}
|
|
69
64
|
throw error;
|
|
70
65
|
}
|
|
71
66
|
// 指定があれば予約追加
|
|
@@ -160,11 +155,6 @@ function addReservations(params) {
|
|
|
160
155
|
yield (0, cancelReservation_1.processUnlockOfferRateLimit)({ reservation, reservationFor })(repos);
|
|
161
156
|
})));
|
|
162
157
|
}
|
|
163
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
164
|
-
/* istanbul ignore next */
|
|
165
|
-
if (error.name === 'MongoError') {
|
|
166
|
-
// no op
|
|
167
|
-
}
|
|
168
158
|
throw error;
|
|
169
159
|
}
|
|
170
160
|
// 座席指定でも座席ロック
|
|
@@ -48,11 +48,6 @@ function start(params) {
|
|
|
48
48
|
yield authorizePaymentCard({ transaction })(repos);
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
51
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
52
|
-
/* istanbul ignore next */
|
|
53
|
-
if (error.name === 'MongoError') {
|
|
54
|
-
// no op
|
|
55
|
-
}
|
|
56
51
|
throw error;
|
|
57
52
|
}
|
|
58
53
|
return transaction;
|
|
@@ -57,7 +57,7 @@ function start(params) {
|
|
|
57
57
|
transaction = yield repos.transaction.start(startParams);
|
|
58
58
|
}
|
|
59
59
|
catch (error) {
|
|
60
|
-
if (
|
|
60
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
61
61
|
// no op
|
|
62
62
|
}
|
|
63
63
|
throw error;
|
|
@@ -132,7 +132,7 @@ function confirm(params) {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
catch (error) {
|
|
135
|
-
if (
|
|
135
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
136
136
|
// 万が一同一注文番号で確定しようとすると、MongoDBでE11000 duplicate key errorが発生する
|
|
137
137
|
// message: 'E11000 duplicate key error collection: prodttts.transactions index:result.order.orderNumber_1 dup key:...',
|
|
138
138
|
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
@@ -81,7 +81,7 @@ function start(params) {
|
|
|
81
81
|
returnOrderTransaction = yield repos.transaction.start(returnOrderAttributes);
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
84
|
-
if (
|
|
84
|
+
if ((0, errorHandler_1.isMongoError)(error)) {
|
|
85
85
|
// 同一取引に対して返品取引を作成しようとすると、MongoDBでE11000 duplicate key errorが発生する
|
|
86
86
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
87
87
|
/* istanbul ignore else */
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|