Add CRUDs and validation/controllers

This commit is contained in:
lumijiez
2025-06-17 15:16:02 +03:00
parent 922021d088
commit 40906bea78
48 changed files with 653 additions and 27 deletions

View File

@@ -0,0 +1,18 @@
using FluentValidation;
using Imprink.Application.Domains.Users;
namespace Imprink.Application.Validation.Users;
public class SetUserFullNameCommandValidator : AbstractValidator<SetUserFullNameCommand>
{
public SetUserFullNameCommandValidator()
{
RuleFor(x => x.FirstName)
.NotEmpty().WithMessage("FirstName is required.")
.Length(1, 50).WithMessage("FirstName must be between 1 and 50 characters.");
RuleFor(x => x.LastName)
.NotEmpty().WithMessage("LastName is required.")
.Length(1, 50).WithMessage("LastName must be between 1 and 50 characters.");
}
}

View File

@@ -0,0 +1,14 @@
using FluentValidation;
using Imprink.Application.Domains.Users;
namespace Imprink.Application.Validation.Users;
public class SetUserPhoneCommandValidator : AbstractValidator<SetUserPhoneCommand>
{
public SetUserPhoneCommandValidator()
{
RuleFor(x => x.PhoneNumber)
.NotEmpty().WithMessage("PhoneNumber is required.")
.Matches(@"^\+?[1-9]\d{1,14}$").WithMessage("PhoneNumber must be a valid phone number format.");
}
}