feat : new auth in chicken

This commit is contained in:
2025-08-02 15:09:06 +03:30
parent fae6703d8d
commit 8b698a8498
27 changed files with 1115 additions and 109 deletions

View File

@@ -0,0 +1,12 @@
import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart';
abstract class AuthRepository {
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest});
Future<void> logout();
Future<bool> hasAuthenticated();
Future<UserInfoModel?> getUserInfo(String phoneNumber);
}

View File

@@ -0,0 +1,25 @@
import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart';
import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart';
import 'auth_repository.dart';
class AuthRepositoryImpl implements AuthRepository {
final AuthRemoteDataSource authRemote;
AuthRepositoryImpl(this.authRemote);
@override
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest}) async =>
await authRemote.login(authRequest: authRequest);
@override
Future<void> logout() async => await authRemote.logout();
@override
Future<bool> hasAuthenticated() async => await authRemote.hasAuthenticated();
@override
Future<UserInfoModel?> getUserInfo(String phoneNumber) async =>
await authRemote.getUserInfo(phoneNumber);
}