@chevre/domain 23.2.0-alpha.20 → 23.2.0-alpha.21
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.
|
@@ -10,8 +10,8 @@ interface IOperator {
|
|
|
10
10
|
*/
|
|
11
11
|
id: string;
|
|
12
12
|
}
|
|
13
|
-
type IEntranceGate = Pick<factory.place.
|
|
14
|
-
type ICreatingEntranceGate = Pick<factory.place.
|
|
13
|
+
type IEntranceGate = Pick<factory.place.entranceGate.IEntranceGate, 'identifier' | 'name'>;
|
|
14
|
+
type ICreatingEntranceGate = Pick<factory.place.entranceGate.IEntranceGate, 'identifier' | 'name'>;
|
|
15
15
|
interface IUpdateOptions {
|
|
16
16
|
project: {
|
|
17
17
|
id: string;
|
|
@@ -24,18 +24,7 @@ export declare class EntranceGateRepo {
|
|
|
24
24
|
private readonly operator;
|
|
25
25
|
private readonly civicStructureModel;
|
|
26
26
|
constructor(connection: Connection, operater: IOperator);
|
|
27
|
-
findEntranceGates(params:
|
|
28
|
-
limit: number;
|
|
29
|
-
page: number;
|
|
30
|
-
project?: {
|
|
31
|
-
id?: {
|
|
32
|
-
$eq?: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
identifier?: {
|
|
36
|
-
$eq?: string;
|
|
37
|
-
};
|
|
38
|
-
}): Promise<IEntranceGate[]>;
|
|
27
|
+
findEntranceGates(params: factory.place.entranceGate.ISearchConditions): Promise<IEntranceGate[]>;
|
|
39
28
|
addEntranceGatesByIdentifierIfNotExist(params: {
|
|
40
29
|
$set: ICreatingEntranceGate;
|
|
41
30
|
}[], options: IUpdateOptions): Promise<{
|
|
@@ -54,5 +43,6 @@ export declare class EntranceGateRepo {
|
|
|
54
43
|
}[], options: IUpdateOptions): Promise<{
|
|
55
44
|
bulkWriteResult?: BulkWriteResult;
|
|
56
45
|
}>;
|
|
46
|
+
private createMatchStages;
|
|
57
47
|
}
|
|
58
48
|
export {};
|
|
@@ -24,25 +24,13 @@ class EntranceGateRepo {
|
|
|
24
24
|
}
|
|
25
25
|
findEntranceGates(params) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
var _a, _b, _c;
|
|
28
|
-
const matchStages = [
|
|
29
|
-
{ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(this.operator.id) } } }
|
|
30
|
-
];
|
|
31
|
-
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
32
|
-
if (typeof projectIdEq === 'string') {
|
|
33
|
-
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
34
|
-
}
|
|
35
|
-
const identifierEq = (_c = params.identifier) === null || _c === void 0 ? void 0 : _c.$eq;
|
|
36
|
-
if (typeof identifierEq === 'string') {
|
|
37
|
-
matchStages.push({ $match: { 'hasEntranceGate.identifier': { $eq: identifierEq } } });
|
|
38
|
-
}
|
|
39
27
|
const aggregate = this.civicStructureModel.aggregate([
|
|
40
28
|
{
|
|
41
29
|
$unwind: {
|
|
42
30
|
path: '$hasEntranceGate'
|
|
43
31
|
}
|
|
44
32
|
},
|
|
45
|
-
...
|
|
33
|
+
...this.createMatchStages(params),
|
|
46
34
|
{ $sort: { 'hasEntranceGate.identifier': factory.sortType.Ascending } },
|
|
47
35
|
{
|
|
48
36
|
$project: {
|
|
@@ -155,5 +143,24 @@ class EntranceGateRepo {
|
|
|
155
143
|
return {};
|
|
156
144
|
});
|
|
157
145
|
}
|
|
146
|
+
createMatchStages(params) {
|
|
147
|
+
var _a, _b, _c, _d;
|
|
148
|
+
const matchStages = [
|
|
149
|
+
{ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(this.operator.id) } } }
|
|
150
|
+
];
|
|
151
|
+
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
152
|
+
if (typeof projectIdEq === 'string') {
|
|
153
|
+
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
154
|
+
}
|
|
155
|
+
const identifierEq = (_c = params.identifier) === null || _c === void 0 ? void 0 : _c.$eq;
|
|
156
|
+
if (typeof identifierEq === 'string') {
|
|
157
|
+
matchStages.push({ $match: { 'hasEntranceGate.identifier': { $eq: identifierEq } } });
|
|
158
|
+
}
|
|
159
|
+
const identifierIn = (_d = params.identifier) === null || _d === void 0 ? void 0 : _d.$in;
|
|
160
|
+
if (Array.isArray(identifierIn)) {
|
|
161
|
+
matchStages.push({ $match: { 'hasEntranceGate.identifier': { $in: identifierIn } } });
|
|
162
|
+
}
|
|
163
|
+
return matchStages;
|
|
164
|
+
}
|
|
158
165
|
}
|
|
159
166
|
exports.EntranceGateRepo = EntranceGateRepo;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "5.4.0-alpha.
|
|
14
|
+
"@chevre/factory": "5.4.0-alpha.13",
|
|
15
15
|
"@cinerino/sdk": "12.12.1",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"postversion": "git push origin --tags",
|
|
117
117
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
118
118
|
},
|
|
119
|
-
"version": "23.2.0-alpha.
|
|
119
|
+
"version": "23.2.0-alpha.21"
|
|
120
120
|
}
|