Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

targeted trust engagement #1236

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
using System.ComponentModel;

namespace ConcernsCaseWork.API.Contracts.TargetedTrustEngagement
{
public enum TrustEngagementActivity
{
[Description("Budget Forecast Return/Accounts Return driven")]
BudgetForecast = 1,
[Description("Executive pay engagement")]
ExecutivePayEngagement = 2,
[Description("Finance returns assurance")]
FinanceReturnsAssurance = 3,
[Description("Reserves oversight assurance project")]
ReservesOversightAssurance = 4,
[Description("Local proactive engagement")]
LocalProactiveEngagement = 5,
[Description("Other vulnerability")]
OtherVulnerability = 6,
[Description("No engagement activities were taken forward")]
NoEngagement = 7
}

public enum SubTrustEnagementActivity
{
[Description("Category 1")]
Category1 = 1,
[Description("Category 2")]
Category2 = 2,
[Description("Category 3")]
Category3 = 3,
[Description("Category 4")]
Category4 = 4,
[Description("CEO's")]
Ceos = 5,
[Description("Leadership")]
Leadership = 6,
[Description("CEO's and Leadership")]
CeosAndLeadership = 7,
[Description("Audit issues")]
AuditIssues = 8,
[Description("Regularity issues")]
RegularityIssues = 9,
[Description("Management letter issues")]
ManagementLetterIssues = 10,
[Description("Annual summary internal scrutiny reports")]
AnnualSummaryInternalScrutiny = 11,
[Description("Priority 1")]
Priority1 = 12,
[Description("Priority 2")]
Priority2 = 13,
[Description("Priority 3")]
Priority3 = 14,
[Description("Priority 4")]
Priority4 = 15,
BudgetForecastDriven = 16,
ExecutivePayEngagement = 17,
FinanceReturnsAssurance = 18,
ReservesOversightAssurance = 19,
LocalProactiveEngagement = 20,
OtherVunerability = 21,
}

public static class TrustEngagementActivityExtensions
{
public static SubTrustEnagementActivity[] GetSubActivities(this TrustEngagementActivity trustEngagementActivity)
{
switch (trustEngagementActivity)
{
case TrustEngagementActivity.BudgetForecast:
return GetBudgetForecastSubActivities();
case TrustEngagementActivity.ExecutivePayEngagement:
return GetExecutivePayEngagementSubActivities();
case TrustEngagementActivity.FinanceReturnsAssurance:
return GetFinanceReturnsAssuranceSubActivities();
case TrustEngagementActivity.ReservesOversightAssurance:
return GetReservesOversightAssuranceSubActivities();
default:
return [];
}
}

public static SubTrustEnagementActivity[] GetBudgetForecastSubActivities()
{
return
[
SubTrustEnagementActivity.Category1,
SubTrustEnagementActivity.Category2,
SubTrustEnagementActivity.Category3,
SubTrustEnagementActivity.Category4,
];
}

public static SubTrustEnagementActivity[] GetExecutivePayEngagementSubActivities()
{
return
[
SubTrustEnagementActivity.Ceos,
SubTrustEnagementActivity.Leadership,
SubTrustEnagementActivity.CeosAndLeadership,
];
}

public static SubTrustEnagementActivity[] GetFinanceReturnsAssuranceSubActivities()
{
return
[
SubTrustEnagementActivity.AuditIssues,
SubTrustEnagementActivity.RegularityIssues,
SubTrustEnagementActivity.ManagementLetterIssues,
SubTrustEnagementActivity.AnnualSummaryInternalScrutiny,
];
}

public static SubTrustEnagementActivity[] GetReservesOversightAssuranceSubActivities()
{
return
[
SubTrustEnagementActivity.Priority1,
SubTrustEnagementActivity.Priority2,
SubTrustEnagementActivity.Priority3,
SubTrustEnagementActivity.Priority4,
];
}

public static SubTrustEnagementActivity[] GetOtherEngagementSubActivities()
{
return
[
SubTrustEnagementActivity.BudgetForecastDriven,
SubTrustEnagementActivity.ExecutivePayEngagement,
SubTrustEnagementActivity.FinanceReturnsAssurance,
SubTrustEnagementActivity.ReservesOversightAssurance,
SubTrustEnagementActivity.LocalProactiveEngagement,
SubTrustEnagementActivity.OtherVunerability,
];
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
@page "/case/{urn:long}/management/action/targeted-trust-engagement/edit"
@using ConcernsCaseWork.API.Contracts.TargetedTrustEngagement
@using ConcernsCaseWork.Constants
@using ConcernsCaseWork.Models
@using ConcernsCaseWork.Utils.Extensions
@model EditTargetedTrustEngagementModel
@{
ViewData[ViewDataConstants.Title] = "Add targeted trust engagement";
}

<partial name="_BannerError" />

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">


<partial name="_ValidationErrors" />

<h1 class="govuk-heading-l">
<span class="govuk-caption-m">Case ID @Model.CaseUrn</span>
Targeted trust engagement
</h1>

<div class="govuk-hint" id="financial-plan-hint">
<a target="_blank" href="#" class="govuk-link" rel="noreferrer noopener">
SFSO Knowledge: Pro-active engagement
</a>
</div>

<form method="post" novalidate>

<div class="govuk-form-group">
<fieldset class="govuk-fieldset" aria-describedby="contact-hint">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading">
Which activity was taken forward?
</h1>
</legend>
<div class="govuk-radios" data-module="govuk-radios">

<govuk-radios-item id="budget-forecast"
name="activity-id"
value="@((int)TrustEngagementActivity.BudgetForecast)"
label="@TrustEngagementActivity.BudgetForecast.Description()"
hint="Engagement with any trusts identified at potential risk" />
<div class="govuk-radios__conditional">
<partial name="Components/_RadioList" model="@Model.BudgetForecastSubActivities" />
</div>

<govuk-radios-item id="executive-pay-engagement"
name="activity-id"
value="@((int)TrustEngagementActivity.ExecutivePayEngagement)"
label="@TrustEngagementActivity.ExecutivePayEngagement.Description()"
hint="(Enter test here)" />
<div class="govuk-radios__conditional">
<partial name="Components/_RadioList" model="@Model.ExecutivePayEngagementSubActivities" />
</div>

<govuk-radios-item id="financial-returns-assurance"
name="activity-id"
value="@((int)TrustEngagementActivity.FinanceReturnsAssurance)"
label="@TrustEngagementActivity.FinanceReturnsAssurance.Description()"
hint="Following up with trusts on issues flagged in their latest financial statements" />
<div class="govuk-radios__conditional">
<partial name="Components/_RadioList" model="@Model.FinancialReturnsAssuranceSubActivities" />
</div>

<govuk-radios-item id="reserves-oversight-assurance"
name="activity-id"
value="@((int)TrustEngagementActivity.ReservesOversightAssurance)"
label="@TrustEngagementActivity.ReservesOversightAssurance.Description()"
hint="Engaging with trusts" />
<div class="govuk-radios__conditional">
<partial name="Components/_RadioList" model="@Model.ReservesOversightAssuranceSubActivities" />
</div>

<govuk-radios-item id="local-proactive-enagement"
name="activity-id"
value="@((int)TrustEngagementActivity.LocalProactiveEngagement)"
label="@TrustEngagementActivity.LocalProactiveEngagement.Description()"
hint="Division-led work" />

<govuk-radios-item id="other-vulnerability"
name="activity-id"
value="@((int)TrustEngagementActivity.OtherVulnerability)"
label="@TrustEngagementActivity.OtherVulnerability.Description()"
hint="Other national processes" />

<govuk-radios-item id="no-engagement"
name="activity-id"
value="@((int)TrustEngagementActivity.NoEngagement)"
label="@TrustEngagementActivity.NoEngagement.Description()"
hint="No engagement activity taken forward" />
<div class="govuk-radios__conditional">
<div class="govuk-form-group">
<fieldset class="govuk-fieldset">
<div class="govuk-checkboxes" data-module="govuk-checkboxes">
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="waste" name="sub-activity-id" type="checkbox" value="carcasses">
<label class="govuk-label govuk-checkboxes__label" for="waste">
Waste from animal carcasses
</label>
</div>
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="waste-2" name="sub-activity-id" type="checkbox" value="mines">
<label class="govuk-label govuk-checkboxes__label" for="waste-2">
Waste from mines or quarries
</label>
</div>
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="waste-3" name="sub-activity-id" type="checkbox" value="farm">
<label class="govuk-label govuk-checkboxes__label" for="waste-3">
Farm or agricultural waste
</label>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</fieldset>
</div>

<div class="govuk-button-group">
<button data-prevent-double-click="true"
class="govuk-button"
data-module="govuk-button"
role="button"
id="save-trust-financial-forecast-button"
data-testid="save-trust-financial-forecast-button"
name="action">
Save and return to case overview
</button>
<a data-prevent-double-click="true" class="govuk-link" data-module="govuk-button" role="button" href="/case/@Model.CaseUrn/management">
Cancel
</a>
</div>
</form>

</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using ConcernsCaseWork.API.Contracts.TargetedTrustEngagement;
using ConcernsCaseWork.Models;
using ConcernsCaseWork.Pages.Base;
using ConcernsCaseWork.Utils.Extensions;
using Microsoft.AspNetCore.Mvc;
using System.Linq;

namespace ConcernsCaseWork.Pages.Case.Management.Action.TargetedTrustEngagement
{
public class EditTargetedTrustEngagementModel : AbstractPageModel
{
[BindProperty(SupportsGet = true, Name = "urn")]
public int CaseUrn { get; set; }

[BindProperty(Name = "activity-id")]
public string ActivityId { get; set; }

[BindProperty(Name = "budget-forecast-sub-activities")]
public RadioButtonsUiComponent BudgetForecastSubActivities { get; set; }

[BindProperty(Name = "executive-pay-engagement-sub-activities")]
public RadioButtonsUiComponent ExecutivePayEngagementSubActivities { get; set; }

[BindProperty(Name = "financial-returns-assurance-sub-activities")]
public RadioButtonsUiComponent FinancialReturnsAssuranceSubActivities { get; set; }

[BindProperty(Name = "reserves-oversight-assurance-sub-activities")]
public RadioButtonsUiComponent ReservesOversightAssuranceSubActivities { get; set; }

public void OnGet()
{
BudgetForecastSubActivities = BuildBudgetForecastSubActivities();
ExecutivePayEngagementSubActivities = BuildExecutivePayEngagementSubActivities();
FinancialReturnsAssuranceSubActivities = BuildFinancialReturnsAssuranceSubActivities();
ReservesOversightAssuranceSubActivities = BuildReservesOversightAssuranceSubActivities();
}

public void OnPost()
{

}

private static RadioButtonsUiComponent BuildBudgetForecastSubActivities()
{
return new RadioButtonsUiComponent(ElementRootId: "budget-forecast-sub-activities", Name: "budget-forecast-sub-activities", "")
{
RadioItems = TrustEngagementActivity.BudgetForecast
.GetSubActivities()
.Select(a => new SimpleRadioItem(a.Description(), (int)a)).ToArray(),
};
}

private static RadioButtonsUiComponent BuildExecutivePayEngagementSubActivities()
{
return new RadioButtonsUiComponent(ElementRootId: "executive-pay-engagement-sub-activities", Name: "executive-pay-engagement-sub-activities", "")
{
RadioItems = TrustEngagementActivity.ExecutivePayEngagement
.GetSubActivities()
.Select(a => new SimpleRadioItem(a.Description(), (int)a)).ToArray(),
};
}

private static RadioButtonsUiComponent BuildFinancialReturnsAssuranceSubActivities()
{
return new RadioButtonsUiComponent(ElementRootId: "financial-returns-assurance-sub-activities", Name: "financial-returns-assurance-sub-activities", "")
{
RadioItems = TrustEngagementActivity.FinanceReturnsAssurance
.GetSubActivities()
.Select(a => new SimpleRadioItem(a.Description(), (int)a)).ToArray(),
};
}

private static RadioButtonsUiComponent BuildReservesOversightAssuranceSubActivities()
{
return new RadioButtonsUiComponent(ElementRootId: "reserves-oversight-assurance-sub-activities", Name: "reserves-oversight-assurance-sub-activities", "")
{
RadioItems = TrustEngagementActivity.ReservesOversightAssurance
.GetSubActivities()
.Select(a => new SimpleRadioItem(a.Description(), (int)a)).ToArray(),
};
}
}
}
Loading
Loading