diff --git a/bottlenote-mono/src/main/resources/openapi/curation/program.json b/bottlenote-mono/src/main/resources/openapi/curation/program.json index b6e2a91dd..37c5854bb 100644 --- a/bottlenote-mono/src/main/resources/openapi/curation/program.json +++ b/bottlenote-mono/src/main/resources/openapi/curation/program.json @@ -110,6 +110,13 @@ "x-field-style": "plain-number", "x-display-name": "참가비" }, + "is_tbc": { + "type": "boolean", + "description": "행사 참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.", + "example": false, + "x-field-style": "none", + "x-display-name": "참가비 미정 여부" + }, "officialUrl": { "type": "string", "description": "행사 공식 페이지 URL", @@ -492,6 +499,19 @@ "description": "피드에서 행사 참가비를 표시하기 위해 포함한다." } }, + "is_tbc": { + "type": "boolean", + "description": "행사 참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.", + "example": false, + "x-field-style": "none", + "x-display-name": "참가비 미정 여부", + "x-feed": { + "enabled": true, + "role": "price-tbc", + "order": 41, + "description": "피드에서 행사 참가비 미정 여부를 구분하기 위해 포함한다." + } + }, "officialUrl": { "type": "string", "description": "행사 공식 페이지 URL", diff --git a/bottlenote-mono/src/main/resources/openapi/curation/whisky_tasting_event.json b/bottlenote-mono/src/main/resources/openapi/curation/whisky_tasting_event.json index 9f1e11d48..acd361280 100644 --- a/bottlenote-mono/src/main/resources/openapi/curation/whisky_tasting_event.json +++ b/bottlenote-mono/src/main/resources/openapi/curation/whisky_tasting_event.json @@ -89,6 +89,13 @@ "x-field-style": "plain-number", "x-display-name": "참가비(1인당)" }, + "is_tbc": { + "type": "boolean", + "description": "참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.", + "example": false, + "x-field-style": "none", + "x-display-name": "참가비 미정 여부" + }, "capacity": { "type": "integer", "minimum": 0, @@ -382,6 +389,19 @@ "description": "피드에서 참가비 정보를 표시하기 위해 포함한다." } }, + "is_tbc": { + "type": "boolean", + "description": "참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.", + "example": false, + "x-field-style": "none", + "x-display-name": "참가비 미정 여부", + "x-feed": { + "enabled": true, + "role": "price-tbc", + "order": 51, + "description": "피드에서 참가비 미정 여부를 구분하기 위해 포함한다." + } + }, "capacity": { "type": "integer", "description": "총 모집 인원수", diff --git a/bottlenote-mono/src/test/java/app/bottlenote/curation/service/CurationPlaceFieldContractTest.java b/bottlenote-mono/src/test/java/app/bottlenote/curation/service/CurationPlaceFieldContractTest.java index 6cdc29dc6..84429d8f2 100644 --- a/bottlenote-mono/src/test/java/app/bottlenote/curation/service/CurationPlaceFieldContractTest.java +++ b/bottlenote-mono/src/test/java/app/bottlenote/curation/service/CurationPlaceFieldContractTest.java @@ -154,6 +154,27 @@ void extractFeedPayload_exposesPlaceNameButNotKakaoPlaceId() throws IOException assertThat(feedPayload.has("kakaoPlaceId")).isFalse(); } + @Test + @DisplayName("가격 스펙은 무료와 미정 구분을 위한 is_tbc 값을 요청과 피드에 선언한다") + void priceSpecs_declareOptionalIsTbcForRequestResponseAndFeed() throws IOException { + for (String resource : List.of(TASTING, PROGRAM)) { + JsonNode request = OBJECT_MAPPER.valueToTree(schema(resource, "Request")); + JsonNode response = OBJECT_MAPPER.valueToTree(schema(resource, "Response")); + + assertThat(request.path("properties").path("is_tbc").path("type").asText()) + .isEqualTo("boolean"); + assertThat(request.path("required").toString()).doesNotContain("is_tbc"); + assertThat(response.path("properties").path("is_tbc").path("type").asText()) + .isEqualTo("boolean"); + assertThat(response.path("required").toString()).doesNotContain("is_tbc"); + assertThat( + response.path("properties").path("is_tbc").path("x-feed").path("enabled").asBoolean()) + .isTrue(); + assertThat(response.path("properties").path("is_tbc").path("x-feed").path("role").asText()) + .isEqualTo("price-tbc"); + } + } + @Test @DisplayName("네 스펙 문서 모두 스펙 자체 검증을 통과한다") void validateSpec_allSchemas_areValid() throws IOException {