@chevre/domain 20.2.0-alpha.10 → 20.2.0-alpha.11

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.
@@ -21,7 +21,8 @@ async function main() {
21
21
  typeOf: { $eq: chevre.factory.eventType.ScreeningEvent },
22
22
  startDate: {
23
23
  $gte: moment()
24
- .add(-1, 'month')
24
+ // tslint:disable-next-line:no-magic-numbers
25
+ .add(-6, 'months')
25
26
  .toDate()
26
27
  }
27
28
  // _id: { $eq: 'al6aff83w' }
@@ -7,6 +7,7 @@ declare type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.scre
7
7
  export declare class MongoRepository {
8
8
  private readonly placeModel;
9
9
  constructor(connection: Connection);
10
+ static CREATE_BUS_STOP_MONGO_CONDITIONS(params: factory.place.busStop.ISearchConditions): any[];
10
11
  static CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params: factory.place.movieTheater.ISearchConditions): any[];
11
12
  /**
12
13
  * 施設を保管する
@@ -19,7 +20,6 @@ export declare class MongoRepository {
19
20
  };
20
21
  branchCode: string;
21
22
  }): Promise<factory.place.movieTheater.IPlace>;
22
- countMovieTheaters(params: factory.place.movieTheater.ISearchConditions): Promise<number>;
23
23
  /**
24
24
  * 施設検索
25
25
  */
@@ -114,6 +114,20 @@ export declare class MongoRepository {
114
114
  id: string;
115
115
  };
116
116
  }): Promise<void>;
117
+ saveBusStop(params: factory.place.busStop.IPlace): Promise<factory.place.busStop.IPlace>;
118
+ findBusStopByBranchCode(params: {
119
+ project: {
120
+ id: string;
121
+ };
122
+ branchCode: string;
123
+ }): Promise<factory.place.movieTheater.IPlace>;
124
+ searchBusStops(params: factory.place.busStop.ISearchConditions): Promise<factory.place.busStop.IPlace[]>;
125
+ findBusStopById(params: {
126
+ id: string;
127
+ }, projection?: any): Promise<factory.place.busStop.IPlace>;
128
+ deleteBusStopById(params: {
129
+ id: string;
130
+ }): Promise<void>;
117
131
  getCursor(conditions: any, projection: any): import("mongoose").QueryCursor<any>;
118
132
  }
119
133
  export {};
@@ -32,6 +32,82 @@ class MongoRepository {
32
32
  this.placeModel = connection.model(place_1.modelName);
33
33
  }
34
34
  // tslint:disable-next-line:max-func-body-length
