Skip to content

feat: implement Presentation layer for GET /api/v1/users/{id} / Presentation層のuserById実装#512

Merged
zigzagdev merged 3 commits into
feat/user_find_by_idfrom
feat/user_find_by_id-presentation_layer
Jun 30, 2026
Merged

feat: implement Presentation layer for GET /api/v1/users/{id} / Presentation層のuserById実装#512
zigzagdev merged 3 commits into
feat/user_find_by_idfrom
feat/user_find_by_id-presentation_layer

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation / 目的

Implement the Controller and route for the User findById API as part of #507.

#507 の一環として、ユーザー取得APIのControllerとRouteを実装しました。

What I have done / 実施内容

  • UserController::getUserById(): call GetUserByIdUseCase and return UserDto as JSON
    • 200 on success
    • 404 when 'User not found.' exception is thrown
    • 500 on other errors with Log::error
  • Route: GET /api/v1/users/{id}

Test Results / テスト結果

Integration tests hitting the real DB and HTTP endpoint:

  • test_get_user_by_id_returns_200_with_user_data
  • test_get_user_by_id_returns_404_when_user_not_found

Closes #509

@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

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.57143% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.06%. Comparing base (bc8de06) to head (658cadb).

Files with missing lines Patch % Lines
...pp/Packages/Features/Controller/UserController.php 60.00% 8 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##             feat/user_find_by_id     #512      +/-   ##
==========================================================
+ Coverage                   58.78%   59.06%   +0.27%     
- Complexity                   1478     1488      +10     
==========================================================
  Files                         114      115       +1     
  Lines                        7505     7575      +70     
==========================================================
+ Hits                         4412     4474      +62     
- Misses                       3093     3101       +8     
Files with missing lines Coverage Δ
...rc/app/Packages/Features/Tests/GetUserByIdTest.php 100.00% <100.00%> (ø)
...pp/Packages/Features/Controller/UserController.php 77.77% <60.00%> (-22.23%) ⬇️
🚀 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

This comment was marked as low quality.

@zigzagdev zigzagdev merged commit 5224faf into feat/user_find_by_id Jun 30, 2026
27 checks passed
@zigzagdev zigzagdev deleted the feat/user_find_by_id-presentation_layer branch June 30, 2026 13:23
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 Presentation layer for User findById API / findById APIのPresentation層実装

1 participant