Added an API to get list of team roles
This commit is contained in:
parent
62031046a1
commit
e7a21e9e2f
@ -40,7 +40,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
|
|
||||||
#region =================================================================== Job Status APIs ===================================================================
|
#region =================================================================== Job Status APIs ===================================================================
|
||||||
[HttpGet("job-status/list")]
|
[HttpGet("job-status/list")]
|
||||||
public async Task<IActionResult> GetJobStatusAsync([FromQuery] Guid? statusId, [FromQuery] Guid? projectId)
|
public async Task<IActionResult> GetJobStatus([FromQuery] Guid? statusId, [FromQuery] Guid? projectId)
|
||||||
{
|
{
|
||||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||||
var response = await _masterService.GetJobStatusAsync(statusId, projectId, loggedInEmployee, tenantId);
|
var response = await _masterService.GetJobStatusAsync(statusId, projectId, loggedInEmployee, tenantId);
|
||||||
@ -48,6 +48,16 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region =================================================================== Job Status APIs ===================================================================
|
||||||
|
[HttpGet("team-roles/list")]
|
||||||
|
public async Task<IActionResult> GetTeamRoles()
|
||||||
|
{
|
||||||
|
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||||
|
var response = await _masterService.GetTeamRolesAsync(loggedInEmployee, tenantId);
|
||||||
|
return StatusCode(response.StatusCode, response);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
||||||
|
|
||||||
[HttpGet("recurring-status/list")]
|
[HttpGet("recurring-status/list")]
|
||||||
|
|||||||
@ -129,6 +129,29 @@ namespace Marco.Pms.Services.Service
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region =================================================================== Team Roles APIs ===================================================================
|
||||||
|
|
||||||
|
public async Task<ApiResponse<object>> GetTeamRolesAsync(Employee loggedInEmployee, Guid tenantId)
|
||||||
|
{
|
||||||
|
_logger.LogDebug("GetTeamRolesAsync called");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Step 1: Fetch global team roles
|
||||||
|
var status = await _context.TeamRoleMasters.OrderBy(rps => rps.Name).ToListAsync();
|
||||||
|
|
||||||
|
_logger.LogInfo("Fetched {Count} team roles records for tenantId: {TenantId}", status.Count, tenantId);
|
||||||
|
|
||||||
|
return ApiResponse<object>.SuccessResponse(status, $"{status.Count} record(s) of team roles fetched successfully", 200);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Error fetching team roles");
|
||||||
|
return ApiResponse<object>.ErrorResponse("An error occurred while fetching team roles", ex.Message, 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
||||||
|
|
||||||
public async Task<ApiResponse<object>> GetRecurringPaymentStatusAsync(Employee loggedInEmployee, Guid tenantId)
|
public async Task<ApiResponse<object>> GetRecurringPaymentStatusAsync(Employee loggedInEmployee, Guid tenantId)
|
||||||
|
|||||||
@ -14,6 +14,10 @@ namespace Marco.Pms.Services.Service.ServiceInterfaces
|
|||||||
Task<ApiResponse<object>> GetJobStatusAsync(Guid? statusId, Guid? projectId, Employee loggedInEmployee, Guid tenantId);
|
Task<ApiResponse<object>> GetJobStatusAsync(Guid? statusId, Guid? projectId, Employee loggedInEmployee, Guid tenantId);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region =================================================================== Job Status APIs ===================================================================
|
||||||
|
Task<ApiResponse<object>> GetTeamRolesAsync(Employee loggedInEmployee, Guid tenantId);
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
||||||
Task<ApiResponse<object>> GetRecurringPaymentStatusAsync(Employee loggedInEmployee, Guid tenantId);
|
Task<ApiResponse<object>> GetRecurringPaymentStatusAsync(Employee loggedInEmployee, Guid tenantId);
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user