Moved dao methods

This commit is contained in:
2026-04-08 23:22:33 +02:00
parent e10f05adb5
commit 855b7c8bea
8 changed files with 155 additions and 148 deletions

View File

@@ -17,7 +17,6 @@ class PlayerMatchDao extends DatabaseAccessor<AppDatabase>
required String matchId,
required String playerId,
String? teamId,
int score = 0,
}) async {
await into(playerMatchTable).insert(
PlayerMatchTableCompanion.insert(
@@ -45,21 +44,6 @@ class PlayerMatchDao extends DatabaseAccessor<AppDatabase>
return players;
}
/// Retrieves a player's score for a specific match.
/// Returns null if the player is not in the match.
/// TODO: Implement
Future<int?> getPlayerScore({
required String matchId,
required String playerId,
}) async {
final result =
await (select(playerMatchTable)..where(
(p) => p.matchId.equals(matchId) & p.playerId.equals(playerId),
))
.getSingleOrNull();
return 0;
}
/// Updates the score for a player in a match.
/// Returns `true` if the update was successful, otherwise `false`.
Future<bool> updatePlayerScore({