Skip to content

fix(afternote): 종류 축 타입 2종 통폐합 + 서버 category 값 정합 — AfternoteCategory 흡수, 홈 탭 3종 400 해소 #689

Closed

Description

@OnlyReadOneBook

📜 Overview (Required)

애프터노트 한 건의 종류를 나타내는 축이 타입 셋으로 갈라져 있고, 그 타입들이 담은 값도 서버 계약과 어긋나 있다. 둘은 같은 코드 지점에서 만나므로 함께 정리한다 — AfternoteCategory 를 없애면 그것이 들고 있던 서버 파라미터 값(navKey)을 새 자리에 다시 쓰게 되는데, 그 값이 지금 틀렸다.

① 타입이 셋

타입 위치 값 쓰임
AfternoteType domain SOCIAL_NETWORK·BUSINESS·GALLERY_AND_FILES·ESTATE·MEMORIAL 도메인 모델 type, 상세 분기, 아이콘
AfternoteCategory presentation/shared 위 5값 + ALL, navKey 로 서버 파라미터 운반 홈 탭 필터

서버 원문은 category: String 이고 변환은 MappingUtils.categoryToAfternoteType 한 곳이다. 같은 축인데 타입이 둘이라 변수 이름도 타입마다 갈리고, 어느 것인지 이름으로 판별되지 않는다.

이 갈라짐이 #622 의 뿌리였다 — 도메인 모델에 종류가 들어 있는데도 서비스명 문자열로 카테고리를 되짚는 AfternoteServiceCatalog.serviceTypeFor 가 살아남아, 직접 입력 서비스의 아이콘이 전부 소셜 네트워크로 붙었다.

② 값이 서버와 불일치

서버 AfternoteCategoryType 전문은 이것뿐이다.

public enum AfternoteCategoryType {
    SOCIAL,
    GALLERY,
    PLAYLIST
}

목록 조회 파라미터(AfternoteController 의 @RequestParam(required = false) AfternoteCategoryType category)와 생성 바디(AfternoteCreateRequest.category) 둘 다 이 enum 타입이라 값이 어긋나면 400 이다. 서버 GlobalExceptionHandler 는 MethodArgumentTypeMismatchException 을 400 "요청 파라미터 형식이 올바르지 않습니다." 로, HttpMessageNotReadableException 을 400 "잘못된 요청 형식입니다. JSON 데이터를 확인해주세요." 로 돌려준다.

홈 카테고리 탭 6개 중 3개가 400 이다. AfternoteHomeViewModel 이 AfternoteCategory.navKey 를 그대로 category 쿼리로 싣는다.

탭 보내는 값 서버
전체 (null) OK
소셜네트워크 SOCIAL OK
갤러리 및 파일 GALLERY OK
비즈니스 BUSINESS 400 — 서버 enum 에 없음
재산 처리 ESTATE 400 — 서버 enum 에 없음
추억 노트 MEMORIAL 400 — 서버 값은 PLAYLIST

생성 경로도 같다. InputToRequest.kt:37 이 비즈니스 생성 바디에 category = "BUSINESS" 를 실어 보내 역직렬화가 깨진다. 추억 노트 생성만 EditorCategory.MEMORIAL.serverValue = "PLAYLIST" 로 맞게 나간다.

같은 값을 네 곳이 다르게 표현하는 것이 원인이다.

그중 ReceiverAfternoteListItemDtoToDomain 의 KDoc 은 서버가 3값이라는 것을 이미 정확히 적어 두고 있었다 — "서버 카테고리 enum(SOCIAL/GALLERY/PLAYLIST)을 (…) 정규화한다". 수신자 목록 변환만 서버 계약을 지키고 있었고, 홈 필터와 에디터가 5값을 보내고 있었다.

위치 추억 노트에 해당하는 값
AfternoteCategory.MEMORIAL.navKey (홈 필터 → 서버) "MEMORIAL"
EditorCategory.MEMORIAL.serverValue (에디터 → 서버) "PLAYLIST"
MappingUtils.categoryToAfternoteType (서버 → 도메인) "MUSIC"·"PLAYLIST" 만 수용, "MEMORIAL" 케이스 없음
ReceiverAfternoteListItemDtoToDomain.serverCategoryToTypeKey (서버 → 수신자 목록) "PLAYLIST"·"MUSIC" 만 수용

📌 Child Issue(Optional)

No response

📍 Note (Optional)

Activity

  1. changed the title [-]refactor(afternote): 애프터노트 종류 축 타입 3종 혼재 정리 — AfternoteServiceType 오명 포함[/-] [+]refactor(afternote): 애프터노트 종류 축 타입 3종 통폐합 판정 — AfternoteType·AfternoteCategory·EditorCategory[/+] on Aug 2, 2026
  2. changed the title [-]refactor(afternote): 애프터노트 종류 축 타입 3종 통폐합 판정 — AfternoteType·AfternoteCategory·EditorCategory[/-] [+]fix(afternote): 종류 축 타입 2종 통폐합 + 서버 category 값 정합 — AfternoteCategory 흡수, 홈 탭 3종 400 해소[/+] on Aug 3, 2026
  3. added
    bugSomething isn't working
    and removed
    enhancementNew feature or request
    on Aug 3, 2026
  4. changed the issue type fromtoon Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions