The internal service for managing Academy Transfers.
To get the Dfe.PrepareTransfers.Web project running you will require:
- .NET Core 3.1
- Node v18.x
- Install dependencies
- .NET
dotnet restore
- Node
make build-frontend
orcd
toDfe.PrepareTransfers.Web/wwwroot
- run
npm install
- run
npm run build
- Set user secrets
dotnet user-secrets set "Key" "Value" --project Dfe.PrepareTransfers.Web
- Run the application
dotnet run --project Dfe.PrepareTransfers.Web
Dfe.PrepareTransfers.Web
The frontend repo requires the following user secrets to be able to connect to TRAMS:
TRAMS_API_KEY
- The API key for the TRAMS APITRAMS_API_BASE
- The base URL for the TRAMS API (with trailing slash)
The following user secret is required for the landing page to be able to navigate to the Conversions service:
ServiceLink:TransfersUrl
- The URL for the Conversions service.
Authentication is provided by Azure AD. The settings are stored in the application configuration and built on startup.
Users can login using their usual DfE account. Allowed roles are transfers.create
.
Full setup details can be found here: https://docs.microsoft.com/en-us/azure/active-directory/develop/web-app-quickstart?pivots=devlang-aspnet-core
- Navigate to the appropriate Azure AD within https://portal.azure.com
- Select App registration and provide a name
- Add Redirect URI(s), this will end with
/signin-oidc
- Select ID tokens
- Create the required app roles
- Assign the necessary AD groups or users to the correct app roles within enterprise applications
- Navigate to Token configuration
- Select "add groups claim"
- Select "security groups"
- Group ids will be available in the
HttpContext.User.Claims
This project uses fluent validators to validate the view model as opposed to MVC Dfe.PrepareTransfers.Data Annotation. Due to this, using attribute tags such as [Required] will have no effect.
You will need to ensure you have ViewModel to hold the properties you will need to validate and to create a custom validator with an AbstractValidator as it's base class.
Once this is in place then you can use ModelState.IsValid()
as usual in the controllers.
For detailed information on the Cypress test suite, see the documentation