fix profile
This commit is contained in:
@@ -2,6 +2,7 @@ class Tariff {
|
||||
final int id;
|
||||
final String title;
|
||||
final String description;
|
||||
final String descriptionJson;
|
||||
final bool isActive;
|
||||
final String currency;
|
||||
final double holdPrice; // Старт / бронь
|
||||
@@ -15,6 +16,7 @@ class Tariff {
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.descriptionJson,
|
||||
required this.isActive,
|
||||
required this.currency,
|
||||
required this.holdPrice,
|
||||
@@ -33,6 +35,7 @@ class Tariff {
|
||||
id: json['id'] ?? 0,
|
||||
title: json['title'] ?? 'Unknown',
|
||||
description: json['description'] ?? '',
|
||||
descriptionJson: json['descriptionJson'] ?? '',
|
||||
isActive: json['isActive'] ?? false,
|
||||
currency: currency['currency'] ?? 'BYN',
|
||||
holdPrice: (planPrice['hold'] as num?)?.toDouble() ?? 0.0,
|
||||
|
||||
@@ -5,6 +5,7 @@ import '../entities/user_profile.dart';
|
||||
|
||||
abstract class UserProfileRepository {
|
||||
Future<UserProfile> getProfile();
|
||||
Future<void> deleteProfile();
|
||||
Future<UserProfile?> updateProfile(UserProfile profile);
|
||||
Future<int?> uploadProfilePhoto(File imageFile);
|
||||
Future<UserCheckFlags?> checkUser();
|
||||
|
||||
21
lib/domain/usecase/delete_profile_usecase.dart
Normal file
21
lib/domain/usecase/delete_profile_usecase.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import '../entities/user_profile.dart';
|
||||
import '../repositories/auth_repository.dart';
|
||||
import '../repositories/pin_repository.dart';
|
||||
import '../repositories/profile_repository.dart';
|
||||
|
||||
class DeleteProfileUsecase {
|
||||
final UserProfileRepository repository;
|
||||
final PinRepository _pinRepository;
|
||||
final AuthRepository _authRepository;
|
||||
|
||||
|
||||
|
||||
DeleteProfileUsecase(this.repository, this._pinRepository, this._authRepository);
|
||||
|
||||
Future<void> call() {
|
||||
_pinRepository.removePin();
|
||||
repository.deleteProfile();
|
||||
return _authRepository.logout();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user