@chevre/domain 21.2.0-alpha.100 → 21.2.0-alpha.101

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.
Files changed (38) hide show
  1. package/lib/chevre/repo/account.js +3 -2
  2. package/lib/chevre/repo/accountTransaction.js +2 -1
  3. package/lib/chevre/repo/action.js +2 -1
  4. package/lib/chevre/repo/additionalProperty.js +2 -1
  5. package/lib/chevre/repo/assetTransaction.js +6 -5
  6. package/lib/chevre/repo/categoryCode.js +3 -2
  7. package/lib/chevre/repo/code.js +3 -2
  8. package/lib/chevre/repo/comment.js +2 -1
  9. package/lib/chevre/repo/creativeWork.js +3 -2
  10. package/lib/chevre/repo/customer.js +2 -1
  11. package/lib/chevre/repo/emailMessage.js +2 -1
  12. package/lib/chevre/repo/event.js +4 -3
  13. package/lib/chevre/repo/member.js +4 -3
  14. package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
  15. package/lib/chevre/repo/offer.js +3 -2
  16. package/lib/chevre/repo/offerCatalog.js +0 -27
  17. package/lib/chevre/repo/offerItemCondition.js +2 -1
  18. package/lib/chevre/repo/order.js +8 -7
  19. package/lib/chevre/repo/ownershipInfo.js +2 -7
  20. package/lib/chevre/repo/place.js +3 -2
  21. package/lib/chevre/repo/priceSpecification.js +3 -2
  22. package/lib/chevre/repo/product.js +2 -1
  23. package/lib/chevre/repo/project.js +2 -1
  24. package/lib/chevre/repo/reservation.js +4 -15
  25. package/lib/chevre/repo/role.js +3 -2
  26. package/lib/chevre/repo/seller.js +3 -2
  27. package/lib/chevre/repo/serviceOutput.js +2 -1
  28. package/lib/chevre/repo/task.d.ts +1 -1
  29. package/lib/chevre/repo/task.js +4 -3
  30. package/lib/chevre/repo/transaction.js +6 -5
  31. package/lib/chevre/repo/trip.js +2 -1
  32. package/lib/chevre/service/offer.d.ts +12 -7
  33. package/lib/chevre/service/offer.js +56 -1
  34. package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
  35. package/lib/chevre/service/task/onEventChanged.js +29 -0
  36. package/lib/chevre/settings.d.ts +4 -0
  37. package/lib/chevre/settings.js +21 -2
  38. package/package.json +3 -3
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const account_1 = require("./mongoose/schemas/account");
14
14
  const factory = require("../factory");
15
+ const settings_1 = require("../settings");
15
16
  /**
16
17
  * 口座リポジトリ
17
18
  */
@@ -390,7 +391,7 @@ class MongoRepository {
390
391
  return __awaiter(this, void 0, void 0, function* () {
391
392
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
392
393
  return this.accountModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
393
- .setOptions({ maxTimeMS: 10000 })
394
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
394
395
  .exec();
395
396
  });
396
397
  }
@@ -419,7 +420,7 @@ class MongoRepository {
419
420
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.openDate) !== undefined) {
420
421
  query.sort({ openDate: params.sort.openDate });
421
422
  }
422
- return query.setOptions({ maxTimeMS: 10000 })
423
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
423
424
  .exec()
424
425
  .then((docs) => docs.map((doc) => doc.toObject()));
425
426
  });
@@ -13,6 +13,7 @@ exports.MongoRepository = void 0;
13
13
  const moment = require("moment");
14
14
  const accountTransaction_1 = require("./mongoose/schemas/accountTransaction");
15
15
  const factory = require("../factory");
16
+ const settings_1 = require("../settings");
16
17
  /**
17
18
  * 口座取引リポジトリ
18
19
  */
@@ -260,7 +261,7 @@ class MongoRepository {
260
261
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
261
262
  query.sort({ startDate: params.sort.startDate });
262
263
  }
263
- return query.setOptions({ maxTimeMS: 10000 })
264
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
264
265
  .exec()
265
266
  .then((docs) => docs.map((doc) => doc.toObject()));
266
267
  });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const factory = require("../factory");
14
14
  const action_1 = require("./mongoose/schemas/action");
15
+ const settings_1 = require("../settings");
15
16
  /**
16
17
  * アクションリポジトリ
17
18
  */
@@ -456,7 +457,7 @@ class MongoRepository {
456
457
  }
457
458
  // const explainResult = await (<any>query).explain();
458
459
  // console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
459
- return query.setOptions({ maxTimeMS: 10000 })
460
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
460
461
  .exec()
461
462
  .then((docs) => docs.map((doc) => doc.toObject()));
462
463
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const additionalProperty_1 = require("./mongoose/schemas/additionalProperty");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * 追加特性リポジトリ
28
29
  */
@@ -145,7 +146,7 @@ class MongoRepository {
145
146
  if (params.sort !== undefined) {
146
147
  query.sort(params.sort);
147
148
  }
148
- return query.setOptions({ maxTimeMS: 10000 })
149
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
149
150
  .exec()
150
151
  .then((docs) => docs.map((doc) => doc.toObject()));
151
152
  });
@@ -14,6 +14,7 @@ const moment = require("moment");
14
14
  const assetTransaction_1 = require("./mongoose/schemas/assetTransaction");
15
15
  const factory = require("../factory");
16
16
  const assetTransaction_2 = require("../eventEmitter/assetTransaction");
17
+ const settings_1 = require("../settings");
17
18
  /**
18
19
  * 資産取引リポジトリ
19
20
  */
