Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:56:29 -06:00
parent ad652bc070
commit 7d760b589e
91 changed files with 4366 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
using Core.Cerberos.Application.UseCases.Roles.Input;
using FluentValidation;
namespace Core.Cerberos.Application.UseCases.Roles.Validator
{
public class ChangeRoleStatusValidator : AbstractValidator<ChangeRoleStatusRequest>
{
public ChangeRoleStatusValidator()
{
RuleFor(i => i.Id).NotEmpty().NotNull().OverridePropertyName(x => x.Id).WithName("Role ID").WithMessage("Role ID is Obligatory.");
RuleFor(i => i.Status).NotNull().OverridePropertyName(x => x.Status).WithName("Status").WithMessage("Status is Obligatory.");
}
}
}

View File

@@ -0,0 +1,16 @@
using Core.Cerberos.Application.UseCases.Roles.Input;
using FluentValidation;
namespace Core.Cerberos.Application.UseCases.Roles.Validator
{
public class CreateRoleValidator : AbstractValidator<CreateRoleRequest>
{
public CreateRoleValidator()
{
RuleFor(i => i.Name).NotEmpty().NotNull().OverridePropertyName(x => x.Name).WithName("Role Name").WithMessage("Role Name is Obligatory.");
RuleFor(i => i.Description).NotEmpty().NotNull().OverridePropertyName(x => x.Description).WithName("Role Description").WithMessage("Role Description is Obligatory.");
RuleFor(i => i.Applications).NotNull().OverridePropertyName(x => x.Applications).WithName("AccesLevel").WithMessage("Role must have at least one application.");
RuleFor(i => i.Permissions).NotEmpty().NotNull().OverridePropertyName(x => x.Applications).WithName("Role permissions").WithMessage("Role Permissions are Obligatory.");
}
}
}

View File

@@ -0,0 +1,16 @@
using Core.Cerberos.Application.UseCases.Roles.Input;
using FluentValidation;
namespace Core.Cerberos.Application.UseCases.Roles.Validator
{
public class UpdateRoleValidator : AbstractValidator<UpdateRoleRequest>
{
public UpdateRoleValidator()
{
RuleFor(i => i.Name).NotEmpty().NotNull().OverridePropertyName(x => x.Name).WithName("Role Name").WithMessage("Role Name is Obligatory.");
RuleFor(i => i.Description).NotEmpty().NotNull().OverridePropertyName(x => x.Description).WithName("Role Description").WithMessage("Role Description is Obligatory.");
RuleFor(i => i.Applications).NotEmpty().NotNull().OverridePropertyName(x => x.Applications).WithName("Role applications").WithMessage("Role Applications are Obligatory.");
RuleFor(i => i.Permissions).NotEmpty().NotNull().OverridePropertyName(x => x.Applications).WithName("Role permissions").WithMessage("Role Permissions are Obligatory.");
}
}
}