feat: 저장된 시뮬레이션 목록 및 상세 조회 API 구현 - #130
Conversation
|
Warning Review limit reached
Next review available in: 10 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthrough저장된 시뮬레이션 목록과 상세 결과 조회 기능을 추가했다. 목록은 페이지네이션과 요약 응답을 사용한다. 상세 조회는 소유권을 검증한다. 관련 저장소 계약, 오류 코드, API 문서와 서비스·컨트롤러 테스트를 추가했다. Changes저장 시뮬레이션 조회
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
actor 인증된 사용자
participant SimulationController
participant SimulationServiceImpl
participant BudgetSimulationRepository
participant BudgetSimulationItemRepository
인증된 사용자->>SimulationController: GET /api/v1/simulations
SimulationController->>SimulationServiceImpl: findMySimulations(userId, pageable)
SimulationServiceImpl->>BudgetSimulationRepository: 사용자별 페이지 조회
BudgetSimulationRepository-->>SimulationServiceImpl: Page<BudgetSimulation>
SimulationServiceImpl->>BudgetSimulationItemRepository: 항목 일괄 조회
BudgetSimulationItemRepository-->>SimulationServiceImpl: 정렬된 항목 목록
SimulationServiceImpl-->>SimulationController: Page<SimulationSummaryResponse>
SimulationController-->>인증된 사용자: PageResponse<SimulationSummaryResponse>
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/chaeso/zip/server/simulation/application/dto/SimulationItemResponse.java`:
- Around line 20-46: Update SimulationItemResponse so optional fields whose
descriptions indicate omission when unavailable are either omitted from JSON via
JsonInclude(NON_NULL) or explicitly represented as nullable in the OpenAPI
schema. Apply this consistently to channelProductId, allocationPct,
estImpressions, estClicks, cpcWon, cpmWon, and the nullable insufficient-budget
field, while preserving requiredMode.REQUIRED for allocatedBudgetWon and
isExecutable.
In
`@src/main/java/chaeso/zip/server/simulation/application/dto/SimulationSummaryResponse.java`:
- Line 53: SimulationSummaryResponse의 channelCount 계산이 문서 의미와 일치하도록 수정하십시오.
items에서 notAllocated처럼 배정 예산이 0원인 항목을 제외하고 실제 예산이 배분된 매체 수만 계산하며, 관련 필드 설명도 해당
의미를 유지하십시오.
In
`@src/main/java/chaeso/zip/server/simulation/application/SimulationServiceImpl.java`:
- Around line 105-110: Update findSimulation in SimulationServiceImpl to first
resolve the simulation by ID, preserving SimulationNotFoundException for missing
records, then compare its userId with the requested userId and throw a
403-specific ownership exception when they differ. Add the corresponding HTTP
403 entry to SimulationErrorCode and cover both ownership failure and
missing-resource behavior in service and controller tests.
In
`@src/main/java/chaeso/zip/server/simulation/presentation/SimulationApiDocs.java`:
- Around line 235-238: Update the 400 ApiResponse example in the relevant
SimulationApiDocs annotation to use a dedicated page/size validation example
instead of VALIDATION_ERROR_EXAMPLE. Define or reuse an example matching
SimulationPageRequest’s actual validation message and ApiResponse response
structure, identifying the invalid page or size field and its range violation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ba651539-02e7-4b92-abe3-f6112ec67e4a
📒 Files selected for processing (15)
src/main/java/chaeso/zip/server/simulation/application/SimulationService.javasrc/main/java/chaeso/zip/server/simulation/application/SimulationServiceImpl.javasrc/main/java/chaeso/zip/server/simulation/application/dto/SimulationItemResponse.javasrc/main/java/chaeso/zip/server/simulation/application/dto/SimulationResponse.javasrc/main/java/chaeso/zip/server/simulation/application/dto/SimulationSummaryResponse.javasrc/main/java/chaeso/zip/server/simulation/domain/SimulationErrorCode.javasrc/main/java/chaeso/zip/server/simulation/domain/SimulationNotFoundException.javasrc/main/java/chaeso/zip/server/simulation/domain/entity/BudgetSimulationItem.javasrc/main/java/chaeso/zip/server/simulation/domain/repository/BudgetSimulationItemRepository.javasrc/main/java/chaeso/zip/server/simulation/domain/repository/BudgetSimulationRepository.javasrc/main/java/chaeso/zip/server/simulation/presentation/SimulationApiDocs.javasrc/main/java/chaeso/zip/server/simulation/presentation/SimulationController.javasrc/main/java/chaeso/zip/server/simulation/presentation/dto/SimulationPageRequest.javasrc/test/java/chaeso/zip/server/simulation/application/SimulationServiceImplTest.javasrc/test/java/chaeso/zip/server/simulation/presentation/SimulationControllerTest.java
|
머지를 막을 필요가 있는 이슈를 찾지 못했습니다. |
* chore: AWS S3 공개 버킷 추가 (#126) * feat(infra): add public S3 bucket and upload commands for static assets * docs: document public static assets S3 bucket * chore: remove unused region field from onboarding S3 test config * chore(infra): increase EC2 root volume to 30GB and switch to gp3 * fix: address review feedback on public assets bucket * fix(infra): scope down public bucket permissions and fix access log delivery * feat: 저장된 시뮬레이션 목록 및 상세 조회 API 구현 (#130) * fix(simulation): mark optional response fields NOT_REQUIRED instead of nullable * feat(simulation): add saved simulation detail API * feat(simulation): add paginated my-simulations list API * chore(simulation): drop unused SimulationNotFoundException import * fix(simulation): omit null fields from simulation item responses * fix(simulation): count only funded channels in list summaries * docs(simulation): add a page/size example to the list API 400 response * feat: 채널 추천 결과 저장 API 구현 (#133) * fix(security): scope the public recommendations path to GET * fix(openapi): publish data and error as required on response wrappers * feat(recommendation): add channel recommendation save API * fix(recommendation): serialize saves per onboarding * feat: add flyway migration v16 * feat(channel): filter the channel list by primary category (#134) * feat: 온보딩 나이대 응답에 "잘 모르겠어요"(UNDECIDED) 추가 (#138) * feat(infra): disable aws scheduler * refactor(performance): build AdPerformance via Lombok builder instead of positional constructor * feat(onboarding): let users answer "don't know" for target age band * refactor(onboarding): extract OnboardingNotFoundException for id-based lookups * test(onboarding): cover UNDECIDED-alone and AdPerformance ratio branches --------- Co-authored-by: Yelim Lee <142207312+1117mg@users.noreply.github.com>
🔗 관련 이슈
Closes #118
📝 작업 내용
GET /api/v1/simulations)page/size페이지네이션(기본 5건, 최대 50건)GET /api/v1/simulations/{simulationId})nullable = true를requiredMode = NOT_REQUIRED로 교체✅ 체크리스트
💬 리뷰 참고 사항
채널 목록은
@SortDefault+Sort로 클라이언트가 정렬을 바꿀 수 있지만, 마이페이지의 예산 시뮬레이션 결과 목록은 최신순 고정이 요구사항이라 레포지토리 메서드에 정렬방식을 고정하고Sort를 아예 받지 않았습니다.채널 목록은
page/size를 모두 생략하면 전체 조회이지만, 시뮬레이션은 사용자당 저장 개수 제한이 없어서 전체 조회를 기본값으로 두지 않고 항상 페이지 단위로 끊어 조회합니다.Summary by CodeRabbit