@chevre/domain 21.2.0-alpha.152 → 21.2.0-alpha.153
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.
|
@@ -88,6 +88,12 @@ export declare class MongoRepository {
|
|
|
88
88
|
};
|
|
89
89
|
typeOf: factory.placeType.ScreeningRoom;
|
|
90
90
|
}>;
|
|
91
|
+
updateScreeningRoomsByContainedInPlaceId(screeningRoom: {
|
|
92
|
+
project: {
|
|
93
|
+
id: string;
|
|
94
|
+
};
|
|
95
|
+
containedInPlace: Pick<factory.place.screeningRoom.IContainedInPlace, 'id' | 'name'>;
|
|
96
|
+
}): Promise<void>;
|
|
91
97
|
deleteScreeningRoom(screeningRoom: {
|
|
92
98
|
project: {
|
|
93
99
|
id: string;
|
package/lib/chevre/repo/place.js
CHANGED
|
@@ -552,6 +552,21 @@ class MongoRepository {
|
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
|
+
updateScreeningRoomsByContainedInPlaceId(screeningRoom) {
|
|
556
|
+
var _a;
|
|
557
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
558
|
+
if (typeof ((_a = screeningRoom.containedInPlace.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string') {
|
|
559
|
+
yield this.placeModel.updateMany({
|
|
560
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
561
|
+
'project.id': { $eq: screeningRoom.project.id },
|
|
562
|
+
'containedInPlace.id': { $exists: true, $eq: screeningRoom.containedInPlace.id }
|
|
563
|
+
}, {
|
|
564
|
+
'containedInPlace.name': screeningRoom.containedInPlace.name
|
|
565
|
+
})
|
|
566
|
+
.exec();
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
}
|
|
555
570
|
deleteScreeningRoom(screeningRoom, useScreeningRoomType) {
|
|
556
571
|
return __awaiter(this, void 0, void 0, function* () {
|
|
557
572
|
if (useScreeningRoomType === true) {
|
|
@@ -78,17 +78,18 @@ function onResourceUpdated(params) {
|
|
|
78
78
|
// no op
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
switch (params.typeOf) {
|
|
82
|
+
// 施設名称を同期する(2023-06-29~)
|
|
83
|
+
case factory.placeType.MovieTheater:
|
|
84
|
+
yield syncMovieTheater({
|
|
85
|
+
project: { id: params.project.id },
|
|
86
|
+
ids: params.id,
|
|
87
|
+
typeOf: params.typeOf
|
|
88
|
+
})(repos);
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
// no op
|
|
92
|
+
}
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
function createInformMovieTasks(params) {
|
|
@@ -374,45 +375,22 @@ function createInformAccountTitleTasks(params) {
|
|
|
374
375
|
}
|
|
375
376
|
});
|
|
376
377
|
}
|
|
377
|
-
|
|
378
|
-
*
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
// { id: { $eq: params.ids[0] } },
|
|
397
|
-
// ['_id', 'branchCode', 'name', 'project', 'typeOf', 'containsPlace'],
|
|
398
|
-
// []
|
|
399
|
-
// );
|
|
400
|
-
// const movieTheater = movieTheaters.shift();
|
|
401
|
-
// if (movieTheater === undefined) {
|
|
402
|
-
// throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
403
|
-
// }
|
|
404
|
-
// const creatingScreeningRooms: factory.place.screeningRoom.IPlace[] = movieTheater.containsPlace.map((place) => {
|
|
405
|
-
// return {
|
|
406
|
-
// ...place,
|
|
407
|
-
// containedInPlace: {
|
|
408
|
-
// id: movieTheater.id,
|
|
409
|
-
// typeOf: movieTheater.typeOf,
|
|
410
|
-
// branchCode: movieTheater.branchCode,
|
|
411
|
-
// name: movieTheater.name
|
|
412
|
-
// },
|
|
413
|
-
// project: movieTheater.project
|
|
414
|
-
// };
|
|
415
|
-
// });
|
|
416
|
-
// debug('sync processing', creatingScreeningRooms.length, 'screeningRooms...');
|
|
417
|
-
// };
|
|
418
|
-
// }
|
|
378
|
+
function syncMovieTheater(params) {
|
|
379
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
380
|
+
if (params.ids.length !== 1) {
|
|
381
|
+
throw new factory.errors.Argument('id', 'id.length must be 1');
|
|
382
|
+
}
|
|
383
|
+
const movieTheaters = yield repos.place.searchMovieTheaters({
|
|
384
|
+
id: { $eq: params.ids[0] },
|
|
385
|
+
project: { id: { $eq: params.project.id } }
|
|
386
|
+
}, ['_id', 'name'], []);
|
|
387
|
+
const movieTheater = movieTheaters.shift();
|
|
388
|
+
if (movieTheater === undefined) {
|
|
389
|
+
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
390
|
+
}
|
|
391
|
+
yield repos.place.updateScreeningRoomsByContainedInPlaceId({
|
|
392
|
+
project: { id: params.project.id },
|
|
393
|
+
containedInPlace: movieTheater
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
}
|
package/package.json
CHANGED