import 'package:dartz/dartz.dart'; import '../../../../core/errors/failures.dart'; import '../../data/models/login_request_model.dart'; import '../entities/user_entity.dart'; /// Abstract repository interface for authentication operations /// /// This defines the contract that the data layer must implement. /// Returns Either for proper error handling. abstract class AuthRepository { /// Login with username and password /// /// Returns [Right(UserEntity)] on success /// Returns [Left(Failure)] on error Future> login(LoginRequestModel request); /// Logout current user /// /// Returns [Right(void)] on success /// Returns [Left(Failure)] on error Future> logout(); /// Refresh access token /// /// Returns [Right(UserEntity)] with new tokens on success /// Returns [Left(Failure)] on error Future> refreshToken(String refreshToken); /// Check if user is authenticated /// /// Returns true if valid access token exists Future isAuthenticated(); /// Get current user from local storage /// /// Returns [Right(UserEntity)] if user data exists /// Returns [Left(Failure)] if no user data found Future> getCurrentUser(); /// Clear authentication data (logout locally) /// /// Returns [Right(void)] on success /// Returns [Left(Failure)] on error Future> clearAuthData(); }