@chevre/domain 20.2.0-alpha.5 → 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
|
-
|
|
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;
|
|
@@ -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
|
|
72
|
+
const event = yield repos.event.findById({
|
|
73
73
|
id: params.event.id
|
|
74
74
|
});
|
|
75
75
|
// 座席指定利用可能かどうか
|
|
76
|
-
const eventOffers =
|
|
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:
|
|
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:
|
|
89
|
-
branchCode: { $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: (
|
|
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:
|
|
99
|
+
branchCode: { $eq: roomBranchCode },
|
|
96
100
|
containedInPlace: {
|
|
97
|
-
branchCode: { $eq:
|
|
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:
|
|
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,7 +137,7 @@ 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
142
|
const event = yield repos.event.findById({
|
|
139
143
|
id: params.event.id
|
|
@@ -152,12 +156,12 @@ function searchEventSeatOffersWithPaging(params) {
|
|
|
152
156
|
});
|
|
153
157
|
// const roomBranchCode = event.location.branchCode;
|
|
154
158
|
// const movieTheaterBranchCode = event.superEvent.location.branchCode;
|
|
155
|
-
const roomBranchCode = eventOffers.itemOffered.availableChannel.serviceLocation.branchCode;
|
|
156
|
-
const movieTheaterBranchCode = eventOffers.itemOffered.availableChannel.serviceLocation.containedInPlace.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);
|
|
157
161
|
const seats = yield repos.place.searchSeats(Object.assign(Object.assign({}, params), { project: { id: { $eq: event.project.id } }, containedInPlace: {
|
|
158
162
|
branchCode: {
|
|
159
|
-
$eq: (typeof ((
|
|
160
|
-
? (
|
|
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
|
|
161
165
|
: undefined
|
|
162
166
|
},
|
|
163
167
|
containedInPlace: {
|
package/package.json
CHANGED