@chevre/domain 21.29.0-alpha.21 → 21.29.0-alpha.22

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.
@@ -97,11 +97,11 @@ class MongoRepository {
97
97
  }
98
98
  const transactionNumberEq = (_c = params.transactionNumber) === null || _c === void 0 ? void 0 : _c.$eq;
99
99
  if (typeof transactionNumberEq === 'string') {
100
- andConditions.push({ transactionNumber: { $exists: true, $eq: transactionNumberEq } });
100
+ andConditions.push({ transactionNumber: { $eq: transactionNumberEq } });
101
101
  }
102
102
  const transactionNumberIn = (_d = params.transactionNumber) === null || _d === void 0 ? void 0 : _d.$in;
103
103
  if (Array.isArray(transactionNumberIn)) {
104
- andConditions.push({ transactionNumber: { $exists: true, $in: transactionNumberIn } });
104
+ andConditions.push({ transactionNumber: { $in: transactionNumberIn } });
105
105
  }
106
106
  if (Array.isArray(params.tasksExportationStatuses)) {
107
107
  andConditions.push({
@@ -316,7 +316,7 @@ class MongoRepository {
316
316
  findByTransactionNumber(params) {
317
317
  return __awaiter(this, void 0, void 0, function* () {
318
318
  const doc = yield this.transactionModel.findOne({
319
- transactionNumber: { $exists: true, $eq: params.transactionNumber },
319
+ transactionNumber: { $eq: params.transactionNumber },
320
320
  typeOf: params.typeOf
321
321
  })
322
322
  .exec();
@@ -574,7 +574,7 @@ class MongoRepository {
574
574
  const endDate = new Date();
575
575
  // 進行中ステータスの取引を中止する
576
576
  const doc = yield this.transactionModel.findOneAndUpdate(Object.assign(Object.assign(Object.assign({ typeOf: { $eq: params.typeOf } }, (typeof params.id === 'string') ? { _id: { $eq: params.id } } : undefined), (typeof params.transactionNumber === 'string')
577
- ? { transactionNumber: { $exists: true, $eq: params.transactionNumber } }
577
+ ? { transactionNumber: { $eq: params.transactionNumber } }
578
578
  : undefined), { status: { $eq: factory.transactionStatusType.InProgress } }), {
579
579
  status: factory.transactionStatusType.Canceled,
580
580
  endDate: endDate
@@ -759,7 +759,7 @@ class MongoRepository {
759
759
  fixReservedTicketIdentifier(params) {
760
760
  return __awaiter(this, void 0, void 0, function* () {
761
761
  const doc = yield this.transactionModel.findOneAndUpdate({
762
- transactionNumber: { $exists: true, $eq: params.transactionNumber },
762
+ transactionNumber: { $eq: params.transactionNumber },
763
763
  'project.id': { $eq: params.project.id },
764
764
  typeOf: { $eq: factory.assetTransactionType.Pay }
765
765
  }, {
@@ -7,10 +7,10 @@ const settings_1 = require("../../../settings");
7
7
  const modelName = 'AssetTransaction';
8
8
  exports.modelName = modelName;
9
9
  const schemaDefinition = {
10
- project: mongoose_1.SchemaTypes.Mixed,
11
- status: String,
12
- typeOf: String,
13
- transactionNumber: String,
10
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
11
+ status: { type: String, required: true },
12
+ typeOf: { type: String, required: true },
13
+ transactionNumber: { type: String, required: true },
14
14
  agent: mongoose_1.SchemaTypes.Mixed,
15
15
  recipient: mongoose_1.SchemaTypes.Mixed,
16
16
  seller: mongoose_1.SchemaTypes.Mixed,
@@ -66,18 +66,12 @@ const indexes = [
66
66
  { transactionNumber: 1 },
67
67
  {
68
68
  unique: true,
69
- partialFilterExpression: {
70
- transactionNumber: { $exists: true }
71
- }
69
+ name: 'uniqueTransactionNumber'
72
70
  }
73
71
  ],
74
72
  [
75
73
  { transactionNumber: 1, startDate: -1 },
76
- {
77
- partialFilterExpression: {
78
- transactionNumber: { $exists: true }
79
- }
80
- }
74
+ { name: 'searchByTransactionNumber' }
81
75
  ],
82
76
  [
83
77
  { 'project.id': 1, startDate: -1 },
package/package.json CHANGED
@@ -110,5 +110,5 @@
110
110
  "postversion": "git push origin --tags",
111
111
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
112
112
  },
113
- "version": "21.29.0-alpha.21"
113
+ "version": "21.29.0-alpha.22"
114
114
  }