@@ -448,7 +449,7 @@ class MongoRepository {
448
449
  typeOf: 1,
449
450
  status: 1
450
451
  })
451
- .setOptions({ maxTimeMS: 10000 })
452
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
452
453
  .exec();
453
454
  if (reexportingTransactions.length > 0) {
454
455
  for (const reexportingTransaction of reexportingTransactions) {
@@ -491,7 +492,7 @@ class MongoRepository {
491
492
  typeOf: 1,
492
493
  status: 1
493
494
  })
494
- .setOptions({ maxTimeMS: 10000 })
495
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
495
496
  .exec();
496
497
  if (delayedTransactions.length > 0) {
497
498
  delayedTransactions.forEach((delayedTransaction) => {
@@ -538,7 +539,7 @@ class MongoRepository {
538
539
  _id: 1,
539
540
  typeOf: 1
540
541
  })
541
- .setOptions({ maxTimeMS: 10000 })
542
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
542
543
  .exec();
543
544
  if (expiringTransactions.length > 0) {
544
545
  // ステータスと期限を見て更新
@@ -618,7 +619,7 @@ class MongoRepository {
618
619
  return __awaiter(this, void 0, void 0, function* () {
619
620
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
620
621
  return this.transactionModel.countDocuments({ $and: conditions })
621
- .setOptions({ maxTimeMS: 10000 })
622
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
622
623
  .exec();
623
624
  });
624
625
  }
@@ -659,7 +660,7 @@ class MongoRepository {
659
660
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.startDate) !== undefined) {
660
661
  query.sort({ startDate: params.sort.startDate });
661
662
  }
662
- return query.setOptions({ maxTimeMS: 10000 })
663
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
663
664
  .exec()
664
665
  .then((docs) => docs.map((doc) => doc.toObject()));
665
666
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const categoryCode_1 = require("./mongoose/schemas/categoryCode");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * 区分リポジトリ
28
29
  */
@@ -155,7 +156,7 @@ class MongoRepository {
155
156
  return __awaiter(this, void 0, void 0, function* () {
156
157
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
157
158
  return this.categoryCodeModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
158
- .setOptions({ maxTimeMS: 10000 })
159
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
159
160
  .exec();
160
161
  });
161
162
  }
@@ -180,7 +181,7 @@ class MongoRepository {
180
181
  if (params.sort !== undefined) {
181
182
  query.sort(params.sort);
182
183
  }
183
- return query.setOptions({ maxTimeMS: 10000 })
184
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
184
185
  .exec()
185
186
  .then((docs) => docs.map((doc) => doc.toObject()));
186
187
  });
@@ -15,6 +15,7 @@ const uuid = require("uuid");
15
15
  const factory = require("../factory");
16
16
  const authorization_1 = require("./mongoose/schemas/authorization");
17
17
  Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return authorization_1.modelName; } });
18
+ const settings_1 = require("../settings");
18
19
  /**
19
20
  * 承認コードリポジトリ
20
21
  */
@@ -177,7 +178,7 @@ class MongoRepository {
177
178
  return __awaiter(this, void 0, void 0, function* () {
178
179
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
179
180
  return this.authorizationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
180
- .setOptions({ maxTimeMS: 10000 })
181
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
181
182
  .exec();
182
183
  });
183
184
  }
@@ -200,7 +201,7 @@ class MongoRepository {
200
201
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.validFrom) !== undefined) {
201
202
  query.sort({ validFrom: params.sort.validFrom });
202
203
  }
203
- return query.setOptions({ maxTimeMS: 10000 })
204
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
204
205
  .exec()
205
206
  .then((docs) => docs.map((doc) => doc.toObject()));
206
207
  });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const comments_1 = require("./mongoose/schemas/comments");
14
14
  const factory = require("../factory");
15
+ const settings_1 = require("../settings");
15
16
  /**
16
17
  * コメントリポジトリ
17
18
  */
@@ -73,7 +74,7 @@ class MongoRepository {
73
74
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.dateCreated) !== undefined) {
74
75
  query.sort({ dateCreated: params.sort.dateCreated });
75
76
  }
76
- return query.setOptions({ maxTimeMS: 10000 })
77
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
77
78
  .exec()
78
79
  .then((docs) => docs.map((doc) => doc.toObject()));
79
80
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const creativeWork_1 = require("./mongoose/schemas/creativeWork");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * コンテンツリポジトリ
28
29
  */
@@ -205,7 +206,7 @@ class MongoRepository {
205
206
  return __awaiter(this, void 0, void 0, function* () {
206
207
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
207
208
  return this.creativeWorkModel.countDocuments({ $and: conditions })
208
- .setOptions({ maxTimeMS: 10000 })
209
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
209
210
  .exec();
210
211
  });
211
212
  }
@@ -231,7 +232,7 @@ class MongoRepository {
231
232
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) {
232
233
  query.sort({ identifier: params.sort.identifier });
233
234
  }
234
- return query.setOptions({ maxTimeMS: 10000 })
235
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
235
236
  .exec()
236
237
  .then((docs) => docs.map((doc) => doc.toObject()));
237
238
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const customer_1 = require("./mongoose/schemas/customer");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * 顧客リポジトリ
28
29
  */
