@chevre/domain 21.2.0-alpha.142 → 21.2.0-alpha.143
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/lib/chevre/repo/place.js +41 -37
- package/package.json +1 -1
package/lib/chevre/repo/place.js
CHANGED
|
@@ -268,24 +268,26 @@ class MongoRepository {
|
|
|
268
268
|
});
|
|
269
269
|
yield Promise.all(creatingScreeningRooms.map((createScreeningRoom) => __awaiter(this, void 0, void 0, function* () {
|
|
270
270
|
const { typeOf, project, branchCode } = createScreeningRoom, setFields = __rest(createScreeningRoom, ["typeOf", "project", "branchCode"]);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
271
|
+
if (typeof branchCode === 'string' && branchCode.length > 0) {
|
|
272
|
+
yield this.placeModel.findOneAndUpdate({
|
|
273
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
274
|
+
'project.id': { $eq: createScreeningRoom.project.id },
|
|
275
|
+
'containedInPlace.id': { $exists: true, $eq: createScreeningRoom.containedInPlace.id },
|
|
276
|
+
branchCode: { $eq: createScreeningRoom.branchCode }
|
|
277
|
+
}, {
|
|
278
|
+
$setOnInsert: {
|
|
279
|
+
typeOf: createScreeningRoom.typeOf,
|
|
280
|
+
project: createScreeningRoom.project,
|
|
281
|
+
branchCode: createScreeningRoom.branchCode
|
|
282
|
+
},
|
|
283
|
+
$set: setFields
|
|
284
|
+
}, {
|
|
285
|
+
upsert: true,
|
|
286
|
+
new: true,
|
|
287
|
+
projection: { _id: 1 }
|
|
288
|
+
})
|
|
289
|
+
.exec();
|
|
290
|
+
}
|
|
289
291
|
})));
|
|
290
292
|
});
|
|
291
293
|
}
|
|
@@ -1800,25 +1802,27 @@ class MongoRepository {
|
|
|
1800
1802
|
debug('sync processing', creatingScreeningRooms.length, 'screeningRooms...', creatingScreeningRooms);
|
|
1801
1803
|
yield Promise.all(creatingScreeningRooms.map((createScreeningRoom) => __awaiter(this, void 0, void 0, function* () {
|
|
1802
1804
|
const { typeOf, project, branchCode } = createScreeningRoom, setFields = __rest(createScreeningRoom, ["typeOf", "project", "branchCode"]);
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1805
|
+
if (typeof branchCode === 'string' && branchCode.length > 0) {
|
|
1806
|
+
const upsertScreeningRoomResult = yield this.placeModel.findOneAndUpdate({
|
|
1807
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
1808
|
+
'project.id': { $eq: createScreeningRoom.project.id },
|
|
1809
|
+
'containedInPlace.id': { $exists: true, $eq: createScreeningRoom.containedInPlace.id },
|
|
1810
|
+
branchCode: { $eq: createScreeningRoom.branchCode }
|
|
1811
|
+
}, {
|
|
1812
|
+
$setOnInsert: {
|
|
1813
|
+
typeOf: createScreeningRoom.typeOf,
|
|
1814
|
+
project: createScreeningRoom.project,
|
|
1815
|
+
branchCode: createScreeningRoom.branchCode
|
|
1816
|
+
},
|
|
1817
|
+
$set: setFields
|
|
1818
|
+
}, {
|
|
1819
|
+
upsert: true,
|
|
1820
|
+
new: true,
|
|
1821
|
+
projection: { _id: 1 }
|
|
1822
|
+
})
|
|
1823
|
+
.exec();
|
|
1824
|
+
debug('screeningRoom upserted. upsertScreeningRoomResult:', upsertScreeningRoomResult);
|
|
1825
|
+
}
|
|
1822
1826
|
})));
|
|
1823
1827
|
});
|
|
1824
1828
|
}
|
package/package.json
CHANGED