35
+ static CREATE_BUS_STOP_MONGO_CONDITIONS(params) {
36
+ var _a, _b, _c, _d, _e, _f, _g, _h;
37
+ const andConditions = [{ typeOf: { $eq: factory.placeType.BusStop } }];
38
+ const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
39
+ if (typeof projectIdEq === 'string') {
40
+ andConditions.push({ 'project.id': { $eq: projectIdEq } });
41
+ }
42
+ const branchCodeEq = (_c = params.branchCode) === null || _c === void 0 ? void 0 : _c.$eq;
43
+ if (typeof branchCodeEq === 'string') {
44
+ andConditions.push({
45
+ branchCode: {
46
+ $exists: true,
47
+ $eq: branchCodeEq
48
+ }
49
+ });
50
+ }
51
+ const branchCodeRegex = (_d = params.branchCode) === null || _d === void 0 ? void 0 : _d.$regex;
52
+ if (typeof branchCodeRegex === 'string' && branchCodeRegex.length > 0) {
53
+ andConditions.push({
54
+ branchCode: {
55
+ $exists: true,
56
+ $regex: new RegExp(branchCodeRegex)
57
+ }
58
+ });
59
+ }
60
+ const branchCodeIn = (_e = params.branchCode) === null || _e === void 0 ? void 0 : _e.$in;
61
+ if (Array.isArray(branchCodeIn)) {
62
+ andConditions.push({
63
+ branchCode: {
64
+ $exists: true,
65
+ $in: branchCodeIn
66
+ }
67
+ });
68
+ }
69
+ // tslint:disable-next-line:no-single-line-block-comment
70
+ /* istanbul ignore else */
71
+ const idEq = (_f = params.id) === null || _f === void 0 ? void 0 : _f.$eq;
72
+ if (typeof idEq === 'string') {
73
+ andConditions.push({
74
+ _id: {
75
+ $eq: idEq
76
+ }
77
+ });
78
+ }
79
+ const idIn = (_g = params.id) === null || _g === void 0 ? void 0 : _g.$in;
80
+ if (Array.isArray(idIn)) {
81
+ andConditions.push({
82
+ _id: {
83
+ $in: idIn
84
+ }
85
+ });
86
+ }
87
+ const nameRegex = (_h = params.name) === null || _h === void 0 ? void 0 : _h.$regex;
88
+ // tslint:disable-next-line:no-single-line-block-comment
89
+ /* istanbul ignore else */
90
+ if (typeof nameRegex === 'string' && nameRegex.length > 0) {
91
+ andConditions.push({
92
+ $or: [
93
+ {
94
+ 'name.ja': {
95
+ $exists: true,
96
+ $regex: new RegExp(nameRegex)
97
+ }
98
+ },
99
+ {
100
+ 'name.en': {
101
+ $exists: true,
102
+ $regex: new RegExp(nameRegex)
103
+ }
104
+ }
105
+ ]
106
+ });
107
+ }
108
+ return andConditions;
109
+ }
110
+ // tslint:disable-next-line:max-func-body-length
35
111
  static CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params) {
36
112
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
37
113
  // MongoDB検索条件
@@ -171,6 +247,7 @@ class MongoRepository {
171
247
  findMovieTheaterByBranchCode(params) {
172
248
  return __awaiter(this, void 0, void 0, function* () {
173
249
  return this.placeModel.findOne({
250
+ typeOf: { $eq: factory.placeType.MovieTheater },
174
251
  'project.id': { $eq: params.project.id },
175
252
  branchCode: { $eq: params.branchCode }
176
253
  })
@@ -183,14 +260,12 @@ class MongoRepository {
183
260
  });
184
261
  });
185
262
  }
186
- countMovieTheaters(params) {
187
- return __awaiter(this, void 0, void 0, function* () {
188
- const conditions = MongoRepository.CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params);
189
- return this.placeModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
190
- .setOptions({ maxTimeMS: 10000 })
191
- .exec();
192
- });
193
- }
263
+ // public async countMovieTheaters(params: factory.place.movieTheater.ISearchConditions): Promise<number> {
264
+ // const conditions = MongoRepository.CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params);
265
+ // return this.placeModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
266
+ // .setOptions({ maxTimeMS: 10000 })
267
+ // .exec();
268
+ // }
194
269
  /**
195
270
  * 施設検索
196
271
  */
