@chevre/domain 20.2.0-alpha.6 → 20.2.0-alpha.7

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.
@@ -26,5 +26,5 @@ export declare function aggregateScreeningEvent(params: {
26
26
  id: string;
27
27
  }): IAggregateScreeningEventOperation<void>;
28
28
  export declare function aggregateByEvent(params: {
29
- event: factory.event.screeningEvent.IEvent;
29
+ event: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
30
30
  }): IAggregateScreeningEventOperation<void>;
@@ -120,9 +120,16 @@ exports.aggregateByEvent = aggregateByEvent;
120
120
  */
121
121
  function findLocation(params) {
122
122
  return (repos) => __awaiter(this, void 0, void 0, function* () {
123
+ var _a;
123
124
  let movieTheater;
124
125
  try {
125
- movieTheater = yield repos.place.findById({ id: params.event.superEvent.location.id });
126
+ if (params.event.typeOf === factory.eventType.ScreeningEvent) {
127
+ movieTheater = yield repos.place.findById({ id: params.event.superEvent.location.id });
128
+ }
129
+ else {
130
+ const movieTheaterId = String((_a = params.event.offers) === null || _a === void 0 ? void 0 : _a.itemOffered.availableChannel.serviceLocation.containedInPlace.id);
131
+ movieTheater = yield repos.place.findById({ id: movieTheaterId });
132
+ }
126
133
  }
127
134
  catch (error) {
128
135
  let throwsError = true;
package/package.json CHANGED
@@ -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.6"
123
+ "version": "20.2.0-alpha.7"
124
124
  }