/// User Info Repository Interface
///
/// Defines the contract for user information data operations.
library;

import 'package:worker/features/account/domain/entities/user_info.dart';

/// User Info Repository
///
/// Repository interface for user information operations.
/// Implementations should handle:
/// - Fetching user info from API
/// - Error handling and retries
/// - Optional local caching
abstract class UserInfoRepository {
  /// Get current user information
  ///
  /// Fetches the authenticated user's information from the API.
  ///
  /// Returns [UserInfo] entity with user data.
  ///
  /// Throws:
  /// - [UnauthorizedException] if session expired
  /// - [NetworkException] if network error occurs
  /// - [ServerException] if server error occurs
  Future<UserInfo> getUserInfo();

  /// Refresh user information
  ///
  /// Forces a refresh from the server, bypassing any cache.
  /// Useful after profile updates or when fresh data is needed.
  ///
  /// Returns [UserInfo] entity with fresh user data.
  Future<UserInfo> refreshUserInfo();

  /// Update user information
  ///
  /// Updates the authenticated user's profile information.
  ///
  /// [data] should contain:
  /// - full_name: String
  /// - date_of_birth: String (YYYY-MM-DD format)
  /// - gender: String
  /// - company_name: String?
  /// - tax_code: String?
  /// - avatar_base64: String? (base64 encoded image)
  /// - id_card_front_base64: String? (base64 encoded image)
  /// - id_card_back_base64: String? (base64 encoded image)
  /// - certificates_base64: List<String> (array of base64 encoded images)
  ///
  /// Returns updated [UserInfo] entity after successful update.
  ///
  /// Throws:
  /// - [UnauthorizedException] if session expired
  /// - [NetworkException] if network error occurs
  /// - [ServerException] if server error occurs
  Future<UserInfo> updateUserInfo(Map<String, dynamic> data);
}
