fix comments
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 40s
Pull Request Pipeline / lint (pull_request) Successful in 45s

This commit is contained in:
2026-03-09 21:00:13 +01:00
parent 4726d170a1
commit 23d00c64ab
5 changed files with 26 additions and 20 deletions

View File

@@ -3,6 +3,7 @@ import 'package:tallee/data/db/database.dart';
import 'package:tallee/data/db/tables/group_table.dart';
import 'package:tallee/data/db/tables/player_group_table.dart';
import 'package:tallee/data/dto/group.dart';
import 'package:tallee/data/dto/match.dart';
import 'package:tallee/data/dto/player.dart';
part 'group_dao.g.dart';
@@ -171,6 +172,12 @@ class GroupDao extends DatabaseAccessor<AppDatabase> with _$GroupDaoMixin {
});
}
/// Retrieves all matches associated with the given [groupId].
Future<List<Match>> getGroupMatches({required String groupId}) async {
final matches = await db.matchDao.getAllMatches();
return matches.where((match) => match.group?.id == groupId).toList();
}
/// Deletes the group with the given [id] from the database.
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> deleteGroup({required String groupId}) async {

View File

@@ -338,10 +338,10 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
return rowsAffected > 0;
}
/// Entfernt die Gruppen-Verknüpfung des Matches mit der gegebenen [matchId].
/// Setzt die groupId auf null.
/// Gibt `true` zurück, wenn mehr als 0 Zeilen betroffen waren, ansonsten `false`.
Future<bool> deleteMatchGroup({required String matchId}) async {
/// Removes the group association of the match with the given [matchId].
/// Sets the groupId to null.
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> removeMatchGroup({required String matchId}) async {
final query = update(matchTable)..where((g) => g.id.equals(matchId));
final rowsAffected = await query.write(
const MatchTableCompanion(groupId: Value(null)),