@chevre/domain 21.4.0-alpha.12 → 21.4.0-alpha.13

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.
@@ -53,6 +53,9 @@ export declare class MongoRepository {
53
53
  containedInPlace: {
54
54
  branchCode: string;
55
55
  };
56
+ parentOrganization?: {
57
+ id?: string;
58
+ };
56
59
  }): Promise<{
57
60
  containedInPlace: {
58
61
  /**
@@ -66,6 +69,9 @@ export declare class MongoRepository {
66
69
  containedInPlace: {
67
70
  branchCode: string;
68
71
  };
72
+ parentOrganization?: {
73
+ id?: string;
74
+ };
69
75
  }, $unset: any): Promise<{
70
76
  containedInPlace: {
71
77
  /**
@@ -98,6 +104,9 @@ export declare class MongoRepository {
98
104
  project: {
99
105
  id: string;
100
106
  };
107
+ parentOrganization?: {
108
+ id?: string;
109
+ };
101
110
  /**
102
111
  * ルームコード
103
112
  */
@@ -128,7 +137,11 @@ export declare class MongoRepository {
128
137
  id: string;
129
138
  };
130
139
  }): Promise<void>;
131
- createScreeningRoomSection(screeningRoomSection: IScreeningRoomSectionWithoutContainsPlace): Promise<{
140
+ createScreeningRoomSection(screeningRoomSection: IScreeningRoomSectionWithoutContainsPlace & {
141
+ parentOrganization?: {
142
+ id?: string;
143
+ };
144
+ }): Promise<{
132
145
  containedInPlace: {
133
146
  /**
134
147
  * 施設ID
@@ -144,6 +157,9 @@ export declare class MongoRepository {
144
157
  branchCode: string;
145
158
  };
146
159
  };
160
+ parentOrganization?: {
161
+ id?: string;
162
+ };
147
163
  }, $unset: any): Promise<{
148
164
  containedInPlace: {
149
165
  /**
@@ -162,6 +178,9 @@ export declare class MongoRepository {
162
178
  project: {
163
179
  id: string;
164
180
  };
181
+ parentOrganization?: {
182
+ id?: string;
183
+ };
165
184
  /**
166
185
  * セクションコード
167
186
  */
@@ -201,7 +220,11 @@ export declare class MongoRepository {
201
220
  };
202
221
  };
203
222
  }): Promise<IScreeningRoomFoundByBranchCode>;
