Skip to content

feat(auth): Implement AuthViewModel and Factory

AGHARAHIMOV AGHASALIM requested to merge feature/auth-viewmodel into main

What does this MR do?

  • Implements the AuthViewModel, which will serve as the brain for the login and registration UI.
  • Introduces an AuthState sealed class to represent the UI state (Idle, Loading, Authenticated, Error).
  • Follows a TDD approach by including a unit test (AuthViewModelTest) that verifies the login logic using a mock repository.
  • Adds a basic ViewModelFactory to handle the creation of ViewModels that have constructor dependencies.

Why was this change needed?

This ViewModel acts as the crucial bridge between the authentication UI and the user data layer. By merging this now, the logic is ready to be connected to the LoginFragment as soon as its UI refactoring is complete, enabling a fully functional login flow.

Merge request reports