initial commit

This commit is contained in:
2026-07-21 13:52:43 +07:00
commit f0e6f38940
881 changed files with 66309 additions and 0 deletions
@@ -0,0 +1,38 @@
using Indotalent.Infrastructure.Database;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Features.Thirdparty.PatientContact.Cqrs;
public class LookupPatientContactResponse
{
public List<LookupItem> Patients { get; set; } = new();
}
public class LookupItem
{
public string? Id { get; set; }
public string? Name { get; set; }
}
public record LookupPatientContactQuery() : IRequest<LookupPatientContactResponse>;
public class LookupPatientContactHandler : IRequestHandler<LookupPatientContactQuery, LookupPatientContactResponse>
{
private readonly AppDbContext _context;
public LookupPatientContactHandler(AppDbContext context) => _context = context;
public async Task<LookupPatientContactResponse> Handle(LookupPatientContactQuery request, CancellationToken cancellationToken)
{
var result = new LookupPatientContactResponse();
result.Patients = await _context.Patient
.AsNoTracking()
.OrderBy(x => x.Name)
.Select(x => new LookupItem { Id = x.Id, Name = x.Name })
.ToListAsync(cancellationToken);
return result;
}
}