Added An APi to get Projects Completion Status
This commit is contained in:
parent
4108915b92
commit
d5a7ad0716
@ -206,6 +206,14 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return Ok(ApiResponse<object>.SuccessResponse(dashboardVM, "Project counts fetched successfully.", 200));
|
return Ok(ApiResponse<object>.SuccessResponse(dashboardVM, "Project counts fetched successfully.", 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("project-completion-status")]
|
||||||
|
public async Task<IActionResult> GetAllProjectsAsync()
|
||||||
|
{
|
||||||
|
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||||
|
var response = await _projectServices.GetAllProjectsAsync(string.Empty, 0, 0, loggedInEmployee, tenantId);
|
||||||
|
return StatusCode(response.StatusCode, response);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves a dashboard summary of total employees and today's attendance.
|
/// Retrieves a dashboard summary of total employees and today's attendance.
|
||||||
/// If a projectId is provided, it returns totals for that project; otherwise, for all accessible active projects.
|
/// If a projectId is provided, it returns totals for that project; otherwise, for all accessible active projects.
|
||||||
|
|||||||
@ -220,6 +220,12 @@ namespace Marco.Pms.Services.Service
|
|||||||
_logger.LogInfo("Cache HIT. All {ProjectCount} projects found in cache.", projectIds.Count);
|
_logger.LogInfo("Cache HIT. All {ProjectCount} projects found in cache.", projectIds.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pageNumber <= 0 || pageSize <= 0)
|
||||||
|
{
|
||||||
|
_logger.LogInfo("Successfully retrieved a total of {ProjectCount} projects.", responseVms.Count);
|
||||||
|
return ApiResponse<object>.SuccessResponse(responseVms, "Projects retrieved successfully.", 200);
|
||||||
|
}
|
||||||
|
|
||||||
var totalEntites = responseVms.Count;
|
var totalEntites = responseVms.Count;
|
||||||
var totalPages = (int)Math.Ceiling((double)totalEntites / pageSize);
|
var totalPages = (int)Math.Ceiling((double)totalEntites / pageSize);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user