@chevre/domain 21.2.0-alpha.140 → 21.2.0-alpha.142

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.
@@ -0,0 +1,41 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../lib/index';
5
+
6
+ // const PROJECT_ID = String(process.env.PROJECT_ID);
7
+
8
+ async function main() {
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
+
11
+ const placeRepo = new chevre.repository.Place(mongoose.connection);
12
+
13
+ const cursor = placeRepo.getCursor(
14
+ {
15
+ typeOf: { $eq: chevre.factory.placeType.MovieTheater }
16
+ },
17
+ {
18
+ _id: 1,
19
+ name: 1,
20
+ project: 1,
21
+ typeOf: 1
22
+ }
23
+ );
24
+ console.log('places found');
25
+
26
+ let i = 0;
27
+ await cursor.eachAsync(async (doc) => {
28
+ i += 1;
29
+ const { id, name, project, typeOf } = <Pick<chevre.factory.place.movieTheater.IPlace, 'id' | 'name' | 'project' | 'typeOf'>>
30
+ doc.toObject();
31
+
32
+ console.log('syncing...', project.id, typeOf, id, name.ja, i);
33
+ // await placeRepo.syncScreeningRooms({ id });
34
+ console.log('synced.', project.id, typeOf, id, name.ja, i);
35
+ });
36
+
37
+ }
38
+
39
+ main()
40
+ .then(console.log)
41
+ .catch(console.error);
@@ -114,7 +114,7 @@ export declare class MongoRepository {
114
114
  $projection?: {
115
115
  [key: string]: number;
116
116
  };
117
- }): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
117
+ }, useScreeningRoomType?: boolean): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
118
118
  deleteScreeningRoomSection(screeningRoomSection: {
119
119
  project: {
120
120
  id: string;
@@ -142,7 +142,7 @@ export declare class MongoRepository {
142
142
  id: string;
143
143
  typeOf: factory.placeType.MovieTheater;
144
144
  }>;
145
- searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>[]>;
145
+ searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions, useScreeningRoomType?: boolean): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>[]>;
146
146
  findScreeningRoomsByBranchCode(params: {
147
147
  branchCode: {
148
148
  $eq: string;
@@ -177,7 +177,7 @@ export declare class MongoRepository {
177
177
  id: string;
178
178
  typeOf: factory.placeType.MovieTheater;
179
179
  }>;
180
- searchSeats(params: factory.place.seat.ISearchConditions): Promise<factory.place.seat.IPlace[]>;
180
+ searchSeats(params: factory.place.seat.ISearchConditions, useScreeningRoomType?: boolean): Promise<factory.place.seat.IPlace[]>;
181
181
  deleteSeat(seat: {
182
182
  project: {
183
183
  id: string;
@@ -216,6 +216,10 @@ export declare class MongoRepository {
216
216
  * 施設ID
217
217
  */
218
218
  id: string;
219
+ /**
220
+ * 特定のルームのみ同期する場合、ルームコードを指定する
221
+ */
222
+ screeningRoomBranchCode?: string;
219
223
  }): Promise<void>;
220
224
  deleteByProject(params: {
221
225
  project: {