Skip to content

Replace ApiTemplate with CollectAPI - #2

Open
KianW-DfE wants to merge 7 commits into
mainfrom
fix/replace-apitemplate-with-collectapi
Open

Replace ApiTemplate with CollectAPI#2
KianW-DfE wants to merge 7 commits into
mainfrom
fix/replace-apitemplate-with-collectapi

Conversation

@KianW-DfE

@KianW-DfE KianW-DfE commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator
  • There is a new GitHub repository called SchoolAccount-CollectAPI
  • The solution, projects, namespaces and folders are renamed to reflect the project name
  • The repository is set up with the standard branch policies to require an approved PR to be merged into main, with at least one approval, all tests passing, and all comments resolved

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

19 tests  ±0   19 ✅ ±0   2s ⏱️ ±0s
 3 suites ±0    0 💤 ±0 
 3 files   ±0    0 ❌ ±0 

Results for commit 879ef6a. ± Comparison against base commit a9bff77.

This pull request removes 19 and adds 19 tests. Note that renamed tests count towards both.
SchoolAccount.Application.UnitTests.Organisations.GetOrganisationByLaestabQueryHandlerTests ‑ Handler_takes_a_laestab_and_returns_school_open_status_localAuthorityCode_and_establishmentNumber
SchoolAccount.Application.UnitTests.Organisations.LaestabValueTests ‑ Laestab_is_separated_into_localAuthorityCode_and_establishmentNumber_by_LaestabValue
SchoolAccount.Application.UnitTests.Organisations.LaestabValueTests ‑ Throw_an_exception_when_the_laestab_value_is_not_seven_characters_long
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_at_exact_closing_time_on_a_weekday
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_on_saturday_during_school_hours
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_on_sunday_during_school_hours
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_outside_of_school_hours_on_a_weekday
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_open_at_exact_opening_time_on_a_weekday
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_open_during_school_hours_on_a_weekday
SchoolAccount.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_takes_into_account_daylight_savings_for_closed_on_a_weekday
…
SchoolAccount.Collect.Api.IntegrationTests.EndPoints.Organisations.GetByLaestabTests ‑ Organisations_endpoint_should_return_400_error_and_validation_errors_for_invalid_laestab
SchoolAccount.Collect.Api.IntegrationTests.EndPoints.Organisations.GetByLaestabTests ‑ Organisations_endpoint_should_return_localAuthorityCode_establishmentNo_and_status_as_a_string_for_valid_laestab
SchoolAccount.Collect.Application.UnitTests.Organisations.GetOrganisationByLaestabQueryHandlerTests ‑ Handler_takes_a_laestab_and_returns_school_open_status_localAuthorityCode_and_establishmentNumber
SchoolAccount.Collect.Application.UnitTests.Organisations.LaestabValueTests ‑ Laestab_is_separated_into_localAuthorityCode_and_establishmentNumber_by_LaestabValue
SchoolAccount.Collect.Application.UnitTests.Organisations.LaestabValueTests ‑ Throw_an_exception_when_the_laestab_value_is_not_seven_characters_long
SchoolAccount.Collect.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_at_exact_closing_time_on_a_weekday
SchoolAccount.Collect.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_on_saturday_during_school_hours
SchoolAccount.Collect.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_on_sunday_during_school_hours
SchoolAccount.Collect.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_closed_outside_of_school_hours_on_a_weekday
SchoolAccount.Collect.Application.UnitTests.Organisations.StatusCalculatorTests ‑ Organisation_is_open_at_exact_opening_time_on_a_weekday
…

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Summary
Generated on: 08/07/2026 - 12:45:36
Parser: MultiReport (3x Cobertura)
Assemblies: 4
Classes: 26
Files: 20
Line coverage: 60.7% (172 of 283)
Covered lines: 172
Uncovered lines: 111
Coverable lines: 283
Total lines: 706
Branch coverage: 54% (53 of 98)
Covered branches: 53
Total branches: 98
Method coverage: Feature is only available for sponsors
Tag: 8_31179477756

Coverage

