Skip to content

Commit b93758c

Browse files
authored
Merge pull request #1307 from ideal-postcodes/more_codes
2 parents 636f44d + e0ec044 commit b93758c

File tree

198 files changed

+77013
-10497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+77013
-10497
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ test-down:
5151
test-shell:
5252
docker compose -f docker/test/docker-compose.yml exec api /bin/bash
5353

54+
## Execute command in test container
55+
.PHONY: test-exec
56+
test-exec:
57+
docker compose -f docker/test/docker-compose.yml exec api $(filter-out $@,$(MAKECMDGOALS))
58+
5459
## Tail test service logs
5560
.PHONY: test-logs
5661
test-logs:

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ make test
5353
make test-up
5454
make test-shell
5555
$api-container> npm test
56+
57+
# Fast iteration: create DB once, then run tests without rebuilding
58+
npm run test:create # Run once
59+
npm run mocha # Reuse existing DB (sets NO_RELOAD_DB=true)
60+
61+
# Execute command in test container
62+
make test-exec npm run mocha
5663
```
5764

5865
## License

api/app/lib/setup.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ import {
1212
ScottishConstituency,
1313
Outcode,
1414
PoliceForceArea,
15+
// New models (Nov 2025)
16+
NhsRegion,
17+
Ttwa,
18+
NationalPark,
19+
Bua,
20+
Icb,
21+
CancerAlliance,
22+
Lsoa21,
23+
Msoa21,
24+
Ruc11,
25+
Ruc21,
26+
Lep,
1527
} from "../models/index";
1628

1729
// List of support tables generated from data/ directory
@@ -28,6 +40,18 @@ export const SUPPORT_TABLES = [
2840
Ward,
2941
ScottishConstituency,
3042
PoliceForceArea,
43+
// New models (Nov 2025)
44+
NhsRegion,
45+
Ttwa,
46+
NationalPark,
47+
Bua,
48+
Icb,
49+
CancerAlliance,
50+
Lsoa21,
51+
Msoa21,
52+
Ruc11,
53+
Ruc21,
54+
Lep,
3155
];
3256

3357
/**

api/app/models/bua.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateAttributeMethods } from "./attribute_base";
2+
3+
const relation = "bua";
4+
5+
export const Bua = generateAttributeMethods({ relation });

api/app/models/cancer_alliance.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateAttributeMethods } from "./attribute_base";
2+
3+
const relation = "cancer_alliances";
4+
5+
export const CancerAlliance = generateAttributeMethods({ relation });

api/app/models/icb.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateAttributeMethods } from "./attribute_base";
2+
3+
const relation = "icb";
4+
5+
export const Icb = generateAttributeMethods({ relation });

api/app/models/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ export * from "./ced";
1717
export * from "./lsoa";
1818
export * from "./msoa";
1919
export * from "./police_force_area";
20+
// New models (Nov 2025)
21+
export * from "./nhs_region";
22+
export * from "./ttwa";
23+
export * from "./national_park";
24+
export * from "./bua";
25+
export * from "./icb";
26+
export * from "./cancer_alliance";
27+
export * from "./lsoa21";
28+
export * from "./msoa21";
29+
export * from "./ruc11";
30+
export * from "./ruc21";
31+
export * from "./lep";

api/app/models/lep.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateAttributeMethods } from "./attribute_base";
2+
3+
const relation = "lep";
4+
5+
export const Lep = generateAttributeMethods({ relation });

api/app/models/lsoa21.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateAttributeMethods } from "./attribute_base";
2+
3+
const relation = "lsoa21";
4+
5+
export const Lsoa21 = generateAttributeMethods({ relation });

api/app/models/msoa21.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateAttributeMethods } from "./attribute_base";
2+
3+
const relation = "msoa21";
4+
5+
export const Msoa21 = generateAttributeMethods({ relation });

0 commit comments

Comments
 (0)