Register Use Case
domain/usecases
Overview
Creates a new account from a registration payload (email, password, displayName) and returns the freshly-issued User on success.
User Flow
- Controller builds RegisterParams from the form.
- Use case enforces password strength + email format.
- Calls AuthRepository.register(payload).
- Repository POSTs to /auth/signup, caches the returned token and user.
- Returns Either<AuthFailure, User>.
Cases & Edge Cases
- Email already taken → Left(AuthFailure.emailInUse) (HTTP 409).
- Server-side validation rejection → Left(AuthFailure.serverValidation(messages)).
- Network failure after token issued but before cache write — handled idempotently on next boot.
Code References
- lib/features/auth/domain/usecases/register_usecase.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Mirrors LoginUseCase intentionally — same shape, same return type — so the controller can reuse the same Either-handling helper.