@@ -120,7 +121,7 @@ class MongoRepository {
120
121
  if (((_a = conditions.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
121
122
  query.sort({ branchCode: conditions.sort.branchCode });
122
123
  }
123
- return query.setOptions({ maxTimeMS: 10000 })
124
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
124
125
  .exec()
125
126
  .then((docs) => docs.map((doc) => doc.toObject()));
126
127
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const emailMessages_1 = require("./mongoose/schemas/emailMessages");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * Eメールメッセージリポジトリ
28
29
  */
@@ -107,7 +108,7 @@ class MongoRepository {
107
108
  if (params.sort !== undefined) {
108
109
  query.sort(params.sort);
109
110
  }
110
- return query.setOptions({ maxTimeMS: 10000 })
111
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
111
112
  .exec()
112
113
  .then((docs) => docs.map((doc) => doc.toObject()));
113
114
  });
@@ -25,6 +25,7 @@ const uniqid = require("uniqid");
25
25
  const factory = require("../factory");
26
26
  const event_1 = require("./mongoose/schemas/event");
27
27
  const errorHandler_1 = require("../errorHandler");
28
+ const settings_1 = require("../settings");
28
29
  exports.PROJECTION_MINIMIZED_EVENT = {
29
30
  project: 1,
30
31
  _id: 1,
@@ -700,7 +701,7 @@ class MongoRepository {
700
701
  return __awaiter(this, void 0, void 0, function* () {
701
702
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
702
703
  return this.eventModel.countDocuments({ $and: conditions })
703
- .setOptions({ maxTimeMS: 10000 })
704
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
704
705
  .exec();
705
706
  });
706
707
  }
@@ -738,7 +739,7 @@ class MongoRepository {
738
739
  // console.log(explainResult[0].queryPlanner?.winningPlan?.inputStage?.inputStage?.inputStage);
739
740
  // console.log(explainResult);
740
741
  // return [];
741
- return query.setOptions({ maxTimeMS: 10000 })
742
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
742
743
  .exec()
743
744
  .then((docs) => docs.map((doc) => doc.toObject()));
744
745
  });
@@ -747,7 +748,7 @@ class MongoRepository {
747
748
  return __awaiter(this, void 0, void 0, function* () {
748
749
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
749
750
  const query = this.eventModel.distinct('_id', { $and: conditions });
750
- return query.setOptions({ maxTimeMS: 10000 })
751
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
751
752
  .exec();
752
753
  });
753
754
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const factory = require("../factory");
14
14
  const member_1 = require("./mongoose/schemas/member");
15
+ const settings_1 = require("../settings");
15
16
  /**
16
17
  * IAMメンバーリポジトリ
17
18
  */
@@ -102,7 +103,7 @@ class MongoRepository {
102
103
  return __awaiter(this, void 0, void 0, function* () {
103
104
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
104
105
  return this.memberModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
105
- .setOptions({ maxTimeMS: 10000 })
106
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
106
107
  .exec();
107
108
  });
108
109
  }
@@ -126,7 +127,7 @@ class MongoRepository {
126
127
  }
127
128
  // const explainResult = await (<any>query).explain();
128
129
  // console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
129
- return query.setOptions({ maxTimeMS: 10000 })
130
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
130
131
  .exec()
131
132
  .then((docs) => docs.map((doc) => doc.toObject()));
132
133
  });
@@ -227,7 +228,7 @@ class MongoRepository {
227
228
  query.limit(params.limit)
228
229
  .skip(params.limit * (page - 1));
229
230
  }
230
- const projectMembers = yield query.setOptions({ maxTimeMS: 10000 })
231
+ const projectMembers = yield query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
231
232
  .exec()
232
233
  .then((docs) => docs.map((doc) => doc.toObject()));
233
234
  return projectMembers.map((m) => m.project.id);
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const merchantReturnPolicy_1 = require("./mongoose/schemas/merchantReturnPolicy");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * 返品ポリシーリポジトリ
28
29
  */
@@ -144,7 +145,7 @@ class MongoRepository {
144
145
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) {
145
146
  query.sort({ identifier: params.sort.identifier });
146
147
  }
147
- return query.setOptions({ maxTimeMS: 10000 })
148
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
148
149
  .exec()
149
150
  .then((docs) => docs.map((doc) => doc.toObject()));
150
151
  });
@@ -25,6 +25,7 @@ const uniqid = require("uniqid");
25
25
  const factory = require("../factory");
26
26
  const offer_1 = require("./mongoose/schemas/offer");
27
27
  const offerCatalog_1 = require("./mongoose/schemas/offerCatalog");
28
+ const settings_1 = require("../settings");
28
29
  /**
29
30
  * オファーリポジトリ
30
31
  */
@@ -409,7 +410,7 @@ class MongoRepository {
409
410
  return __awaiter(this, void 0, void 0, function* () {
410
411
  const conditions = MongoRepository.CREATE_OFFER_MONGO_CONDITIONS(params);
411
412
  return this.offerModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
412
- .setOptions({ maxTimeMS: 10000 })
413
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
413
414
  .exec();
414
415
  });
415
416
  }
@@ -434,7 +435,7 @@ class MongoRepository {
434
435
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a['priceSpecification.price']) !== undefined) {
435
436
  query.sort({ 'priceSpecification.price': params.sort['priceSpecification.price'] });
436
437
  }
437
- return query.setOptions({ maxTimeMS: 10000 })
438
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
438
439
  .exec()
439
440
  .then((docs) => docs.map((doc) => doc.toObject()));
440
441
  });
@@ -178,33 +178,6 @@ class MongoRepository {
178
178
  .exec();
179
179
  });
180
180
  }
