feat: Add User and UserBalance models with serialization methods

feat: Implement BalanceRepository for group balance calculations

feat: Create ExpenseRepository for managing expenses

feat: Add services for handling expenses and storage operations

fix: Update import paths for models in repositories and services

refactor: Rename CountContent to AccountContent in HomePage

chore: Add StorageService for image upload and management
This commit is contained in:
Dayron
2025-10-21 16:02:58 +02:00
parent 62eb434548
commit 4edbd1cf34
60 changed files with 1973 additions and 342 deletions

54
lib/models/account.dart Normal file
View File

@@ -0,0 +1,54 @@
import 'group_member.dart';
class Account {
final String id;
final String tripId;
final String groupId;
final String name;
final List<GroupMember> members;
Account({
required this.id,
required this.tripId,
required this.groupId,
required this.name,
List<GroupMember>? members,
}) : members = members ?? [];
factory Account.fromMap(Map<String, dynamic> map) {
return Account(
id: map['id'] as String,
tripId: map['tripId'] as String,
groupId: map['groupId'] as String,
name: map['name'] as String,
members: [],
);
}
Map<String, dynamic> toMap() {
return {
'id': id,
'tripId': tripId,
'groupId': groupId,
'name': name,
'members': members.map((member) => member.toMap()).toList(),
};
}
Account copyWith({
String? id,
String? tripId,
String? groupId,
String? name,
List<GroupMember>? members,
}) {
return Account(
id: id ?? this.id,
tripId: tripId ?? this.tripId,
groupId: groupId ?? this.groupId,
name: name ?? this.name,
members: members ?? this.members,
);
}
}