PlanTempusApp/PlanTempus.Components/Accounts/Create/CreateAccountValidator.cs
Janus C. H. Knudsen 88812177a9 Migrate from User to Account domain concept
Renames core domain entities and services from "User" to "Account"

Refactors project-wide namespaces, classes, and database tables to use "Account" terminology
Updates related components, services, and database schema to reflect new domain naming
Standardizes naming conventions across authentication and organization setup features
2026-01-09 22:14:46 +01:00

23 lines
912 B
C#

using FluentValidation;
namespace PlanTempus.Components.Accounts.Create
{
public class CreateAccountValidator : AbstractValidator<CreateAccountCommand>
{
public CreateAccountValidator()
{
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email skal angives.")
.EmailAddress().WithMessage("Ugyldig emailadresse.")
.MaximumLength(256).WithMessage("Email må højst være 256 tegn.");
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password skal angives.")
.MinimumLength(8).WithMessage("Password skal være mindst 8 tegn.")
.Matches("[A-Z]").WithMessage("Password skal indeholde mindst ét stort bogstav.")
.Matches("[a-z]").WithMessage("Password skal indeholde mindst ét lille bogstav.")
.Matches("[0-9]").WithMessage("Password skal indeholde mindst ét tal.")
.Matches("[^a-zA-Z0-9]").WithMessage("Password skal indeholde mindst ét specialtegn.");
}
}
}