Skip to content

feat: implement Infra and Application layers for favorite heritages list / お気に入り一覧のInfra・Application層実装 - #570

Merged
zigzagdev merged 4 commits into
feat/user-favoritefrom
feat/user-favorite-index-list-application
Aug 8, 2026
Merged

feat: implement Infra and Application layers for favorite heritages list / お気に入り一覧のInfra・Application層実装#570
zigzagdev merged 4 commits into
feat/user-favoritefrom
feat/user-favorite-index-list-application

Conversation

@zigzagdev

@zigzagdev zigzagdev commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Motivation / 目的

Continue the favorite heritages list feature. This PR adds the pieces needed to turn a user's favorite ids into a displayable list of world heritages:

  • Infra: WorldHeritageQueryService::getHeritagesByIds(), reusing the existing findByIdsPreserveOrder() + payload/DTO pipeline already used by searchHeritages().
  • Application: GetFavoriteHeritagesUseCase, which combines FavoriteRepository::getFavoriteWorldHeritageIds() with getHeritagesByIds() to return a WorldHeritageDtoCollection for a given user.

Pagination is intentionally out of scope — it will be added later once needed.

What I have done / 実施内容

  • Added WorldHeritageQueryServiceInterface::getHeritagesByIds(array $ids): WorldHeritageDtoCollection
  • Implemented it in WorldHeritageQueryService
  • Added GetFavoriteHeritagesUseCase::handle(int $userId): WorldHeritageDtoCollection

Test Results / テスト結果

  • test_returns_world_heritage_dto_collection
  • test_preserves_order_of_given_ids
  • test_returns_empty_collection_when_no_ids_given
  • test_skips_missing_ids_without_failing
  • test_handle_returns_world_heritage_dto_collection_for_favorite_ids
  • test_handle_returns_empty_collection_when_user_has_no_favorites

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.85057% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.05%. Comparing base (5e2a643) to head (74a2857).

Files with missing lines Patch % Lines
...orldHeritageQueryService_getHeritagesByIdsTest.php 97.67% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##             feat/user-favorite     #570      +/-   ##
========================================================
+ Coverage                 63.70%   64.05%   +0.35%     
- Complexity                 1657     1671      +14     
========================================================
  Files                       142      145       +3     
  Lines                      8607     8694      +87     
========================================================
+ Hits                       5483     5569      +86     
- Misses                     3124     3125       +1     
Files with missing lines Coverage Δ
...omains/WorldHeritage/WorldHeritageQueryService.php 96.56% <100.00%> (+0.08%) ⬆️
.../Tests/UseCase/GetFavoriteHeritagesUseCaseTest.php 100.00% <100.00%> (ø)
...s/UseCase/Favorite/GetFavoriteHeritagesUseCase.php 100.00% <100.00%> (ø)
...orldHeritageQueryService_getHeritagesByIdsTest.php 97.67% <97.67%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zigzagdev zigzagdev changed the title feat(Application): Favorite WorldHeritage Index Page ApplicationLayer feat: implement Infra and Application layers for favorite heritages list / お気に入り一覧のInfra・Application層実装 Aug 8, 2026

@zigzagdev zigzagdev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@zigzagdev
zigzagdev merged commit 04ecf9e into feat/user-favorite Aug 8, 2026
28 checks passed
@zigzagdev
zigzagdev deleted the feat/user-favorite-index-list-application branch August 8, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement Application layer for favorite heritages list API / お気に入り一覧APIのApplication層実装

1 participant