181
- // public async findById(params: {
182
- // id: string;
183
- // }): Promise<factory.offerCatalog.IOfferCatalog> {
184
- // const doc = await this.offerCatalogModel.findOne(
185
- // {
186
- // _id: params.id
187
- // },
188
- // {
189
- // __v: 0,
190
- // createdAt: 0,
191
- // updatedAt: 0
192
- // }
193
- // )
194
- // .exec();
195
- // if (doc === null) {
196
- // throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
197
- // }
198
- // return doc.toObject();
199
- // }
200
- // public async count(
201
- // params: factory.offerCatalog.ISearchConditions
202
- // ): Promise<number> {
203
- // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
204
- // return this.offerCatalogModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
205
- // .setOptions({ maxTimeMS: 10000 })
206
- // .exec();
207
- // }
208
181
  search(params) {
209
182
  var _a;
210
183
  return __awaiter(this, void 0, void 0, function* () {
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const factory = require("../factory");
25
25
  const offerItemCondition_1 = require("./mongoose/schemas/offerItemCondition");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * アイテムコンディションリポジトリ
28
29
  */
@@ -88,7 +89,7 @@ class MongoRepository {
88
89
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) {
89
90
  query.sort({ identifier: params.sort.identifier });
90
91
  }
91
- return query.setOptions({ maxTimeMS: 10000 })
92
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
92
93
  .exec()
93
94
  .then((docs) => docs.map((doc) => doc.toObject()));
94
95
  });
@@ -14,6 +14,7 @@ const factory = require("../factory");
14
14
  const order_1 = require("./mongoose/schemas/order");
15
15
  const errorHandler_1 = require("../errorHandler");
16
16
  const order_2 = require("../factory/order");
17
+ const settings_1 = require("../settings");
17
18
  /**
18
19
  * 注文リポジトリ
19
20
  */
@@ -888,7 +889,7 @@ class MongoRepository {
888
889
  return __awaiter(this, void 0, void 0, function* () {
889
890
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
890
891
  return this.orderModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
891
- .setOptions({ maxTimeMS: 10000 })
892
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
892
893
  .exec();
893
894
  });
894
895
  }
@@ -920,7 +921,7 @@ class MongoRepository {
920
921
  }
921
922
  // const explainResult = await (<any>query).explain();
922
923
  // console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
923
- return query.setOptions({ maxTimeMS: 10000 })
924
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
924
925
  .exec()
925
926
  .then((docs) => docs.map((doc) => doc.toObject()));
926
927
  });
@@ -935,7 +936,7 @@ class MongoRepository {
935
936
  .select({
936
937
  'acceptedOffers.id': 1
937
938
  });
938
- const orders = yield query.setOptions({ maxTimeMS: 10000 })
939
+ const orders = yield query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
939
940
  .exec()
940
941
  .then((docs) => docs.map((doc) => {
941
942
  return doc.toObject();
@@ -985,7 +986,7 @@ class MongoRepository {
985
986
  .skip(params.limit * (page - 1));
986
987
  }
987
988
  return aggregate.allowDiskUse(true)
988
- .option({ maxTimeMS: 10000 })
989
+ .option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
989
990
  .exec();
990
991
  });
991
992
  }
@@ -1016,7 +1017,7 @@ class MongoRepository {
1016
1017
  'acceptedOffers.itemOffered.reservationNumber': { $exists: true },
1017
1018
  orderNumber: { $in: params.orderNumber.$in }
1018
1019
  })
1019
- .setOptions({ maxTimeMS: 10000 })
1020
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
1020
1021
  .exec();
1021
1022
  });
1022
1023
  }
@@ -1032,7 +1033,7 @@ class MongoRepository {
1032
1033
  'acceptedOffers.itemOffered.reservationFor.id': { $exists: true },
1033
1034
  orderNumber: { $in: params.orderNumber.$in }
1034
1035
  })
1035
- .setOptions({ maxTimeMS: 10000 })
1036
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
1036
1037
  .exec();
1037
1038
  });
1038
1039
  }
@@ -1052,7 +1053,7 @@ class MongoRepository {
1052
1053
  id: '$acceptedOffers.id',
1053
1054
  priceSpecification: '$acceptedOffers.priceSpecification'
1054
1055
  });
1055
- return aggregate.option({ maxTimeMS: 10000 })
1056
+ return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
1056
1057
  .exec();
1057
1058
  });
1058
1059
  }
@@ -14,6 +14,7 @@ const uuid = require("uuid");
14
14
  const ownershipInfo_1 = require("./mongoose/schemas/ownershipInfo");
15
15
  const errorHandler_1 = require("../errorHandler");
16
16
  const factory = require("../factory");
17
+ const settings_1 = require("../settings");
17
18
  /**
18
19
  * 所有権リポジトリ
19
20
  */
@@ -276,12 +277,6 @@ class MongoRepository {
276
277
  return doc.toObject();
277
278
  });
278
279
  }
279
- // public async count(params: factory.ownershipInfo.ISearchConditions): Promise<number> {
280
- // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
281
- // return this.ownershipInfoModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
282
- // .setOptions({ maxTimeMS: 10000 })
283
- // .exec();
284
- // }
285
280
  /**
286
281
  * 所有権を検索する
287
282
  */
@@ -300,7 +295,7 @@ class MongoRepository {
300
295
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.ownedFrom) !== undefined) {
301
296
  query.sort({ ownedFrom: params.sort.ownedFrom });
302
297
  }
303
- return query.setOptions({ maxTimeMS: 10000 })
298
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
304
299
  .exec()
305
300
  .then((docs) => docs.map((doc) => doc.toObject()));
