From 6da24c5a8dcd8a22201ec58d7848d735b70bbc9b Mon Sep 17 00:00:00 2001 From: andycunningham Date: Wed, 23 Sep 2026 15:28:37 +0100 Subject: [PATCH 1/2] Add SupportService object to the census stubbed data response --- .../Census/GetCensusActions/CensusActionsResponse.cs | 8 ++++++++ .../Census/GetCensusActions/StubbedCensusResponse.cs | 7 +++++++ .../EndPoints/Census/GetCensusActionsTests.cs | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs index 885b87f..790a986 100644 --- a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs +++ b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs @@ -7,6 +7,7 @@ public sealed class CensusActionsResponse public required string Overview { get; init; } public required ActionStatus Status { get; init; } public required LastUpdated LastUpdated { get; init; } + public required SupportService SupportService { get; init; } public required CallToAction CallToAction { get; init; } public IReadOnlyList Steps { get; init; } = []; public IReadOnlyList ImportantDates { get; init; } = []; @@ -48,3 +49,10 @@ public sealed class ImportantDate public DateOnly Date { get; init; } public required string Label { get; init; } } + +public sealed class SupportService +{ + public required string Title { get; init; } + public required string Description { get; init; } + public required string Url { get; init; } +} diff --git a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs index ff18a9a..aa416cf 100644 --- a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs +++ b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs @@ -22,6 +22,13 @@ public static CensusActionsResponse Create(int? statusCode = null) Label = ReturnStatusMapper.GetStatusDescription(statusCode.Value), }, LastUpdated = new LastUpdated { Date = new DateOnly(2026, 8, 26) }, + SupportService = new SupportService + { + Title = "Get help with the Autumn school census", + Description = "Contact the Autumn school census team (opens in new tab)", + Url = + "https://form.education.gov.uk/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-2b61dfcd-9296-4f6a-8a26-4671265cae67/AF-Stage-f3f5200e-e605-4a1b-ae6b-3536bc77305c/definition.json&redirectlink=%2Fen&cancelRedirectLink=%2Fen", + }, CallToAction = new CallToAction { Label = "Go to COLLECT", diff --git a/tests/SchoolAccount.Collect.Api.IntegrationTests/EndPoints/Census/GetCensusActionsTests.cs b/tests/SchoolAccount.Collect.Api.IntegrationTests/EndPoints/Census/GetCensusActionsTests.cs index c5c1d3e..221b407 100644 --- a/tests/SchoolAccount.Collect.Api.IntegrationTests/EndPoints/Census/GetCensusActionsTests.cs +++ b/tests/SchoolAccount.Collect.Api.IntegrationTests/EndPoints/Census/GetCensusActionsTests.cs @@ -66,6 +66,11 @@ public async Task CensusActions_endpoint_should_return_census_actions_response() result.Status.Name.ShouldBe(stubbedCensusResponse.Status.Name); result.Status.Label.ShouldBe(stubbedCensusResponse.Status.Label); result.LastUpdated.Date.ShouldBe(stubbedCensusResponse.LastUpdated.Date); + result.SupportService.Title.ShouldBe(stubbedCensusResponse.SupportService.Title); + result.SupportService.Description.ShouldBe( + stubbedCensusResponse.SupportService.Description + ); + result.SupportService.Url.ShouldBe(stubbedCensusResponse.SupportService.Url); result.CallToAction.Label.ShouldBe(stubbedCensusResponse.CallToAction.Label); result.CallToAction.Url.ShouldBe(stubbedCensusResponse.CallToAction.Url); result.Steps.Count.ShouldBe(stubbedCensusResponse.Steps.Count); From 7d173ef02163211f144d6ebf7b9c7cf9f307a5f5 Mon Sep 17 00:00:00 2001 From: andycunningham Date: Thu, 24 Sep 2026 12:20:59 +0100 Subject: [PATCH 2/2] Update SupportService Url type to Uri --- .../Census/GetCensusActions/CensusActionsResponse.cs | 2 +- .../Census/GetCensusActions/StubbedCensusResponse.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs index 790a986..f819446 100644 --- a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs +++ b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/CensusActionsResponse.cs @@ -54,5 +54,5 @@ public sealed class SupportService { public required string Title { get; init; } public required string Description { get; init; } - public required string Url { get; init; } + public required Uri Url { get; init; } } diff --git a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs index aa416cf..9d971d3 100644 --- a/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs +++ b/src/SchoolAccount.Collect.Application/Census/GetCensusActions/StubbedCensusResponse.cs @@ -26,8 +26,9 @@ public static CensusActionsResponse Create(int? statusCode = null) { Title = "Get help with the Autumn school census", Description = "Contact the Autumn school census team (opens in new tab)", - Url = - "https://form.education.gov.uk/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-2b61dfcd-9296-4f6a-8a26-4671265cae67/AF-Stage-f3f5200e-e605-4a1b-ae6b-3536bc77305c/definition.json&redirectlink=%2Fen&cancelRedirectLink=%2Fen", + Url = new Uri( + "https://form.education.gov.uk/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-2b61dfcd-9296-4f6a-8a26-4671265cae67/AF-Stage-f3f5200e-e605-4a1b-ae6b-3536bc77305c/definition.json&redirectlink=%2Fen&cancelRedirectLink=%2Fen" + ), }, CallToAction = new CallToAction {