import 'package:dio/dio.dart';

import '../../../../../core/locator/locator.dart';
import '../../../../../core/network/api_provider_imp.dart';

/// تماس‌های خامِ HTTP مربوط به احراز هویت (خروجی Response).
class AuthApiProvider {
  ApiProviderImp get _api => locator<ApiProviderImp>();

  Future<Response> loginOtp(String mobile) =>
      _api.post('/auth/login-otp', body: {'mobile': mobile});

  Future<Response> checkOtp(String mobile, String token) =>
      _api.post('/auth/check-otp', body: {'mobile': mobile, 'token': token});

  Future<Response> updateProfile(String firstName, String avatar) =>
      _api.post('/profile', body: {'first_name': firstName, 'avatar': avatar});

  Future<Response> me() => _api.get('/me');
}
