@chevre/domain 21.2.0-alpha.137 → 21.2.0-alpha.138

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.
@@ -42,7 +42,7 @@ export declare class MongoRepository {
42
42
  /**
43
43
  * 施設検索
44
44
  */
45
- searchMovieTheaters(params: factory.place.movieTheater.ISearchConditions & {}, inclusion: string[], exclusion: string[]): Promise<factory.place.movieTheater.IPlaceWithoutScreeningRoom[]>;
45
+ searchMovieTheaters(params: factory.place.movieTheater.ISearchConditions & {}, inclusion: string[], exclusion: string[]): Promise<factory.place.movieTheater.IPlace[]>;
46
46
  /**
47
47
  * 施設取得
48
48
  * 廃止(2023-06-22~)
@@ -5,3 +5,6 @@ export type IOperation<T> = (settings: IConnectionSettings) => Promise<T>;
5
5
  * タスク実行関数
6
6
  */
7
7
  export declare function call(data: factory.task.onResourceUpdated.IData): IOperation<void>;
8
+ /**
9
+ * 施設のcontainsPlaceをdocumentとして保管する
10
+ */
@@ -66,13 +66,6 @@ function onResourceUpdated(params) {
66
66
  ids: params.id,
67
67
  typeOf: params.typeOf
68
68
  })(repos);
69
- // tslint:disable-next-line:no-suspicious-comment
70
- // TODO ルーム同期タスクを作成
71
- yield syncScreeningRooms({
72
- project: { id: params.project.id },
73
- ids: params.id,
74
- typeOf: params.typeOf
75
- })(repos);
76
69
  break;
77
70
  case 'AccountTitle':
78
71
  yield createInformAccountTitleTasks({
@@ -85,6 +78,17 @@ function onResourceUpdated(params) {
85
78
  // no op
86
79
  }
87
80
  }
81
+ // switch (params.typeOf) {
82
+ // case factory.placeType.MovieTheater:
83
+ // await syncScreeningRooms({
84
+ // project: { id: params.project.id },
85
+ // ids: params.id,
86
+ // typeOf: params.typeOf
87
+ // })(repos);
88
+ // break;
89
+ // default:
90
+ // // no op
91
+ // }
88
92
  });
89
93
  }
90
94
  function createInformMovieTasks(params) {
@@ -375,35 +379,45 @@ function createInformAccountTitleTasks(params) {
375
379
  }
376
380
  });
377
381
  }
378
- function syncScreeningRooms(__) {
379
- return (__2) => __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 movieTheater = await repos.place.findById(
384
- // { id: params.ids[0] },
385
- // [
386
- // 'additionalProperty',
387
- // 'branchCode',
388
- // 'hasEntranceGate',
389
- // 'hasPOS',
390
- // 'kanaName',
391
- // 'name',
392
- // 'parentOrganization',
393
- // 'project',
394
- // 'telephone',
395
- // 'url',
396
- // 'typeOf',
397
- // 'containsPlace.branchCode',
398
- // 'containsPlace.name',
399
- // 'containsPlace.typeOf',
400
- // 'containsPlace.additionalProperty',
401
- // 'containsPlace.address'
402
- // ],
403
- // []
404
- // );
405
- // if (movieTheater.project.id !== params.project.id) {
406
- // throw new factory.errors.Argument('project.id', 'project.id not matched');
407
- // }
408
- });
409
- }
382
+ /**
383
+ * 施設のcontainsPlaceをdocumentとして保管する
384
+ */
385
+ // function syncScreeningRooms(params: {
386
+ // project: { id: string };
387
+ // ids: string[];
388
+ // typeOf: factory.placeType.MovieTheater;
389
+ // }) {
390
+ // return async (repos: {
391
+ // place: PlaceRepo;
392
+ // }) => {
393
+ // if (params.ids.length !== 1) {
394
+ // throw new factory.errors.Argument('id', 'id.length must be 1');
395
+ // }
396
+ // const movieTheaters = <Pick<
397
+ // factory.place.movieTheater.IPlace,
398
+ // 'id' | 'branchCode' | 'name' | 'project' | 'typeOf' | 'containsPlace'
399
+ // >[]>
400
+ // await repos.place.searchMovieTheaters(
401
+ // { id: { $eq: params.ids[0] } },
402
+ // ['_id', 'branchCode', 'name', 'project', 'typeOf', 'containsPlace'],
403
+ // []
404
+ // );
405
+ // const movieTheater = movieTheaters.shift();
406
+ // if (movieTheater === undefined) {
407
+ // throw new factory.errors.NotFound(factory.placeType.MovieTheater);
408
+ // }
409
+ // const creatingScreeningRooms: factory.place.screeningRoom.IPlace[] = movieTheater.containsPlace.map((place) => {
410
+ // return {
411
+ // ...place,
412
+ // containedInPlace: {
413
+ // id: movieTheater.id,
414
+ // typeOf: movieTheater.typeOf,
415
+ // branchCode: movieTheater.branchCode,
416
+ // name: movieTheater.name
417
+ // },
418
+ // project: movieTheater.project
419
+ // };
420
+ // });
421
+ // debug('sync processing', creatingScreeningRooms.length, 'screeningRooms...');
422
+ // };
423
+ // }
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.313.0-alpha.40",
13
- "@cinerino/sdk": "3.157.0-alpha.16",
12
+ "@chevre/factory": "4.313.0-alpha.41",
13
+ "@cinerino/sdk": "3.157.0-alpha.17",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.2.0-alpha.137"
120
+ "version": "21.2.0-alpha.138"
121
121
  }
@@ -1,41 +0,0 @@
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 movieTheater = await placeRepo.updateScreeningRoom(
14
- {
15
- typeOf: chevre.factory.placeType.ScreeningRoom,
16
- branchCode: '01',
17
- project: {
18
- id: PROJECT_ID,
19
- typeOf: chevre.factory.organizationType.Project
20
- },
21
- containedInPlace: {
22
- branchCode: '001',
23
- project: {
24
- id: PROJECT_ID,
25
- typeOf: chevre.factory.organizationType.Project
26
- },
27
- typeOf: chevre.factory.placeType.MovieTheater
28
- },
29
- name: {
30
- ja: '東京タワー TOP DECK',
31
- en: 'TokyoTower TOP DECK'
32
- }
33
- },
34
- {}
35
- );
36
- console.log('place found', movieTheater);
37
- }
38
-
39
- main()
40
- .then(console.log)
41
- .catch(console.error);