@chevre/domain 28.0.0-alpha.10 → 28.0.0-alpha.12

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.
@@ -3,6 +3,7 @@ import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
4
  export type IDocType = Omit<factory.place.movieTheater.IPlace, 'id'> & {
5
5
  hasPOS?: factory.place.movieTheater.IPOS[];
6
+ hasEntranceGate?: factory.place.movieTheater.IEntranceGate[];
6
7
  };
7
8
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
8
9
  type ISchemaDefinition = SchemaDefinition<IDocType>;
@@ -34,15 +34,6 @@ const schemaDefinition = {
34
34
  // ↓ルームの施設からの分離に伴い属性追加(2023-06-22~)
35
35
  openSeatingAllowed: mongoose_1.SchemaTypes.Mixed,
36
36
  amenityFeature: mongoose_1.SchemaTypes.Mixed
37
- // ↓migrated to civicStructures(2024-09-19~)
38
- // alternateName: SchemaTypes.Mixed,
39
- // hasEntranceGate: [SchemaTypes.Mixed],
40
- // hasPOS: [SchemaTypes.Mixed],
41
- // sameAs: String,
42
- // telephone: String,
43
- // url: String,
44
- // kanaName: String,
45
- // offers: SchemaTypes.Mixed,
46
37
  };
47
38
  const schemaOptions = {
48
39
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -32,7 +32,7 @@ export declare class MovieTheaterRepo {
32
32
  /**
33
33
  * 施設を保管する
34
34
  */
35
- saveMovieTheater(params: Pick<factory.place.movieTheater.IPlace, 'additionalProperty' | 'branchCode' | 'hasEntranceGate' | 'id' | 'kanaName' | 'name' | 'offers' | 'parentOrganization' | 'project' | 'typeOf' | 'url'> & {
35
+ saveMovieTheater(params: Pick<factory.place.movieTheater.IPlace, 'additionalProperty' | 'branchCode' | 'id' | 'kanaName' | 'name' | 'offers' | 'parentOrganization' | 'project' | 'typeOf' | 'url'> & {
36
36
  hasEntranceGate?: never;
37
37
  }): Promise<{
38
38
  id: string;
@@ -96,12 +96,14 @@ export declare class MovieTheaterRepo {
96
96
  }): Promise<void>;
97
97
  getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("../mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/place/movieTheater").IPlace, "id"> & {
98
98
  hasPOS?: factory.place.movieTheater.IPOS[];
99
+ hasEntranceGate?: factory.place.movieTheater.IEntranceGate[];
99
100
  } & {
100
101
  _id: import("mongoose").Types.ObjectId;
101
102
  } & {
102
103
  __v: number;
103
104
  }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("../mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/place/movieTheater").IPlace, "id"> & {
104
105
  hasPOS?: factory.place.movieTheater.IPOS[];
106
+ hasEntranceGate?: factory.place.movieTheater.IEntranceGate[];
105
107
  } & {
106
108
  _id: import("mongoose").Types.ObjectId;
107
109
  } & {
@@ -5,7 +5,9 @@ const factory_1 = require("../../factory");
5
5
  const settings_1 = require("../../settings");
6
6
  const civicStructure_1 = require("../mongoose/schemas/civicStructure");
7
7
  const AVAILABLE_PROJECT_FIELDS = [
8
- 'additionalProperty', 'branchCode', 'hasEntranceGate', 'kanaName', 'name',
8
+ 'additionalProperty', 'branchCode',
9
+ // 'hasEntranceGate',
10
+ 'kanaName', 'name',
9
11
  'offers', 'parentOrganization', 'project', 'telephone', 'typeOf', 'url',
10
12
  'offers.typeOf',
11
13
  'offers.eligibleQuantity',
@@ -24,7 +24,12 @@ export declare class POSRepo {
24
24
  $eq?: string;
25
25
  $regex?: string;
26
26
  };
27
- }): Promise<Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name' | 'id'>[]>;
27
+ }, options: {
28
+ /**
29
+ * 2026-09-18~
30
+ */
31
+ excludePOSId: boolean;
32
+ }): Promise<Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name'>[]>;
28
33
  createByBranchCode(params: Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name'> & {
29
34
  project: {
30
35
  id: string;
@@ -15,7 +15,7 @@ class POSRepo {
15
15
  this.civicStructureModel = connection.model(civicStructure_1.modelName, (0, civicStructure_1.createSchema)());
16
16
  this.operator = operater;
17
17
  }
18
- async findPOS(params) {
18
+ async findPOS(params, options) {
19
19
  const matchStages = [];
20
20
  const branchCodeEq = params.branchCode?.$eq;
21
21
  if (typeof branchCodeEq === 'string') {
@@ -25,6 +25,7 @@ class POSRepo {
25
25
  if (typeof branchCodeRegex === 'string' && branchCodeRegex.length > 0) {
26
26
  matchStages.push({ $match: { 'hasPOS.branchCode': { $regex: new RegExp(branchCodeRegex) } } });
27
27
  }
28
+ const { excludePOSId } = options;
28
29
  const aggregate = this.civicStructureModel.aggregate([
29
30
  // まず施設ドキュメントで絞る
30
31
  {
@@ -43,9 +44,9 @@ class POSRepo {
43
44
  {
44
45
  $project: {
45
46
  _id: 0,
46
- id: '$hasPOS.branchCode',
47
47
  branchCode: '$hasPOS.branchCode',
48
- name: '$hasPOS.name'
48
+ name: '$hasPOS.name',
49
+ ...((!excludePOSId) && { id: '$hasPOS.branchCode' })
49
50
  }
50
51
  }
51
52
  ]);
@@ -28,7 +28,7 @@ function createInformHasPOSTasks(params) {
28
28
  repos.pos.operator.id = movieTheater.id;
29
29
  const hasPOS = await repos.pos.findPOS({
30
30
  projectId: params.project.id
31
- });
31
+ }, { excludePOSId: true }); // pos.idを除外(2026-09-18~)
32
32
  const movieTheaters4inform = [{
33
33
  hasPOS: (Array.isArray(hasPOS)) ? hasPOS : [],
34
34
  id: movieTheater.id,
@@ -401,32 +401,11 @@ function createInformMovieTheaterTasks(params, setting) {
401
401
  ]
402
402
  // []
403
403
  );
404
- // const movieTheater = movieTheaters.shift();
405
- // if (movieTheater === undefined) {
406
- // throw new factory.errors.NotFound(factory.placeType.MovieTheater);
407
- // }
408
- // // ルームを検索
409
- // const screeningRooms = await repos.screeningRoom.findRooms(
410
- // {
411
- // containedInPlace: { id: { $eq: movieTheater.id } }
412
- // }
413
- // );
414
404
  // 入場ゲートを廃止(2026-01-17~)
415
405
  const movieTheaters4inform = movieTheaters.map((movieTheater) => {
416
406
  const { hasEntranceGate, ...movieTheaterWithoutEntranceGates } = movieTheater; // eslint-disable-line @typescript-eslint/no-unused-vars
417
407
  return {
418
408
  ...movieTheaterWithoutEntranceGates
419
- // ...movieTheater
420
- // migrate to IRoomAsNotification(2026-01-16~)
421
- // containsPlace: screeningRooms.map((room) => {
422
- // return {
423
- // branchCode: room.branchCode,
424
- // name: room.name,
425
- // typeOf: factory.placeType.ScreeningRoom,
426
- // additionalProperty: room.additionalProperty,
427
- // address: room.address
428
- // };
429
- // })
430
409
  };
431
410
  });
432
411
  if (movieTheaters4inform.length > 0) {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.1090.0",
13
13
  "@aws-sdk/credential-providers": "3.1090.0",
14
- "@chevre/factory": "11.0.0-alpha.3",
14
+ "@chevre/factory": "11.0.0-alpha.4",
15
15
  "@motionpicture/coa-service": "10.0.0",
16
16
  "@motionpicture/gmo-service": "6.1.0-alpha.0",
17
17
  "@sendgrid/client": "8.1.4",
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "28.0.0-alpha.10"
91
+ "version": "28.0.0-alpha.12"
92
92
  }