feat(product): 홈 카드 3종에 storeId 노출 (FE 상세 URL 대응) - #191
Conversation
프론트 상세 화면 URL이 /store/{storeId}/products/{productId},
/store/{storeId}/reviews/{reviewId} 구조라 홈 카드 클릭 시 storeId가
필요하다는 FE 요청 반영. 카드마다 상세 조회로 storeId를 알아내는
추가 요청을 없앤다.
- popularCakes.items[].storeId / randomCakes.items[].storeId /
customCakeShowcase[].storeId 추가 (additive, 기존 필드 불변)
- 세 조회 모두 원본 row가 store_id를 이미 갖고 있어(상품 store_id,
리뷰 store_id) select 확장 + 매핑만으로 처리 — 추가 쿼리 없음
회귀: 기존 매핑 테스트 3곳에 storeId 검증 추가(33건 통과).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🩺 NestJS Doctor — 89/100 (Good)진단 277건 (error 0).
architecture / security 상위 항목
|
🧹 knip — dead-code 리포트전체 리포트
|
Coverage report
Test suite run success1552 tests passing in 182 suites. Report generated by 🧪jest coverage report action from dcb24d5 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
배경
프론트의 상세 화면 URL 구조가 매장 id를 포함하는 형태입니다.
/store/{storeId}/products/{productId}/store/{storeId}/reviews/{reviewId}그런데 홈 신설 API의 카드 응답에는 상품/후기 id만 있어서, 카드를 탭했을 때 기존 상세 화면으로 바로 이동할 수 없습니다.
프론트에서 카드 클릭 시마다 상세 조회를 한 번 더 해서 storeId를 알아내는 우회도 가능하지만, 클릭마다 불필요한 요청이 생기고 URL 구조와도 어긋나므로 홈 응답에
storeId를 함께 포함하기로 했습니다.변경 내용
세 카드 타입에
storeId: ID!필드를 추가했습니다. 모두 additive 변경이라 기존 필드·쿼리는 영향이 없습니다.PopularCake.storeId— 상황별 인기 케이크 카드RandomCake.storeId— 랜덤 케이크 그리드 셀CustomCakeShowcaseItem.storeId— 제작 후기 카드 (후기 상세 URL 구성용)세 조회 모두 원본 데이터가 이미 매장 id를 갖고 있습니다 — 상품 카드 두 종은
product.store_id, 제작 후기는review.store_id. 따라서 추가 쿼리나 조인 없이 기존 select에 컬럼 하나를 더하고 매핑에 노출하는 것으로 끝나며, 응답 비용 변화도 사실상 없습니다.검증
storeId검증을 추가해 세 타입 모두 실제 매장 id가 매핑되는 것을 확인했습니다. 관련 스위트 33건 통과.yarn validate(lint + tsc + dto:check + arch:check + 커버리지 포함 전체 테스트) 통과.docs/guide-to-frontend/guide-home-screen.md, gitignore 경로)에도 세 쿼리 예시에storeId를 반영해 두었습니다.