Added An APi to get Projects Completion Status

This commit is contained in:
ashutosh.nehete 2025-11-19 18:30:16 +05:30
parent 4108915b92
commit d5a7ad0716
2 changed files with 14 additions and 0 deletions

View File

@ -206,6 +206,14 @@ namespace Marco.Pms.Services.Controllers
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>
/// 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.

View File

@ -220,6 +220,12 @@ namespace Marco.Pms.Services.Service
_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 totalPages = (int)Math.Ceiling((double)totalEntites / pageSize);