@chevre/domain 23.2.0-alpha.16 → 23.2.0-alpha.17

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.
@@ -67,7 +67,7 @@ async function main() {
67
67
  }
68
68
  console.log('movieTheater:', movieTheater);
69
69
 
70
- const screeningRooms = await roomRepo.searchScreeningRooms({
70
+ const screeningRooms = await roomRepo.findRooms({
71
71
  project: { id: { $eq: project.id } },
72
72
  containedInPlace: { branchCode: { $eq: movieTheater.branchCode } },
73
73
  branchCode: { $eq: roomCode }
@@ -13,7 +13,7 @@ async function main() {
13
13
  const cursor = eventSeriesRepo.getCursor(
14
14
  {
15
15
  // _id: { $eq: 'al9s38bj6' },
16
- 'project.id': { $ne: 'sskts-development' }
16
+ 'project.id': { $nin: ['sskts-development', 'sskts-test', 'sskts-production'] }
17
17
  },
18
18
  {
19
19
  // _id: 1,
@@ -8,18 +8,15 @@ const project = { id: String(process.env.PROJECT_ID) };
8
8
  async function main() {
9
9
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
10
 
11
- const entranceGateRepo = await chevre.repository.place.EntranceGate.createInstance(
12
- mongoose.connection,
13
- { id: '5bfb841d5a78d7948369979a' }
14
- );
11
+ const roomRepo = await chevre.repository.place.ScreeningRoom.createInstance(mongoose.connection);
15
12
 
16
- const entranceGates = await entranceGateRepo.findEntranceGates({
13
+ const rooms = await roomRepo.findRooms({
17
14
  limit: 20,
18
15
  page: 1,
19
16
  project: { id: { $eq: project.id } }
20
17
  });
21
- console.log(entranceGates);
22
- console.log(entranceGates.length);
18
+ console.log(rooms);
19
+ console.log(rooms.length);
23
20
  }
24
21
 
25
22
  main()
@@ -15,6 +15,7 @@ async function main() {
15
15
  chevre.factory.role.organizationRole.RoleName.TicketClerk
16
16
  ];
17
17
  const permissions = [
18
+ 'admin.sellers.entranceGates.read',
18
19
  'admin.sellers.movieTheaters.read'
19
20
  ];
20
21
  for (const roleName of roleNames) {
@@ -15,6 +15,7 @@ async function main() {
15
15
  // chevre.factory.role.organizationRole.RoleName.TicketClerk
16
16
  ];
17
17
  const permissions = [
18
+ 'admin.sellers.entranceGates.*',
18
19
  'admin.sellers.movieTheaters.*'
19
20
  ];
20
21
  for (const roleName of roleNames) {
@@ -1,6 +1,7 @@
1
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, PipelineStage } from 'mongoose';
2
2
  import * as factory from '../../factory';
3
3
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
4
+ type IMatchStage = PipelineStage.Match;
4
5
  interface IUpdateOptions {
5
6
  project: {
6
7
  id: string;
@@ -32,6 +33,7 @@ export declare class ScreeningRoomRepo {
32
33
  private readonly civicStructureModel;
33
34
  private readonly placeModel;
34
35
  constructor(connection: Connection);
36
+ static CREATE_ROOM_MONGO_CONDITIONS(searchConditions: Omit<factory.place.screeningRoom.ISearchConditions, '$projection' | 'limit' | 'page'>): IMatchStage[];
35
37
  saveScreeningRooms4coa(params: IMovieTheaterIncludingScreeningRooms): Promise<void>;
36
38
  createRoom(screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed'>, options: IUpdateOptions): Promise<IUpdateScreeningRoomResult>;
37
39
  updateRoomByBranchCode(screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed'>, $unset: any, options: IUpdateOptions): Promise<IUpdateScreeningRoomResult>;
@@ -59,6 +61,7 @@ export declare class ScreeningRoomRepo {
59
61
  };
60
62
  }): Promise<import("mongodb").DeleteResult>;
61
63
  searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>[]>;
64
+ findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
62
65
  /**
63
66
  * セクションと座席も含めたひとつのルームを取得する
64
67
  */
@@ -33,6 +33,120 @@ class ScreeningRoomRepo {
33
33
  this.civicStructureModel = connection.model(civicStructure_1.modelName, (0, civicStructure_1.createSchema)());
34
34
  this.placeModel = connection.model(place_1.modelName, (0, place_1.createSchema)());
35
35
  }
36
+ // tslint:disable-next-line:max-func-body-length
37
+ static CREATE_ROOM_MONGO_CONDITIONS(searchConditions) {
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
39
+ const matchStages = [{ $match: { typeOf: { $eq: factory.placeType.ScreeningRoom } } }];
40
+ const projectIdEq = (_b = (_a = searchConditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
41
+ if (typeof projectIdEq === 'string') {
42
+ matchStages.push({
43
+ $match: { 'project.id': { $eq: projectIdEq } }
44
+ });
45
+ }
46
+ const parentOrganizationIdEq = (_d = (_c = searchConditions.parentOrganization) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
47
+ if (typeof parentOrganizationIdEq === 'string') {
48
+ matchStages.push({
49
+ $match: { 'parentOrganization.id': { $exists: true, $eq: parentOrganizationIdEq } }
50
+ });
51
+ }
52
+ // 施設ID
53
+ const containedInPlaceIdEq = (_f = (_e = searchConditions.containedInPlace) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.$eq;
54
+ if (typeof containedInPlaceIdEq === 'string') {
55
+ matchStages.push({
56
+ $match: {
57
+ 'containedInPlace.id': {
58
+ $exists: true,
59
+ $eq: containedInPlaceIdEq
60
+ }
61
+ }
62
+ });
63
+ }
64
+ if (searchConditions.containedInPlace !== undefined) {
65
+ // 施設コード
66
+ if (searchConditions.containedInPlace.branchCode !== undefined) {
67
+ if (typeof searchConditions.containedInPlace.branchCode.$eq === 'string') {
68
+ matchStages.push({
69
+ $match: {
70
+ 'containedInPlace.branchCode': {
71
+ $exists: true,
72
+ $eq: searchConditions.containedInPlace.branchCode.$eq
73
+ }
74
+ }
75
+ });
76
+ }
77
+ }
78
+ }
79
+ const branchCodeEq = (_g = searchConditions.branchCode) === null || _g === void 0 ? void 0 : _g.$eq;
80
+ if (typeof branchCodeEq === 'string') {
81
+ matchStages.push({
82
+ $match: {
83
+ branchCode: { $eq: branchCodeEq }
84
+ }
85
+ });
86
+ }
87
+ const branchCodeIn = (_h = searchConditions.branchCode) === null || _h === void 0 ? void 0 : _h.$in;
88
+ if (Array.isArray(branchCodeIn)) {
89
+ matchStages.push({
90
+ $match: {
91
+ branchCode: { $in: branchCodeIn }
92
+ }
93
+ });
94
+ }
95
+ const branchCodeRegex = (_j = searchConditions.branchCode) === null || _j === void 0 ? void 0 : _j.$regex;
96
+ if (typeof branchCodeRegex === 'string') {
97
+ matchStages.push({
98
+ $match: {
99
+ branchCode: {
100
+ $regex: new RegExp(branchCodeRegex)
101
+ }
102
+ }
103
+ });
104
+ }
105
+ const nameCodeRegex = (_k = searchConditions.name) === null || _k === void 0 ? void 0 : _k.$regex;
106
+ if (typeof nameCodeRegex === 'string') {
107
+ matchStages.push({
108
+ $match: {
109
+ $or: [
110
+ {
111
+ 'name.ja': {
112
+ $exists: true,
113
+ $regex: new RegExp(nameCodeRegex)
114
+ }
115
+ },
116
+ {
117
+ 'name.en': {
118
+ $exists: true,
119
+ $regex: new RegExp(nameCodeRegex)
120
+ }
121
+ }
122
+ ]
123
+ }
124
+ });
125
+ }
126
+ const openSeatingAllowed = searchConditions.openSeatingAllowed;
127
+ if (typeof openSeatingAllowed === 'boolean') {
128
+ matchStages.push({
129
+ $match: {
130
+ openSeatingAllowed: {
131
+ $exists: true,
132
+ $eq: openSeatingAllowed
133
+ }
134
+ }
135
+ });
136
+ }
137
+ const additionalPropertyElemMatch = (_l = searchConditions.additionalProperty) === null || _l === void 0 ? void 0 : _l.$elemMatch;
138
+ if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
139
+ matchStages.push({
140
+ $match: {
141
+ additionalProperty: {
142
+ $exists: true,
143
+ $elemMatch: additionalPropertyElemMatch
144
+ }
145
+ }
146
+ });
147
+ }
148
+ return matchStages;
149
+ }
36
150
  saveScreeningRooms4coa(params) {
37
151
  return __awaiter(this, void 0, void 0, function* () {
38
152
  const { containsPlace } = params, movieTheater4update = __rest(params, ["containsPlace"]);
@@ -189,130 +303,19 @@ class ScreeningRoomRepo {
189
303
  .exec();
190
304
  });
191
305
  }
192
- // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
193
306
  searchScreeningRooms(searchConditions) {
194
307
  return __awaiter(this, void 0, void 0, function* () {
195
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
196
- const matchStages = [{ $match: { typeOf: { $eq: factory.placeType.ScreeningRoom } } }];
197
- const projectIdEq = (_b = (_a = searchConditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
198
- if (typeof projectIdEq === 'string') {
199
- matchStages.push({
200
- $match: { 'project.id': { $eq: projectIdEq } }
201
- });
202
- }
203
- const parentOrganizationIdEq = (_d = (_c = searchConditions.parentOrganization) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
204
- if (typeof parentOrganizationIdEq === 'string') {
205
- matchStages.push({
206
- $match: { 'parentOrganization.id': { $exists: true, $eq: parentOrganizationIdEq } }
207
- });
208
- }
209
- // 施設ID
210
- const containedInPlaceIdEq = (_f = (_e = searchConditions.containedInPlace) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.$eq;
211
- if (typeof containedInPlaceIdEq === 'string') {
212
- matchStages.push({
213
- $match: {
214
- 'containedInPlace.id': {
215
- $exists: true,
216
- $eq: containedInPlaceIdEq
217
- }
218
- }
219
- });
220
- }
221
- if (searchConditions.containedInPlace !== undefined) {
222
- // 施設コード
223
- if (searchConditions.containedInPlace.branchCode !== undefined) {
224
- if (typeof searchConditions.containedInPlace.branchCode.$eq === 'string') {
225
- matchStages.push({
226
- $match: {
227
- 'containedInPlace.branchCode': {
228
- $exists: true,
229
- $eq: searchConditions.containedInPlace.branchCode.$eq
230
- }
231
- }
232
- });
233
- }
234
- }
235
- }
236
- const branchCodeEq = (_g = searchConditions.branchCode) === null || _g === void 0 ? void 0 : _g.$eq;
237
- if (typeof branchCodeEq === 'string') {
238
- matchStages.push({
239
- $match: {
240
- branchCode: { $eq: branchCodeEq }
241
- }
242
- });
243
- }
244
- const branchCodeIn = (_h = searchConditions.branchCode) === null || _h === void 0 ? void 0 : _h.$in;
245
- if (Array.isArray(branchCodeIn)) {
246
- matchStages.push({
247
- $match: {
248
- branchCode: { $in: branchCodeIn }
249
- }
250
- });
251
- }
252
- const branchCodeRegex = (_j = searchConditions.branchCode) === null || _j === void 0 ? void 0 : _j.$regex;
253
- if (typeof branchCodeRegex === 'string') {
254
- matchStages.push({
255
- $match: {
256
- branchCode: {
257
- $regex: new RegExp(branchCodeRegex)
258
- }
259
- }
260
- });
261
- }
262
- const nameCodeRegex = (_k = searchConditions.name) === null || _k === void 0 ? void 0 : _k.$regex;
263
- if (typeof nameCodeRegex === 'string') {
264
- matchStages.push({
265
- $match: {
266
- $or: [
267
- {
268
- 'name.ja': {
269
- $exists: true,
270
- $regex: new RegExp(nameCodeRegex)
271
- }
272
- },
273
- {
274
- 'name.en': {
275
- $exists: true,
276
- $regex: new RegExp(nameCodeRegex)
277
- }
278
- }
279
- ]
280
- }
281
- });
282
- }
283
- const openSeatingAllowed = searchConditions.openSeatingAllowed;
284
- if (typeof openSeatingAllowed === 'boolean') {
285
- matchStages.push({
286
- $match: {
287
- openSeatingAllowed: {
288
- $exists: true,
289
- $eq: openSeatingAllowed
290
- }
291
- }
292
- });
293
- }
294
- const additionalPropertyElemMatch = (_l = searchConditions.additionalProperty) === null || _l === void 0 ? void 0 : _l.$elemMatch;
295
- if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
296
- matchStages.push({
297
- $match: {
298
- additionalProperty: {
299
- $exists: true,
300
- $elemMatch: additionalPropertyElemMatch
301
- }
302
- }
303
- });
304
- }
308
+ var _a, _b;
305
309
  const aggregate = this.placeModel.aggregate([
306
310
  { $sort: { branchCode: factory.sortType.Ascending } },
307
- // { $unwind: '$containsPlace' },
308
- ...matchStages,
311
+ ...ScreeningRoomRepo.CREATE_ROOM_MONGO_CONDITIONS(searchConditions),
309
312
  {
310
313
  $project: Object.assign(Object.assign({ _id: 0, typeOf: '$typeOf', branchCode: '$branchCode', name: '$name', address: '$address', containedInPlace: {
311
314
  id: '$containedInPlace.id',
312
315
  typeOf: '$containedInPlace.typeOf',
313
316
  branchCode: '$containedInPlace.branchCode',
314
317
  name: '$containedInPlace.name'
315
- }, openSeatingAllowed: '$openSeatingAllowed', additionalProperty: '$additionalProperty', maximumAttendeeCapacity: '$maximumAttendeeCapacity' }, (((_m = searchConditions.$projection) === null || _m === void 0 ? void 0 : _m.sectionCount) === 1)
318
+ }, openSeatingAllowed: '$openSeatingAllowed', additionalProperty: '$additionalProperty', maximumAttendeeCapacity: '$maximumAttendeeCapacity' }, (((_a = searchConditions.$projection) === null || _a === void 0 ? void 0 : _a.sectionCount) === 1)
316
319
  ? {
317
320
  sectionCount: {
318
321
  $cond: {
@@ -322,7 +325,7 @@ class ScreeningRoomRepo {
322
325
  }
323
326
  }
324
327
  }
325
- : undefined), (((_o = searchConditions.$projection) === null || _o === void 0 ? void 0 : _o.seatCount) === 1)
328
+ : undefined), (((_b = searchConditions.$projection) === null || _b === void 0 ? void 0 : _b.seatCount) === 1)
326
329
  ? {
327
330
  seatCount: {
328
331
  $sum: {
@@ -354,6 +357,34 @@ class ScreeningRoomRepo {
354
357
  .exec();
355
358
  });
356
359
  }
360
+ findRooms(params) {
361
+ return __awaiter(this, void 0, void 0, function* () {
362
+ const aggregate = this.placeModel.aggregate([
363
+ ...ScreeningRoomRepo.CREATE_ROOM_MONGO_CONDITIONS(params),
364
+ {
365
+ $project: {
366
+ _id: 0,
367
+ branchCode: '$branchCode',
368
+ name: '$name',
369
+ address: '$address',
370
+ openSeatingAllowed: '$openSeatingAllowed',
371
+ additionalProperty: '$additionalProperty',
372
+ maximumAttendeeCapacity: '$maximumAttendeeCapacity'
373
+ }
374
+ },
375
+ { $sort: { branchCode: factory.sortType.Ascending } }
376
+ ]);
377
+ const { limit, page } = params;
378
+ if (typeof limit === 'number' && limit > 0) {
379
+ const pageMustBePositive = (typeof page === 'number' && page > 0) ? page : 1;
380
+ aggregate.skip(limit * (pageMustBePositive - 1))
381
+ .limit(limit);
382
+ }
383
+ return aggregate
384
+ .option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
385
+ .exec();
386
+ });
387
+ }
357
388
  /**
358
389
  * セクションと座席も含めたひとつのルームを取得する
359
390
  */
@@ -19,6 +19,6 @@ declare function processUpdateMovieTheater(params: IImportFromCOAParams): (repos
19
19
  id: string;
20
20
  };
21
21
  movieTheater: IMovieTheater;
22
- screeningRooms: Omit<factory.place.screeningRoom.IPlace, "containsPlace" | "parentOrganization">[];
22
+ screeningRooms: Pick<factory.place.screeningRoom.IPlace, "additionalProperty" | "address" | "branchCode" | "name" | "openSeatingAllowed">[];
23
23
  }>;
24
24
  export { processUpdateMovieTheater };
@@ -65,7 +65,7 @@ function processUpdateMovieTheater(params) {
65
65
  if (movieTheater === undefined) {
66
66
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
67
67
  }
68
- screeningRooms = yield repos.screeningRoom.searchScreeningRooms({
68
+ screeningRooms = yield repos.screeningRoom.findRooms({
69
69
  project: { id: { $eq: params.project.id } },
70
70
  containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
71
71
  });
@@ -7,7 +7,7 @@ import * as factory from '../../factory';
7
7
  type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
8
8
  declare function saveScreeningEvents(params: {
9
9
  movieTheater: IMovieTheater;
10
- screeningRooms: Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'maximumAttendeeCapacity'>[];
10
+ screeningRooms: Pick<factory.place.screeningRoom.IPlace, 'branchCode' | 'name' | 'maximumAttendeeCapacity'>[];
11
11
  screeningEventSerieses?: factory.eventSeries.IEvent[];
12
12
  project: {
13
13
  id: string;
@@ -266,7 +266,7 @@ function createScreeningEventFromCOA(params) {
266
266
  name: params.superEvent.name,
267
267
  eventStatus: factory.eventStatusType.EventScheduled,
268
268
  location: {
269
- typeOf: params.screenRoom.typeOf,
269
+ typeOf: factory.placeType.ScreeningRoom,
270
270
  branchCode: params.screenRoom.branchCode,
271
271
  name: params.screenRoom.name
272
272
  },
@@ -1,7 +1,7 @@
1
1
  import type { ICreatingEvent4ttts } from '../../../../repo/event';
2
2
  import type { ICustomerMember } from '../../../../repo/member';
3
3
  import * as factory from '../../../../factory';
4
- declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<factory.place.movieTheater.IPlace, 'id' | 'branchCode' | 'parentOrganization'>, screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>, existingApplicationMembers: {
4
+ declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<factory.place.movieTheater.IPlace, 'id' | 'branchCode' | 'parentOrganization'>, screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'maximumAttendeeCapacity'>, existingApplicationMembers: {
5
5
  member: ICustomerMember;
6
6
  }[], maxValue: number, eventService: Pick<factory.product.IProduct, 'id' | 'name'> & {
7
7
  id: string;
@@ -83,7 +83,7 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
83
83
  }, typeOf: factory.product.ProductType.EventService, availableChannel: {
84
84
  typeOf: 'ServiceChannel',
85
85
  serviceLocation: {
86
- typeOf: screeningRoom.typeOf,
86
+ typeOf: factory.placeType.ScreeningRoom,
87
87
  branchCode: screeningRoom.branchCode,
88
88
  name: screeningRoom.name,
89
89
  containedInPlace: Object.assign({ typeOf: screeningEventSeries.location.typeOf, id: screeningEventSeries.location.id, branchCode: screeningEventSeries.location.branchCode }, (screeningEventSeries.location.name !== undefined)
@@ -104,7 +104,7 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
104
104
  : undefined), (screeningEventSeries.headline !== undefined)
105
105
  ? { headline: screeningEventSeries.headline }
106
106
  : undefined);
107
- const location = Object.assign({ typeOf: screeningRoom.typeOf, branchCode: screeningRoom.branchCode, name: screeningRoom.name }, (screeningRoom.address !== undefined) ? { address: screeningRoom.address } : undefined);
107
+ const location = Object.assign({ typeOf: factory.placeType.ScreeningRoom, branchCode: screeningRoom.branchCode, name: screeningRoom.name }, (screeningRoom.address !== undefined) ? { address: screeningRoom.address } : undefined);
108
108
  return {
109
109
  project: { id: project.id, typeOf: factory.organizationType.Project },
110
110
  typeOf: factory.eventType.ScreeningEvent,
@@ -61,7 +61,7 @@ function schedule2relatedResources(schedule) {
61
61
  if (movieTheater === undefined) {
62
62
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
63
63
  }
64
- const screeningRoom = (yield repos.screeningRoom.searchScreeningRooms({
64
+ const screeningRoom = (yield repos.screeningRoom.findRooms({
65
65
  limit: 1,
66
66
  page: 1,
67
67
  project: { id: { $eq: project.id } },
@@ -433,14 +433,14 @@ function createInformMovieTheaterTasks(params, setting) {
433
433
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
434
434
  }
435
435
  // ルームを検索
436
- const screeningRooms = yield repos.screeningRoom.searchScreeningRooms({
436
+ const screeningRooms = yield repos.screeningRoom.findRooms({
437
437
  containedInPlace: { id: { $eq: movieTheater.id } }
438
438
  });
439
439
  const movieTheaters4inform = [Object.assign(Object.assign({}, movieTheater), { containsPlace: screeningRooms.map((room) => {
440
440
  return {
441
441
  branchCode: room.branchCode,
442
442
  name: room.name,
443
- typeOf: room.typeOf,
443
+ typeOf: factory.placeType.ScreeningRoom,
444
444
  additionalProperty: room.additionalProperty,
445
445
  address: room.address
446
446
  };
@@ -216,7 +216,7 @@ function syncEvents(params) {
216
216
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
217
217
  }
218
218
  // console.log('movieTheater:', movieTheater);
219
- const screeningRoom = (yield repos.screeningRoom.searchScreeningRooms({
219
+ const screeningRoom = (yield repos.screeningRoom.findRooms({
220
220
  project: { id: { $eq: params.project.id } },
221
221
  containedInPlace: { branchCode: { $eq: movieTheater.branchCode } },
222
222
  branchCode: { $eq: roomCode }
package/package.json CHANGED
@@ -116,5 +116,5 @@
116
116
  "postversion": "git push origin --tags",
117
117
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
118
118
  },
119
- "version": "23.2.0-alpha.16"
119
+ "version": "23.2.0-alpha.17"
120
120
  }
@@ -1,60 +0,0 @@
1
- /**
2
- * マスターデータ同期サービス
3
- */
4
- import type * as COA from '@motionpicture/coa-service';
5
- import type { ActionRepo } from '../repo/action';
6
- import type { CategoryCodeRepo } from '../repo/categoryCode';
7
- import type { CreativeWorkRepo } from '../repo/creativeWork';
8
- import type { EventRepo } from '../repo/event';
9
- import type { EventSeriesRepo } from '../repo/eventSeries';
10
- import type { MovieTheaterRepo } from '../repo/place/movieTheater';
11
- import type { ScreeningRoomRepo } from '../repo/place/screeningRoom';
12
- import type { SellerRepo } from '../repo/seller';
13
- import * as factory from '../factory';
14
- interface IImportFromCOAParams {
15
- project: {
16
- id: string;
17
- typeOf: factory.organizationType.Project;
18
- };
19
- /**
20
- * 施設コード
21
- */
22
- locationBranchCode: string;
23
- importFrom: Date;
24
- importThrough: Date;
25
- /**
26
- * 施設を保管するかどうか
27
- */
28
- saveMovieTheater: boolean;
29
- /**
30
- * 施設コンテンツを保管するかどうか
31
- */
32
- saveScreeningEventSeries: boolean;
33
- saveScreeningEventSeriesPeriodInMonth: number;
34
- }
35
- /**
36
- * イベントをインポートする
37
- */
38
- declare function importFromCOA(params: IImportFromCOAParams): (repos: {
39
- action: ActionRepo;
40
- categoryCode: CategoryCodeRepo;
41
- creativeWork: CreativeWorkRepo;
42
- event: EventRepo;
43
- eventSeries: EventSeriesRepo;
44
- movieTheater: MovieTheaterRepo;
45
- screeningRoom: ScreeningRoomRepo;
46
- seller: SellerRepo;
47
- masterService: COA.service.Master;
48
- }) => Promise<void>;
49
- /**
50
- * COA情報からイベントIDを作成する
51
- */
52
- declare function createScreeningEventIdFromCOA(params: {
53
- theaterCode: string;
54
- titleCode: string;
55
- titleBranchNum: string;
56
- dateJouei: string;
57
- screenCode: string;
58
- timeBegin: string;
59
- }): string;
60
- export { importFromCOA, createScreeningEventIdFromCOA };