Update validation rules in ImportManualInboxCommand and ManualInboxDialog to allow season numbers starting from zero, reflecting the inclusion of special episodes and pilots. Adjust input constraints in the frontend to enhance user experience and ensure consistency with backend validation.
build / backend (push) Successful in 1m48s
build / frontend (push) Successful in 51s
tests / backend-tests (push) Successful in 2m2s

This commit is contained in:
Leonid Pershin
2026-07-26 15:53:09 +03:00
parent 7af6242003
commit 6bca42754c
3 changed files with 54 additions and 3 deletions
@@ -37,11 +37,12 @@ public sealed class ImportManualInboxCommandValidator
RuleFor(x => x.Items.Count).LessThanOrEqualTo(500);
RuleFor(x => x.ShowId).NotEmpty();
// Ноль — законный номер: пилот часто идёт как E00, а спецвыпуски живут в нулевом сезоне.
RuleForEach(x => x.Items)
.Must(i => i.Season is null or (> 0 and <= 99))
.Must(i => i.Season is null or (>= 0 and <= 99))
.WithMessage("Сезон вне допустимого диапазона.");
RuleForEach(x => x.Items)
.Must(i => i.Episode is null or (> 0 and <= 999))
.Must(i => i.Episode is null or (>= 0 and <= 999))
.WithMessage("Номер серии вне допустимого диапазона.");
}
}