feat: Implement Query endpoint for Connections puzzles
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO.Compression;
|
||||
using ConnectionsAPI.Models.Request;
|
||||
using FluentValidation;
|
||||
|
||||
@@ -15,5 +16,13 @@ public class QueryPuzzlesRequestValidator : Validator<QueryPuzzlesRequest>
|
||||
RuleFor(x => x.Count)
|
||||
.Must(x => x > 0)
|
||||
.WithMessage(x => "Item count must be a positive integer");
|
||||
|
||||
RuleFor(x => x.Year)
|
||||
.Must(x => x == null || (x != null && x >= 2021 && x <= DateTime.UtcNow.Year + 1))
|
||||
.WithMessage($"Year must be a valid year between 2021 and {DateTime.UtcNow.Year + 1}");
|
||||
|
||||
RuleFor(x => x.Month)
|
||||
.Must(x => x == null || (x != null && x >= 1 && x <= 12))
|
||||
.WithMessage("Month must be a valid month");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user