306
301
  });
@@ -24,6 +24,7 @@ exports.MongoRepository = void 0;
24
24
  const mongoose_1 = require("mongoose");
25
25
  const place_1 = require("./mongoose/schemas/place");
26
26
  const factory = require("../factory");
27
+ const settings_1 = require("../settings");
27
28
  /**
28
29
  * 施設リポジトリ
29
30
  */
@@ -283,7 +284,7 @@ class MongoRepository {
283
284
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
284
285
  query.sort({ branchCode: params.sort.branchCode });
285
286
  }
286
- return query.setOptions({ maxTimeMS: 10000 })
287
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
287
288
  .exec()
288
289
  .then((docs) => docs.map((doc) => doc.toObject()));
289
290
  });
@@ -1235,7 +1236,7 @@ class MongoRepository {
1235
1236
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
1236
1237
  query.sort({ branchCode: params.sort.branchCode });
1237
1238
  }
1238
- return query.setOptions({ maxTimeMS: 10000 })
1239
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
1239
1240
  .exec()
1240
1241
  .then((docs) => docs.map((doc) => doc.toObject()));
1241
1242
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const factory = require("../factory");
25
25
  const priceSpecification_1 = require("./mongoose/schemas/priceSpecification");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * 価格仕様リポジトリ
28
29
  */
@@ -156,7 +157,7 @@ class MongoRepository {
156
157
  return __awaiter(this, void 0, void 0, function* () {
157
158
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
158
159
  return this.priceSpecificationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
159
- .setOptions({ maxTimeMS: 10000 })
160
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
160
161
  .exec();
161
162
  });
162
163
  }
@@ -182,7 +183,7 @@ class MongoRepository {
182
183
  // const explainResult = await (<any>query).explain();
183
184
  // console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
184
185
  // return;
185
- return query.setOptions({ maxTimeMS: 10000 })
186
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
186
187
  .exec()
187
188
  .then((docs) => docs.map((doc) => doc.toObject()));
188
189
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const product_1 = require("./mongoose/schemas/product");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * プロダクトリポジトリ
28
29
  */
@@ -170,7 +171,7 @@ class MongoRepository {
170
171
  if (((_a = conditions.sort) === null || _a === void 0 ? void 0 : _a.productID) !== undefined) {
171
172
  query.sort({ productID: conditions.sort.productID });
172
173
  }
173
- return query.setOptions({ maxTimeMS: 10000 })
174
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
174
175
  .exec()
175
176
  .then((docs) => docs.map((doc) => doc.toObject()));
176
177
  });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const project_1 = require("./mongoose/schemas/project");
14
14
  const factory = require("../factory");
15
+ const settings_1 = require("../settings");
15
16
  /**
16
17
  * プロジェクトリポジトリ
17
18
  */
@@ -89,7 +90,7 @@ class MongoRepository {
89
90
  if (((_a = conditions.sort) === null || _a === void 0 ? void 0 : _a._id) !== undefined) {
90
91
  query.sort({ _id: conditions.sort._id });
91
92
  }
92
- return query.setOptions({ maxTimeMS: 10000 })
93
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
93
94
  .exec()
94
95
  .then((docs) => docs.map((doc) => doc.toObject()));
95
96
  });
@@ -13,6 +13,7 @@ exports.MongoRepository = void 0;
13
13
  const createDebug = require("debug");
14
14
  const reservation_1 = require("./mongoose/schemas/reservation");
15
15
  const factory = require("../factory");
16
+ const settings_1 = require("../settings");
16
17
  const debug = createDebug('chevre-domain:repo');
17
18
  /**
18
19
  * 予約リポジトリ
@@ -813,18 +814,6 @@ class MongoRepository {
813
814
  }
814
815
  return andConditions;
815
816
  }
816
- // public async distinct<T extends factory.reservationType>(
817
- // field: string,
818
- // params: factory.reservation.ISearchConditions<T>
819
- // ): Promise<any[]> {
820
- // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
821
- // return this.reservationModel.distinct(
822
- // field,
823
- // (conditions.length > 0) ? { $and: conditions } : {}
824
- // )
825
- // .setOptions({ maxTimeMS: 10000 })
826
- // .exec();
827
- // }
828
817
  createMany(params) {
829
818
  return __awaiter(this, void 0, void 0, function* () {
830
819
  if (params.reservations.length > 0) {
@@ -851,7 +840,7 @@ class MongoRepository {
851
840
  return __awaiter(this, void 0, void 0, function* () {
852
841
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
853
842
  return this.reservationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
854
- .setOptions({ maxTimeMS: 10000 })
843
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
855
844
  .exec();
856
845
  });
857
846
  }
@@ -879,7 +868,7 @@ class MongoRepository {
879
868
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.modifiedTime) !== undefined) {
880
869
  query.sort({ modifiedTime: params.sort.modifiedTime });
881
870
  }
882
- return query.setOptions({ maxTimeMS: 10000 })
871
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
883
872
  .exec()
884
873
  .then((docs) => docs.map((doc) => doc.toObject()));
885
874
  });
@@ -1146,7 +1135,7 @@ class MongoRepository {
1146
1135
  }
1147
1136
  })
1148
1137
  .select({ _id: 1 })
1149
- .setOptions({ maxTimeMS: 10000 })
1138
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
1150
1139
  .exec()
1151
1140
  .then((docs) => docs.map((doc) => doc._id.toString()));
1152
1141
  });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = exports.RoleType = void 0;
13
13
  const factory = require("../factory");
14
14
  const role_1 = require("./mongoose/schemas/role");
15
+ const settings_1 = require("../settings");
15
16
  var RoleType;
16
17
  (function (RoleType) {
17
18
  RoleType["OrganizationRole"] = "OrganizationRole";
@@ -67,7 +68,7 @@ class MongoRepository {
67
68
  return __awaiter(this, void 0, void 0, function* () {
68
69
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
69
70
  return this.roleModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
70
- .setOptions({ maxTimeMS: 10000 })
71
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
71
72
  .exec();
72
73
  });
73
74
  }
@@ -91,7 +92,7 @@ class MongoRepository {
91
92
  }
92
93
  // const explainResult = await (<any>query).explain();
93
94
  // console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
94
- return query.setOptions({ maxTimeMS: 10000 })
95
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
95
96
  .exec()
96
97
  .then((docs) => docs.map((doc) => doc.toObject()));
97
98
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const seller_1 = require("./mongoose/schemas/seller");
25
25
  const factory = require("../factory");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * 販売者リポジトリ
28
29
  */
