Skip to content

Commit 5a5677c

Browse files
authored
Remove NPQ TRN request UI (#3434)
Also renames `ApiTrnRequest` to `TrnRequest` since that's now the sole TRN request route (and they're not only created via the API).
1 parent c2d72f1 commit 5a5677c

111 files changed

Lines changed: 875 additions & 8011 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/TeachingRecordSystem.Api/V3/Implementation/Operations/CreateTrnRequest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public async Task<ApiResult<TrnRequestInfo>> ExecuteAsync(CreateTrnRequestComman
4242
var normalizedNino = NationalInsuranceNumber.Normalize(command.NationalInsuranceNumber);
4343
var emailAddress = command.EmailAddresses.FirstOrDefault();
4444

45-
var processContext = new ProcessContext(ProcessType.ApiTrnRequestCreating, timeProvider.UtcNow, currentApplicationUserId);
45+
var processContext = new ProcessContext(ProcessType.TrnRequestCreating, timeProvider.UtcNow, currentApplicationUserId);
4646

4747
var (trnRequest, resolvedPersonTrn) = await trnRequestService.CreateTrnRequestAsync(
4848
new CreateTrnRequestOptions
@@ -66,8 +66,8 @@ public async Task<ApiResult<TrnRequestInfo>> ExecuteAsync(CreateTrnRequestComman
6666
await supportTaskService.CreateSupportTaskAsync(
6767
new CreateSupportTaskOptions
6868
{
69-
SupportTaskType = SupportTaskType.ApiTrnRequest,
70-
Data = new ApiTrnRequestData(),
69+
SupportTaskType = SupportTaskType.TrnRequest,
70+
Data = new TrnRequestData(),
7171
PersonId = null,
7272
OneLoginUserSubject = null, // This must be null as we likely won't have an entry in the one_login_users table yet
7373
TrnRequest = (trnRequest.ApplicationUserId, trnRequest.RequestId)

src/TeachingRecordSystem.Cli/Commands.ResetTrnRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public static Command CreateResetTrnRequestCommand(IConfiguration configuration)
100100
(oldTrnRequest.ResolvedPersonId != request.ResolvedPersonId ? TrnRequestUpdatedChanges.ResolvedPersonId : 0);
101101

102102
var supportTask = SupportTask.Create(
103-
SupportTaskType.ApiTrnRequest,
104-
new ApiTrnRequestData(),
103+
SupportTaskType.TrnRequest,
104+
new TrnRequestData(),
105105
personId: null,
106106
request.OneLoginUserSubject,
107107
request.ApplicationUserId,

src/TeachingRecordSystem.Core/EventHandlers/CreateLegacySupportTaskEvents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task HandleEventAsync(SupportTaskCreatedEvent @event, ProcessContex
2424

2525
public async Task HandleEventAsync(SupportTaskUpdatedEvent @event, ProcessContext processContext, IEventScope eventScope)
2626
{
27-
if (processContext.ProcessType is ProcessType.ApiTrnRequestResolving)
27+
if (processContext.ProcessType is ProcessType.TrnRequestResolving)
2828
{
2929
var trnRequestUpdatedEvent = processContext.Events.OfType<TrnRequestUpdatedEvent>().Single();
3030
var personDetailsUpdatedEvent = processContext.Events.OfType<PersonDetailsUpdatedEvent>().SingleOrDefault();

src/TeachingRecordSystem.Core/Models/ProcessType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public enum ProcessType
1515
NoteCreating = 11,
1616
ChangeOfDateOfBirthRequestCreating = 12,
1717
ChangeOfNameRequestCreating = 13,
18-
ApiTrnRequestCreating = 14,
18+
TrnRequestCreating = 14,
1919
NpqTrnRequestTaskCreating = 15,
20-
ApiTrnRequestResolving = 16,
20+
TrnRequestResolving = 16,
2121
NpqTrnRequestApproving = 18,
2222
NpqTrnRequestRejecting = 19,
2323
TrnRequestManualChecksNeededTaskCompleting = 20,

src/TeachingRecordSystem.Core/Models/SupportTaskType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public enum SupportTaskType
1414
[SupportTaskTypeDescription("change date of birth request", SupportTaskCategory.ChangeRequests, typeof(ChangeDateOfBirthRequestData))]
1515
ChangeDateOfBirthRequest = 3,
1616

17-
[SupportTaskTypeDescription("TRN request from API", SupportTaskCategory.TrnRequests, typeof(ApiTrnRequestData))]
18-
ApiTrnRequest = 4,
17+
[SupportTaskTypeDescription("TRN request", SupportTaskCategory.TrnRequests, typeof(TrnRequestData))]
18+
TrnRequest = 4,
1919

2020
[SupportTaskTypeDescription("TRN request from NPQ", SupportTaskCategory.TrnRequests, typeof(NpqTrnRequestData))]
2121
NpqTrnRequest = 5,

src/TeachingRecordSystem.Core/Models/SupportTasks/ApiTrnRequestData.cs renamed to src/TeachingRecordSystem.Core/Models/SupportTasks/TrnRequestData.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
namespace TeachingRecordSystem.Core.Models.SupportTasks;
22

3-
public record ApiTrnRequestData : ISupportTaskData
3+
public record TrnRequestData : ISupportTaskData
44
{
5-
public ApiTrnRequestDataPersonAttributes? SelectedPersonAttributes { get; init; }
6-
public ApiTrnRequestDataPersonAttributes? ResolvedAttributes { get; init; }
5+
public TrnRequestDataPersonAttributes? SelectedPersonAttributes { get; init; }
6+
public TrnRequestDataPersonAttributes? ResolvedAttributes { get; init; }
77
}
88

9-
public record ApiTrnRequestDataPersonAttributes
9+
public record TrnRequestDataPersonAttributes
1010
{
1111
public required string FirstName { get; init; }
1212
public required string MiddleName { get; init; }

src/TeachingRecordSystem.Core/Services/TrnRequests/TrnRequestService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ public async Task<TrnRequestInfo> ActivateTrnRequestAsync(TrnRequestMetadata trn
561561
await supportTaskService.CreateSupportTaskAsync(
562562
new CreateSupportTaskOptions
563563
{
564-
SupportTaskType = SupportTaskType.ApiTrnRequest,
565-
Data = new ApiTrnRequestData(),
564+
SupportTaskType = SupportTaskType.TrnRequest,
565+
Data = new TrnRequestData(),
566566
PersonId = null,
567567
OneLoginUserSubject = null,
568568
TrnRequest = (trnRequest.ApplicationUserId, trnRequest.RequestId)

src/TeachingRecordSystem.SupportUi/Infrastructure/Filters/CheckSupportTaskExistsFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task OnResourceExecutionAsync(ResourceExecutingContext context, Res
2222

2323
if (supportTaskTypes
2424
.Intersect([
25-
SupportTaskType.ApiTrnRequest,
25+
SupportTaskType.TrnRequest,
2626
SupportTaskType.TrnRequestManualChecksNeeded,
2727
SupportTaskType.NpqTrnRequest,
2828
SupportTaskType.TeacherPensionsPotentialDuplicate,

src/TeachingRecordSystem.SupportUi/JourneyNames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class JourneyNames
2020
public const string EditRouteToProfessionalStatus = nameof(EditRouteToProfessionalStatus);
2121
public const string AddRouteToProfessionalStatus = nameof(AddRouteToProfessionalStatus);
2222
public const string DeleteRouteToProfessionalStatus = nameof(DeleteRouteToProfessionalStatus);
23-
public const string ResolveApiTrnRequest = nameof(ResolveApiTrnRequest);
23+
public const string ResolveTrnRequest = nameof(ResolveTrnRequest);
2424
public const string EditDetails = nameof(EditDetails);
2525
public const string AddPerson = nameof(AddPerson);
2626
public const string MergePerson = nameof(MergePerson);

src/TeachingRecordSystem.SupportUi/Pages/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<div class="trs-tile-section">
4343
<h2 class="govuk-heading-m">TRN requests</h2>
4444
<div class="trs-tile-row">
45-
<a href="@LinkGenerator.SupportTasks.ApiTrnRequests.Index()" class="trs-tile trs-tile--branded">
46-
<span class="trs-tile__count">@Model.SupportTaskCounts!.GetValueOrDefault(SupportTaskType.ApiTrnRequest)</span>
45+
<a href="@LinkGenerator.SupportTasks.TrnRequests.Index()" class="trs-tile trs-tile--branded">
46+
<span class="trs-tile__count">@Model.SupportTaskCounts!.GetValueOrDefault(SupportTaskType.TrnRequest)</span>
4747
<span class="trs-tile__title">Potential duplicates via API</span>
4848
</a>
4949
<a href="@LinkGenerator.SupportTasks.TrnRequestManualChecksNeeded.Index()" class="trs-tile trs-tile--branded">

0 commit comments

Comments
 (0)