204
- createSeat(seat: factory.place.seat.IPlace): Promise<{
223
+ createSeat(seat: factory.place.seat.IPlace & {
224
+ parentOrganization?: {
225
+ id?: string;
226
+ };
227
+ }): Promise<{
205
228
  containedInPlace: {
206
229
  /**
207
230
  * 施設ID
@@ -220,6 +243,9 @@ export declare class MongoRepository {
220
243
  };
221
244
  };
222
245
  };
246
+ parentOrganization?: {
247
+ id?: string;
248
+ };
223
249
  }, $unset: any): Promise<{
224
250
  containedInPlace: {
225
251
  /**
@@ -234,6 +260,9 @@ export declare class MongoRepository {
234
260
  project: {
235
261
  id: string;
236
262
  };
263
+ parentOrganization?: {
264
+ id?: string;
265
+ };
237
266
  /**
238
267
  * 座席コード
239
268
  */
@@ -354,13 +354,12 @@ class MongoRepository {
354
354
  });
355
355
  }
356
356
  createScreeningRoom(screeningRoom) {
357
+ var _a;
357
358
  return __awaiter(this, void 0, void 0, function* () {
358
359
  // 施設存在確認
359
- const movieTheaterDoc = yield this.placeModel.findOne({
360
- typeOf: { $eq: factory.placeType.MovieTheater },
361
- 'project.id': { $eq: screeningRoom.project.id },
362
- branchCode: { $eq: screeningRoom.containedInPlace.branchCode }
363
- }, { _id: 1, typeOf: 1, branchCode: 1, name: 1, parentOrganization: 1 })
360
+ const movieTheaterDoc = yield this.placeModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq: screeningRoom.project.id }, branchCode: { $eq: screeningRoom.containedInPlace.branchCode } }, (typeof ((_a = screeningRoom.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
361
+ ? { 'parentOrganization.id': { $exists: true, $eq: screeningRoom.parentOrganization.id } }
362
+ : undefined), { _id: 1, typeOf: 1, branchCode: 1, name: 1, parentOrganization: 1 })
364
363
  .exec();
365
364
  if (movieTheaterDoc === null) {
366
365
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
@@ -396,13 +395,11 @@ class MongoRepository {
396
395
  });
397
396
  }
398
397
  updateScreeningRoom(screeningRoom, $unset) {
398
+ var _a;
399
399
  return __awaiter(this, void 0, void 0, function* () {
400
- const doc = yield this.placeModel.findOneAndUpdate({
401
- typeOf: { $eq: factory.placeType.ScreeningRoom },
402
- 'project.id': { $eq: screeningRoom.project.id },
403
- 'containedInPlace.branchCode': { $exists: true, $eq: screeningRoom.containedInPlace.branchCode },
404
- branchCode: screeningRoom.branchCode
405
- }, Object.assign(Object.assign(Object.assign(Object.assign({ name: screeningRoom.name }, (screeningRoom.address !== undefined && screeningRoom.address !== null)
400
+ const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: screeningRoom.project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: screeningRoom.containedInPlace.branchCode }, branchCode: screeningRoom.branchCode }, (typeof ((_a = screeningRoom.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
401
+ ? { 'parentOrganization.id': { $exists: true, $eq: screeningRoom.parentOrganization.id } }
402
+ : undefined), Object.assign(Object.assign(Object.assign(Object.assign({ name: screeningRoom.name }, (screeningRoom.address !== undefined && screeningRoom.address !== null)
406
403
  ? { address: screeningRoom.address }
407
404
  : undefined), (typeof screeningRoom.openSeatingAllowed === 'boolean')
408
405
  ? { openSeatingAllowed: screeningRoom.openSeatingAllowed }
@@ -462,13 +459,11 @@ class MongoRepository {
462
459
  });
463
460
  }
464
461
  deleteScreeningRoom(screeningRoom) {
462
+ var _a;
465
463
  return __awaiter(this, void 0, void 0, function* () {
466
- const doc = yield this.placeModel.findOneAndDelete({
467
- typeOf: { $eq: factory.placeType.ScreeningRoom },
468
- 'project.id': { $eq: screeningRoom.project.id },
469
- 'containedInPlace.branchCode': { $exists: true, $eq: screeningRoom.containedInPlace.branchCode },
470
- branchCode: screeningRoom.branchCode
471
- }, {
464
+ const doc = yield this.placeModel.findOneAndDelete(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: screeningRoom.project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: screeningRoom.containedInPlace.branchCode }, branchCode: screeningRoom.branchCode }, (typeof ((_a = screeningRoom.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
465
+ ? { 'parentOrganization.id': { $exists: true, $eq: screeningRoom.parentOrganization.id } }
466
+ : undefined), {
472
467
  projection: { 'containedInPlace.id': 1, typeOf: 1 }
473
468
  })
474
469
  .exec();
@@ -490,6 +485,7 @@ class MongoRepository {
490
485
  }
491
486
  // tslint:disable-next-line:max-func-body-length
492
487
  createScreeningRoomSection(screeningRoomSection) {
488
+ var _a;
493
489
  return __awaiter(this, void 0, void 0, function* () {
494
490
  const screeningRoom = screeningRoomSection.containedInPlace;
495
491
  if (typeof (screeningRoom === null || screeningRoom === void 0 ? void 0 : screeningRoom.branchCode) !== 'string') {
@@ -500,11 +496,9 @@ class MongoRepository {
500
496
  throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode');
501
497
  }
502
498
  // 施設存在確認
503
- let doc = yield this.placeModel.findOne({
504
- typeOf: { $eq: factory.placeType.MovieTheater },
505
- 'project.id': { $eq: screeningRoomSection.project.id },
506
- branchCode: { $eq: movieTheater.branchCode }
507
- }, { _id: 1 })
499
+ let doc = yield this.placeModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq: screeningRoomSection.project.id }, branchCode: { $eq: movieTheater.branchCode } }, (typeof ((_a = screeningRoomSection.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
500
+ ? { 'parentOrganization.id': { $exists: true, $eq: screeningRoomSection.parentOrganization.id } }
501
+ : undefined), { _id: 1 })
508
502
  .exec();
509
503
  if (doc === null) {
510
504
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
@@ -536,6 +530,7 @@ class MongoRepository {
536
530
  }
537
531
  // tslint:disable-next-line:max-func-body-length
538
532
  updateScreeningRoomSection(screeningRoomSection, $unset) {
533
+ var _a;
539
534
  return __awaiter(this, void 0, void 0, function* () {
540
535
  const screeningRoom = screeningRoomSection.containedInPlace;
541
536
  if (typeof (screeningRoom === null || screeningRoom === void 0 ? void 0 : screeningRoom.branchCode) !== 'string') {
@@ -545,13 +540,9 @@ class MongoRepository {
545
540
  if (typeof (movieTheater === null || movieTheater === void 0 ? void 0 : movieTheater.branchCode) !== 'string') {
546
541
  throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode');
547
542
  }
548
- const doc = yield this.placeModel.findOneAndUpdate({
549
- typeOf: { $eq: factory.placeType.ScreeningRoom },
550
- 'project.id': { $eq: screeningRoomSection.project.id },
551
- 'containedInPlace.branchCode': { $exists: true, $eq: movieTheater.branchCode },
552
- branchCode: { $eq: screeningRoom.branchCode },
553
- 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode }
554
- }, Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].branchCode': screeningRoomSection.branchCode }, (screeningRoomSection.name !== undefined && screeningRoomSection !== null)
543
+ const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: screeningRoomSection.project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: movieTheater.branchCode }, branchCode: { $eq: screeningRoom.branchCode }, 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode } }, (typeof ((_a = screeningRoomSection.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
544
+ ? { 'parentOrganization.id': { $exists: true, $eq: screeningRoomSection.parentOrganization.id } }
545
+ : undefined), Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].branchCode': screeningRoomSection.branchCode }, (screeningRoomSection.name !== undefined && screeningRoomSection !== null)
555
546
  ? {
556
547
  'containsPlace.$[screeningRoomSection].name': screeningRoomSection.name
557
548
  }
@@ -712,17 +703,14 @@ class MongoRepository {
712
703
  });
713
704
  }
714
705
  deleteScreeningRoomSection(screeningRoomSection) {
706
+ var _a;
715
707
  return __awaiter(this, void 0, void 0, function* () {
716
- const doc = yield this.placeModel.findOneAndUpdate({
717
- typeOf: { $eq: factory.placeType.ScreeningRoom },
718
- 'project.id': { $eq: screeningRoomSection.project.id },
719
- 'containedInPlace.branchCode': {
708
+ const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: screeningRoomSection.project.id }, 'containedInPlace.branchCode': {
720
709
  $exists: true,
721
710
  $eq: screeningRoomSection.containedInPlace.containedInPlace.branchCode
722
- },
723
- branchCode: { $eq: screeningRoomSection.containedInPlace.branchCode },
724
- 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode }
725
- }, {
711
+ }, branchCode: { $eq: screeningRoomSection.containedInPlace.branchCode }, 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode } }, (typeof ((_a = screeningRoomSection.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
712
+ ? { 'parentOrganization.id': { $exists: true, $eq: screeningRoomSection.parentOrganization.id } }
713
+ : undefined), {
726
714
  $pull: {
727
715
  containsPlace: {
728
716
  branchCode: screeningRoomSection.branchCode
@@ -947,7 +935,7 @@ class MongoRepository {
947
935
  }
948
936
  // tslint:disable-next-line:max-func-body-length
949
937
  createSeat(seat) {
950
- var _a, _b;
938
+ var _a, _b, _c;
951
939
  return __awaiter(this, void 0, void 0, function* () {
952
940
  const screeningRoomSection = seat.containedInPlace;
953
941
  if (typeof (screeningRoomSection === null || screeningRoomSection === void 0 ? void 0 : screeningRoomSection.branchCode) !== 'string') {
@@ -962,11 +950,9 @@ class MongoRepository {
962
950
  throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.containedInPlace.branchCode');
963
951
  }
964
952
  // 施設存在確認
965
- let doc = yield this.placeModel.findOne({
966
- typeOf: { $eq: factory.placeType.MovieTheater },
967
- 'project.id': { $eq: seat.project.id },
968
- branchCode: { $eq: movieTheater.branchCode }
969
- }, { _id: 1 })
953
+ let doc = yield this.placeModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq: seat.project.id }, branchCode: { $eq: movieTheater.branchCode } }, (typeof ((_a = seat.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
954
+ ? { 'parentOrganization.id': { $exists: true, $eq: seat.parentOrganization.id } }
955
+ : undefined), { _id: 1 })
970
956
  .exec();
971
957
  if (doc === null) {
972
958
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
@@ -979,7 +965,7 @@ class MongoRepository {
979
965
  'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode }
980
966
  }, {
981
967
  $push: {
982
- 'containsPlace.$[screeningRoomSection].containsPlace': Object.assign(Object.assign({ typeOf: seat.typeOf, branchCode: seat.branchCode, additionalProperty: seat.additionalProperty }, (typeof ((_a = seat.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string' || typeof ((_b = seat.name) === null || _b === void 0 ? void 0 : _b.en) === 'string') ? { name: seat.name } : undefined), (Array.isArray(seat.seatingType)) ? { seatingType: seat.seatingType } : undefined)
968
+ 'containsPlace.$[screeningRoomSection].containsPlace': Object.assign(Object.assign({ typeOf: seat.typeOf, branchCode: seat.branchCode, additionalProperty: seat.additionalProperty }, (typeof ((_b = seat.name) === null || _b === void 0 ? void 0 : _b.ja) === 'string' || typeof ((_c = seat.name) === null || _c === void 0 ? void 0 : _c.en) === 'string') ? { name: seat.name } : undefined), (Array.isArray(seat.seatingType)) ? { seatingType: seat.seatingType } : undefined)
983
969
  }
984
970
  }, {
985
971
  new: true,
@@ -1001,7 +987,7 @@ class MongoRepository {
1001
987
  }
1002
988
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
1003
989
  updateSeat(seat, $unset) {
1004
- var _a, _b;
990
+ var _a, _b, _c;
1005
991
  return __awaiter(this, void 0, void 0, function* () {
1006
992
  const screeningRoomSection = seat.containedInPlace;
1007
993
  if (typeof (screeningRoomSection === null || screeningRoomSection === void 0 ? void 0 : screeningRoomSection.branchCode) !== 'string') {
@@ -1015,14 +1001,9 @@ class MongoRepository {
1015
1001
  if (typeof (movieTheater === null || movieTheater === void 0 ? void 0 : movieTheater.branchCode) !== 'string') {
1016
1002
  throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.containedInPlace.branchCode');
1017
1003
  }
1018
- const doc = yield this.placeModel.findOneAndUpdate({
1019
- typeOf: { $eq: factory.placeType.ScreeningRoom },
1020
- 'project.id': { $eq: seat.project.id },
1021
- 'containedInPlace.branchCode': { $exists: true, $eq: movieTheater.branchCode },
1022
- branchCode: { $eq: screeningRoom.branchCode },
1023
- 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode },
1024
- 'containsPlace.containsPlace.branchCode': { $eq: seat.branchCode }
1025
- }, Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].branchCode': seat.branchCode }, (typeof ((_a = seat.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string' || typeof ((_b = seat.name) === null || _b === void 0 ? void 0 : _b.en) === 'string')
1004
+ const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: seat.project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: movieTheater.branchCode }, branchCode: { $eq: screeningRoom.branchCode }, 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode }, 'containsPlace.containsPlace.branchCode': { $eq: seat.branchCode } }, (typeof ((_a = seat.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
1005
+ ? { 'parentOrganization.id': { $exists: true, $eq: seat.parentOrganization.id } }
1006
+ : undefined), Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].branchCode': seat.branchCode }, (typeof ((_b = seat.name) === null || _b === void 0 ? void 0 : _b.ja) === 'string' || typeof ((_c = seat.name) === null || _c === void 0 ? void 0 : _c.en) === 'string')
1026
1007
  ? {
1027
1008
  'containsPlace.$[screeningRoomSection].containsPlace.$[seat].name': seat.name
1028
1009
  }
@@ -1252,18 +1233,14 @@ class MongoRepository {
1252
1233
  });
1253
1234
  }
1254
1235
  deleteSeat(seat) {
1236
+ var _a;
1255
1237
  return __awaiter(this, void 0, void 0, function* () {
1256
- const doc = yield this.placeModel.findOneAndUpdate({
1257
- typeOf: { $eq: factory.placeType.ScreeningRoom },
1258
- 'project.id': { $eq: seat.project.id },
1259
- 'containedInPlace.branchCode': {
1238
+ const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: seat.project.id }, 'containedInPlace.branchCode': {
1260
1239
  $exists: true,
1261
1240
  $eq: seat.containedInPlace.containedInPlace.containedInPlace.branchCode
1262
- },
1263
- branchCode: { $eq: seat.containedInPlace.containedInPlace.branchCode },
1264
- 'containsPlace.branchCode': { $eq: seat.containedInPlace.branchCode },
1265
- 'containsPlace.containsPlace.branchCode': { $eq: seat.branchCode }
1266
- }, {
1241
+ }, branchCode: { $eq: seat.containedInPlace.containedInPlace.branchCode }, 'containsPlace.branchCode': { $eq: seat.containedInPlace.branchCode }, 'containsPlace.containsPlace.branchCode': { $eq: seat.branchCode } }, (typeof ((_a = seat.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
1242
+ ? { 'parentOrganization.id': { $exists: true, $eq: seat.parentOrganization.id } }
1243
+ : undefined), {
1267
1244
  $pull: {
1268
1245
  'containsPlace.$[screeningRoomSection].containsPlace': {
1269
1246
  branchCode: seat.branchCode
package/package.json CHANGED
@@ -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.4.0-alpha.12"
120
+ "version": "21.4.0-alpha.13"
121
121
  }