updates for secondary schools
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 46s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m15s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 32s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

This commit is contained in:
2026-03-28 22:36:00 +00:00
parent f3a8ebdb4b
commit e8175561d5
16 changed files with 2170 additions and 42 deletions

View File

@@ -14,6 +14,7 @@ import type {
SchoolSearchParams,
RankingsParams,
APIError,
LAaveragesResponse,
} from './types';
// ============================================================================
@@ -241,6 +242,25 @@ export async function fetchMetrics(
};
}
/**
* Fetch per-LA average Attainment 8 score for secondary schools
*/
export async function fetchLAaverages(
options: RequestInit = {}
): Promise<LAaveragesResponse> {
const url = `${API_BASE_URL}/la-averages`;
const response = await fetch(url, {
...options,
next: {
revalidate: 3600,
...options.next,
},
});
return handleResponse<LAaveragesResponse>(response);
}
/**
* Fetch database statistics and info
*/

View File

@@ -54,6 +54,7 @@ export interface School {
// KS4 card metrics
attainment_8_score?: number | null;
english_maths_standard_pass_pct?: number | null;
prev_attainment_8_score?: number | null;
// GIAS enrichment fields
website?: string | null;
@@ -61,6 +62,7 @@ export interface School {
capacity?: number | null;
trust_name?: string | null;
gender?: string | null;
admissions_policy?: string | null;
// Ofsted (for list view — summary only)
ofsted_grade?: 1 | 2 | 3 | 4 | null;
@@ -127,9 +129,12 @@ export interface SchoolCensus {
export interface SchoolAdmissions {
year: number;
school_phase?: string | null;
published_admission_number: number | null;
total_applications: number | null;
first_preference_offers_pct: number | null;
first_preference_applications?: number | null;
first_preference_offers?: number | null;
first_preference_offer_pct: number | null;
oversubscribed: boolean | null;
}
@@ -330,6 +335,8 @@ export interface Filters {
school_types: string[];
years: number[];
phases: string[];
genders: string[];
admissions_policies: string[];
}
export interface NationalAverages {
@@ -338,6 +345,13 @@ export interface NationalAverages {
secondary: Record<string, number>;
}
export interface LAaveragesResponse {
year: number;
secondary: {
attainment_8_by_la: Record<string, number>;
};
}
// Backend returns filters directly, not wrapped
export type FiltersResponse = Filters;
@@ -375,6 +389,9 @@ export interface SchoolSearchParams {
radius?: number;
page?: number;
page_size?: number;
gender?: string;
admissions_policy?: string;
has_sixth_form?: string;
}
export interface RankingsParams {