@chevre/domain 21.3.0 → 21.4.0-alpha.0

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.
@@ -45,7 +45,6 @@ export declare class MongoRepository {
45
45
  id?: string;
46
46
  attributes: factory.seller.ISeller;
47
47
  }): Promise<ISeller>;
48
- count(params: factory.seller.ISearchConditions): Promise<number>;
49
48
  /**
50
49
  * 販売者検索
51
50
  */
@@ -34,13 +34,17 @@ class MongoRepository {
34
34
  }
35
35
  // tslint:disable-next-line:max-func-body-length
36
36
  static CREATE_MONGO_CONDITIONS(params) {
37
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
37
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
38
38
  // MongoDB検索条件
39
39
  const andConditions = [];
40
40
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
41
41
  if (typeof projectIdEq === 'string') {
42
42
  andConditions.push({ 'project.id': { $eq: projectIdEq } });
43
43
  }
44
+ const idEq = (_c = params.id) === null || _c === void 0 ? void 0 : _c.$eq;
45
+ if (typeof idEq === 'string') {
46
+ andConditions.push({ _id: { $eq: idEq } });
47
+ }
44
48
  const nameRegex = params.name;
45
49
  if (typeof nameRegex === 'string' && nameRegex.length > 0) {
46
50
  andConditions.push({
@@ -60,7 +64,7 @@ class MongoRepository {
60
64
  ]
61
65
  });
62
66
  }
63
- const branchCodeEq = (_c = params.branchCode) === null || _c === void 0 ? void 0 : _c.$eq;
67
+ const branchCodeEq = (_d = params.branchCode) === null || _d === void 0 ? void 0 : _d.$eq;
64
68
  if (typeof branchCodeEq === 'string') {
65
69
  andConditions.push({
66
70
  branchCode: {
@@ -68,7 +72,7 @@ class MongoRepository {
68
72
  }
69
73
  });
70
74
  }
71
- const branchCodeRegex = (_d = params.branchCode) === null || _d === void 0 ? void 0 : _d.$regex;
75
+ const branchCodeRegex = (_e = params.branchCode) === null || _e === void 0 ? void 0 : _e.$regex;
72
76
  if (typeof branchCodeRegex === 'string' && branchCodeRegex.length > 0) {
73
77
  andConditions.push({
74
78
  branchCode: {
@@ -76,7 +80,7 @@ class MongoRepository {
76
80
  }
77
81
  });
78
82
  }
79
- const additionalPropertyAll = (_e = params.additionalProperty) === null || _e === void 0 ? void 0 : _e.$all;
83
+ const additionalPropertyAll = (_f = params.additionalProperty) === null || _f === void 0 ? void 0 : _f.$all;
80
84
  if (Array.isArray(additionalPropertyAll)) {
81
85
  andConditions.push({
82
86
  additionalProperty: {
@@ -85,7 +89,7 @@ class MongoRepository {
85
89
  }
86
90
  });
87
91
  }
88
- const additionalPropertyIn = (_f = params.additionalProperty) === null || _f === void 0 ? void 0 : _f.$in;
92
+ const additionalPropertyIn = (_g = params.additionalProperty) === null || _g === void 0 ? void 0 : _g.$in;
89
93
  if (Array.isArray(additionalPropertyIn)) {
90
94
  andConditions.push({
91
95
  additionalProperty: {
@@ -94,7 +98,7 @@ class MongoRepository {
94
98
  }
95
99
  });
96
100
  }
97
- const additionalPropertyNin = (_g = params.additionalProperty) === null || _g === void 0 ? void 0 : _g.$nin;
101
+ const additionalPropertyNin = (_h = params.additionalProperty) === null || _h === void 0 ? void 0 : _h.$nin;
98
102
  if (Array.isArray(additionalPropertyNin)) {
99
103
  andConditions.push({
100
104
  additionalProperty: {
@@ -102,7 +106,7 @@ class MongoRepository {
102
106
  }
103
107
  });
104
108
  }
105
- const additionalPropertyElemMatch = (_h = params.additionalProperty) === null || _h === void 0 ? void 0 : _h.$elemMatch;
109
+ const additionalPropertyElemMatch = (_j = params.additionalProperty) === null || _j === void 0 ? void 0 : _j.$elemMatch;
106
110
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
107
111
  andConditions.push({
108
112
  additionalProperty: {
@@ -111,7 +115,7 @@ class MongoRepository {
111
115
  }
112
116
  });
113
117
  }
114
- const hasMerchantReturnPolicyItemConditionIdEq = (_l = (_k = (_j = params.hasMerchantReturnPolicy) === null || _j === void 0 ? void 0 : _j.itemCondition) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.$eq;
118
+ const hasMerchantReturnPolicyItemConditionIdEq = (_m = (_l = (_k = params.hasMerchantReturnPolicy) === null || _k === void 0 ? void 0 : _k.itemCondition) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$eq;
115
119
  if (typeof hasMerchantReturnPolicyItemConditionIdEq === 'string') {
116
120
  andConditions.push({
117
121
  'hasMerchantReturnPolicy.itemCondition.id': {
@@ -178,14 +182,12 @@ class MongoRepository {
178
182
  return organization;
179
183
  });
180
184
  }
181
- count(params) {
182
- return __awaiter(this, void 0, void 0, function* () {
183
- const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
184
- return this.organizationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
185
- .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
186
- .exec();
187
- });
188
- }
185
+ // public async count(params: factory.seller.ISearchConditions): Promise<number> {
186
+ // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
187
+ // return this.organizationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
188
+ // .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
189
+ // .exec();
190
+ // }
189
191
  /**
190
192
  * 販売者検索
191
193
  */
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.313.0",
12
+ "@chevre/factory": "4.314.0",
13
13
  "@cinerino/sdk": "3.157.1",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.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.3.0"
120
+ "version": "21.4.0-alpha.0"
121
121
  }