문의 상태값 수정: IN_PROGRESS → RESPONDED
- 문의 상태 필드 및 관련 로직/뷰 업데이트 - Validation 패턴 및 테스트 코드 반영 - 뷰 상태 배지 및 응답 섹션 표시 로직 수정
This commit is contained in:
@@ -25,7 +25,7 @@ public class InquiryDTO {
|
||||
@Size(max = 4000, message = "제목은 50자를 초과할 수 없습니다.")
|
||||
private String inquiryDetail;
|
||||
|
||||
@Pattern(regexp = "^(PENDING|IN_PROGRESS|CLOSED)$", message = "유효하지 않은 문의 상태입니다.")
|
||||
@Pattern(regexp = "^(PENDING|RESPONDED|CLOSED)$", message = "유효하지 않은 문의 상태입니다.")
|
||||
private String inquiryStatus;
|
||||
|
||||
private String inquirerName;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.eactive.apim.portal.djb.community.qna.constant;
|
||||
public final class DjbInquiryStatus {
|
||||
|
||||
public static final String PENDING = "PENDING";
|
||||
public static final String IN_PROGRESS = "IN_PROGRESS";
|
||||
public static final String RESPONDED = "RESPONDED";
|
||||
public static final String CLOSED = "CLOSED";
|
||||
|
||||
private DjbInquiryStatus() {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<div class="inquiry-detail-header">
|
||||
<div class="inquiry-header-top">
|
||||
<span class="inquiry-status-badge"
|
||||
th:classappend="${inquiry.inquiryStatus == 'IN_PROGRESS' ? 'inquiry-status-badge--completed' : (inquiry.inquiryStatus == 'CLOSED' ? 'inquiry-status-badge--closed' : 'inquiry-status-badge--pending')}"
|
||||
th:text="${inquiry.inquiryStatus == 'IN_PROGRESS' ? '답변완료' : (inquiry.inquiryStatus == 'CLOSED' ? '종료' : '답변대기')}">
|
||||
th:classappend="${inquiry.inquiryStatus == 'RESPONDED' ? 'inquiry-status-badge--completed' : (inquiry.inquiryStatus == 'CLOSED' ? 'inquiry-status-badge--closed' : 'inquiry-status-badge--pending')}"
|
||||
th:text="${inquiry.inquiryStatus == 'RESPONDED' ? '답변완료' : (inquiry.inquiryStatus == 'CLOSED' ? '종료' : '답변대기')}">
|
||||
답변대기
|
||||
</span>
|
||||
<div class="inquiry-header-right">
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Admin Response Section -->
|
||||
<div class="inquiry-response-section" th:if="${inquiry.inquiryStatus == 'IN_PROGRESS' or inquiry.inquiryStatus == 'CLOSED'}">
|
||||
<div class="inquiry-response-section" th:if="${inquiry.inquiryStatus == 'RESPONDED' or inquiry.inquiryStatus == 'CLOSED'}">
|
||||
<div class="inquiry-response-header">
|
||||
<span class="response-label">관리자 답변</span>
|
||||
<span class="response-date" th:text="${#temporals.format(inquiry.responseDate, 'yyyy.MM.dd')}">2025.11.02</span>
|
||||
|
||||
@@ -70,8 +70,8 @@
|
||||
<div class="row-cell" style="width: 100px;" data-label="작성자" th:text="${inquiry.maskedInquirerName}">홍**</div>
|
||||
<div class="row-cell" style="width: 120px;" data-label="처리상태">
|
||||
<span class="inquiry-status-badge"
|
||||
th:classappend="${inquiry.inquiryStatus == 'IN_PROGRESS' ? 'inquiry-status-badge--completed' : (inquiry.inquiryStatus == 'CLOSED' ? 'inquiry-status-badge--closed' : 'inquiry-status-badge--pending')}"
|
||||
th:text="${inquiry.inquiryStatus == 'IN_PROGRESS' ? '답변완료' : (inquiry.inquiryStatus == 'CLOSED' ? '종료' : '답변대기')}">
|
||||
th:classappend="${inquiry.inquiryStatus == 'RESPONDED' ? 'inquiry-status-badge--completed' : (inquiry.inquiryStatus == 'CLOSED' ? 'inquiry-status-badge--closed' : 'inquiry-status-badge--pending')}"
|
||||
th:text="${inquiry.inquiryStatus == 'RESPONDED' ? '답변완료' : (inquiry.inquiryStatus == 'CLOSED' ? '종료' : '답변대기')}">
|
||||
답변대기
|
||||
</span>
|
||||
</div>
|
||||
|
||||
+5
-5
@@ -54,7 +54,7 @@ class InquiryCommentPermissionCheckerTest {
|
||||
|
||||
@Test
|
||||
void canWrite_inProgressTrue() {
|
||||
assertTrue(checker.canWrite(inquiry("IN_PROGRESS")));
|
||||
assertTrue(checker.canWrite(inquiry("RESPONDED")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -64,14 +64,14 @@ class InquiryCommentPermissionCheckerTest {
|
||||
|
||||
@Test
|
||||
void canDelete_ownerInOpenTrue() {
|
||||
Inquiry i = inquiry("IN_PROGRESS");
|
||||
Inquiry i = inquiry("RESPONDED");
|
||||
InquiryComment c = comment("alice", i);
|
||||
assertTrue(checker.canDelete(c, user("alice")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void canDelete_otherUserFalse() {
|
||||
Inquiry i = inquiry("IN_PROGRESS");
|
||||
Inquiry i = inquiry("RESPONDED");
|
||||
InquiryComment c = comment("alice", i);
|
||||
assertFalse(checker.canDelete(c, user("bob")));
|
||||
}
|
||||
@@ -102,7 +102,7 @@ class InquiryCommentPermissionCheckerTest {
|
||||
|
||||
@Test
|
||||
void assertDeletable_notOwnerThrowsNotOwned() {
|
||||
Inquiry i = inquiry("IN_PROGRESS");
|
||||
Inquiry i = inquiry("RESPONDED");
|
||||
InquiryComment c = comment("alice", i);
|
||||
assertThrows(InquiryCommentNotOwnedException.class,
|
||||
() -> checker.assertDeletable(c, user("bob")));
|
||||
@@ -110,7 +110,7 @@ class InquiryCommentPermissionCheckerTest {
|
||||
|
||||
@Test
|
||||
void assertDeletable_ownerInOpenOk() {
|
||||
Inquiry i = inquiry("IN_PROGRESS");
|
||||
Inquiry i = inquiry("RESPONDED");
|
||||
InquiryComment c = comment("alice", i);
|
||||
assertDoesNotThrow(() -> checker.assertDeletable(c, user("alice")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user