@chevre/domain 20.1.0-alpha.23 → 20.1.0-alpha.24

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.
@@ -12,9 +12,11 @@ async function main() {
12
12
  await mongoose.connect(<string>process.env.MONGOLAB_URI);
13
13
 
14
14
  const creativeWorkRepo = new chevre.repository.CreativeWork(mongoose.connection);
15
+ // const placeRepo = new chevre.repository.Place(mongoose.connection);
15
16
  // const additionalPropertyRepo = new chevre.repository.AdditionalProperty(mongoose.connection);
16
17
 
17
18
  const cursor = creativeWorkRepo.getCursor(
19
+ // const cursor = placeRepo.getCursor(
18
20
  {
19
21
  // 'project.id': { $eq: project.id },
20
22
  'project.id': { $ne: EXCLUDED_PROJECT_ID }
@@ -33,7 +33,7 @@ class MongoRepository {
33
33
  }
34
34
  // tslint:disable-next-line:max-func-body-length
35
35
  static CREATE_MONGO_CONDITIONS(params) {
36
- var _a, _b, _c, _d, _e;
36
+ var _a, _b, _c, _d, _e, _f;
37
37
  // MongoDB検索条件
38
38
  const andConditions = [
39
39
  {
@@ -155,6 +155,15 @@ class MongoRepository {
155
155
  });
156
156
  }
157
157
  }
158
+ const additionalPropertyElemMatch = (_f = params.additionalProperty) === null || _f === void 0 ? void 0 : _f.$elemMatch;
159
+ if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
160
+ andConditions.push({
161
+ additionalProperty: {
162
+ $exists: true,
163
+ $elemMatch: additionalPropertyElemMatch
164
+ }
165
+ });
166
+ }
158
167
  return andConditions;
159
168
  }
160
169
  /**
@@ -111,6 +111,12 @@ schema.index({ 'distributor.codeValue': 1, identifier: 1 }, {
111
111
  'distributor.codeValue': { $exists: true }
112
112
  }
113
113
  });
114
+ schema.index({ additionalProperty: 1, identifier: 1 }, {
115
+ name: 'searchByAdditionalProperty',
116
+ partialFilterExpression: {
117
+ additionalProperty: { $exists: true }
118
+ }
119
+ });
114
120
  mongoose.model(modelName, schema)
115
121
  .on('index',
116
122
  // tslint:disable-next-line:no-single-line-block-comment
@@ -107,6 +107,12 @@ schema.index({ 'containsPlace.containsPlace.containsPlace.branchCode': 1, branch
107
107
  'containsPlace.containsPlace.containsPlace.branchCode': { $exists: true }
108
108
  }
109
109
  });
110
+ schema.index({ additionalProperty: 1, branchCode: 1 }, {
111
+ name: 'searchByAdditionalProperty',
112
+ partialFilterExpression: {
113
+ additionalProperty: { $exists: true }
114
+ }
115
+ });
110
116
  mongoose.model(modelName, schema)
111
117
  .on('index',
112
118
  // tslint:disable-next-line:no-single-line-block-comment
@@ -33,7 +33,7 @@ class MongoRepository {
33
33
  }
34
34
  // tslint:disable-next-line:max-func-body-length
35
35
  static CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params) {
36
- var _a, _b, _c, _d, _e, _f, _g, _h;
36
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
37
37
  // MongoDB検索条件
38
38
  const andConditions = [];
39
39
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
@@ -123,6 +123,15 @@ class MongoRepository {
123
123
  }
124
124
  });
125
125
  }
126
+ const additionalPropertyElemMatch = (_j = params.additionalProperty) === null || _j === void 0 ? void 0 : _j.$elemMatch;
127
+ if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
128
+ andConditions.push({
129
+ additionalProperty: {
130
+ $exists: true,
131
+ $elemMatch: additionalPropertyElemMatch
132
+ }
133
+ });
134
+ }
126
135
  return andConditions;
127
136
  }
128
137
  /**
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.279.0-alpha.2",
13
- "@cinerino/sdk": "3.133.0",
12
+ "@chevre/factory": "4.279.0-alpha.3",
13
+ "@cinerino/sdk": "3.134.0-alpha.3",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.1.0-alpha.23"
123
+ "version": "20.1.0-alpha.24"
124
124
  }