Skip to content

Commit

Permalink
Revert "Very WIP"
Browse files Browse the repository at this point in the history
This reverts commit 37b2c51.
  • Loading branch information
ConorTill committed Sep 15, 2021
1 parent 37b2c51 commit e7cb757
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ public TransfersOrchestrator(

public async Task<OrchestratorResponse<TransfersIndexViewModel>> Index(string hashedAccountId)
{
bool renderCreateTransfersPledgeButton = true; //await _authorizationService.IsAuthorizedAsync(EmployerUserRole.OwnerOrTransactor);
bool renderCreateTransfersPledgeButton = await _authorizationService.IsAuthorizedAsync(EmployerUserRole.OwnerOrTransactor);

var accountId = _hashingService.DecodeValue(hashedAccountId);

var pledgesCount = await _levyTransferMatchingService.GetPledgesCount(accountId);
var applicationsCount = await _levyTransferMatchingService.GetApplicationsCount(accountId);

var viewModel = new OrchestratorResponse<TransfersIndexViewModel>()
{
Data = new TransfersIndexViewModel()
{
RenderCreateTransfersPledgeButton = renderCreateTransfersPledgeButton,
PledgesCount = pledgesCount,
ApplicationsCount = applicationsCount
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ public class TransfersIndexViewModel
{
public bool RenderCreateTransfersPledgeButton { get; set; }
public int PledgesCount { get; set; }
public int ApplicationsCount { get; set; }
}
}
12 changes: 0 additions & 12 deletions src/SFA.DAS.EmployerFinance.Web/Views/Transfers/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@
<a href="@Url.LevyMatchingTransfersAction("pledges")" class="button button-secondary">View my transfer pledges and applications</a>
</div>
</div>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-m">Apply for transfers funding</h2>
<p>Search transfers funding opportunities and apply for a transfer of funds.</p>
<div class="panel panel-border-wide">
You have <strong>@Model.Data.ApplicationsCount</strong> transfer applications.
</div>
<div class="govuk-button-group">
<a class="button" href="@Url.LevyMatchingTransfersAction("opportunities")" id="ApplyForTransfersButton">Apply for transfer opportunities</a>
<a href="@Url.LevyMatchingTransfersAction("applications")" class="button button-secondary">View applications I've submitted</a>
</div>
</div>
</div>

@section breadcrumb {
Expand Down
3 changes: 2 additions & 1 deletion src/SFA.DAS.EmployerFinance/Infrastructure/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ public ApiClient (
{
_httpClient = httpClient;
_config = options;
_httpClient.BaseAddress = new Uri("https://localhost:44350/");
_httpClient.BaseAddress = new Uri(_config.BaseUrl);
}

public async Task<TResponse> Get<TResponse>(IGetApiRequest request)
{
AddHeaders();

var response = await _httpClient.GetAsync(request.GetUrl).ConfigureAwait(false);

response.EnsureSuccessStatusCode();
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ namespace SFA.DAS.EmployerFinance.Services
public interface ILevyTransferMatchingService
{
Task<int> GetPledgesCount(long accountId);
Task<int> GetApplicationsCount(long accountId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,5 @@ public async Task<int> GetPledgesCount(long accountId)

return getPledgesResponse.TotalPledges;
}

public async Task<int> GetApplicationsCount(long accountId)
{
//var getApplicationsResponse = await _apiClient.Get<GetApplicationsResponse>(new GetApplicationsRequest(accountId));

//return getApplicationsResponse.ApplicationsCount;
return 2;
}
}
}

0 comments on commit e7cb757

Please sign in to comment.