For anyone recorded on PNomis / NDelius as non-British / non-Irish, documentation is required to support their Right to Work. More information on this requirement can be found in the CFO Enrolment Guidance.
@@ -38,21 +38,24 @@
To your knowledge, is any Right to Work (RTW) documentation required for the enrolment of this person?
- Yes, Right to Work is required
- No, Right to Work is not required
+ Yes, Right to Work is required
+ No, Right to Work is not required
-
+
@if (_isRequired)
{
+
-
-
+ @bind-Date="Model.ValidFrom" Required />
+ @if (_isIndefiniteRtwChecked == false)
+ {
+
+ }
@@ -62,7 +65,7 @@
StartIcon="@Icons.Material.Filled.Upload">
@if (_uploading)
{
-
+
@ConstantString.Uploading
}
else
@@ -83,14 +86,15 @@
private bool _isRequired = true;
private bool _uploading = false;
-
+ private bool _isIndefiniteRtwChecked { get; set; } = false;
+
[EditorRequired]
[Parameter]
- public AddRightToWork.Command? Model { get; set; }
+ public AddRightToWork.Command? Model { get; set; }
[Parameter]
public RightToWorkDto[]? RightToWorkDtos { get; set; }
-
+
private MudForm? Form { get; set; }
public async Task Validate()
@@ -99,7 +103,7 @@
{
return true;
}
-
+
await Form!.Validate();
if (Form.IsValid)
@@ -132,11 +136,35 @@
await using var stream = file.OpenReadStream(maxFileSize);
using var memoryStream = new MemoryStream();
await stream.CopyToAsync(memoryStream);
-
+
Model!.UploadRequest = new UploadRequest(file.Name, UploadType.Document, memoryStream.ToArray());
_uploading = false;
}
}
}
+ private void RightToWorkRequiredOnClick()
+ {
+ _isRequired = true;
+
+ IndefiniteRtwOnValueChanged(_isIndefiniteRtwChecked);
+ }
+ private void NoRightToWorkRequiredOnClick()
+ {
+ _isRequired = false;
+
+ IndefiniteRtwOnValueChanged(_isIndefiniteRtwChecked);
+ }
+ private void IndefiniteRtwOnValueChanged(bool isIndefiniteRtwChecked)
+ {
+ _isIndefiniteRtwChecked = isIndefiniteRtwChecked;
+ if (_isIndefiniteRtwChecked)
+ {
+ Model!.ValidTo = new DateTime(9999, 12, 31);
+ }
+ else
+ {
+ Model!.ValidTo = null;
+ }
+ }
}