Implemented an API endpoint that allows the system to record attendance entries (e.g., check-in and check-out) for a specific employee. This helps track employee working hours, presence, and status. #37

Merged
vikas.nale merged 3 commits from Ashutosh_Feature#183_Get_AttendanceLogs_By_EmployeeId into main 2025-05-06 12:12:26 +00:00
Showing only changes of commit 68c5021085 - Show all commits

View File

@ -91,7 +91,7 @@ namespace MarcoBMS.Services.Controllers
_logger.LogError("The employee Id sent by user is empty");
return BadRequest(ApiResponse<object>.ErrorResponse("Employee ID is required and must not be Empty.", "Employee ID is required and must not be empty.", 400));
}
List<Attendance> attendances = await _context.Attendes.Where(c => c.EmployeeID == employeeId && c.TenantId == TenantId).ToListAsync();
List<Attendance> attendances = await _context.Attendes.Where(c => c.EmployeeID == employeeId && c.TenantId == TenantId && c.AttendanceDate.Date >= fromDate && c.AttendanceDate.Date <= toDate).ToListAsync();
Employee? employee = await _context.Employees.Include(e => e.JobRole).FirstOrDefaultAsync(e => e.Id == employeeId && e.TenantId == TenantId && e.IsActive);
List<EmployeeAttendanceVM> results = new List<EmployeeAttendanceVM>();