Skip to content

Commit

Permalink
Merge branch 'master' into CON-2182-Finance-content-api-banner
Browse files Browse the repository at this point in the history
  • Loading branch information
ben1stone-leftdfe committed Aug 18, 2020
2 parents 6ea674f + cc78b15 commit b4d8431
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
DECLARE @agreementVersion INT
SET IDENTITY_INSERT [employer_account].[Account] ON
INSERT INTO [employer_account].[Account] (Id, HashedId, PublicHashedId, Name, CreatedDate)
VALUES (@accountId, @accountHashedId, @accountPublicHashedId, @legalEntityName, GETDATE())
INSERT INTO [employer_account].[Account] (Id, HashedId, PublicHashedId, Name, CreatedDate, ApprenticeshipEmployerType)
VALUES (@accountId, @accountHashedId, @accountPublicHashedId, @legalEntityName, GETDATE(), 1)
SET IDENTITY_INSERT [employer_account].[Account] OFF
INSERT INTO [employer_account].[Membership] (AccountId, UserId, Role)
Expand Down Expand Up @@ -65,7 +65,7 @@ DECLARE @userRef UNIQUEIDENTIFIER = '87df36f4-78ad-47c7-84d7-900ef4c39920'

IF (NOT EXISTS (SELECT 1 FROM [employer_account].[User] WHERE UserRef = @userRef))
BEGIN
EXECUTE [employer_account].[UpsertUser] @userRef, '[email protected]', 'Test', 'Account'
EXECUTE [employer_account].[UpsertUser] @userRef, '[email protected]', 'Test', 'Account' , null
END

DECLARE @userId BIGINT = (SELECT Id FROM [employer_account].[User] WHERE UserRef = @userRef)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public static string EmployerFinanceAction(this UrlHelper helper, string path)
return AccountAction(helper, baseUrl, path);
}

public static string EmployerIncentivesAction(this UrlHelper helper)
{
var configuration = DependencyResolver.Current.GetService<EmployerAccountsConfiguration>();
var baseUrl = configuration.EmployerIncentivesBaseUrl;
var hashedAccountId = helper.RequestContext.RouteData.Values[ControllerConstants.AccountHashedIdRouteKeyName];
return Action(baseUrl, hashedAccountId.ToString());
}

public static string EmployerProjectionsAction(this UrlHelper helper, string path)
{
var configuration = DependencyResolver.Current.GetService<EmployerAccountsConfiguration>();
Expand Down Expand Up @@ -108,7 +116,7 @@ private static string CommitmentAction(UrlHelper helper, string baseUrl, string
var commitmentPath = hashedAccountId == null ? $"{path}" : $"{hashedAccountId}/{path}";

return Action(baseUrl, commitmentPath);
}
}

private static string Action(string baseUrl, string path)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ else
<h3 class="heading-medium"><a href="@Url.EmployerFinanceAction("finance")">Your finances</a></h3>
<p>View your financial transactions, connect with other employers and @(Model.Data.ApprenticeshipEmployerType == ApprenticeshipEmployerType.Levy ? "send or " : "")receive transfer funds.</p>
</div>

@if (Html.IsAuthorized("EmployerFeature.EmployerIncentives"))
{
<div class="card">
<h3 class="heading-medium"><a href="@Url.EmployerIncentivesAction()">Apply for the hire a new apprentice payment</a></h3>
<p>You can apply for the payment if you take on new apprentices between 1 August 2020 and 31 January 2021.</p>
</div>
}
</div>
</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public class EmployerAccountsConfiguration : ITopicMessagePublisherConfiguration
public string DatabaseConnectionString { get; set; }
public string EmployerAccountsBaseUrl { get; set; }
public string EmployerCommitmentsBaseUrl { get; set; }
public string EmployerCommitmentsV2BaseUrl { get; set; }
public string EmployerCommitmentsV2BaseUrl { get; set; }
public string EmployerFinanceBaseUrl { get; set; }
public string EmployerIncentivesBaseUrl { get; set; }
public string EmployerPortalBaseUrl { get; set; }
public string EmployerProjectionsBaseUrl { get; set; }
public string EmployerRecruitBaseUrl { get; set; }
Expand Down

0 comments on commit b4d8431

Please sign in to comment.