Added the API to get Recurring Payment Status
This commit is contained in:
parent
ff66d59472
commit
c285f2be03
@ -37,6 +37,18 @@ namespace Marco.Pms.Services.Controllers
|
||||
tenantId = userHelper.GetTenantId();
|
||||
}
|
||||
|
||||
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
||||
|
||||
[HttpGet("recurring-status/list")]
|
||||
public async Task<IActionResult> GetRecurringPaymentStatus()
|
||||
{
|
||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
var response = await _masterService.GetRecurringPaymentStatusAsync(loggedInEmployee, tenantId);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Currency APIs ===================================================================
|
||||
|
||||
[HttpGet("currencies/list")]
|
||||
|
||||
@ -53,6 +53,29 @@ namespace Marco.Pms.Services.Service
|
||||
_updateLogHelper = updateLogHelper ?? throw new ArgumentNullException(nameof(updateLogHelper));
|
||||
}
|
||||
|
||||
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
||||
|
||||
public async Task<ApiResponse<object>> GetRecurringPaymentStatusAsync(Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
_logger.LogDebug("GetRecurringPaymentStatusAsync called");
|
||||
|
||||
try
|
||||
{
|
||||
// Step 1: Fetch global recurring payment status
|
||||
var status = await _context.RecurringPaymentStatus.OrderBy(rps => rps.Name).ToListAsync();
|
||||
|
||||
_logger.LogInfo("Fetched {Count} recurring payment status records for tenantId: {TenantId}", status.Count, tenantId);
|
||||
|
||||
return ApiResponse<object>.SuccessResponse(status, $"{status.Count} record(s) of recurring payment status fetched successfully", 200);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error fetching recurring payment status");
|
||||
return ApiResponse<object>.ErrorResponse("An error occurred while fetching recurring payment status", ex.Message, 500);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Currency APIs ===================================================================
|
||||
|
||||
public async Task<ApiResponse<object>> GetCurrencyAsync(Employee loggedInEmployee, Guid tenantId)
|
||||
|
||||
@ -9,6 +9,12 @@ namespace Marco.Pms.Services.Service.ServiceInterfaces
|
||||
{
|
||||
public interface IMasterService
|
||||
{
|
||||
#region =================================================================== Recurring Payment Status APIs ===================================================================
|
||||
|
||||
Task<ApiResponse<object>> GetRecurringPaymentStatusAsync(Employee loggedInEmployee, Guid tenantId);
|
||||
|
||||
#endregion
|
||||
|
||||
#region =================================================================== Currency APIs ===================================================================
|
||||
|
||||
Task<ApiResponse<object>> GetCurrencyAsync(Employee loggedInEmployee, Guid tenantId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user