fix(school, compare): ISI, not-yet-inspected and further-education states (H4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ab25d83b9d
commit
9feb37b974
12 files changed
+143
-16
No files matched your search
@@ -10,7 +10,8 @@
|
||||
* methodology instead of thresholding point estimates.
|
||||
*/
|
||||
|
||||
import type { OfstedInspection, SchoolAdmissions } from './types';
|
||||
import { hasReportCard } from './ofstedStatus';
|
||||
import type { OfstedInspection, School, SchoolAdmissions } from './types';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Verdicts against an anchor (England average or state-school benchmark)
|
||||
@@ -104,6 +105,16 @@ export type OfstedDisplay =
|
||||
| { kind: 'no_overall_grade' }
|
||||
| { kind: 'report_card'; summary: ReportCardSummary };
|
||||
|
||||
/**
|
||||
* The compare cell when a school has no Ofsted record (audit H4): ISI per GIAS,
|
||||
* Ofsted's own "not yet inspected", or plainly that we hold nothing.
|
||||
*/
|
||||
export function noInspectionLabel(school: Pick<School, 'inspectorate' | 'ofsted_listed'>): string {
|
||||
if (school.inspectorate === 'ISI') return 'Inspected by ISI';
|
||||
if (school.ofsted_listed) return 'Not yet inspected';
|
||||
return 'No inspection in our dataset';
|
||||
}
|
||||
|
||||
export function ofstedDisplay(
|
||||
ofsted: OfstedInspection | null | undefined,
|
||||
): OfstedDisplay {
|
||||
@@ -111,7 +122,7 @@ export function ofstedDisplay(
|
||||
|
||||
// A report card is the newest inspection format; when present it wins —
|
||||
// never derive or prefer an overall grade alongside it.
|
||||
if (ofsted.report_card && Object.keys(ofsted.report_card).length > 0) {
|
||||
if (hasReportCard(ofsted)) {
|
||||
return { kind: 'report_card', summary: summariseReportCard(ofsted) };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user