This repo contains the API for Eligibility Checking Engine (ECE) and the Check Free School Meals (FSM) service.
This is a .NET 8 project - you'll need the latest .NET SDK etc to run it locally.
When you first clone the repo, you'll want to define your own config. You'll want to copy up the
file appsettings.json, name the copy appsettings.developmnent.json
in the same folder. Update the values in this new file as needed. This file should not be committed, nor will it with
our .gitignore.
You can get the credentials through following the instructions in check-your-eligibility-infrastructure. Otherwise, just ask your Lead Developer or fellow colleague.
There is a Azure Storage Queue part of the whole flow, which triggers a logic app. You can either ignore that part of the application, mock it, or connect to the dev queue. Credentials in keyvault.
Each request needs to be authenticated with a JWT token. YOu get this token bu calling /api/Login with the following
object:
{ "username": "", "emailAddress": "[email protected]", "password": "" } inserting your username and password.
Any errors will be seen in the Response Headers
Postman collection below automates this.
We have two test-suites - one .NET NUnit for unit tests and one Cypress for integration and e2e tests. Cypress needs a running application responding to http calls.
VisualStudio does most of this for you, there'll be a button in your UI. Correctly set up Rider too.
cd CheckYourEligibility.API.Tests dotnet test
Assuming you have NPM installed.
cd tests npm install export CYPRESS_API_HOST="https-path to localhost or remote" export CYPRESS_JWT_USERNAME="JWT user username" export CYPRESS_JWT_PASSWORD="JWT user password" npm run e2e:chrome
Note, replace export with set in the above command for Windows.
We submit PRs into main for functioning code. The reviewer checks that the automated tests pass, then approve.
We expect the code reviewer to run the code locally, read through it and understand what it is trying to solve.
If approved, the original code-creator merges the PR and deletes the branch.
We don't commit active secrets to this repo. If we do, it is crucial to notify DM/TL/PO, rewrite git history and follow DfE processes.
User Swagger doc from below
You'll find a Swagger page on /swagger/index.html once you're running the application.
You need to download a CSV from GIAS, selecting All Establishment Data -> Establishment Fields CSV.
The contents is then POSTed to /importEstablishments
dotnet ef update-database
Add-Migration BaseMigration
update-database
Get-Migration
Remove-Migration -Force Remove-Migration
update-database -migration BaseMigration



