[volume-2] 요구사항 문서, 시퀀스 다이어그램, 클래스 다이어그램, ERD 작성#82
[volume-2] 요구사항 문서, 시퀀스 다이어그램, 클래스 다이어그램, ERD 작성#82dame2 wants to merge 16 commits intoLoopers-dev-lab:dame2from
Conversation
- CLAUDE.md 추가 (프로젝트 컨텍스트 및 개발 규칙) - spring-security-crypto 의존성 추가 - ErrorType에 UNAUTHORIZED, USER_NOT_FOUND, PASSWORD_MISMATCH 추가 - MySqlTestContainersConfig에 MYSQL_ROOT_PASSWORD 환경변수 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- User 엔티티 (필드 검증, BCrypt 암호화, 이름 마스킹) - UserRepository 인터페이스 - UserService (회원가입, 조회, 인증, 비밀번호 변경) - UserTest 단위 테스트 47건 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- UserJpaRepository (Spring Data JPA) - UserRepositoryImpl (Repository 구현체) - UserServiceIntegrationTest 통합 테스트 9건 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- UserFacade, UserInfo (Application 계층) - AuthenticatedUser, AuthenticatedUserArgumentResolver (헤더 인증) - WebMvcConfig (ArgumentResolver 등록) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- UserV1Controller (POST /users, GET /users/me, PATCH /users/me/password) - UserV1Dto (요청/응답 DTO) - UserV1ApiSpec (OpenAPI 스펙) - UserV1ApiE2ETest E2E 테스트 12건 - user-v1.http (IntelliJ HTTP Client) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- .claude/commands/create-pr.md (PR 템플릿 기반 자동 생성 스킬) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 01-requirements.md: 도메인별 필드/비즈니스 규칙, 유저 시나리오 - 02-sequence-diagrams.md: 주문/좋아요/브랜드 삭제 시퀀스 다이어그램 - 03-class-diagram.md: 계층별 클래스 구조 다이어그램 - 04-erd.md: 테이블 스키마, 인덱스, FK 정책 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: User 도메인 구현 (회원가입, 내 정보 조회, 비밀번호 변경)
This reverts commit 44bfc36.
- Brand/Product/ProductLike/Order/OrderItem 도메인 필드 정의 - 비즈니스 규칙 (BR-*) 및 검증 규칙 정의 - 유저 시나리오 9개 (US-001~009), 어드민 시나리오 7개 (AS-001~007) - API 명세 및 에러 타입 정의 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 주문 생성 시퀀스 (정상/재고 부족 플로우) - 좋아요 등록 시퀀스 (토글 방식: 신규/취소) - 브랜드 삭제 시퀀스 (Cascade 삭제) - 상품 목록 조회 시퀀스 (좋아요 수 포함) - 어드민 인증 플로우 (Interceptor + ArgumentResolver) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 전체 계층 구조 개요 (Layered Architecture) - Brand/Product/ProductLike/Order 도메인 클래스 - 인증 관련 클래스 (AdminAuthInterceptor, AdminUserArgumentResolver) - 공통 클래스 (BaseEntity, ApiResponse, CoreException, ErrorType) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 6개 테이블 스키마 (users, brands, products, product_likes, orders, order_items) - 인덱스 설계 및 FK 삭제 정책 - 쿼리 최적화 가이드 (좋아요순 정렬, 비관적 락) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- requirements-analysis 스킬 정의 - 요구사항 분석 워크플로우 가이드라인 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
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 You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
- Domain Layer: 순수 Java 엔티티 (Brand, Product, Like, Order) - Value Objects: Money, Stock, Quantity, ProductSort - Domain Services: 비즈니스 규칙 캡슐화 - Application Services: 트랜잭션 경계 및 BC 조합 - Infrastructure Layer: JPA 엔티티, Mapper, Repository 구현체 - Fake Repository: 단위 테스트용 in-memory 구현 - Interface Layer: REST API 컨트롤러 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📌 Summary
🧭 Context & Decision
문제 정의
선택지와 결정
좋아요 설계 방식:
좋아요 등록 정책:
어드민 인증:
주문 로직:
🏗️ Design Overview
변경 범위
.docs/design/01-requirements.md- 요구사항 명세.docs/design/02-sequence-diagrams.md- 시퀀스 다이어그램.docs/design/03-class-diagram.md- 클래스 다이어그램.docs/design/04-erd.md- ERD.claude/skills/SKILL.md- 요구사항 분석 스킬주요 컴포넌트 책임
01-requirements.md: 도메인별 필드, 비즈니스 규칙, 유저 시나리오 16개, API 명세02-sequence-diagrams.md: 주문/좋아요/브랜드 삭제/상품 조회/어드민 인증 시퀀스03-class-diagram.md: 계층별 클래스 구조 (Controller → Facade → Service → Repository)04-erd.md: 6개 테이블 스키마, 인덱스, FK 정책, 쿼리 최적화 가이드🔁 Flow Diagram
주문 생성 Flow (설계 문서 기반)
sequenceDiagram autonumber participant Client participant OrderV1Controller participant OrderFacade participant OrderService participant ProductService participant DB Client->>OrderV1Controller: POST /api/v1/orders OrderV1Controller->>OrderFacade: createOrder(userId, items) OrderFacade->>OrderService: createOrder(userId, items) Note over OrderService: @Transactional 시작 loop 각 주문 항목 OrderService->>ProductService: getProductForOrder(productId) ProductService->>DB: SELECT ... FOR UPDATE DB-->>ProductService: Product OrderService->>OrderService: 재고 검증 alt 재고 부족 OrderService-->>Client: 400 INSUFFICIENT_STOCK (전체 롤백) end OrderService->>ProductService: decreaseStock(productId, quantity) end OrderService->>DB: INSERT orders, order_items Note over OrderService: @Transactional 커밋 OrderService-->>Client: 201 Created좋아요 토글 Flow (설계 문서 기반)
sequenceDiagram autonumber participant Client participant ProductLikeV1Controller participant ProductLikeFacade participant ProductLikeService participant DB Client->>ProductLikeV1Controller: POST /api/v1/products/{id}/likes ProductLikeV1Controller->>ProductLikeFacade: like(userId, productId) ProductLikeFacade->>ProductLikeService: like(userId, productId) ProductLikeService->>DB: SELECT FROM product_likes alt 좋아요 없음 ProductLikeService->>DB: INSERT (신규 등록) ProductLikeService-->>Client: 200 OK "좋아요 등록" else 좋아요 존재 ProductLikeService->>DB: DELETE (토글 취소) ProductLikeService-->>Client: 200 OK "좋아요 취소" end📋 Checklist