Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2cb312a
feat(ONSPD): Add extraction scripts and lookup data for new fields
cblanc Dec 14, 2025
b89ec32
feat(models): Add lookup table models for new ONSPD fields
cblanc Dec 14, 2025
afa64cb
feat(postcode): Add schema, mappings and API response for new fields
cblanc Dec 14, 2025
890f16a
test: Add new ONSPD fields to type checking helpers
cblanc Dec 14, 2025
af64aa6
Rebuild seed onspd file
cblanc Dec 14, 2025
a64f846
Include new tables
cblanc Dec 15, 2025
9407acc
Documenting testing process
cblanc Dec 15, 2025
ba9dc1d
Fix
cblanc Dec 15, 2025
1838dd3
Update test for new codes
cblanc Dec 15, 2025
d011c7c
docs(postcode): Add new ONSPD fields to API documentation and OpenAPI…
cblanc Dec 16, 2025
36e9822
feat(setup): Add new ONSPD lookup tables to support tables array
cblanc Dec 16, 2025
326ec47
feat(postcode): Add lsoa11 and msoa11 as explicit aliases
cblanc Dec 16, 2025
cfa7cd0
feat(postcode): Change lsoa/msoa to point to 2021 census data
cblanc Dec 16, 2025
65d9e4d
Update deps
cblanc Dec 18, 2025
31ba410
test(postcode): Add E2E tests and model specs for new ONSPD fields
cblanc Dec 18, 2025
b51c41b
Fix path
cblanc Dec 18, 2025
f68ea68
Quick script to verify build
cblanc Dec 18, 2025
0f5df97
Update deps
cblanc Dec 18, 2025
fd4426a
feat(api): Update LSOA and MSOA to 2021 Census data
cblanc Dec 18, 2025
4023c46
Rebuild openapi docs
cblanc Dec 18, 2025
d4ff099
docs(openapi): Improve field descriptions and clarify pseudo codes
cblanc Dec 18, 2025
4080dd0
Fix for deprecated field
cblanc Dec 18, 2025
76492f9
docs: Update API documentation for new postcode fields
cblanc Dec 18, 2025
e0ec044
Rebuild docs
cblanc Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ test-down:
test-shell:
docker compose -f docker/test/docker-compose.yml exec api /bin/bash

## Execute command in test container
.PHONY: test-exec
test-exec:
docker compose -f docker/test/docker-compose.yml exec api $(filter-out $@,$(MAKECMDGOALS))

## Tail test service logs
.PHONY: test-logs
test-logs:
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ make test
make test-up
make test-shell
$api-container> npm test

# Fast iteration: create DB once, then run tests without rebuilding
npm run test:create # Run once
npm run mocha # Reuse existing DB (sets NO_RELOAD_DB=true)

# Execute command in test container
make test-exec npm run mocha
```

## License
Expand Down
24 changes: 24 additions & 0 deletions api/app/lib/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ import {
ScottishConstituency,
Outcode,
PoliceForceArea,
// New models (Nov 2025)
NhsRegion,
Ttwa,
NationalPark,
Bua,
Icb,
CancerAlliance,
Lsoa21,
Msoa21,
Ruc11,
Ruc21,
Lep,
} from "../models/index";

// List of support tables generated from data/ directory
Expand All @@ -28,6 +40,18 @@ export const SUPPORT_TABLES = [
Ward,
ScottishConstituency,
PoliceForceArea,
// New models (Nov 2025)
NhsRegion,
Ttwa,
NationalPark,
Bua,
Icb,
CancerAlliance,
Lsoa21,
Msoa21,
Ruc11,
Ruc21,
Lep,
];

/**
Expand Down
5 changes: 5 additions & 0 deletions api/app/models/bua.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "bua";

export const Bua = generateAttributeMethods({ relation });
5 changes: 5 additions & 0 deletions api/app/models/cancer_alliance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "cancer_alliances";

export const CancerAlliance = generateAttributeMethods({ relation });
5 changes: 5 additions & 0 deletions api/app/models/icb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "icb";

export const Icb = generateAttributeMethods({ relation });
12 changes: 12 additions & 0 deletions api/app/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@ export * from "./ced";
export * from "./lsoa";
export * from "./msoa";
export * from "./police_force_area";
// New models (Nov 2025)
export * from "./nhs_region";
export * from "./ttwa";
export * from "./national_park";
export * from "./bua";
export * from "./icb";
export * from "./cancer_alliance";
export * from "./lsoa21";
export * from "./msoa21";
export * from "./ruc11";
export * from "./ruc21";
export * from "./lep";
5 changes: 5 additions & 0 deletions api/app/models/lep.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "lep";

export const Lep = generateAttributeMethods({ relation });
5 changes: 5 additions & 0 deletions api/app/models/lsoa21.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "lsoa21";

export const Lsoa21 = generateAttributeMethods({ relation });
5 changes: 5 additions & 0 deletions api/app/models/msoa21.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "msoa21";

export const Msoa21 = generateAttributeMethods({ relation });
5 changes: 5 additions & 0 deletions api/app/models/national_park.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "national_parks";

export const NationalPark = generateAttributeMethods({ relation });
5 changes: 5 additions & 0 deletions api/app/models/nhs_region.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateAttributeMethods } from "./attribute_base";

const relation = "nhs_regions";

export const NhsRegion = generateAttributeMethods({ relation });
Loading