Initial commit

This commit is contained in:
Kevin Harlay
2026-09-07 13:33:22 +02:00
commit ebfaf6f5ec
295 changed files with 8786 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
using ExpenseTracker.Api.DTOs;
using FluentValidation;
namespace ExpenseTracker.Api.Validators;
public class CreateCategoryDtoValidator : AbstractValidator<CreateCategoryDto>
{
public CreateCategoryDtoValidator()
{
RuleFor(x => x.Name)
.NotEmpty()
.WithMessage("Name is required.")
.MaximumLength(100)
.WithMessage("Name must not exceed 100 characters.");
RuleFor(x => x.Color)
.NotEmpty()
.WithMessage("Color is required.")
.Matches(@"^#[0-9A-Fa-f]{6}$")
.WithMessage("Color must be a valid hex color in the format #RRGGBB.");
}
}