fix profile

This commit is contained in:
2026-08-18 15:09:53 +03:00
parent 80a95ece5b
commit 6513a004d9
16 changed files with 268 additions and 26 deletions

View File

@@ -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,

View File

@@ -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();

View 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();
}
}