@chevre/domain 20.2.0-alpha.4 → 20.2.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.
@@ -67,34 +67,38 @@ function addOffers2Seat(params) {
67
67
  */
68
68
  function searchEventSeatOffers(params) {
69
69
  return (repos) => __awaiter(this, void 0, void 0, function* () {
70
- var _a, _b, _c, _d, _e;
70
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
71
71
  let offers = [];
72
- const screeningEvent = yield repos.event.findById({
72
+ const event = yield repos.event.findById({
73
73
  id: params.event.id
74
74
  });
75
75
  // 座席指定利用可能かどうか
76
- const eventOffers = screeningEvent.offers;
76
+ const eventOffers = event.offers;
77
77
  const reservedSeatsAvailable = ((_b = (_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered.serviceOutput) === null || _a === void 0 ? void 0 : _a.reservedTicket) === null || _b === void 0 ? void 0 : _b.ticketedSeat) !== undefined;
78
78
  if (reservedSeatsAvailable) {
79
79
  // 座席タイプ価格仕様を検索
80
80
  const priceSpecs = yield repos.priceSpecification.search({
81
- project: { id: { $eq: screeningEvent.project.id } },
81
+ project: { id: { $eq: event.project.id } },
82
82
  typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
83
83
  appliesToCategoryCode: {
84
84
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.SeatingType } }
85
85
  }
86
86
  });
87
+ // const roomBranchCode = event.location.branchCode;
88
+ // const movieTheaterBranchCode = event.superEvent.location.branchCode;
89
+ const roomBranchCode = String((_d = (_c = eventOffers.itemOffered) === null || _c === void 0 ? void 0 : _c.availableChannel) === null || _d === void 0 ? void 0 : _d.serviceLocation.branchCode);
90
+ const movieTheaterBranchCode = String((_f = (_e = eventOffers.itemOffered) === null || _e === void 0 ? void 0 : _e.availableChannel) === null || _f === void 0 ? void 0 : _f.serviceLocation.containedInPlace.branchCode);
87
91
  const seats = yield repos.place.searchSeats({
88
- project: { id: { $eq: screeningEvent.project.id } },
89
- branchCode: { $in: (_c = params.branchCode) === null || _c === void 0 ? void 0 : _c.$in },
92
+ project: { id: { $eq: event.project.id } },
93
+ branchCode: { $in: (_g = params.branchCode) === null || _g === void 0 ? void 0 : _g.$in },
90
94
  containedInPlace: {
91
95
  branchCode: {
92
- $in: (_e = (_d = params.containedInPlace) === null || _d === void 0 ? void 0 : _d.branchCode) === null || _e === void 0 ? void 0 : _e.$in
96
+ $in: (_j = (_h = params.containedInPlace) === null || _h === void 0 ? void 0 : _h.branchCode) === null || _j === void 0 ? void 0 : _j.$in
93
97
  },
94
98
  containedInPlace: {
95
- branchCode: { $eq: screeningEvent.location.branchCode },
99
+ branchCode: { $eq: roomBranchCode },
96
100
  containedInPlace: {
97
- branchCode: { $eq: screeningEvent.superEvent.location.branchCode }
101
+ branchCode: { $eq: movieTheaterBranchCode }
98
102
  }
99
103
  }
100
104
  },
@@ -114,7 +118,7 @@ function searchEventSeatOffers(params) {
114
118
  offers = seats.map((seat, index) => {
115
119
  var _a;
116
120
  return addOffers2Seat({
117
- project: screeningEvent.project,
121
+ project: event.project,
118
122
  seat: seat,
119
123
  seatSection: (_a = seat.containedInPlace) === null || _a === void 0 ? void 0 : _a.branchCode,
120
124
  unavailableOffers: [],
@@ -133,33 +137,37 @@ exports.searchEventSeatOffers = searchEventSeatOffers;
133
137
  */
134
138
  function searchEventSeatOffersWithPaging(params) {
135
139
  return (repos) => __awaiter(this, void 0, void 0, function* () {
136
- var _a, _b, _c, _d, _e, _f;
140
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
137
141
  let offers = [];
138
- const screeningEvent = yield repos.event.findById({
142
+ const event = yield repos.event.findById({
139
143
  id: params.event.id
140
144
  });
141
145
  // 座席指定利用可能かどうか
142
- const eventOffers = screeningEvent.offers;
146
+ const eventOffers = event.offers;
143
147
  const reservedSeatsAvailable = ((_b = (_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered.serviceOutput) === null || _a === void 0 ? void 0 : _a.reservedTicket) === null || _b === void 0 ? void 0 : _b.ticketedSeat) !== undefined;
144
148
  if (reservedSeatsAvailable) {
145
149
  // 座席タイプ価格仕様を検索
146
150
  const priceSpecs = yield repos.priceSpecification.search({
147
- project: { id: { $eq: screeningEvent.project.id } },
151
+ project: { id: { $eq: event.project.id } },
148
152
  typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
149
153
  appliesToCategoryCode: {
150
154
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.SeatingType } }
151
155
  }
152
156
  });
153
- const seats = yield repos.place.searchSeats(Object.assign(Object.assign({}, params), { project: { id: { $eq: screeningEvent.project.id } }, containedInPlace: {
157
+ // const roomBranchCode = event.location.branchCode;
158
+ // const movieTheaterBranchCode = event.superEvent.location.branchCode;
159
+ const roomBranchCode = String((_d = (_c = eventOffers.itemOffered) === null || _c === void 0 ? void 0 : _c.availableChannel) === null || _d === void 0 ? void 0 : _d.serviceLocation.branchCode);
160
+ const movieTheaterBranchCode = String((_f = (_e = eventOffers.itemOffered) === null || _e === void 0 ? void 0 : _e.availableChannel) === null || _f === void 0 ? void 0 : _f.serviceLocation.containedInPlace.branchCode);
161
+ const seats = yield repos.place.searchSeats(Object.assign(Object.assign({}, params), { project: { id: { $eq: event.project.id } }, containedInPlace: {
154
162
  branchCode: {
155
- $eq: (typeof ((_d = (_c = params.containedInPlace) === null || _c === void 0 ? void 0 : _c.branchCode) === null || _d === void 0 ? void 0 : _d.$eq) === 'string')
156
- ? (_f = (_e = params.containedInPlace) === null || _e === void 0 ? void 0 : _e.branchCode) === null || _f === void 0 ? void 0 : _f.$eq
163
+ $eq: (typeof ((_h = (_g = params.containedInPlace) === null || _g === void 0 ? void 0 : _g.branchCode) === null || _h === void 0 ? void 0 : _h.$eq) === 'string')
164
+ ? (_k = (_j = params.containedInPlace) === null || _j === void 0 ? void 0 : _j.branchCode) === null || _k === void 0 ? void 0 : _k.$eq
157
165
  : undefined
158
166
  },
159
167
  containedInPlace: {
160
- branchCode: { $eq: screeningEvent.location.branchCode },
168
+ branchCode: { $eq: roomBranchCode },
161
169
  containedInPlace: {
162
- branchCode: { $eq: screeningEvent.superEvent.location.branchCode }
170
+ branchCode: { $eq: movieTheaterBranchCode }
163
171
  }
164
172
  }
165
173
  } }));
@@ -177,7 +185,7 @@ function searchEventSeatOffersWithPaging(params) {
177
185
  offers = seats.map((seat, index) => {
178
186
  var _a;
179
187
  return addOffers2Seat({
180
- project: screeningEvent.project,
188
+ project: event.project,
181
189
  seat: seat,
182
190
  seatSection: (_a = seat.containedInPlace) === null || _a === void 0 ? void 0 : _a.branchCode,
183
191
  unavailableOffers: [],
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.4"
123
+ "version": "20.2.0-alpha.6"
124
124
  }