[FE-03] 앱 api/communityBooking.ts 신규 (소모임 예약 타입 + 함수)
작업 내용 (설계 의도)
변경 사항
소모임 예약 연동(community↔booking)의 타입·함수를 신규 파일 mobile/api/communityBooking.ts에 정의한다. BE TDD community 2개 신규 엔드포인트(POST /communities/{communityId}/bookings, GET /communities/{communityId}/bookings)를 미러링한다.
정의 대상:
- 타입:
CommunityBookingResponse(id/communityId/slotId/linkedByUserId + 표시정보 facilityId/date/timeRange/capacity — BESlotInfoGateway반환 형태),LinkBookingRequest { slotId: number }. - 함수:
listCommunityBookings(communityId),linkCommunityBooking(communityId, slotId).
의존
- 없음 (wave 1)
다이어그램
클래스 의존
flowchart LR CBApi["api/communityBooking.ts"] --> Client["api/be-client.ts"] Hook["lib/useCommunityBooking.ts (FE-09)"] --> CBApi
테스트 케이스
listCommunityBookings(5)가GET /communities/5/bookings를 호출한다linkCommunityBooking(5, 42)가POST /communities/5/bookingsbody{slotId:42}를 전송한다- 403 응답 시 에러가 전파된다
- 응답의 표시정보(facilityId/date/timeRange/capacity)가 타입에 존재한다