add deleted attribute
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 45s
Pull Request Pipeline / lint (pull_request) Successful in 46s

This commit is contained in:
gelbeinhalb
2026-04-30 11:56:15 +02:00
parent 1ec1df3514
commit 66e657235a
6 changed files with 30 additions and 7 deletions

View File

@@ -7,12 +7,14 @@ class Team {
final String name;
final DateTime createdAt;
final List<Player> members;
final bool deleted;
Team({
String? id,
required this.name,
DateTime? createdAt,
required this.members,
this.deleted = false,
}) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now();
@@ -27,7 +29,8 @@ class Team {
: id = json['id'],
name = json['name'],
createdAt = DateTime.parse(json['createdAt']),
members = []; // Populated during import via DataTransferService
members = [],
deleted = json['deleted'] ?? false;
/// Converts the Team instance to a JSON object. Related objects are
/// represented by their IDs.
@@ -36,5 +39,6 @@ class Team {
'name': name,
'createdAt': createdAt.toIso8601String(),
'memberIds': members.map((member) => member.id).toList(),
'deleted': deleted,
};
}