Add validation and gateway creation
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 1m14s

This commit is contained in:
Maxime Adler
2025-04-14 16:23:45 +02:00
parent b16d997417
commit 3447fa6eb1
14 changed files with 101 additions and 49 deletions

View File

@@ -0,0 +1,25 @@
using FluentValidation;
using GameIdeas.Shared.Constants;
using GameIdeas.Shared.Dto;
namespace GameIdeas.BlazorApp.Pages.Games.Components;
public class GameValidation : AbstractValidator<GameDto>
{
public GameValidation()
{
RuleFor(g => g.Title)
.NotEmpty()
.NotNull()
.Matches(GlobalConstants.RegexName);
RuleFor(g => g.ReleaseDate)
.NotEmpty()
.NotNull();
RuleFor(g => g.Interest)
.NotNull()
.GreaterThanOrEqualTo(1)
.LessThanOrEqualTo(5);
}
}