Skip to content

Conversation

@ggamnunq
Copy link
Contributor

@ggamnunq ggamnunq commented Sep 17, 2025

  • Tour API 호출하여 명소 저장 시 사진 없는 데이터는 제외
  • 연령별 이용객 분포 비율 조정

Summary by CodeRabbit

  • Bug Fixes

    • Listings now exclude places without images for a cleaner browsing experience.
    • Visitor statistics now consistently sum to 100%, improving accuracy and readability.
  • Refactor

    • Streamlined data-saving workflow to enhance reliability when importing multiple places.

@ggamnunq ggamnunq self-assigned this Sep 17, 2025
@ggamnunq ggamnunq merged commit 15704cd into main Sep 17, 2025
1 check passed
@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The service now filters out places without images before building the list, introduces a new saveAllPlaces workflow that iterates and saves each place via saveOne (transactional) with error logging, and replaces the visitor distribution generator with a weighted distribution that sums to 100.

Changes

Cohort / File(s) Summary
TourCommandService updates
src/main/kotlin/busanVibe/busan/domain/tourApi/service/TourCommandService.kt
- Filter: only persist places with non-empty images
- New method: saveAllPlaces(List<Place>) delegates to transactional saveOne per item with error logging
- Persistence path switched from commented repository saves to saveAllPlaces call
- Reworked visitor distribution to weighted values totaling 100

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Service as TourCommandService
  participant Repo as PlaceRepository

  Caller->>Service: saveAllPlaces(placeList)
  loop for each place in placeList
    alt has images (pre-filtered upstream)
      Service->>Service: saveOne(place) [@Transactional]
      Service->>Repo: save(place)
      Repo-->>Service: persisted place / id
    else no images
      Note over Service: Skipped earlier (not added to list)
    end
    opt error on save
      Service->>Service: log error and continue
    end
  end
  Service-->>Caller: return (void)
Loading
sequenceDiagram
  autonumber
  participant Service as TourCommandService

  Service->>Service: getRandomVisitorDistribution()
  Note over Service: Generate weighted randoms per group
  Service->>Service: scale values to sum to 100
  Service->>Service: adjust final value to enforce total=100
  Service-->>Service: distribution map (total 100)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through code with carrot-bright eyes,
Filtering pics—no empty surprise.
I batch-save places, one by one,
Log the bumps, then onward I run.
Visitors balanced to a perfect score—
A hundred percent, and room for more. 🥕

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6978944 and 138a1d5.

📒 Files selected for processing (1)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/service/TourCommandService.kt (2 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants