import 'package:social_app/core/api/i_api_client.dart'; import 'models/signup_request.dart'; import 'models/login_request.dart'; import 'models/auth_response.dart'; class AuthApi { final IApiClient _client; static const _prefix = '/api/v1/auth'; AuthApi(this._client); Future sendOtp(OtpSendRequest request) async { await _client.post('$_prefix/otp/send', data: request.toJson()); } Future createPhoneSession(LoginRequest request) async { final response = await _client.post( '$_prefix/phone-session', data: request.toJson(), ); return AuthResponse.fromJson(response.data); } Future refreshSession(RefreshRequest request) async { final response = await _client.post( '$_prefix/sessions/refresh', data: request.toJson(), ); return AuthResponse.fromJson(response.data); } Future deleteSession(LogoutRequest request) async { await _client.delete('$_prefix/sessions', data: request.toJson()); } }