Elwig: Update database to include new BKI wine varieties
All checks were successful
Test / Run tests (push) Successful in 2m43s

This commit is contained in:
2025-09-18 23:29:38 +02:00
parent 844fc5217a
commit a0dcaf7b4f
7 changed files with 48 additions and 8 deletions

View File

@@ -248,9 +248,10 @@ namespace Elwig.Helpers {
return c + 1;
}
public async Task<WineQualLevel> GetWineQualityLevel(double kmw) {
public async Task<WineQualLevel> GetWineQualityLevel(double kmw, string? maxQualId = null) {
return await WineQualityLevels
.Where(q => !q.IsPredicate && (q.MinKmw == null || q.MinKmw <= kmw))
.Where(q => maxQualId == null || q.QualId == "WEI" || q.QualId == maxQualId)
.OrderBy(q => q.MinKmw)
.LastAsync();
}