initial commit

This commit is contained in:
2026-07-21 14:08:10 +07:00
commit f7cf118326
533 changed files with 41762 additions and 0 deletions
@@ -0,0 +1,44 @@
using FluentValidation;
using Indotalent.Shared.Consts;
namespace Indotalent.Features.Organization.Employee.Cqrs;
public class UpdateEmployeeValidator : AbstractValidator<UpdateEmployeeRequest>
{
public UpdateEmployeeValidator()
{
RuleFor(x => x.Id)
.NotEmpty().WithMessage("Employee ID is required for update");
RuleFor(x => x.Code)
.NotEmpty().WithMessage("Employee Code is required")
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"Code cannot exceed {GlobalConsts.StringLengthShort} characters");
RuleFor(x => x.FirstName)
.NotEmpty().WithMessage("First Name is required")
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"First Name cannot exceed {GlobalConsts.StringLengthShort} characters");
RuleFor(x => x.LastName)
.NotEmpty().WithMessage("Last Name is required")
.MaximumLength(GlobalConsts.StringLengthShort).WithMessage($"Last Name cannot exceed {GlobalConsts.StringLengthShort} characters");
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required")
.EmailAddress().WithMessage("Invalid email format");
RuleFor(x => x.BranchId)
.NotEmpty().WithMessage("Please select a Branch");
RuleFor(x => x.DepartmentId)
.NotEmpty().WithMessage("Please select a Department");
RuleFor(x => x.DesignationId)
.NotEmpty().WithMessage("Please select a Designation");
RuleFor(x => x.GradeId)
.NotEmpty().WithMessage("Please select a Salary Grade");
RuleFor(x => x.BasicSalary)
.GreaterThan(0).WithMessage("Basic Salary must be greater than 0");
}
}