@@ -224,7 +299,10 @@ class MongoRepository {
224
299
  */
225
300
  findById(params, projection) {
226
301
  return __awaiter(this, void 0, void 0, function* () {
227
- const doc = yield this.placeModel.findOne({ _id: params.id }, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection))
302
+ const doc = yield this.placeModel.findOne({
303
+ typeOf: { $eq: factory.placeType.MovieTheater },
304
+ _id: { $eq: params.id }
305
+ }, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection))
228
306
  .exec();
229
307
  if (doc === null) {
230
308
  throw new factory.errors.NotFound(this.placeModel.modelName);
@@ -235,7 +313,8 @@ class MongoRepository {
235
313
  deleteMovieTheaterById(params) {
236
314
  return __awaiter(this, void 0, void 0, function* () {
237
315
  yield this.placeModel.findOneAndDelete({
238
- _id: params.id
316
+ typeOf: { $eq: factory.placeType.MovieTheater },
317
+ _id: { $eq: params.id }
239
318
  })
240
319
  .exec()
241
320
  .then((doc) => {
@@ -1066,6 +1145,92 @@ class MongoRepository {
1066
1145
  .exec();
1067
1146
  });
1068
1147
  }
1148
+ saveBusStop(params) {
1149
+ return __awaiter(this, void 0, void 0, function* () {
1150
+ let doc;
1151
+ if (typeof params.id !== 'string' || params.id.length === 0) {
1152
+ doc = yield this.placeModel.create(params);
1153
+ }
1154
+ else {
1155
+ // 上書き禁止属性を除外(2022-08-24~)
1156
+ const { id, branchCode, project, typeOf } = params, updateFields = __rest(params, ["id", "branchCode", "project", "typeOf"]);
1157
+ doc = yield this.placeModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
1158
+ .exec();
1159
+ }
1160
+ if (doc === null) {
1161
+ throw new factory.errors.NotFound(this.placeModel.modelName);
1162
+ }
1163
+ return doc.toObject();
1164
+ });
1165
+ }
1166
+ findBusStopByBranchCode(params) {
1167
+ return __awaiter(this, void 0, void 0, function* () {
1168
+ return this.placeModel.findOne({
1169
+ typeOf: { $eq: factory.placeType.BusStop },
1170
+ 'project.id': { $eq: params.project.id },
1171
+ branchCode: { $eq: params.branchCode }
1172
+ })
1173
+ .exec()
1174
+ .then((doc) => {
1175
+ if (doc === null) {
1176
+ throw new factory.errors.NotFound(`${factory.placeType.BusStop} ${params.branchCode}`);
1177
+ }
1178
+ return doc.toObject();
1179
+ });
1180
+ });
1181
+ }
1182
+ searchBusStops(params) {
1183
+ return __awaiter(this, void 0, void 0, function* () {
1184
+ const conditions = MongoRepository.CREATE_BUS_STOP_MONGO_CONDITIONS(params);
1185
+ // containsPlaceを含めるとデータサイズが大きくなるので、検索結果には含めない
1186
+ const query = this.placeModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
1187
+ __v: 0,
1188
+ createdAt: 0,
1189
+ updatedAt: 0,
1190
+ containsPlace: 0
1191
+ });
1192
+ if (typeof params.limit === 'number') {
1193
+ const page = (typeof params.page === 'number') ? params.page : 1;
1194
+ query.limit(params.limit)
1195
+ .skip(params.limit * (page - 1));
1196
+ }
1197
+ // tslint:disable-next-line:no-single-line-block-comment
1198
+ /* istanbul ignore else */
1199
+ if (params.sort !== undefined) {
1200
+ query.sort(params.sort);
1201
+ }
1202
+ return query.setOptions({ maxTimeMS: 10000 })
1203
+ .exec()
1204
+ .then((docs) => docs.map((doc) => doc.toObject()));
1205
+ });
1206
+ }
1207
+ findBusStopById(params, projection) {
1208
+ return __awaiter(this, void 0, void 0, function* () {
1209
+ const doc = yield this.placeModel.findOne({
1210
+ typeOf: { $eq: factory.placeType.BusStop },
1211
+ _id: { $eq: params.id }
1212
+ }, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection))
1213
+ .exec();
1214
+ if (doc === null) {
1215
+ throw new factory.errors.NotFound(this.placeModel.modelName);
1216
+ }
1217
+ return doc.toObject();
1218
+ });
1219
+ }
1220
+ deleteBusStopById(params) {
1221
+ return __awaiter(this, void 0, void 0, function* () {
1222
+ yield this.placeModel.findOneAndDelete({
1223
+ typeOf: { $eq: factory.placeType.BusStop },
1224
+ _id: { $eq: params.id }
1225
+ })
1226
+ .exec()
1227
+ .then((doc) => {
1228
+ if (doc === null) {
1229
+ throw new factory.errors.NotFound(this.placeModel.modelName);
1230
+ }
1231
+ });
1232
+ });
1233
+ }
1069
1234
  getCursor(conditions, projection) {
1070
1235
  return this.placeModel.find(conditions, projection)
1071
1236
  .sort({ branchCode: factory.sortType.Ascending })
@@ -21,7 +21,7 @@ class MongoRepository {
21
21
  }
22
22
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
23
23
  static CREATE_MONGO_CONDITIONS(params) {
24
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
25
25
  // MongoDB検索条件
26
26
  const andConditions = [
27
27
  { typeOf: params.typeOf }
@@ -242,7 +242,7 @@ class MongoRepository {
242
242
  }
243
243
  });
244
244
  }
245
- const reservationForIdEq = (_j = params.reservationFor) === null || _j === void 0 ? void 0 : _j.id;
245
+ const reservationForIdEq = (_k = (_j = params.reservationFor) === null || _j === void 0 ? void 0 : _j.id) === null || _k === void 0 ? void 0 : _k.$eq;
246
246
  if (typeof reservationForIdEq === 'string') {
247
247
  andConditions.push({
248
248
  'reservationFor.id': {
@@ -251,7 +251,7 @@ class MongoRepository {
251
251
  }
252
252
  });
253
253
  }
254
- const reservationForIdIn = (_k = params.reservationFor) === null || _k === void 0 ? void 0 : _k.ids;
254
+ const reservationForIdIn = (_m = (_l = params.reservationFor) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$in;
255
255
  if (Array.isArray(reservationForIdIn)) {
256
256
  andConditions.push({
257
257
  'reservationFor.id': {
@@ -262,6 +262,25 @@ class MongoRepository {
262
262
  }
263
263
  break;
264
264
  case factory.reservationType.EventReservation:
265
+ if (typeof ((_o = params.reservationFor) === null || _o === void 0 ? void 0 : _o.id) === 'string') {
266
+ andConditions.push({
267
+ 'reservationFor.id': {
268
+ $exists: true,
269
+ $eq: params.reservationFor.id
270
+ }
271
+ });
272
+ }
273
+ else {
274
+ const reservationForIdEq4eventReservation = (_q = (_p = params.reservationFor) === null || _p === void 0 ? void 0 : _p.id) === null || _q === void 0 ? void 0 : _q.$eq;
275
+ if (typeof reservationForIdEq4eventReservation === 'string') {
276
+ andConditions.push({
277
+ 'reservationFor.id': {
278
+ $exists: true,
279
+ $eq: reservationForIdEq4eventReservation
280
+ }
281
+ });
282
+ }
283
+ }
265
284
  // tslint:disable-next-line:no-single-line-block-comment
266
285
  /* istanbul ignore else */
267
286
  if (params.reservationFor !== undefined) {
@@ -277,16 +296,6 @@ class MongoRepository {
277
296
  }
278
297
  // tslint:disable-next-line:no-single-line-block-comment
279
298
  /* istanbul ignore else */
280
- if (params.reservationFor.id !== undefined) {
281
- andConditions.push({
282
- 'reservationFor.id': {
283
- $exists: true,
284
- $eq: params.reservationFor.id
285
- }
286
- });
287
- }
288
- // tslint:disable-next-line:no-single-line-block-comment
289
- /* istanbul ignore else */
290
299
  if (Array.isArray(params.reservationFor.ids)) {
291
300
  andConditions.push({
292
301
  'reservationFor.id': {
@@ -516,7 +525,7 @@ class MongoRepository {
516
525
  }
517
526
  // tslint:disable-next-line:no-single-line-block-comment
518
527
  /* istanbul ignore else */
519
- const ticketedSeatSeatingTypeIn = (_m = (_l = params.reservedTicket.ticketedSeat) === null || _l === void 0 ? void 0 : _l.seatingType) === null || _m === void 0 ? void 0 : _m.$in;
528
+ const ticketedSeatSeatingTypeIn = (_s = (_r = params.reservedTicket.ticketedSeat) === null || _r === void 0 ? void 0 : _r.seatingType) === null || _s === void 0 ? void 0 : _s.$in;
520
529
  if (Array.isArray(ticketedSeatSeatingTypeIn)) {
521
530
  andConditions.push({
522
531
  'reservedTicket.ticketedSeat.seatingType': {
@@ -527,7 +536,7 @@ class MongoRepository {
527
536
  }
528
537
  }
529
538
  }
530
- const brokerIdRegex = (_o = params.broker) === null || _o === void 0 ? void 0 : _o.id;
539
+ const brokerIdRegex = (_t = params.broker) === null || _t === void 0 ? void 0 : _t.id;
531
540
  if (typeof brokerIdRegex === 'string' && brokerIdRegex.length > 0) {
532
541
  andConditions.push({
533
542
  'broker.id': {
@@ -536,7 +545,7 @@ class MongoRepository {
536
545
  }
537
546
  });
538
547
  }
539
- const brokerIdentifierAll = (_q = (_p = params.broker) === null || _p === void 0 ? void 0 : _p.identifier) === null || _q === void 0 ? void 0 : _q.$all;
548
+ const brokerIdentifierAll = (_v = (_u = params.broker) === null || _u === void 0 ? void 0 : _u.identifier) === null || _v === void 0 ? void 0 : _v.$all;
540
549
  if (Array.isArray(brokerIdentifierAll)) {
541
550
  andConditions.push({
542
551
  'broker.identifier': {
@@ -545,7 +554,7 @@ class MongoRepository {
545
554
  }
546
555
  });
547
556
  }
548
- const brokerIdentifierIn = (_s = (_r = params.broker) === null || _r === void 0 ? void 0 : _r.identifier) === null || _s === void 0 ? void 0 : _s.$in;
557
+ const brokerIdentifierIn = (_x = (_w = params.broker) === null || _w === void 0 ? void 0 : _w.identifier) === null || _x === void 0 ? void 0 : _x.$in;
549
558
  if (Array.isArray(brokerIdentifierIn)) {
550
559
  andConditions.push({
551
560
  'broker.identifier': {
@@ -554,7 +563,7 @@ class MongoRepository {
554
563
  }
555
564
  });
556
565
  }
557
- const brokerIdentifierNin = (_u = (_t = params.broker) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$nin;
566
+ const brokerIdentifierNin = (_z = (_y = params.broker) === null || _y === void 0 ? void 0 : _y.identifier) === null || _z === void 0 ? void 0 : _z.$nin;
558
567
  if (Array.isArray(brokerIdentifierNin)) {
559
568
  andConditions.push({
560
569
  'broker.identifier': {
@@ -562,7 +571,7 @@ class MongoRepository {
562
571
  }
563
572
  });
564
573
  }
565
- const brokerIdentifierElemMatch = (_w = (_v = params.broker) === null || _v === void 0 ? void 0 : _v.identifier) === null || _w === void 0 ? void 0 : _w.$elemMatch;
574
+ const brokerIdentifierElemMatch = (_1 = (_0 = params.broker) === null || _0 === void 0 ? void 0 : _0.identifier) === null || _1 === void 0 ? void 0 : _1.$elemMatch;
566
575
  if (brokerIdentifierElemMatch !== undefined && brokerIdentifierElemMatch !== null) {
567
576
  andConditions.push({
568
577
  'broker.identifier': {
@@ -597,9 +606,9 @@ class MongoRepository {
597
606
  }
598
607
  }
599
608
  else {
600
- const emailRegex = (_x = params.underName.email) === null || _x === void 0 ? void 0 : _x.$regex;
609
+ const emailRegex = (_2 = params.underName.email) === null || _2 === void 0 ? void 0 : _2.$regex;
601
610
  if (typeof emailRegex === 'string' && emailRegex.length > 0) {
602
- const emailOptions = (_y = params.underName.email) === null || _y === void 0 ? void 0 : _y.$options;
611
+ const emailOptions = (_3 = params.underName.email) === null || _3 === void 0 ? void 0 : _3.$options;
603
612
  andConditions.push({
604
613
  'underName.email': Object.assign({ $exists: true, $regex: new RegExp(emailRegex) }, (typeof emailOptions === 'string') ? { $options: emailOptions } : undefined)
605
614
  });
@@ -618,9 +627,9 @@ class MongoRepository {
618
627
  }
619
628
  }
620
629
  else {
621
- const underNameNameRegex = (_z = params.underName.name) === null || _z === void 0 ? void 0 : _z.$regex;
630
+ const underNameNameRegex = (_4 = params.underName.name) === null || _4 === void 0 ? void 0 : _4.$regex;
622
631
  if (typeof underNameNameRegex === 'string' && underNameNameRegex.length > 0) {
623
- const underNameNameOptions = (_0 = params.underName.name) === null || _0 === void 0 ? void 0 : _0.$options;
632
+ const underNameNameOptions = (_5 = params.underName.name) === null || _5 === void 0 ? void 0 : _5.$options;
624
633
  andConditions.push({
625
634
  'underName.name': Object.assign({ $exists: true, $regex: new RegExp(underNameNameRegex) }, (typeof underNameNameOptions === 'string') ? { $options: underNameNameOptions } : undefined)
626
635
  });
@@ -649,9 +658,9 @@ class MongoRepository {
649
658
  }
650
659
  }
651
660
  else {
652
- const givenNameRegex = (_1 = params.underName.givenName) === null || _1 === void 0 ? void 0 : _1.$regex;
661
+ const givenNameRegex = (_6 = params.underName.givenName) === null || _6 === void 0 ? void 0 : _6.$regex;
653
662
  if (typeof givenNameRegex === 'string' && givenNameRegex.length > 0) {
654
- const givenNameOptions = (_2 = params.underName.givenName) === null || _2 === void 0 ? void 0 : _2.$options;
663
+ const givenNameOptions = (_7 = params.underName.givenName) === null || _7 === void 0 ? void 0 : _7.$options;
655
664
  andConditions.push({
656
665
  'underName.givenName': Object.assign({ $exists: true, $regex: new RegExp(givenNameRegex) }, (typeof givenNameOptions === 'string') ? { $options: givenNameOptions } : undefined)
657
666
  });
@@ -670,9 +679,9 @@ class MongoRepository {
670
679
  }
671
680
  }
672
681
  else {
673
- const familyNameRegex = (_3 = params.underName.familyName) === null || _3 === void 0 ? void 0 : _3.$regex;
682
+ const familyNameRegex = (_8 = params.underName.familyName) === null || _8 === void 0 ? void 0 : _8.$regex;
674
683
  if (typeof familyNameRegex === 'string' && familyNameRegex.length > 0) {
675
- const familyNameOptions = (_4 = params.underName.familyName) === null || _4 === void 0 ? void 0 : _4.$options;
684
+ const familyNameOptions = (_9 = params.underName.familyName) === null || _9 === void 0 ? void 0 : _9.$options;
676
685
  andConditions.push({
677
686
  'underName.familyName': Object.assign({ $exists: true, $regex: new RegExp(familyNameRegex) }, (typeof familyNameOptions === 'string') ? { $options: familyNameOptions } : undefined)
678
687
  });
@@ -773,7 +782,7 @@ class MongoRepository {
773
782
  });
774
783
  }
775
784
  }
776
- const programMembershipUsedIdentifierEq = (_6 = (_5 = params.programMembershipUsed) === null || _5 === void 0 ? void 0 : _5.identifier) === null || _6 === void 0 ? void 0 : _6.$eq;
785
+ const programMembershipUsedIdentifierEq = (_11 = (_10 = params.programMembershipUsed) === null || _10 === void 0 ? void 0 : _10.identifier) === null || _11 === void 0 ? void 0 : _11.$eq;
777
786
  if (typeof programMembershipUsedIdentifierEq === 'string') {
778
787
  andConditions.push({
779
788
  'programMembershipUsed.identifier': {
@@ -782,7 +791,7 @@ class MongoRepository {
782
791
  }
783
792
  });
784
793
  }
785
- const programMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_10 = (_9 = (_8 = (_7 = params.programMembershipUsed) === null || _7 === void 0 ? void 0 : _7.issuedThrough) === null || _8 === void 0 ? void 0 : _8.serviceType) === null || _9 === void 0 ? void 0 : _9.codeValue) === null || _10 === void 0 ? void 0 : _10.$eq;
794
+ const programMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_15 = (_14 = (_13 = (_12 = params.programMembershipUsed) === null || _12 === void 0 ? void 0 : _12.issuedThrough) === null || _13 === void 0 ? void 0 : _13.serviceType) === null || _14 === void 0 ? void 0 : _14.codeValue) === null || _15 === void 0 ? void 0 : _15.$eq;
786
795
  if (typeof programMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
787
796
  andConditions.push({
788
797
  'programMembershipUsed.issuedThrough.serviceType.codeValue': {
@@ -791,7 +800,7 @@ class MongoRepository {
791
800
  }
792
801
  });
793
802
  }
794
- const appliesToMovieTicketIdentifierEq = (_14 = (_13 = (_12 = (_11 = params.price) === null || _11 === void 0 ? void 0 : _11.priceComponent) === null || _12 === void 0 ? void 0 : _12.appliesToMovieTicket) === null || _13 === void 0 ? void 0 : _13.identifier) === null || _14 === void 0 ? void 0 : _14.$eq;
803
+ const appliesToMovieTicketIdentifierEq = (_19 = (_18 = (_17 = (_16 = params.price) === null || _16 === void 0 ? void 0 : _16.priceComponent) === null || _17 === void 0 ? void 0 : _17.appliesToMovieTicket) === null || _18 === void 0 ? void 0 : _18.identifier) === null || _19 === void 0 ? void 0 : _19.$eq;
795
804
  if (typeof appliesToMovieTicketIdentifierEq === 'string') {
796
805
  andConditions.push({
797
806
  'price.priceComponent.appliesToMovieTicket.identifier': {
@@ -236,20 +236,23 @@ function aggregateReservationByOffer(params) {
236
236
  }
237
237
  reservationCount4offer = yield repos.reservation.count({
238
238
  typeOf: reservationType,
239
- reservationFor: { ids: [params.event.id] },
239
+ // reservationFor: { ids: [params.event.id] },
240
+ reservationFor: { id: { $eq: params.event.id } },
240
241
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
241
242
  reservedTicket: { ticketType: { ids: [params.offer.id] } }
242
243
  });
243
244
  attendeeCount4offer = yield repos.reservation.count({
244
245
  typeOf: reservationType,
245
- reservationFor: { ids: [params.event.id] },
246
+ // reservationFor: { ids: [params.event.id] },
247
+ reservationFor: { id: { $eq: params.event.id } },
246
248
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
247
249
  reservedTicket: { ticketType: { ids: [params.offer.id] } },
248
250
  attended: true
249
251
  });
250
252
  checkInCount4offer = yield repos.reservation.count({
251
253
  typeOf: reservationType,
252
- reservationFor: { ids: [params.event.id] },
254
+ // reservationFor: { ids: [params.event.id] },
255
+ reservationFor: { id: { $eq: params.event.id } },
253
256
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
254
257
  reservedTicket: { ticketType: { ids: [params.offer.id] } },
255
258
  checkedIn: true
@@ -407,7 +410,8 @@ function aggregateReservationByEvent(params) {
407
410
  }
408
411
  reservationCount = yield repos.reservation.count({
409
412
  typeOf: reservationType,
410
- reservationFor: { ids: [params.event.id] },
413
+ // reservationFor: { ids: [params.event.id] },
414
+ reservationFor: { id: { $eq: params.event.id } },
411
415
  reservationStatuses: [factory.reservationStatusType.ReservationConfirmed]
412
416
  });
413
417
  // maximumAttendeeCapacityを決定
@@ -437,13 +441,15 @@ function aggregateReservationByEvent(params) {
437
441
  }
438
442
  attendeeCount = yield repos.reservation.count({
439
443
  typeOf: reservationType,
440
- reservationFor: { ids: [params.event.id] },
444
+ // reservationFor: { ids: [params.event.id] },
445
+ reservationFor: { id: { $eq: params.event.id } },
441
446
  // reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
442
447
  attended: true
443
448
  });
444
449
  checkInCount = yield repos.reservation.count({
445
450
  typeOf: reservationType,
446
- reservationFor: { ids: [params.event.id] },
451
+ // reservationFor: { ids: [params.event.id] },
452
+ reservationFor: { id: { $eq: params.event.id } },
447
453
  // reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
448
454
  checkedIn: true
449
455
  });
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.281.0-alpha.3",
12
+ "@chevre/factory": "4.281.0-alpha.4",
13
13
  "@cinerino/sdk": "3.135.0-alpha.7",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.2.0-alpha.10"
123
+ "version": "20.2.0-alpha.11"
124
124
  }