แก้รายงานการแสดงวันลา

This commit is contained in:
Suphonchai Phoonsawat 2024-01-22 12:09:36 +07:00
parent c0d7aa92cc
commit 34da86653f
4 changed files with 224 additions and 49 deletions

View file

@ -602,6 +602,17 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
}
}
public async Task<LeaveRequest?> GetLeavePeriodAsync(Guid keycloakUserId, DateTime date)
{
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
.Include(x => x.Type)
.Where(x => x.KeycloakUserId == keycloakUserId)
.Where(x => x.LeaveStatus == "APPROVE")
.Where(x => x.LeaveStartDate.Date >= date.Date && x.LeaveEndDate <= date.Date)
.FirstOrDefaultAsync();
return data;
}
#endregion
}
}