initial commit

This commit is contained in:
2026-07-21 13:59:38 +07:00
commit c40792266a
1321 changed files with 100465 additions and 0 deletions
@@ -0,0 +1,35 @@
using Indotalent.Infrastructure.Database;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Features.Pipeline.SalesTeam.Cqrs;
public class GetSalesTeamListResponse
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
}
public record GetSalesTeamListQuery() : IRequest<List<GetSalesTeamListResponse>>;
public class GetSalesTeamListHandler : IRequestHandler<GetSalesTeamListQuery, List<GetSalesTeamListResponse>>
{
private readonly AppDbContext _context;
public GetSalesTeamListHandler(AppDbContext context) => _context = context;
public async Task<List<GetSalesTeamListResponse>> Handle(GetSalesTeamListQuery request, CancellationToken cancellationToken)
{
return await _context.SalesTeam
.AsNoTracking()
.OrderBy(x => x.Name)
.Select(x => new GetSalesTeamListResponse
{
Id = x.Id,
Name = x.Name,
Description = x.Description
})
.ToListAsync(cancellationToken);
}
}