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,35 @@
using Indotalent.Infrastructure.Database;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Features.Leave.LeaveRequest.Cqrs;
public class EmployeeLeaveReferenceResponse
{
public string? Id { get; set; }
public string? Code { get; set; }
public string? FullName { get; set; }
}
public record GetEmployeeLeaveReferenceQuery() : IRequest<List<EmployeeLeaveReferenceResponse>>;
public class GetEmployeeLeaveReferenceHandler : IRequestHandler<GetEmployeeLeaveReferenceQuery, List<EmployeeLeaveReferenceResponse>>
{
private readonly AppDbContext _context;
public GetEmployeeLeaveReferenceHandler(AppDbContext context) => _context = context;
public async Task<List<EmployeeLeaveReferenceResponse>> Handle(GetEmployeeLeaveReferenceQuery request, CancellationToken cancellationToken)
{
return await _context.Employee
.AsNoTracking()
.Where(x => x.EmployeeStatus == "Active")
.Select(x => new EmployeeLeaveReferenceResponse
{
Id = x.Id,
Code = x.Code,
FullName = $"{x.FirstName} {x.LastName}"
})
.ToListAsync(cancellationToken);
}
}