@@ -160,7 +161,7 @@ class MongoRepository {
160
161
  return __awaiter(this, void 0, void 0, function* () {
161
162
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
162
163
  return this.organizationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
163
- .setOptions({ maxTimeMS: 10000 })
164
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
164
165
  .exec();
165
166
  });
166
167
  }
@@ -182,7 +183,7 @@ class MongoRepository {
182
183
  if (((_a = conditions.sort) === null || _a === void 0 ? void 0 : _a.branchCode) !== undefined) {
183
184
  query.sort({ branchCode: conditions.sort.branchCode });
184
185
  }
185
- return query.setOptions({ maxTimeMS: 10000 })
186
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
186
187
  .exec()
187
188
  .then((docs) => docs.map((doc) => doc.toObject()));
188
189
  });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const serviceOutput_1 = require("./mongoose/schemas/serviceOutput");
14
14
  const factory = require("../factory");
15
+ const settings_1 = require("../settings");
15
16
  /**
16
17
  * サービスアウトプットリポジトリ
17
18
  */
@@ -128,7 +129,7 @@ class MongoRepository {
128
129
  // if (params.sort !== undefined) {
129
130
  // query.sort(params.sort);
130
131
  // }
131
- return query.setOptions({ maxTimeMS: 10000 })
132
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
132
133
  .exec()
133
134
  .then((docs) => docs.map((doc) => doc.toObject()));
134
135
  });
@@ -63,7 +63,7 @@ export declare class MongoRepository {
63
63
  */
64
64
  $nin?: factory.taskName[];
65
65
  };
66
- }): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
66
+ }): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
67
67
  retry(params: {
68
68
  intervalInMinutes: number;
69
69
  }): Promise<void>;
@@ -14,6 +14,7 @@ const moment = require("moment");
14
14
  const factory = require("../factory");
15
15
  const task_1 = require("./mongoose/schemas/task");
16
16
  const task_2 = require("../eventEmitter/task");
17
+ const settings_1 = require("../settings");
17
18
  /**
18
19
  * タスク実行時のソート条件
19
20
  */
@@ -267,7 +268,7 @@ class MongoRepository {
267
268
  status: 1
268
269
  })
269
270
  .limit(params.limit)
270
- .setOptions({ maxTimeMS: 10000 })
271
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
271
272
  .exec();
272
273
  if (delayedTasks.length > 0) {
273
274
  delayedTasks.forEach((delayedTask) => {
@@ -375,7 +376,7 @@ class MongoRepository {
375
376
  return __awaiter(this, void 0, void 0, function* () {
376
377
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
377
378
  return this.taskModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
378
- .setOptions({ maxTimeMS: 10000 })
379
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
379
380
  .exec();
380
381
  });
381
382
  }
@@ -397,7 +398,7 @@ class MongoRepository {
397
398
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.runsAt) !== undefined) {
398
399
  query.sort({ runsAt: params.sort.runsAt });
399
400
  }
400
- return query.setOptions({ maxTimeMS: 10000 })
401
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
401
402
  .exec()
402
403
  .then((docs) => docs.map((doc) => doc.toObject()));
403
404
  });
@@ -14,6 +14,7 @@ const moment = require("moment");
14
14
  const factory = require("../factory");
15
15
  const transaction_1 = require("./mongoose/schemas/transaction");
16
16
  const transaction_2 = require("../eventEmitter/transaction");
17
+ const settings_1 = require("../settings");
17
18
  /**
18
19
  * 取引リポジトリ
19
20
  */
@@ -516,7 +517,7 @@ class MongoRepository {
516
517
  typeOf: 1,
517
518
  status: 1
518
519
  })
519
- .setOptions({ maxTimeMS: 10000 })
520
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
520
521
  .exec();
