@chevre/domain 20.1.0-alpha.24 → 20.1.0-alpha.26
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 +19 -2
- package/lib/chevre/repo/categoryCode.d.ts +1 -0
- package/lib/chevre/repo/categoryCode.js +15 -1
- package/lib/chevre/repo/customer.d.ts +1 -0
- package/lib/chevre/repo/customer.js +5 -0
- package/lib/chevre/repo/mongoose/model/categoryCode.js +8 -1
- package/lib/chevre/repo/mongoose/model/offer.js +7 -1
- package/lib/chevre/repo/offer.js +10 -1
- package/lib/chevre/repository.d.ts +0 -3
- package/lib/chevre/repository.js +3 -5
- package/package.json +2 -2
|
@@ -11,15 +11,27 @@ 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 customerRepo = new chevre.repository.Customer(mongoose.connection);
|
|
15
|
+
// const sellerRepo = new chevre.repository.Seller(mongoose.connection);
|
|
16
|
+
// const eventRepo = new chevre.repository.Event(mongoose.connection);
|
|
14
17
|
const creativeWorkRepo = new chevre.repository.CreativeWork(mongoose.connection);
|
|
15
18
|
// const placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
19
|
+
// const offerRepo = new chevre.repository.Offer(mongoose.connection);
|
|
20
|
+
// const categoryCodeRepo = new chevre.repository.CategoryCode(mongoose.connection);
|
|
16
21
|
// const additionalPropertyRepo = new chevre.repository.AdditionalProperty(mongoose.connection);
|
|
17
22
|
|
|
23
|
+
// const cursor = customerRepo.getCursor(
|
|
24
|
+
// const cursor = sellerRepo.getCursor(
|
|
25
|
+
// const cursor = eventRepo.getCursor(
|
|
26
|
+
// const cursor = categoryCodeRepo.getCursor(
|
|
27
|
+
// const cursor = offerRepo.getCursor(
|
|
18
28
|
const cursor = creativeWorkRepo.getCursor(
|
|
19
29
|
// const cursor = placeRepo.getCursor(
|
|
20
30
|
{
|
|
21
31
|
// 'project.id': { $eq: project.id },
|
|
22
|
-
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
32
|
+
'project.id': { $ne: EXCLUDED_PROJECT_ID },
|
|
33
|
+
// typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries },
|
|
34
|
+
// starDate: { $gte: new Date() }
|
|
23
35
|
// _id: { $eq: 'al6aff83w' }
|
|
24
36
|
},
|
|
25
37
|
{
|
|
@@ -39,7 +51,12 @@ async function main() {
|
|
|
39
51
|
|
|
40
52
|
const additionalPropertyNamesOnEvent = creativeWork.additionalProperty?.map((p) => p.name);
|
|
41
53
|
if (Array.isArray(additionalPropertyNamesOnEvent) && additionalPropertyNamesOnEvent.length > 0) {
|
|
42
|
-
console.log(
|
|
54
|
+
console.log(
|
|
55
|
+
additionalPropertyNamesOnEvent.length,
|
|
56
|
+
'additionalPropertyNamesOnEvent found',
|
|
57
|
+
creativeWork.project.id,
|
|
58
|
+
creativeWork.id
|
|
59
|
+
);
|
|
43
60
|
additionalPropertyNames.push(...additionalPropertyNamesOnEvent);
|
|
44
61
|
projectIds.push(creativeWork.project.id);
|
|
45
62
|
additionalPropertyNamesOnEvent.forEach((name) => {
|
|
@@ -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;
|
|
@@ -130,5 +130,10 @@ class MongoRepository {
|
|
|
130
130
|
.exec();
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
+
getCursor(conditions, projection) {
|
|
134
|
+
return this.customerModel.find(conditions, projection)
|
|
135
|
+
.sort({ branchCode: factory.sortType.Ascending })
|
|
136
|
+
.cursor();
|
|
137
|
+
}
|
|
133
138
|
}
|
|
134
139
|
exports.MongoRepository = MongoRepository;
|
|
@@ -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
|
|
@@ -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
|
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
|
/**
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* リポジトリ
|
|
3
3
|
*/
|
|
4
4
|
import { MongoRepository as AccountRepo } from './repo/account';
|
|
5
|
-
import { MongoRepository as AccountActionRepo } from './repo/accountAction';
|
|
6
5
|
import { MongoRepository as AccountingReportRepo } from './repo/accountingReport';
|
|
7
6
|
import { MongoRepository as AccountTitleRepo } from './repo/accountTitle';
|
|
8
7
|
import { MongoRepository as AccountTransactionRepo } from './repo/accountTransaction';
|
|
@@ -50,8 +49,6 @@ export declare class Account extends AccountRepo {
|
|
|
50
49
|
/**
|
|
51
50
|
* 口座アクションリポジトリ
|
|
52
51
|
*/
|
|
53
|
-
export declare class AccountAction extends AccountActionRepo {
|
|
54
|
-
}
|
|
55
52
|
/**
|
|
56
53
|
* 経理レポートリポジトリ
|
|
57
54
|
*/
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rateLimit = exports.itemAvailability = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.OfferCatalog = exports.Offer = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.
|
|
3
|
+
exports.rateLimit = exports.itemAvailability = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.OfferCatalog = exports.Offer = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = void 0;
|
|
4
4
|
// tslint:disable:max-classes-per-file completed-docs
|
|
5
5
|
/**
|
|
6
6
|
* リポジトリ
|
|
7
7
|
*/
|
|
8
8
|
const account_1 = require("./repo/account");
|
|
9
|
-
|
|
9
|
+
// import { MongoRepository as AccountActionRepo } from './repo/accountAction';
|
|
10
10
|
const accountingReport_1 = require("./repo/accountingReport");
|
|
11
11
|
const accountTitle_1 = require("./repo/accountTitle");
|
|
12
12
|
const accountTransaction_1 = require("./repo/accountTransaction");
|
|
@@ -55,9 +55,7 @@ exports.Account = Account;
|
|
|
55
55
|
/**
|
|
56
56
|
* 口座アクションリポジトリ
|
|
57
57
|
*/
|
|
58
|
-
class AccountAction extends
|
|
59
|
-
}
|
|
60
|
-
exports.AccountAction = AccountAction;
|
|
58
|
+
// export class AccountAction extends AccountActionRepo { }
|
|
61
59
|
/**
|
|
62
60
|
* 経理レポートリポジトリ
|
|
63
61
|
*/
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.279.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.279.0-alpha.4",
|
|
13
13
|
"@cinerino/sdk": "3.134.0-alpha.3",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.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.26"
|
|
124
124
|
}
|