SchoolAccount.Collect.Api - 60.9%
Name Line Branch
SchoolAccount.Collect.Api 60.9% 50%
Program 100% 100%
SchoolAccount.Collect.Api.DependencyInjection 100% 100%
SchoolAccount.Collect.Api.Endpoints.Organisations.GetByLaestab.GetByLaestab
Endpoint
100% 100%
SchoolAccount.Collect.Api.Extensions.EndpointExtensions 100% 92.8%
SchoolAccount.Collect.Api.Extensions.MiddlewareExtensions 100%
SchoolAccount.Collect.Api.Extensions.ResultExtensions 50% 25%
SchoolAccount.Collect.Api.Infrastructure.CustomResults 0% 0%
SchoolAccount.Collect.Api.Infrastructure.GlobalExceptionHandler 8.3%
SchoolAccount.Collect.Api.Middleware.RequestContextLoggingMiddleware 100% 100%
SchoolAccount.Collect.Application - 57.5%
Name Line Branch
SchoolAccount.Collect.Application 57.5% 76.9%
SchoolAccount.Collect.Application.Abstractions.Behaviors.LoggingDecorator.C
ommandBaseHandler
0% 0%
SchoolAccount.Collect.Application.Abstractions.Behaviors.LoggingDecorator.C
ommandBaseHandler
0%
SchoolAccount.Collect.Application.Abstractions.Behaviors.LoggingDecorator.C
ommandHandler<TCommand, TResponse>
0% 0%
SchoolAccount.Collect.Application.Abstractions.Behaviors.LoggingDecorator.C
ommandHandler<TCommand, TResponse>
0%
SchoolAccount.Collect.Application.Abstractions.Behaviors.LoggingDecorator.Q
ueryHandler<TQuery, TResponse>
0% 0%
SchoolAccount.Collect.Application.Abstractions.Behaviors.LoggingDecorator.Q
ueryHandler<TQuery, TResponse>
0%
SchoolAccount.Collect.Application.DependencyInjection 100% 100%
SchoolAccount.Collect.Application.Organisations.GetByLaestab.GetOrganisatio
nByLaestabQuery
100%
SchoolAccount.Collect.Application.Organisations.GetByLaestab.GetOrganisatio
nByLaestabQueryHandler
100%
SchoolAccount.Collect.Application.Organisations.GetByLaestab.LaestabValue 100% 100%
SchoolAccount.Collect.Application.Organisations.GetByLaestab.StatusCalculat
or
100% 100%
SchoolAccount.Collect.Infrastructure - 80%
Name Line Branch
SchoolAccount.Collect.Infrastructure 80% ****
SchoolAccount.Collect.Infrastructure.DependencyInjection 100%
SchoolAccount.Collect.Infrastructure.Time.DateTimeProvider 0%
SchoolAccount.Collect.SharedKernel - 65.7%
Name Line Branch
SchoolAccount.Collect.SharedKernel 65.7% 31.2%
SchoolAccount.Collect.SharedKernel.Error 73.3%
SchoolAccount.Collect.SharedKernel.Result 54.5% 50%
SchoolAccount.Collect.SharedKernel.Result 80% 25%
SchoolAccount.Collect.SharedKernel.ValidationError 0% 0%

Comment thread Directory.Packages.props
Comment thread README.md Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth changing the port number to avoid clashes for other APIs generated from the template?

Might be worth putting a note in the template project README that suggests changing the port number after creation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I've changed the port number to 5101, shouldn't cause us any problems as it's only a default port number for tools that we will not be using in this application, generally safe to use

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only changes the port in the docker compose file, you'll also need to change it in this launchsettings.json and the src/SchoolAccount.Collect.Api/Endpoints/Organisations/organisations.http file

@markysoft

Copy link
Copy Markdown

Maybe not one for this PR, but when you run the project there's a warning message:

No action descriptors found. This may indicate an incorrectly configured application or missing application parts. To learn more, visit https://aka.ms/aspnet/mvc/app-parts

It's also an issue on the template project, might be worth a quick look, or creating a separate card to fix and back fill

@markysoft

markysoft commented Aug 7, 2026

Copy link
Copy Markdown

Could do with renaming the other projects, not just the API one, as they don't reflect the root namespace.
i.e.

SchoolAccount.Collect.Application
SchoolAccount.Collect.Domain
...
SchoolAccount.Collect.Api

Another option is:

SchoolAccount.CollectApi
SchoolAccount.CollectApi.Application
SchoolAccount.CollectApi.Domain
...

which feels a bit neater as the namespace reflects the project name, what do you think?

In retrospect the naming on the web project could be better too, we shouldn't have every project with the namespace SchoolAccount.Domain

@KianW-DfE
KianW-DfE requested a review from markysoft August 7, 2026 12:33
@KianW-DfE

Copy link
Copy Markdown
Collaborator Author

@markysoft The No action descriptors found warning message is common for minimal APIs as ASP.Net Core sees the infrastructure has been initialised, however, it can't find controllers/endpoints to register
A note has been added in the README instructions to let users know this message should not have any effect
A note may need to be added into the Api-Template README

@KianW-DfE

Copy link
Copy Markdown
Collaborator Author

@markysoft I have renamed all projects in the solution using the SchoolAccount.Collect. format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants