@chevre/domain 24.0.0-alpha.42 → 24.0.0-alpha.44
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.
- package/lib/chevre/repo/place/seat.d.ts +17 -11
- package/lib/chevre/repo/place/seat.js +12 -0
- package/lib/chevre/repo/place/section.js +6 -0
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +7 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +4 -2
- package/lib/chevre/service/offer.js +10 -6
- package/package.json +2 -2
|
@@ -128,23 +128,29 @@ export declare class SeatRepo {
|
|
|
128
128
|
/**
|
|
129
129
|
* 座席コード
|
|
130
130
|
*/
|
|
131
|
-
branchCode
|
|
132
|
-
$in
|
|
131
|
+
branchCode: {
|
|
132
|
+
$in: string[];
|
|
133
133
|
};
|
|
134
|
-
containedInPlace
|
|
134
|
+
containedInPlace: {
|
|
135
135
|
/**
|
|
136
136
|
* セクションコード
|
|
137
137
|
*/
|
|
138
|
-
branchCode
|
|
139
|
-
$in
|
|
138
|
+
branchCode: {
|
|
139
|
+
$in: string[];
|
|
140
140
|
};
|
|
141
|
-
containedInPlace
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
containedInPlace: {
|
|
142
|
+
/**
|
|
143
|
+
* ルームコード
|
|
144
|
+
*/
|
|
145
|
+
branchCode: {
|
|
146
|
+
$eq: string;
|
|
144
147
|
};
|
|
145
|
-
containedInPlace
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
containedInPlace: {
|
|
149
|
+
/**
|
|
150
|
+
* 施設コード
|
|
151
|
+
*/
|
|
152
|
+
branchCode: {
|
|
153
|
+
$eq: string;
|
|
148
154
|
};
|
|
149
155
|
};
|
|
150
156
|
};
|
|
@@ -542,6 +542,12 @@ class SeatRepo {
|
|
|
542
542
|
// ルーム指定の座席検索として再定義(2025-04-28~)
|
|
543
543
|
async projectSeatsByScreeningRoom(params) {
|
|
544
544
|
const { limit, page, project, containedInPlace, screeningRoom, $projection, ...searchSeatsConditions } = params;
|
|
545
|
+
if (typeof screeningRoom.branchCode.$eq !== 'string' || screeningRoom.branchCode.$eq === '') {
|
|
546
|
+
throw new factory.errors.ArgumentNull('screeningRoom.branchCode.$eq');
|
|
547
|
+
}
|
|
548
|
+
if (typeof screeningRoom.containedInPlace.branchCode.$eq !== 'string' || screeningRoom.containedInPlace.branchCode.$eq === '') {
|
|
549
|
+
throw new factory.errors.ArgumentNull('screeningRoom.containedInPlace.branchCode.$eq');
|
|
550
|
+
}
|
|
545
551
|
// まずルーム検索
|
|
546
552
|
const screeningRoomDoc = await this.placeModel.findOne({
|
|
547
553
|
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
@@ -706,10 +712,16 @@ class SeatRepo {
|
|
|
706
712
|
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
707
713
|
}
|
|
708
714
|
const branchCodeEq = params.containedInPlace?.containedInPlace?.branchCode?.$eq;
|
|
715
|
+
if (typeof branchCodeEq !== 'string' || branchCodeEq === '') {
|
|
716
|
+
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode.$eq');
|
|
717
|
+
}
|
|
709
718
|
if (typeof branchCodeEq === 'string') {
|
|
710
719
|
matchStages.push({ $match: { branchCode: { $eq: branchCodeEq } } });
|
|
711
720
|
}
|
|
712
721
|
const containedInPlaceBranchCodeEq = params.containedInPlace?.containedInPlace?.containedInPlace?.branchCode?.$eq;
|
|
722
|
+
if (typeof containedInPlaceBranchCodeEq !== 'string' || containedInPlaceBranchCodeEq === '') {
|
|
723
|
+
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.containedInPlace.branchCode.$eq');
|
|
724
|
+
}
|
|
713
725
|
if (typeof containedInPlaceBranchCodeEq === 'string') {
|
|
714
726
|
matchStages.push({
|
|
715
727
|
$match: { 'containedInPlace.branchCode': { $exists: true, $eq: containedInPlaceBranchCodeEq } }
|
|
@@ -520,6 +520,12 @@ class SectionRepo {
|
|
|
520
520
|
// >
|
|
521
521
|
) {
|
|
522
522
|
const { limit, page, projectId, sellerId, movieTheaterCode, roomCode } = params;
|
|
523
|
+
if (typeof movieTheaterCode !== 'string' || movieTheaterCode === '') {
|
|
524
|
+
throw new factory.errors.ArgumentNull('movieTheaterCode');
|
|
525
|
+
}
|
|
526
|
+
if (typeof roomCode !== 'string' || roomCode === '') {
|
|
527
|
+
throw new factory.errors.ArgumentNull('roomCode');
|
|
528
|
+
}
|
|
523
529
|
const matchStageBeforeUnwind = {
|
|
524
530
|
$match: {
|
|
525
531
|
'project.id': { $eq: projectId },
|
|
@@ -127,9 +127,14 @@ function createIssuedThrough(params) {
|
|
|
127
127
|
}
|
|
128
128
|
: undefined;
|
|
129
129
|
const availableChannel = eventOffers.itemOffered.availableChannel;
|
|
130
|
-
|
|
130
|
+
// itemOffered.availableChannel: optional(20226-03-24~)
|
|
131
|
+
// if (availableChannel === undefined) {
|
|
132
|
+
// // availableChannelは必ず存在するはず
|
|
133
|
+
// throw new factory.errors.NotFound('reservationFor.offers.availableChannel');
|
|
134
|
+
// }
|
|
135
|
+
if (typeof eventOffers.itemOffered.id !== 'string') {
|
|
131
136
|
// availableChannelは必ず存在するはず
|
|
132
|
-
throw new factory.errors.NotFound('reservationFor.offers.
|
|
137
|
+
throw new factory.errors.NotFound('reservationFor.offers.itemOffered.id');
|
|
133
138
|
}
|
|
134
139
|
if (params.reservationFor.typeOf === factory.eventType.ScreeningEvent) {
|
|
135
140
|
const issuedThrough = {
|
|
@@ -244,8 +244,10 @@ function searchEventSeatOffers(params) {
|
|
|
244
244
|
const eventOffers = params.event.offers;
|
|
245
245
|
const reservedSeatsAvailable = eventOffers?.itemOffered.serviceOutput?.reservedTicket?.ticketedSeat !== undefined;
|
|
246
246
|
if (reservedSeatsAvailable) {
|
|
247
|
-
const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
248
|
-
const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
247
|
+
// const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
248
|
+
// const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
249
|
+
const roomBranchCode = params.event.location.branchCode;
|
|
250
|
+
const movieTheaterBranchCode = params.event.superEvent.location.branchCode;
|
|
249
251
|
// reimplement using projectSeatsByScreeningRoom
|
|
250
252
|
const seats = await repos.seat.projectSeatsByScreeningRoom({
|
|
251
253
|
project: { id: { $eq: params.event.project.id } },
|
|
@@ -45,13 +45,15 @@ function searchEventSeatOffersWithPaging(params) {
|
|
|
45
45
|
const { includeSectionCodeOnlyFirstElement, useDefaultSection } = params.options;
|
|
46
46
|
let offers = [];
|
|
47
47
|
// optimize(2024-07-18~)
|
|
48
|
-
const event = await repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered', 'organizer']);
|
|
48
|
+
const event = await repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered', 'organizer', 'location', 'superEvent']);
|
|
49
49
|
// 座席指定利用可能かどうか
|
|
50
50
|
const eventOffers = event.offers;
|
|
51
51
|
const reservedSeatsAvailable = eventOffers?.itemOffered.serviceOutput?.reservedTicket?.ticketedSeat !== undefined;
|
|
52
52
|
if (reservedSeatsAvailable) {
|
|
53
|
-
const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
54
|
-
const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
53
|
+
// const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
54
|
+
// const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
55
|
+
const roomBranchCode = event.location.branchCode;
|
|
56
|
+
const movieTheaterBranchCode = event.superEvent.location.branchCode;
|
|
55
57
|
let defaultSectionCode;
|
|
56
58
|
if (useDefaultSection) {
|
|
57
59
|
const defaultSection = (await repos.section.findSectionsByRoom({
|
|
@@ -159,7 +161,7 @@ function findEventSeatOffersBySection(params) {
|
|
|
159
161
|
organizer: { id: { $eq: sellerId } },
|
|
160
162
|
id: { $eq: eventId },
|
|
161
163
|
typeOf: factory.eventType.ScreeningEvent
|
|
162
|
-
}, ['startDate', 'offers.itemOffered'])).shift();
|
|
164
|
+
}, ['startDate', 'offers.itemOffered', 'location', 'superEvent'])).shift();
|
|
163
165
|
if (event === undefined) {
|
|
164
166
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEvent);
|
|
165
167
|
}
|
|
@@ -167,8 +169,10 @@ function findEventSeatOffersBySection(params) {
|
|
|
167
169
|
const eventOffers = event.offers;
|
|
168
170
|
const reservedSeatsAvailable = eventOffers?.itemOffered.serviceOutput?.reservedTicket?.ticketedSeat !== undefined;
|
|
169
171
|
if (reservedSeatsAvailable) {
|
|
170
|
-
const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
171
|
-
const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
172
|
+
// const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
173
|
+
// const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
174
|
+
const roomBranchCode = event.location.branchCode;
|
|
175
|
+
const movieTheaterBranchCode = event.superEvent.location.branchCode;
|
|
172
176
|
const seats = await repos.seat.projectSeatsByScreeningRoom({
|
|
173
177
|
limit,
|
|
174
178
|
page,
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "6.0.0-alpha.
|
|
14
|
+
"@chevre/factory": "6.0.0-alpha.5",
|
|
15
15
|
"@cinerino/sdk": "13.2.0",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"postversion": "git push origin --tags",
|
|
100
100
|
"prepublishOnly": "npm run clean && npm run build"
|
|
101
101
|
},
|
|
102
|
-
"version": "24.0.0-alpha.
|
|
102
|
+
"version": "24.0.0-alpha.44"
|
|
103
103
|
}
|