Skip to content

feat: implement Application layer for User Update API / ユーザー更新APIのApplication層実装 #502

Description

@zigzagdev

Overview / 概要

Implement UseCommand, UseCase, and Dto for the User Update API, as part of #500.

#500 の一環として、ユーザー更新APIのUseCommand・UseCase・Dtoを実装する。

Requirements / 要件

  • UseCommand: Validate that required keys exist in the request. Password must NOT be included — password change is a separate API with its own dedicated flow.
  • UseCase: Business logic for overwriting user data. Calls the repository and returns a UserDto.
  • Dto: Reuse the existing UserDto (no password field, which is correct as-is).

Design note / 設計メモ

Excluding password from UpdateUserCommand is the correct approach. Since password change is a separate endpoint, mixing it into the general update command would blur the responsibility of this UseCommand. Each Command should represent exactly the responsibility of its use case.

Tasks / タスク

  • Create UpdateUserCommand with key validation (no password field)
  • Create UpdateUserUseCase that calls UserRepositroyInterface::updateUser()
  • Reuse existing UserDto and UserDtoFactory for the response
  • Write unit tests for each class to meet Codecov patch coverage target

Parent issue / 親Issue

#500

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions