Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public List<VenueInfo> list(Long actorId) {
.collect(Collectors.toMap(row -> (Long) row[0], row -> (Long) row[1]));
var byVenue = layouts.findAll().stream().sorted(Comparator.comparing(layout -> layout.getId()))
.collect(Collectors.groupingBy(layout -> layout.getVenueId()));
return venues.findAll().stream().sorted(Comparator.comparing(venue -> venue.getName()))
return venues.findAll().stream().filter(venue -> "ACTIVE".equals(venue.getStatus()))
.sorted(Comparator.comparing(venue -> venue.getName()))
.map(venue -> new VenueInfo(venue.getId(), venue.getName(), venue.getAddress(),
byVenue.getOrDefault(venue.getId(), List.of()).stream()
.map(layout -> new LayoutInfo(layout.getId(), layout.getName(), layout.getStatus(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ void previewsVenueLayoutSeatsWithAuthorization() throws Exception {

@Test
void listsVenuesAndTheirLayoutsForOrganizers() throws Exception {
jdbc.update("INSERT INTO venues (name, address, timezone, status, created_at) VALUES ('Archived Hall', 'address', 'Asia/Seoul', 'ARCHIVED', UTC_TIMESTAMP(6))");
Long first = layoutFor(venueId);
Long second = layoutFor(venueId);
addSellableSeat(first);
entityManager.flush();
mockMvc.perform(get("/api/organizer/venues").with(actor(ownerId, "ORGANIZER")))
.andExpect(status().isOk())
.andExpect(jsonPath("$[?(@.name == 'Archived Hall')]").isEmpty())
.andExpect(jsonPath("$[?(@.venueId == " + venueId + ")].name").value(org.hamcrest.Matchers.hasItem("Hall")))
.andExpect(jsonPath("$[?(@.venueId == " + venueId + ")].layouts[0].layoutId").value(org.hamcrest.Matchers.hasItem(first.intValue())))
.andExpect(jsonPath("$[?(@.venueId == " + venueId + ")].layouts[1].layoutId").value(org.hamcrest.Matchers.hasItem(second.intValue())))
Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/api/ticketing.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

`PUT /api/organizer/concerts/{concertId}/section-prices`는 공개 전이며 회차가 없는 본인 공연의 공통 구역별 등급과 가격을 전체 설정한다.

`GET /api/organizer/venues`는 활성 ORGANIZER·ADMIN에게 공연장 ID·이름·주소와 소속 배치 ID·이름·상태·판매 가능 좌석 수를 반환한다. 기존 등록 정책과 같이 상태에 따른 필터는 적용하지 않는다. 좌석 수는 해당 배치의 판매 가능 좌석을 집계하며 공연장 고정 수용 인원은 아니다.
`GET /api/organizer/venues`는 활성 ORGANIZER·ADMIN에게 ACTIVE 공연장의 ID·이름·주소와 소속 배치 ID·이름·상태·판매 가능 좌석 수를 반환한다. 비활성 공연장은 목록에서 제외하며 기존 공연 이력은 보존한다. 좌석 수는 해당 배치의 판매 가능 좌석을 집계하며 공연장 고정 수용 인원은 아니다.

`GET /api/organizer/venues/{venueId}/layouts/{layoutId}/seats`는 활성 ORGANIZER·ADMIN에게 지정한 공연장에 속한 배치의 판매 가능 좌석을 물리 좌석 ID 순으로 반환한다. 각 항목은 `venueSeatId`, `sectionLabel`, `rowLabel`, `seatNumber`, `posX`, `posY`를 포함한다. 좌석이 없으면 빈 배열이며 배치가 없거나 다른 공연장에 속하면 404다. 인증 실패는 401, 권한 부족은 403이다.
```json
Expand Down
Loading