[FE-03] 커뮤니티 도메인 타입 정의 (community-types)
작업 내용 (설계 의도)
변경 사항
근거: 20260704-채팅시스템고도화-design-fe-app.md “API 연동 표”·BE TDD “REST API 계약”.
커뮤니티(동아리) 신규 DTO 타입을 신규 파일 api/community-types.ts에 정의한다. 기존 api/types.ts는 수정하지 않는다(Single Writer). 기존 post 게시판 타입과 무관한 별개 도메인이다.
CommunityResponse{id,name,description,visibility,sportCategory,memberCount,hostUserId,roomId}(roomId=전용 채팅방; 역제안 필드는 optional + 주석).CreateCommunityRequest{name,description,visibility,sportCategory}.CommunityVisibility(PUBLIC|PRIVATE),MemberRole(HOST|MEMBER),MembershipStatus(ACTIVE|PENDING_APPROVAL|LEFT|KICKED).CommunityMemberResponse{userId,role,status},MembershipResponse{status},TransferHostRequest{newHostUserId}.SportCategory유니온(축구/농구/야구 등 — PRD 종목 카테고리, BE 확정값 대기 주석).
any·검증 없는 단언 금지. BE 계약과 필드 일치. 계약 미정의 응답은 역제안 기준 초안 + “BE 확정 대기” 주석.
의존
- 없음 (wave 1)
다이어그램
클래스 의존
flowchart LR CommTypes[community-types.ts] --> Api[api/community.ts] CommTypes --> Hooks[lib/useCommunity.ts] CommTypes --> Screens[communities 화면]
테스트 케이스
tsc --noEmit통과,any·검증없는 단언 없음MembershipResponse.status가 계약의ACTIVE|PENDING_APPROVAL을 포함한다MemberRole·CommunityVisibility유니온이 BE 상태 전이 표와 일치한다CreateCommunityRequest필드가POST /communities계약과 일치한다