WIP: Score implementation ergänzen #196

Draft
flixcoo wants to merge 23 commits from feature/191-score-implementation-ergaenzen into development
Showing only changes of commit bed8a05057 - Show all commits

View File

@@ -49,7 +49,11 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
.toList(); .toList();
await batch((batch) { await batch((batch) {
batch.insertAll(scoreTable, entries, mode: InsertMode.insertOrReplace); batch.insertAll(
ScoreEntryTable,
entries,
mode: InsertMode.insertOrReplace,
);
}); });
} }
@@ -181,10 +185,10 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
/// Returns `null` if there are no scores for the match. /// Returns `null` if there are no scores for the match.
Future<int?> getLatestRoundNumber({required String matchId}) async { Future<int?> getLatestRoundNumber({required String matchId}) async {
final query = selectOnly(scoreEntryTable) final query = selectOnly(scoreEntryTable)
..where(scoreTable.matchId.equals(matchId)) ..where(ScoreEntryTable.matchId.equals(matchId))
..addColumns([scoreTable.roundNumber.max()]); ..addColumns([ScoreEntryTable.roundNumber.max()]);
final result = await query.getSingle(); final result = await query.getSingle();
return result.read(scoreTable.roundNumber.max()); return result.read(ScoreEntryTable.roundNumber.max());
} }
/// Aggregates the total score for a player in a match by summing all their /// Aggregates the total score for a player in a match by summing all their