fixed generation of random challenge

This commit is contained in:
2026-04-12 14:18:46 +01:00
parent cd0dd8d7e1
commit 5d203bed67
2 changed files with 45 additions and 21 deletions
@@ -0,0 +1,13 @@
using Ardalis.Specification;
using BeReadyBackend.Models;
namespace BeReadyBackend.Specifications.RandomChallenges;
public class GetRandomChallengeByDateSpec : SingleResultSpecification<RandomChallenge>
{
public GetRandomChallengeByDateSpec(DateOnly today)
{
Query
.Where(x => x.GeneratedAt != null && DateOnly.FromDateTime(x.GeneratedAt.Value) == today);
}
}