521
522
  if (reexportingTransactions.length > 0) {
522
523
  for (const reexportingTransaction of reexportingTransactions) {
@@ -559,7 +560,7 @@ class MongoRepository {
559
560
  typeOf: 1,
560
561
  status: 1
561
562
  })
562
- .setOptions({ maxTimeMS: 10000 })
563
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
563
564
  .exec();
564
565
  if (delayedTransactions.length > 0) {
565
566
  delayedTransactions.forEach((delayedTransaction) => {
@@ -606,7 +607,7 @@ class MongoRepository {
606
607
  _id: 1,
607
608
  typeOf: 1
608
609
  })
609
- .setOptions({ maxTimeMS: 10000 })
610
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
610
611
  .exec();
611
612
  if (expiringTransactions.length > 0) {
612
613
  // ステータスと期限を見て更新
@@ -675,7 +676,7 @@ class MongoRepository {
675
676
  return __awaiter(this, void 0, void 0, function* () {
676
677
  const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
677
678
  return this.transactionModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
678
- .setOptions({ maxTimeMS: 10000 })
679
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
679
680
  .exec();
680
681
  });
681
682
  }
@@ -718,7 +719,7 @@ class MongoRepository {
718
719
  }
719
720
  // const explainResult = await (<any>query).explain();
720
721
  // console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
721
- return query.setOptions({ maxTimeMS: 10000 })
722
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
722
723
  .exec()
723
724
  .then((docs) => docs.map((doc) => doc.toObject()));
724
725
  });
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
24
  const factory = require("../factory");
25
25
  const trip_1 = require("./mongoose/schemas/trip");
26
+ const settings_1 = require("../settings");
26
27
  /**
27
28
  * トリップリポジトリ
28
29
  */
@@ -193,7 +194,7 @@ class MongoRepository {
193
194
  // console.log(explainResult[0].queryPlanner?.winningPlan?.inputStage?.inputStage?.inputStage);
194
195
  // console.log(explainResult);
195
196
  // return [];
196
- return query.setOptions({ maxTimeMS: 10000 })
197
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
197
198
  .exec()
198
199
  .then((docs) => docs.map((doc) => doc.toObject()));
199
200
  });
@@ -47,19 +47,14 @@ export declare function searchEventSeatOffersWithPaging(params: {
47
47
  stockHolder: StockHolderRepo;
48
48
  place: PlaceRepo;
49
49
  }) => Promise<factory.place.seat.IPlaceWithOffer[]>;
50
- interface IChangedEvent {
51
- id: string;
52
- typeOf: factory.eventType;
53
- project: {
54
- id: string;
55
- };
56
- }
50
+ type IChangedEvent = factory.task.onEventChanged.IChangedEvent;
57
51
  /**
58
52
  * イベント変更時処理
59
53
  */
60
54
  export declare function onEventChanged(params: {
61
55
  event: IChangedEvent | IChangedEvent[];
62
56
  isNew: boolean;
57
+ useInform?: boolean;
63
58
  }): (repos: {
64
59
  event: EventRepo;
65
60
  project: ProjectRepo;
@@ -76,3 +71,13 @@ export declare function createAggregateScreeningEventIfNotExist(params: {
76
71
  }): (repos: {
77
72
  task: TaskRepo;
78
73
  }) => Promise<void>;
74
+ export declare function createInformTasks(params: {
75
+ project: {
76
+ id: string;
77
+ };
78
+ ids: string[];
79
+ typeOf: factory.eventType;
80
+ }): (repos: {
81
+ event: EventRepo;
82
+ task: TaskRepo;
83
+ }) => Promise<void>;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createAggregateScreeningEventIfNotExist = exports.onEventChanged = exports.searchEventSeatOffersWithPaging = exports.addOffers2Seat = exports.product = exports.moneyTransfer = exports.eventServiceByCOA = exports.event = void 0;
12
+ exports.createInformTasks = exports.createAggregateScreeningEventIfNotExist = exports.onEventChanged = exports.searchEventSeatOffersWithPaging = exports.addOffers2Seat = exports.product = exports.moneyTransfer = exports.eventServiceByCOA = exports.event = void 0;
13
13
  const moment = require("moment");
14
14
  const factory = require("../factory");
15
15
  const EventOfferService = require("./offer/event");
@@ -20,6 +20,8 @@ const MoneyTransferOfferService = require("./offer/moneyTransfer");
20
20
  exports.moneyTransfer = MoneyTransferOfferService;
21
21
  const ProductOfferService = require("./offer/product");
22
22
  exports.product = ProductOfferService;
23
+ const settings_1 = require("../settings");
24
+ const informEvents = settings_1.settings.onEventChanged.informEvent;
23
25
  /**
24
26
  * 座席にオファー情報を付加する
25
27
  */
@@ -135,6 +137,14 @@ function onEventChanged(params) {
135
137
  force: params.isNew
136
138
  })(repos);
137
139
  }
140
+ // 通知タスク作成(2023-06-08~)
141
+ if (params.useInform === true) {
142
+ yield createInformTasks({
143
+ project: { id: changedEvents[0].project.id },
144
+ ids: changedEvents.map((changedEvent) => changedEvent.id),
145
+ typeOf: changedEvents[0].typeOf
146
+ })(repos);
147
+ }
138
148
  }
139
149
  });
140
150
  }
@@ -191,3 +201,48 @@ function createAggregateScreeningEventIfNotExist(params) {
191
201
  });
192
202
  }
193
203
  exports.createAggregateScreeningEventIfNotExist = createAggregateScreeningEventIfNotExist;
