@chevre/domain 20.1.0-alpha.23 → 20.1.0-alpha.25
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/example/src/chevre/migrateCreativeWorkAdditionalProperties.ts +8 -2
- package/lib/chevre/repo/categoryCode.d.ts +1 -0
- package/lib/chevre/repo/categoryCode.js +15 -1
- package/lib/chevre/repo/creativeWork.js +10 -1
- package/lib/chevre/repo/mongoose/model/categoryCode.js +8 -1
- package/lib/chevre/repo/mongoose/model/creativeWork.js +6 -0
- package/lib/chevre/repo/mongoose/model/offer.js +7 -1
- package/lib/chevre/repo/mongoose/model/place.js +6 -0
- package/lib/chevre/repo/offer.js +10 -1
- package/lib/chevre/repo/place.js +10 -1
- package/package.json +3 -3
|
@@ -11,10 +11,16 @@ const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
|
|
|
11
11
|
async function main() {
|
|
12
12
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
13
13
|
|
|
14
|
-
const creativeWorkRepo = new chevre.repository.CreativeWork(mongoose.connection);
|
|
14
|
+
// const creativeWorkRepo = new chevre.repository.CreativeWork(mongoose.connection);
|
|
15
|
+
// const placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
16
|
+
// const offerRepo = new chevre.repository.Offer(mongoose.connection);
|
|
17
|
+
const categoryCodeRepo = new chevre.repository.CategoryCode(mongoose.connection);
|
|
15
18
|
// const additionalPropertyRepo = new chevre.repository.AdditionalProperty(mongoose.connection);
|
|
16
19
|
|
|
17
|
-
const cursor =
|
|
20
|
+
const cursor = categoryCodeRepo.getCursor(
|
|
21
|
+
// const cursor = offerRepo.getCursor(
|
|
22
|
+
// const cursor = creativeWorkRepo.getCursor(
|
|
23
|
+
// const cursor = placeRepo.getCursor(
|
|
18
24
|
{
|
|
19
25
|
// 'project.id': { $eq: project.id },
|
|
20
26
|
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
@@ -32,7 +32,7 @@ class MongoRepository {
|
|
|
32
32
|
}
|
|
33
33
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
34
34
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
36
|
// MongoDB検索条件
|
|
37
37
|
const andConditions = [];
|
|
38
38
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -140,6 +140,15 @@ class MongoRepository {
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
+
const additionalPropertyElemMatch = (_j = params.additionalProperty) === null || _j === void 0 ? void 0 : _j.$elemMatch;
|
|
144
|
+
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
145
|
+
andConditions.push({
|
|
146
|
+
additionalProperty: {
|
|
147
|
+
$exists: true,
|
|
148
|
+
$elemMatch: additionalPropertyElemMatch
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
143
152
|
return andConditions;
|
|
144
153
|
}
|
|
145
154
|
count(params) {
|
|
@@ -228,5 +237,10 @@ class MongoRepository {
|
|
|
228
237
|
.exec();
|
|
229
238
|
});
|
|
230
239
|
}
|
|
240
|
+
getCursor(conditions, projection) {
|
|
241
|
+
return this.categoryCodeModel.find(conditions, projection)
|
|
242
|
+
.sort({ codeValue: factory.sortType.Ascending })
|
|
243
|
+
.cursor();
|
|
244
|
+
}
|
|
231
245
|
}
|
|
232
246
|
exports.MongoRepository = MongoRepository;
|
|
@@ -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
|
/**
|
|
@@ -13,7 +13,8 @@ const schema = new mongoose.Schema({
|
|
|
13
13
|
typeOf: {
|
|
14
14
|
type: String,
|
|
15
15
|
required: true
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
|
+
additionalProperty: [mongoose.SchemaTypes.Mixed]
|
|
17
18
|
}, {
|
|
18
19
|
collection: 'categoryCodes',
|
|
19
20
|
id: true,
|
|
@@ -71,6 +72,12 @@ schema.index({ 'paymentMethod.typeOf': 1, codeValue: 1 }, {
|
|
|
71
72
|
schema.index({ 'project.id': 1, codeValue: 1 }, {
|
|
72
73
|
name: 'searchByProjectId-v20220721'
|
|
73
74
|
});
|
|
75
|
+
schema.index({ additionalProperty: 1, codeValue: 1 }, {
|
|
76
|
+
name: 'searchByAdditionalProperty',
|
|
77
|
+
partialFilterExpression: {
|
|
78
|
+
additionalProperty: { $exists: true }
|
|
79
|
+
}
|
|
80
|
+
});
|
|
74
81
|
mongoose.model(modelName, schema)
|
|
75
82
|
.on('index',
|
|
76
83
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -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
|
|
@@ -19,7 +19,7 @@ const schema = new mongoose.Schema({
|
|
|
19
19
|
description: mongoose.SchemaTypes.Mixed,
|
|
20
20
|
category: mongoose.SchemaTypes.Mixed,
|
|
21
21
|
color: mongoose.SchemaTypes.Mixed,
|
|
22
|
-
additionalProperty: mongoose.SchemaTypes.Mixed,
|
|
22
|
+
additionalProperty: [mongoose.SchemaTypes.Mixed],
|
|
23
23
|
alternateName: mongoose.SchemaTypes.Mixed,
|
|
24
24
|
acceptedPaymentMethod: mongoose.SchemaTypes.Mixed,
|
|
25
25
|
addOn: mongoose.SchemaTypes.Mixed,
|
|
@@ -189,6 +189,12 @@ schema.index({ 'hasMerchantReturnPolicy.id': 1, 'priceSpecification.price': 1 },
|
|
|
189
189
|
'hasMerchantReturnPolicy.id': { $exists: true }
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
+
schema.index({ additionalProperty: 1, 'priceSpecification.price': 1 }, {
|
|
193
|
+
name: 'searchByAdditionalProperty',
|
|
194
|
+
partialFilterExpression: {
|
|
195
|
+
additionalProperty: { $exists: true }
|
|
196
|
+
}
|
|
197
|
+
});
|
|
192
198
|
mongoose.model(modelName, schema)
|
|
193
199
|
.on('index',
|
|
194
200
|
// 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
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -35,7 +35,7 @@ class MongoRepository {
|
|
|
35
35
|
}
|
|
36
36
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
37
37
|
static CREATE_OFFER_MONGO_CONDITIONS(params) {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23;
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24;
|
|
39
39
|
// MongoDB検索条件
|
|
40
40
|
const andConditions = [];
|
|
41
41
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
@@ -285,6 +285,15 @@ class MongoRepository {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
|
+
const additionalPropertyElemMatch = (_24 = params.additionalProperty) === null || _24 === void 0 ? void 0 : _24.$elemMatch;
|
|
289
|
+
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
290
|
+
andConditions.push({
|
|
291
|
+
additionalProperty: {
|
|
292
|
+
$exists: true,
|
|
293
|
+
$elemMatch: additionalPropertyElemMatch
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
288
297
|
return andConditions;
|
|
289
298
|
}
|
|
290
299
|
/**
|
package/lib/chevre/repo/place.js
CHANGED
|
@@ -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.
|
|
13
|
-
"@cinerino/sdk": "3.
|
|
12
|
+
"@chevre/factory": "4.279.0-alpha.4",
|
|
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.
|
|
123
|
+
"version": "20.1.0-alpha.25"
|
|
124
124
|
}
|