feat: Implement account management functionality with loading, creation, and error handling

This commit is contained in:
Dayron
2025-10-21 10:48:12 +02:00
parent c69618cbd9
commit 62eb434548
9 changed files with 520 additions and 245 deletions

View File

@@ -0,0 +1,63 @@
import 'package:equatable/equatable.dart';
import '../../data/models/account.dart';
import '../../data/models/group_member.dart';
abstract class AccountEvent extends Equatable {
const AccountEvent();
@override
List<Object?> get props => [];
}
class LoadAccountsByUserId extends AccountEvent {
final String userId;
const LoadAccountsByUserId(this.userId);
@override
List<Object?> get props => [userId];
}
class LoadAccountsByTrip extends AccountEvent {
final String tripId;
const LoadAccountsByTrip(this.tripId);
@override
List<Object?> get props => [tripId];
}
class CreateAccount extends AccountEvent {
final Account account;
const CreateAccount(this.account);
@override
List<Object?> get props => [account];
}
class UpdateAccount extends AccountEvent {
final String accountId;
final Account account;
const UpdateAccount({
required this.accountId,
required this.account,
});
@override
List<Object?> get props => [accountId, account];
}
class CreateAccountWithMembers extends AccountEvent {
final Account account;
final List<GroupMember> members;
const CreateAccountWithMembers({
required this.account,
required this.members,
});
@override
List<Object?> get props => [account, members];
}