UNPKG

@vepler/schools-types

Version:

TypeScript type definitions for Vepler Schools Service

79 lines (78 loc) 2.5 kB
/** * Public Metric Types * * Types for metric data and dimensional models used in the API. */ export declare const periodEnum: readonly ["annual", "termly", "monthly"]; export type Period = typeof periodEnum[number]; export declare const cohortTypeEnum: readonly ["all", "disadvantaged", "boys", "girls", "eal", "senSupport", "ehcp", "english", "unclassified"]; export type CohortType = typeof cohortTypeEnum[number]; export declare const priorAttainmentEnum: readonly ["low", "medium", "high"]; export type PriorAttainment = typeof priorAttainmentEnum[number]; export declare const pupilCharacteristicEnum: readonly ["fsm", "eal", "sen", "none"]; export type PupilCharacteristic = typeof pupilCharacteristicEnum[number]; export declare const metricCategoryEnum: readonly ["ks2", "ks4", "ks5", "pupil", "finance", "ofsted"]; export type MetricCategory = typeof metricCategoryEnum[number]; export declare const dataTypeEnum: readonly ["percentage", "score", "count", "currency", "text"]; export type DataType = typeof dataTypeEnum[number]; /** * Metric definition interface for public API */ export interface IMetricDefinition { id?: number; code: string; category: MetricCategory; subcategory: string; dataType: DataType; description: string; metadata: { rangeMin?: number; rangeMax?: number; nationalAverage?: number; isHigherBetter?: boolean; units?: string; decimalPlaces?: number; [key: string]: any; }; } /** * Metric value interface for public API */ export interface IMetricValue { id?: number; schoolId: number; schoolName?: string; schoolURN?: number; metricCode: string; academicYear: string; academicYearName?: string; period: Period; periodNumber: number | null; value: string | null; cohortType: CohortType; contextualFactors?: { priorAttainment?: PriorAttainment | null; pupilCharacteristic?: PupilCharacteristic | null; } | null; confidence?: { lower?: number; upper?: number; } | null; metadata?: Partial<IMetricDefinition['metadata']> & { description?: string; category?: string; subcategory?: string; dataType?: string; }; } /** * Academic year interface for public API */ export interface IAcademicYear { id: string; name: string; countryCode: string; startDate: string | Date; endDate: string | Date; current: boolean; }