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
@ -91,7 +91,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
_logger.LogError("The employee Id sent by user is empty");
|
_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));
|
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);
|
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>();
|
List<EmployeeAttendanceVM> results = new List<EmployeeAttendanceVM>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user