@chevre/domain 21.4.0-alpha.5 → 21.4.0-alpha.6

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.
@@ -51,7 +51,7 @@ class MongoRepository {
51
51
  }
52
52
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
53
53
  static CREATE_MONGO_CONDITIONS(conditions) {
54
- 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, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39;
54
+ 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, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41;
55
55
  const andConditions = [{ typeOf: { $eq: conditions.typeOf } }];
56
56
  const projectIdEq = (_b = (_a = conditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
57
57
  if (typeof projectIdEq === 'string') {
@@ -59,7 +59,13 @@ class MongoRepository {
59
59
  'project.id': { $eq: projectIdEq }
60
60
  });
61
61
  }
62
- const idIn = (_c = conditions.id) === null || _c === void 0 ? void 0 : _c.$in;
62
+ const organizerIdEq = (_d = (_c = conditions.organizer) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
63
+ if (typeof organizerIdEq === 'string') {
64
+ andConditions.push({
65
+ 'organizer.id': { $exists: true, $eq: organizerIdEq }
66
+ });
67
+ }
68
+ const idIn = (_e = conditions.id) === null || _e === void 0 ? void 0 : _e.$in;
63
69
  if (Array.isArray(idIn)) {
64
70
  andConditions.push({
65
71
  _id: { $in: idIn }
@@ -114,17 +120,17 @@ class MongoRepository {
114
120
  endDate: { $lte: conditions.endThrough }
115
121
  });
116
122
  }
117
- const locationBranchCodeEq = (_e = (_d = conditions.location) === null || _d === void 0 ? void 0 : _d.branchCode) === null || _e === void 0 ? void 0 : _e.$eq;
123
+ const locationBranchCodeEq = (_g = (_f = conditions.location) === null || _f === void 0 ? void 0 : _f.branchCode) === null || _g === void 0 ? void 0 : _g.$eq;
118
124
  if (typeof locationBranchCodeEq === 'string') {
119
125
  andConditions.push({ 'location.branchCode': { $exists: true, $eq: locationBranchCodeEq } });
120
126
  }
121
- const locationBranchCodeIn = (_g = (_f = conditions.location) === null || _f === void 0 ? void 0 : _f.branchCode) === null || _g === void 0 ? void 0 : _g.$in;
127
+ const locationBranchCodeIn = (_j = (_h = conditions.location) === null || _h === void 0 ? void 0 : _h.branchCode) === null || _j === void 0 ? void 0 : _j.$in;
122
128
  if (Array.isArray(locationBranchCodeIn)) {
123
129
  andConditions.push({ 'location.branchCode': { $exists: true, $in: locationBranchCodeIn } });
124
130
  }
125
131
  // tslint:disable-next-line:no-single-line-block-comment
126
132
  /* istanbul ignore else */
127
- const hasOfferCatalogIdEq = (_j = (_h = conditions.hasOfferCatalog) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.$eq;
133
+ const hasOfferCatalogIdEq = (_l = (_k = conditions.hasOfferCatalog) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.$eq;
128
134
  if (typeof hasOfferCatalogIdEq === 'string') {
129
135
  andConditions.push({
130
136
  'hasOfferCatalog.id': {
@@ -133,7 +139,7 @@ class MongoRepository {
133
139
  }
134
140
  });
135
141
  }
136
- const additionalPropertyElemMatch = (_k = conditions.additionalProperty) === null || _k === void 0 ? void 0 : _k.$elemMatch;
142
+ const additionalPropertyElemMatch = (_m = conditions.additionalProperty) === null || _m === void 0 ? void 0 : _m.$elemMatch;
137
143
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
138
144
  andConditions.push({
139
145
  additionalProperty: {
@@ -149,7 +155,7 @@ class MongoRepository {
149
155
  // tslint:disable-next-line:no-single-line-block-comment
150
156
  /* istanbul ignore else */
151
157
  if (params.offers !== undefined) {
152
- const itemOfferedIdIn4event = (_m = (_l = params.offers.itemOffered) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$in;
158
+ const itemOfferedIdIn4event = (_p = (_o = params.offers.itemOffered) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$in;
153
159
  if (Array.isArray(itemOfferedIdIn4event)) {
154
160
  andConditions.push({
155
161
  'offers.itemOffered.id': {
@@ -199,8 +205,8 @@ class MongoRepository {
199
205
  }
200
206
  }
201
207
  }
202
- const sellerMakesOfferElemMatch4event = (_q = (_p = (_o = params.offers) === null || _o === void 0 ? void 0 : _o.seller) === null || _p === void 0 ? void 0 : _p.makesOffer) === null || _q === void 0 ? void 0 : _q.$elemMatch;
203
- if (typeof ((_r = sellerMakesOfferElemMatch4event === null || sellerMakesOfferElemMatch4event === void 0 ? void 0 : sellerMakesOfferElemMatch4event['availableAtOrFrom.id']) === null || _r === void 0 ? void 0 : _r.$eq) === 'string') {
208
+ const sellerMakesOfferElemMatch4event = (_s = (_r = (_q = params.offers) === null || _q === void 0 ? void 0 : _q.seller) === null || _r === void 0 ? void 0 : _r.makesOffer) === null || _s === void 0 ? void 0 : _s.$elemMatch;
209
+ if (typeof ((_t = sellerMakesOfferElemMatch4event === null || sellerMakesOfferElemMatch4event === void 0 ? void 0 : sellerMakesOfferElemMatch4event['availableAtOrFrom.id']) === null || _t === void 0 ? void 0 : _t.$eq) === 'string') {
204
210
  andConditions.push({
205
211
  'offers.seller.makesOffer': {
206
212
  $exists: true,
@@ -208,7 +214,7 @@ class MongoRepository {
208
214
  }
209
215
  });
210
216
  }
211
- const reservationForIdentifierEq = (_w = (_v = (_u = (_t = (_s = params.offers) === null || _s === void 0 ? void 0 : _s.itemOffered) === null || _t === void 0 ? void 0 : _t.serviceOutput) === null || _u === void 0 ? void 0 : _u.reservationFor) === null || _v === void 0 ? void 0 : _v.identifier) === null || _w === void 0 ? void 0 : _w.$eq;
217
+ const reservationForIdentifierEq = (_y = (_x = (_w = (_v = (_u = params.offers) === null || _u === void 0 ? void 0 : _u.itemOffered) === null || _v === void 0 ? void 0 : _v.serviceOutput) === null || _w === void 0 ? void 0 : _w.reservationFor) === null || _x === void 0 ? void 0 : _x.identifier) === null || _y === void 0 ? void 0 : _y.$eq;
212
218
  if (typeof reservationForIdentifierEq === 'string') {
213
219
  andConditions.push({
214
220
  'offers.itemOffered.serviceOutput.reservationFor.identifier': {
@@ -217,7 +223,7 @@ class MongoRepository {
217
223
  }
218
224
  });
219
225
  }
220
- const reservationForArrivalBusStopBranchCodeEq = (_2 = (_1 = (_0 = (_z = (_y = (_x = params.offers) === null || _x === void 0 ? void 0 : _x.itemOffered) === null || _y === void 0 ? void 0 : _y.serviceOutput) === null || _z === void 0 ? void 0 : _z.reservationFor) === null || _0 === void 0 ? void 0 : _0.arrivalBusStop) === null || _1 === void 0 ? void 0 : _1.branchCode) === null || _2 === void 0 ? void 0 : _2.$eq;
226
+ const reservationForArrivalBusStopBranchCodeEq = (_4 = (_3 = (_2 = (_1 = (_0 = (_z = params.offers) === null || _z === void 0 ? void 0 : _z.itemOffered) === null || _0 === void 0 ? void 0 : _0.serviceOutput) === null || _1 === void 0 ? void 0 : _1.reservationFor) === null || _2 === void 0 ? void 0 : _2.arrivalBusStop) === null || _3 === void 0 ? void 0 : _3.branchCode) === null || _4 === void 0 ? void 0 : _4.$eq;
221
227
  if (typeof reservationForArrivalBusStopBranchCodeEq === 'string') {
222
228
  andConditions.push({
223
229
  'offers.itemOffered.serviceOutput.reservationFor.arrivalBusStop.branchCode': {
@@ -226,7 +232,7 @@ class MongoRepository {
226
232
  }
227
233
  });
228
234
  }
229
- const reservationForDepartureBusStopBranchCodeEq = (_8 = (_7 = (_6 = (_5 = (_4 = (_3 = params.offers) === null || _3 === void 0 ? void 0 : _3.itemOffered) === null || _4 === void 0 ? void 0 : _4.serviceOutput) === null || _5 === void 0 ? void 0 : _5.reservationFor) === null || _6 === void 0 ? void 0 : _6.departureBusStop) === null || _7 === void 0 ? void 0 : _7.branchCode) === null || _8 === void 0 ? void 0 : _8.$eq;
235
+ const reservationForDepartureBusStopBranchCodeEq = (_10 = (_9 = (_8 = (_7 = (_6 = (_5 = params.offers) === null || _5 === void 0 ? void 0 : _5.itemOffered) === null || _6 === void 0 ? void 0 : _6.serviceOutput) === null || _7 === void 0 ? void 0 : _7.reservationFor) === null || _8 === void 0 ? void 0 : _8.departureBusStop) === null || _9 === void 0 ? void 0 : _9.branchCode) === null || _10 === void 0 ? void 0 : _10.$eq;
230
236
  if (typeof reservationForDepartureBusStopBranchCodeEq === 'string') {
231
237
  andConditions.push({
232
238
  'offers.itemOffered.serviceOutput.reservationFor.departureBusStop.branchCode': {
@@ -260,7 +266,7 @@ class MongoRepository {
260
266
  }
261
267
  // tslint:disable-next-line:no-single-line-block-comment
262
268
  /* istanbul ignore else */
263
- const superEventLocationIdEq = (_11 = (_10 = (_9 = params.superEvent) === null || _9 === void 0 ? void 0 : _9.location) === null || _10 === void 0 ? void 0 : _10.id) === null || _11 === void 0 ? void 0 : _11.$eq;
269
+ const superEventLocationIdEq = (_13 = (_12 = (_11 = params.superEvent) === null || _11 === void 0 ? void 0 : _11.location) === null || _12 === void 0 ? void 0 : _12.id) === null || _13 === void 0 ? void 0 : _13.$eq;
264
270
  if (typeof superEventLocationIdEq === 'string') {
265
271
  andConditions.push({
266
272
  'superEvent.location.id': {
@@ -303,7 +309,7 @@ class MongoRepository {
303
309
  });
304
310
  }
305
311
  }
306
- const itemOfferedIdIn = (_14 = (_13 = (_12 = params.offers) === null || _12 === void 0 ? void 0 : _12.itemOffered) === null || _13 === void 0 ? void 0 : _13.id) === null || _14 === void 0 ? void 0 : _14.$in;
312
+ const itemOfferedIdIn = (_16 = (_15 = (_14 = params.offers) === null || _14 === void 0 ? void 0 : _14.itemOffered) === null || _15 === void 0 ? void 0 : _15.id) === null || _16 === void 0 ? void 0 : _16.$in;
307
313
  if (Array.isArray(itemOfferedIdIn)) {
308
314
  andConditions.push({
309
315
  'offers.itemOffered.id': {
@@ -312,7 +318,7 @@ class MongoRepository {
312
318
  }
313
319
  });
314
320
  }
315
- const itemOfferedTicketedSeatTypeOfIn = (_19 = (_18 = (_17 = (_16 = (_15 = params.offers) === null || _15 === void 0 ? void 0 : _15.itemOffered) === null || _16 === void 0 ? void 0 : _16.serviceOutput) === null || _17 === void 0 ? void 0 : _17.reservedTicket) === null || _18 === void 0 ? void 0 : _18.ticketedSeat) === null || _19 === void 0 ? void 0 : _19.typeOfs;
321
+ const itemOfferedTicketedSeatTypeOfIn = (_21 = (_20 = (_19 = (_18 = (_17 = params.offers) === null || _17 === void 0 ? void 0 : _17.itemOffered) === null || _18 === void 0 ? void 0 : _18.serviceOutput) === null || _19 === void 0 ? void 0 : _19.reservedTicket) === null || _20 === void 0 ? void 0 : _20.ticketedSeat) === null || _21 === void 0 ? void 0 : _21.typeOfs;
316
322
  if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
317
323
  andConditions.push({
318
324
  'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
@@ -321,7 +327,7 @@ class MongoRepository {
321
327
  }
322
328
  });
323
329
  }
324
- const itemOfferedServiceTypeIdIn = (_22 = (_21 = (_20 = params.offers) === null || _20 === void 0 ? void 0 : _20.itemOffered) === null || _21 === void 0 ? void 0 : _21.serviceType) === null || _22 === void 0 ? void 0 : _22.ids;
330
+ const itemOfferedServiceTypeIdIn = (_24 = (_23 = (_22 = params.offers) === null || _22 === void 0 ? void 0 : _22.itemOffered) === null || _23 === void 0 ? void 0 : _23.serviceType) === null || _24 === void 0 ? void 0 : _24.ids;
325
331
  if (Array.isArray(itemOfferedServiceTypeIdIn)) {
326
332
  andConditions.push({
327
333
  'offers.itemOffered.serviceType.id': {
@@ -330,8 +336,8 @@ class MongoRepository {
330
336
  }
331
337
  });
332
338
  }
333
- const sellerMakesOfferElemMatch = (_25 = (_24 = (_23 = params.offers) === null || _23 === void 0 ? void 0 : _23.seller) === null || _24 === void 0 ? void 0 : _24.makesOffer) === null || _25 === void 0 ? void 0 : _25.$elemMatch;
334
- if (typeof ((_26 = sellerMakesOfferElemMatch === null || sellerMakesOfferElemMatch === void 0 ? void 0 : sellerMakesOfferElemMatch['availableAtOrFrom.id']) === null || _26 === void 0 ? void 0 : _26.$eq) === 'string') {
339
+ const sellerMakesOfferElemMatch = (_27 = (_26 = (_25 = params.offers) === null || _25 === void 0 ? void 0 : _25.seller) === null || _26 === void 0 ? void 0 : _26.makesOffer) === null || _27 === void 0 ? void 0 : _27.$elemMatch;
340
+ if (typeof ((_28 = sellerMakesOfferElemMatch === null || sellerMakesOfferElemMatch === void 0 ? void 0 : sellerMakesOfferElemMatch['availableAtOrFrom.id']) === null || _28 === void 0 ? void 0 : _28.$eq) === 'string') {
335
341
  andConditions.push({
336
342
  'offers.seller.makesOffer': {
337
343
  $exists: true,
@@ -368,7 +374,7 @@ class MongoRepository {
368
374
  ]
369
375
  });
370
376
  }
371
- const locationIdEq = (_28 = (_27 = params.location) === null || _27 === void 0 ? void 0 : _27.id) === null || _28 === void 0 ? void 0 : _28.$eq;
377
+ const locationIdEq = (_30 = (_29 = params.location) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$eq;
372
378
  // tslint:disable-next-line:no-single-line-block-comment
373
379
  /* istanbul ignore else */
374
380
  if (typeof locationIdEq === 'string') {
@@ -390,7 +396,7 @@ class MongoRepository {
390
396
  });
391
397
  }
392
398
  }
393
- const workPerformedIdentifierIn = (_29 = params.workPerformed) === null || _29 === void 0 ? void 0 : _29.identifiers;
399
+ const workPerformedIdentifierIn = (_31 = params.workPerformed) === null || _31 === void 0 ? void 0 : _31.identifiers;
394
400
  // tslint:disable-next-line:no-single-line-block-comment
395
401
  /* istanbul ignore else */
396
402
  if (Array.isArray(workPerformedIdentifierIn)) {
@@ -398,13 +404,13 @@ class MongoRepository {
398
404
  'workPerformed.identifier': { $exists: true, $in: workPerformedIdentifierIn }
399
405
  });
400
406
  }
401
- const workPerformedVersionEq = (_31 = (_30 = params.workPerformed) === null || _30 === void 0 ? void 0 : _30.version) === null || _31 === void 0 ? void 0 : _31.$eq;
407
+ const workPerformedVersionEq = (_33 = (_32 = params.workPerformed) === null || _32 === void 0 ? void 0 : _32.version) === null || _33 === void 0 ? void 0 : _33.$eq;
402
408
  if (typeof workPerformedVersionEq === 'string') {
403
409
  andConditions.push({
404
410
  'workPerformed.version': { $exists: true, $eq: workPerformedVersionEq }
405
411
  });
406
412
  }
407
- const videoFormatTypeOfEq = (_33 = (_32 = params.videoFormat) === null || _32 === void 0 ? void 0 : _32.typeOf) === null || _33 === void 0 ? void 0 : _33.$eq;
413
+ const videoFormatTypeOfEq = (_35 = (_34 = params.videoFormat) === null || _34 === void 0 ? void 0 : _34.typeOf) === null || _35 === void 0 ? void 0 : _35.$eq;
408
414
  if (typeof videoFormatTypeOfEq === 'string') {
409
415
  andConditions.push({
410
416
  'videoFormat.typeOf': {
@@ -413,7 +419,7 @@ class MongoRepository {
413
419
  }
414
420
  });
415
421
  }
416
- const videoFormatTypeOfIn = (_35 = (_34 = params.videoFormat) === null || _34 === void 0 ? void 0 : _34.typeOf) === null || _35 === void 0 ? void 0 : _35.$in;
422
+ const videoFormatTypeOfIn = (_37 = (_36 = params.videoFormat) === null || _36 === void 0 ? void 0 : _36.typeOf) === null || _37 === void 0 ? void 0 : _37.$in;
417
423
  if (Array.isArray(videoFormatTypeOfIn)) {
418
424
  andConditions.push({
419
425
  'videoFormat.typeOf': {
@@ -422,7 +428,7 @@ class MongoRepository {
422
428
  }
423
429
  });
424
430
  }
425
- const soundFormatTypeOfEq = (_37 = (_36 = params.soundFormat) === null || _36 === void 0 ? void 0 : _36.typeOf) === null || _37 === void 0 ? void 0 : _37.$eq;
431
+ const soundFormatTypeOfEq = (_39 = (_38 = params.soundFormat) === null || _38 === void 0 ? void 0 : _38.typeOf) === null || _39 === void 0 ? void 0 : _39.$eq;
426
432
  if (typeof soundFormatTypeOfEq === 'string') {
427
433
  andConditions.push({
428
434
  'soundFormat.typeOf': {
@@ -431,7 +437,7 @@ class MongoRepository {
431
437
  }
432
438
  });
433
439
  }
434
- const soundFormatTypeOfIn = (_39 = (_38 = params.soundFormat) === null || _38 === void 0 ? void 0 : _38.typeOf) === null || _39 === void 0 ? void 0 : _39.$in;
440
+ const soundFormatTypeOfIn = (_41 = (_40 = params.soundFormat) === null || _40 === void 0 ? void 0 : _40.typeOf) === null || _41 === void 0 ? void 0 : _41.$in;
435
441
  if (Array.isArray(soundFormatTypeOfIn)) {
436
442
  andConditions.push({
437
443
  'soundFormat.typeOf': {
@@ -79,6 +79,12 @@ schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
79
79
  schema.index({ 'project.id': 1, startDate: 1 }, {
80
80
  name: 'searchByProjectId-v20220721'
81
81
  });
82
+ schema.index({ 'organizer.id': 1, startDate: 1 }, {
83
+ name: 'searchByOrganizerId',
84
+ partialFilterExpression: {
85
+ 'organizer.id': { $exists: true }
86
+ }
87
+ });
82
88
  schema.index({ typeOf: 1, startDate: 1 }, { name: 'searchByTypeOf' });
83
89
  schema.index({ eventStatus: 1, startDate: 1 }, { name: 'searchByEventStatus' });
84
90
  schema.index({ name: 1, startDate: 1 }, { name: 'searchByName' });
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.5"
120
+ "version": "21.4.0-alpha.6"
121
121
  }