Initial commit

This commit is contained in:
2026-05-05 10:39:43 +02:00
commit b590ecdc35
87 changed files with 3934 additions and 0 deletions
@@ -0,0 +1,23 @@
using FastEndpoints;
using FluentValidation;
using MetaCourse.Api.DTOs.Courses;
namespace MetaCourse.Api.Validators.Courses;
public class CreateCourseDtoValidator : Validator<CreateCourseDto>
{
public CreateCourseDtoValidator()
{
RuleFor(x => x.Title)
.NotEmpty().WithMessage("Le titre est requis.")
.MinimumLength(3).WithMessage("Le titre doit contenir au moins 3 caractères.")
.MaximumLength(200).WithMessage("Le titre ne peut pas dépasser 200 caractères.");
RuleFor(x => x.Description)
.NotEmpty().WithMessage("La description est requise.")
.MaximumLength(2000).WithMessage("La description ne peut pas dépasser 2000 caractères.");
RuleFor(x => x.CreatorId)
.NotEqual(Guid.Empty).WithMessage("L'identifiant du créateur est invalide.");
}
}
@@ -0,0 +1,23 @@
using FastEndpoints;
using FluentValidation;
using MetaCourse.Api.DTOs.Courses;
namespace MetaCourse.Api.Validators.Courses;
public class UpdateCourseDtoValidator : Validator<UpdateCourseDto>
{
public UpdateCourseDtoValidator()
{
RuleFor(x => x.Id)
.NotEqual(Guid.Empty).WithMessage("L'identifiant est invalide.");
RuleFor(x => x.Title)
.NotEmpty().WithMessage("Le titre est requis.")
.MinimumLength(3).WithMessage("Le titre doit contenir au moins 3 caractères.")
.MaximumLength(200).WithMessage("Le titre ne peut pas dépasser 200 caractères.");
RuleFor(x => x.Description)
.NotEmpty().WithMessage("La description est requise.")
.MaximumLength(2000).WithMessage("La description ne peut pas dépasser 2000 caractères.");
}
}