204
+ function createInformTasks(params) {
205
+ return (repos) => __awaiter(this, void 0, void 0, function* () {
206
+ const events4inform = yield repos.event.search({
207
+ id: { $in: params.ids },
208
+ typeOf: params.typeOf
209
+ }, { aggregateOffer: 0, aggregateReservation: 0, remainingAttendeeCapacity: 0, checkInCount: 0, attendeeCount: 0 });
210
+ if (events4inform.length > 0) {
211
+ const taskRunsAt = new Date();
212
+ const informTasks = [];
213
+ informEvents === null || informEvents === void 0 ? void 0 : informEvents.forEach((informEvent) => {
214
+ var _a;
215
+ const informUrl = String((_a = informEvent.recipient) === null || _a === void 0 ? void 0 : _a.url);
216
+ events4inform.forEach((event4inform) => {
217
+ var _a;
218
+ const informActionAttributes = {
219
+ agent: event4inform.project,
220
+ object: event4inform,
221
+ project: event4inform.project,
222
+ recipient: {
223
+ id: '',
224
+ name: String((_a = informEvent.recipient) === null || _a === void 0 ? void 0 : _a.name),
225
+ typeOf: factory.creativeWorkType.WebApplication,
226
+ url: informUrl
227
+ },
228
+ typeOf: factory.actionType.InformAction
229
+ };
230
+ informTasks.push({
231
+ project: event4inform.project,
232
+ name: factory.taskName.TriggerWebhook,
233
+ status: factory.taskStatus.Ready,
234
+ runsAt: taskRunsAt,
235
+ remainingNumberOfTries: 10,
236
+ numberOfTried: 0,
237
+ executionResults: [],
238
+ data: informActionAttributes
239
+ });
240
+ });
241
+ });
242
+ if (informTasks.length > 0) {
243
+ yield repos.task.saveMany(informTasks, { emitImmediately: true });
244
+ }
245
+ }
246
+ });
247
+ }
248
+ exports.createInformTasks = createInformTasks;
@@ -0,0 +1,7 @@
1
+ import * as factory from '../../factory';
2
+ import { IConnectionSettings } from '../task';
3
+ export type IOperation<T> = (settings: IConnectionSettings) => Promise<T>;
4
+ /**
5
+ * タスク実行関数
6
+ */
7
+ export declare function call(data: factory.task.onEventChanged.IData): IOperation<void>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.call = void 0;
13
+ const event_1 = require("../../repo/event");
14
+ const project_1 = require("../../repo/project");
15
+ const task_1 = require("../../repo/task");
16
+ const offer_1 = require("../offer");
17
+ /**
18
+ * タスク実行関数
19
+ */
20
+ function call(data) {
21
+ return (settings) => __awaiter(this, void 0, void 0, function* () {
22
+ yield (0, offer_1.onEventChanged)(data)({
23
+ event: new event_1.MongoRepository(settings.connection),
24
+ project: new project_1.MongoRepository(settings.connection),
25
+ task: new task_1.MongoRepository(settings.connection)
26
+ });
27
+ });
28
+ }
29
+ exports.call = call;
@@ -17,6 +17,9 @@ export declare const TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS: number;
17
17
  export declare const TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS: number;
18
18
  export declare const DEFAULT_SENDER_EMAIL: string;
19
19
  export type ISettings = factory.project.ISettings & {
20
+ onEventChanged: {
21
+ informEvent?: factory.project.IInformParams[];
22
+ };
20
23
  onReservationStatusChanged: {
21
24
  informReservation?: factory.project.IInformParams[];
22
25
  };
@@ -34,6 +37,7 @@ export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
34
37
  export declare const USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
35
38
  export declare const USE_NEW_EVENT_AVAILABILITY_KEY_FROM: moment.Moment;
36
39
  export declare const INFORM_RESERVATION_TASK_DELAY_IN_SECONDS: number;
40
+ export declare const MONGO_MAX_TIME_MS: number;
37
41
  /**
38
42
  * グローバル設定
39
43
  */
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settings = exports.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
3
+ exports.settings = exports.MONGO_MAX_TIME_MS = exports.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
4
4
  const moment = require("moment");
5
5
  const factory = require("./factory");
6
6
  const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
7
7
  ? process.env.INFORM_TRANSACTION_URL.split(' ')
8
8
  : [];
9
+ const informEventUrls = (typeof process.env.INFORM_EVENT_URL === 'string')
10
+ ? process.env.INFORM_EVENT_URL.split(' ')
11
+ : [];
9
12
  const informOrderUrls = (typeof process.env.INFORM_ORDER_URL === 'string')
10
13
  ? process.env.INFORM_ORDER_URL.split(' ')
11
14
  : [];
@@ -62,10 +65,26 @@ exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = (typeof process.env.USE_NEW_EVENT_
62
65
  exports.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS = (typeof process.env.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS === 'string')
63
66
  ? Number(process.env.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS)
64
67
  : 0;
68
+ exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
69
+ ? Number(process.env.MONGO_MAX_TIME_MS)
70
+ // tslint:disable-next-line:no-magic-numbers
71
+ : 10000;
65
72
  /**
66
73
  * グローバル設定
67
74
  */
68
- exports.settings = Object.assign(Object.assign({ transactionWebhookUrls, onOrderStatusChanged: {
75
+ exports.settings = Object.assign(Object.assign({ transactionWebhookUrls, onEventChanged: {
76
+ informEvent: informEventUrls
77
+ .filter((url) => url.length > 0)
78
+ .map((url) => {
79
+ return {
80
+ recipient: {
81
+ typeOf: factory.creativeWorkType.WebApplication,
82
+ name: 'Global HUB',
83
+ url
84
+ }
85
+ };
86
+ })
87
+ }, onOrderStatusChanged: {
69
88
  informOrder: informOrderUrls
70
89
  .filter((url) => url.length > 0)
71
90
  .map((url) => {
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.313.0-alpha.28",
13
- "@cinerino/sdk": "3.157.0-alpha.8",
12
+ "@chevre/factory": "4.313.0-alpha.29",
13
+ "@cinerino/sdk": "3.157.0-alpha.9",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.2.0-alpha.100"
120
+ "version": "21.2.0-alpha.101"
121
121
  }