UNPKG

@iota-big3/sdk-gateway

Version:

Universal API Gateway with protocol translation, intelligent routing, rate limiting, health checking, and caching

919 lines 26.7 kB
/** * Education Domain Type Definitions * * @module education-types * @description Comprehensive types for K-12 and higher education including: * - Student information and records * - Academic performance (grades, assessments, transcripts) * - Attendance tracking * - Curriculum and course management * - Teacher and staff information * - Parent/guardian relationships * - Special education (IEPs, 504 plans) * - Extracurricular activities * * Designed for AI/debugging friendliness with clear naming and validation */ import type { Brand, DataClassification, FERPAEducationRecord, MonetaryAmount, Result } from './index'; /** Unique student identifier across the system */ export type StudentId = Brand<string, 'StudentId'>; /** Unique teacher/instructor identifier */ export type TeacherId = Brand<string, 'TeacherId'>; /** Unique parent/guardian identifier */ export type GuardianId = Brand<string, 'GuardianId'>; /** Unique school identifier */ export type SchoolId = Brand<string, 'SchoolId'>; /** Unique district identifier */ export type DistrictId = Brand<string, 'DistrictId'>; /** Unique course identifier */ export type CourseId = Brand<string, 'CourseId'>; /** Unique section/class identifier */ export type SectionId = Brand<string, 'SectionId'>; /** Unique assignment identifier */ export type AssignmentId = Brand<string, 'AssignmentId'>; /** Unique grade/assessment identifier */ export type GradeId = Brand<string, 'GradeId'>; /** * Comprehensive student profile * Central record for all student information */ export interface StudentProfile { readonly studentId: StudentId; readonly personalInfo: StudentPersonalInfo; readonly enrollment: StudentEnrollment; readonly contacts: StudentContacts; readonly academicInfo: StudentAcademicInfo; readonly healthInfo?: StudentHealthInfo; readonly specialEducation?: SpecialEducationInfo; readonly transportation?: StudentTransportation; readonly mealProgram?: MealProgramEnrollment; readonly metadata: { readonly createdAt: string; readonly lastUpdated: string; readonly dataClassification: DataClassification; readonly ferpaRecord?: FERPAEducationRecord; }; } /** * Student personal information * PII that requires FERPA protection */ export interface StudentPersonalInfo { readonly legalName: { readonly firstName: string; readonly middleName?: string; readonly lastName: string; readonly suffix?: string; }; readonly preferredName?: string; readonly pronouns?: string; readonly dateOfBirth: string; readonly placeOfBirth?: { readonly city: string; readonly state?: string; readonly country: string; }; readonly gender?: 'male' | 'female' | 'non-binary' | 'other' | 'prefer-not-to-say'; readonly ethnicity?: string[]; readonly primaryLanguage: string; readonly homeLanguage?: string; readonly citizenshipStatus?: 'citizen' | 'permanent-resident' | 'visa' | 'other'; readonly ssn?: string; } /** * Student enrollment information */ export interface StudentEnrollment { readonly schoolId: SchoolId; readonly districtId: DistrictId; readonly gradeLevel: GradeLevel; readonly academicYear: string; readonly enrollmentDate: string; readonly withdrawalDate?: string; readonly status: EnrollmentStatus; readonly type: 'full-time' | 'part-time' | 'dual-enrollment'; readonly previousSchools?: PreviousSchoolRecord[]; readonly graduationDate?: string; readonly diplomaType?: 'standard' | 'honors' | 'IB' | 'vocational' | 'GED'; } /** * Grade levels in education system */ export type GradeLevel = 'PK' | 'K' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'PS' | 'UG' | 'GR'; /** * Student enrollment status */ export declare enum EnrollmentStatus { PreEnrolled = "PRE_ENROLLED", Active = "ACTIVE", Inactive = "INACTIVE", Withdrawn = "WITHDRAWN", Graduated = "GRADUATED", Expelled = "EXPELLED", Transferred = "TRANSFERRED", Deceased = "DECEASED" } /** * Previous school attendance record */ export interface PreviousSchoolRecord { readonly schoolName: string; readonly schoolId?: string; readonly city: string; readonly state?: string; readonly country: string; readonly startDate: string; readonly endDate: string; readonly gradeLevel: string; readonly reasonForLeaving?: string; readonly recordsReceived: boolean; } /** * Student contact information */ export interface StudentContacts { readonly primaryAddress: Address; readonly mailingAddress?: Address; readonly phone?: { readonly home?: string; readonly mobile?: string; }; readonly email?: string; readonly emergencyContacts: EmergencyContact[]; readonly guardians: GuardianRelationship[]; } /** * Address structure */ export interface Address { readonly street1: string; readonly street2?: string; readonly city: string; readonly state?: string; readonly postalCode?: string; readonly country: string; readonly verifiedDate?: string; readonly isTemporary?: boolean; readonly effectiveDate?: string; readonly endDate?: string; } /** * Emergency contact information */ export interface EmergencyContact { readonly name: string; readonly relationship: string; readonly primaryPhone: string; readonly alternatePhone?: string; readonly email?: string; readonly isPrimaryContact: boolean; readonly hasPickupRights: boolean; readonly restrictions?: string; } /** * Guardian/parent relationship */ export interface GuardianRelationship { readonly guardianId: GuardianId; readonly relationship: GuardianType; readonly isPrimaryGuardian: boolean; readonly hasLegalCustody: boolean; readonly hasEducationalRights: boolean; readonly hasFinancialResponsibility: boolean; readonly courtOrders?: { readonly type: string; readonly description: string; readonly effectiveDate: string; readonly expirationDate?: string; readonly documentUrl?: string; }[]; } /** * Types of guardian relationships */ export declare enum GuardianType { Mother = "MOTHER", Father = "FATHER", Stepmother = "STEPMOTHER", Stepfather = "STEPFATHER", Grandmother = "GRANDMOTHER", Grandfather = "GRANDFATHER", Aunt = "AUNT", Uncle = "UNCLE", LegalGuardian = "LEGAL_GUARDIAN", FosterParent = "FOSTER_PARENT", Other = "OTHER" } /** * Student academic information summary */ export interface StudentAcademicInfo { readonly cumulativeGPA?: number; readonly currentGPA?: number; readonly classRank?: { readonly rank: number; readonly totalStudents: number; readonly percentile: number; }; readonly credits: { readonly earned: number; readonly attempted: number; readonly required: number; readonly transferCredits?: number; }; readonly standardizedTests?: StandardizedTestScore[]; readonly academicHonors?: AcademicHonor[]; readonly disciplinaryActions?: DisciplinaryAction[]; } /** * Standardized test score record */ export interface StandardizedTestScore { readonly testType: StandardizedTestType; readonly testDate: string; readonly scores: Record<string, number>; readonly percentiles?: Record<string, number>; readonly isOfficial: boolean; readonly verifiedBy?: string; } /** * Types of standardized tests */ export declare enum StandardizedTestType { SAT = "SAT", ACT = "ACT", PSAT = "PSAT", AP = "AP",// Advanced Placement IB = "IB",// International Baccalaureate StateAssessment = "STATE_ASSESSMENT", TOEFL = "TOEFL", IELTS = "IELTS", GRE = "GRE", GMAT = "GMAT" } /** * Academic honor/award record */ export interface AcademicHonor { readonly title: string; readonly type: 'honor-roll' | 'dean-list' | 'scholarship' | 'award' | 'recognition'; readonly dateAwarded: string; readonly term?: string; readonly criteria?: string; readonly monetaryValue?: MonetaryAmount; } /** * Disciplinary action record */ export interface DisciplinaryAction { readonly incidentDate: string; readonly incidentType: string; readonly description: string; readonly action: string; readonly duration?: { readonly startDate: string; readonly endDate?: string; }; readonly severity: 'minor' | 'moderate' | 'major' | 'severe'; readonly reportedBy: string; readonly parentNotified: boolean; readonly resolutionNotes?: string; } /** * Course definition in curriculum */ export interface Course { readonly courseId: CourseId; readonly courseCode: string; readonly title: string; readonly description: string; readonly department: string; readonly subjectArea: SubjectArea; readonly creditHours: number; readonly prerequisites?: CourseId[]; readonly corequisites?: CourseId[]; readonly gradeLevel: GradeLevel[]; readonly difficulty: 'regular' | 'honors' | 'AP' | 'IB' | 'remedial'; readonly format: 'traditional' | 'online' | 'hybrid' | 'self-paced'; readonly duration: { readonly type: 'semester' | 'trimester' | 'quarter' | 'year' | 'summer'; readonly weeks: number; }; } /** * Subject areas in curriculum */ export declare enum SubjectArea { EnglishLanguageArts = "ENGLISH_LANGUAGE_ARTS", Mathematics = "MATHEMATICS", Science = "SCIENCE", SocialStudies = "SOCIAL_STUDIES", ForeignLanguage = "FOREIGN_LANGUAGE", Arts = "ARTS", Music = "MUSIC", PhysicalEducation = "PHYSICAL_EDUCATION", Health = "HEALTH", Technology = "TECHNOLOGY", BusinessEducation = "BUSINESS_EDUCATION", CareerTechnical = "CAREER_TECHNICAL", SpecialEducation = "SPECIAL_EDUCATION", ESL = "ESL", Other = "OTHER" } /** * Course section (actual class instance) */ export interface CourseSection { readonly sectionId: SectionId; readonly courseId: CourseId; readonly term: AcademicTerm; readonly teacher: TeacherId; readonly assistants?: TeacherId[]; readonly schedule: ClassSchedule; readonly location: { readonly building?: string; readonly room: string; readonly capacity: number; }; readonly enrollment: { readonly current: number; readonly maximum: number; readonly waitlist: number; }; readonly modality: 'in-person' | 'online' | 'hybrid'; } /** * Academic term/semester */ export interface AcademicTerm { readonly year: string; readonly term: 'fall' | 'spring' | 'summer' | 'winter' | 'trimester-1' | 'trimester-2' | 'trimester-3'; readonly startDate: string; readonly endDate: string; readonly instructionalDays: number; readonly holidays: Holiday[]; } /** * Class schedule information */ export interface ClassSchedule { readonly pattern: SchedulePattern; readonly days: DayOfWeek[]; readonly startTime: string; readonly endTime: string; readonly duration: number; readonly recurrence?: { readonly frequency: 'daily' | 'weekly' | 'biweekly' | 'monthly'; readonly interval?: number; }; } /** * Schedule patterns */ export declare enum SchedulePattern { Traditional = "TRADITIONAL", Block = "BLOCK", Rotating = "ROTATING", ModifiedBlock = "MODIFIED_BLOCK", Flexible = "FLEXIBLE" } /** * Days of the week */ export declare enum DayOfWeek { Monday = "MONDAY", Tuesday = "TUESDAY", Wednesday = "WEDNESDAY", Thursday = "THURSDAY", Friday = "FRIDAY", Saturday = "SATURDAY", Sunday = "SUNDAY" } /** * School holiday/break */ export interface Holiday { readonly name: string; readonly date: string; readonly type: 'federal' | 'state' | 'local' | 'religious' | 'break' | 'professional-development'; } /** * Student enrollment in a course section */ export interface StudentEnrollmentRecord { readonly studentId: StudentId; readonly sectionId: SectionId; readonly enrollmentDate: string; readonly withdrawalDate?: string; readonly status: 'active' | 'withdrawn' | 'completed' | 'incomplete' | 'failed'; readonly finalGrade?: Grade; readonly currentGrade?: Grade; readonly attendance: AttendanceSummary; readonly assignments: AssignmentSubmission[]; } /** * Grade representation */ export interface Grade { readonly gradeId: GradeId; readonly value: GradeValue; readonly numeric?: number; readonly letter?: string; readonly points?: number; readonly weight?: number; readonly gradedBy: TeacherId; readonly gradedAt: string; readonly comments?: string; readonly rubric?: GradingRubric; } /** * Grade value types */ export type GradeValue = { type: 'numeric'; value: number; scale: number; } | { type: 'letter'; value: string; plusMinus?: boolean; } | { type: 'gpa'; value: number; scale: number; } | { type: 'pass-fail'; value: 'pass' | 'fail'; } | { type: 'standards-based'; value: number; scale: number; } | { type: 'narrative'; value: string; }; /** * Grading rubric for consistent assessment */ export interface GradingRubric { readonly rubricId: Brand<string, 'RubricId'>; readonly name: string; readonly criteria: RubricCriterion[]; readonly totalPoints: number; } /** * Individual criterion in a rubric */ export interface RubricCriterion { readonly name: string; readonly description: string; readonly maxPoints: number; readonly levels: { readonly level: number; readonly description: string; readonly points: number; }[]; } /** * Assignment definition */ export interface Assignment { readonly assignmentId: AssignmentId; readonly sectionId: SectionId; readonly title: string; readonly description: string; readonly type: AssignmentType; readonly category: string; readonly points: number; readonly weight?: number; readonly assignedDate: string; readonly dueDate: string; readonly latePolicy?: { readonly allowed: boolean; readonly penaltyPerDay?: number; readonly maxLateDays?: number; }; readonly resources?: string[]; readonly rubric?: GradingRubric; } /** * Types of assignments */ export declare enum AssignmentType { Homework = "HOMEWORK", Quiz = "QUIZ", Test = "TEST", Essay = "ESSAY", Project = "PROJECT", Presentation = "PRESENTATION", Lab = "LAB", Participation = "PARTICIPATION", Other = "OTHER" } /** * Student assignment submission */ export interface AssignmentSubmission { readonly submissionId: Brand<string, 'SubmissionId'>; readonly assignmentId: AssignmentId; readonly studentId: StudentId; readonly submittedAt?: string; readonly status: SubmissionStatus; readonly files?: { readonly filename: string; readonly url: string; readonly size: number; readonly mimeType: string; }[]; readonly text?: string; readonly grade?: Grade; readonly feedback?: string; readonly turnitinScore?: number; } /** * Assignment submission status */ export declare enum SubmissionStatus { NotStarted = "NOT_STARTED", InProgress = "IN_PROGRESS", Submitted = "SUBMITTED", Late = "LATE", Missing = "MISSING", Graded = "GRADED", Returned = "RETURNED", Resubmitted = "RESUBMITTED" } /** * Daily attendance record */ export interface AttendanceRecord { readonly studentId: StudentId; readonly date: string; readonly status: AttendanceStatus; readonly periods?: PeriodAttendance[]; readonly minutesPresent?: number; readonly minutesAbsent?: number; readonly excused: boolean; readonly reason?: string; readonly verifiedBy?: string; readonly notes?: string; } /** * Attendance status */ export declare enum AttendanceStatus { Present = "PRESENT", Absent = "ABSENT", Tardy = "TARDY", EarlyDismissal = "EARLY_DISMISSAL", Excused = "EXCUSED", Unexcused = "UNEXCUSED", Suspended = "SUSPENDED", FieldTrip = "FIELD_TRIP", SchoolActivity = "SCHOOL_ACTIVITY" } /** * Period-by-period attendance */ export interface PeriodAttendance { readonly period: number; readonly sectionId: SectionId; readonly status: AttendanceStatus; readonly arrivalTime?: string; readonly departureTime?: string; readonly teacher: TeacherId; } /** * Attendance summary statistics */ export interface AttendanceSummary { readonly totalDays: number; readonly daysPresent: number; readonly daysAbsent: number; readonly daysExcused: number; readonly daysUnexcused: number; readonly daysTardy: number; readonly attendanceRate: number; readonly consecutiveAbsences: number; readonly pattern?: 'chronic' | 'improving' | 'declining' | 'stable'; } /** * Special education information */ export interface SpecialEducationInfo { readonly hasIEP: boolean; readonly has504Plan: boolean; readonly iep?: IEP; readonly section504?: Section504Plan; readonly evaluations: SpecialEdEvaluation[]; readonly services: SpecialEdService[]; } /** * Individualized Education Program (IEP) */ export interface IEP { readonly iepId: Brand<string, 'IEPId'>; readonly studentId: StudentId; readonly effectiveDate: string; readonly reviewDate: string; readonly goals: IEPGoal[]; readonly accommodations: Accommodation[]; readonly modifications: Modification[]; readonly services: SpecialEdService[]; readonly placement: { readonly setting: string; readonly percentInGenEd: number; }; readonly team: IEPTeamMember[]; } /** * IEP goal */ export interface IEPGoal { readonly goalId: Brand<string, 'GoalId'>; readonly domain: string; readonly description: string; readonly measurable: boolean; readonly baseline: string; readonly target: string; readonly criteria: string; readonly progress: { readonly method: string; readonly frequency: string; readonly lastUpdate?: string; readonly status?: 'not-started' | 'in-progress' | 'achieved' | 'modified'; }; } /** * Educational accommodation */ export interface Accommodation { readonly type: AccommodationType; readonly description: string; readonly subject?: SubjectArea; readonly frequency: 'always' | 'as-needed' | 'testing-only'; readonly implementedBy?: string; } /** * Types of accommodations */ export declare enum AccommodationType { ExtendedTime = "EXTENDED_TIME", ReducedAssignments = "REDUCED_ASSIGNMENTS", PreferentialSeating = "PREFERENTIAL_SEATING", BreaksAllowed = "BREAKS_ALLOWED", OralTesting = "ORAL_TESTING", LargeText = "LARGE_TEXT", AudioBooks = "AUDIO_BOOKS", Calculator = "CALCULATOR", SpeechToText = "SPEECH_TO_TEXT", Other = "OTHER" } /** * Educational modification */ export interface Modification { readonly type: string; readonly description: string; readonly subject?: SubjectArea; readonly impacts: 'curriculum' | 'standards' | 'grading' | 'other'; } /** * Special education service */ export interface SpecialEdService { readonly serviceType: SpecialServiceType; readonly provider: string; readonly frequency: string; readonly duration: string; readonly location: 'general-ed' | 'resource-room' | 'separate-class' | 'therapy-room'; readonly groupSize?: number; } /** * Types of special education services */ export declare enum SpecialServiceType { SpeechTherapy = "SPEECH_THERAPY", OccupationalTherapy = "OCCUPATIONAL_THERAPY", PhysicalTherapy = "PHYSICAL_THERAPY", Counseling = "COUNSELING", ResourceRoom = "RESOURCE_ROOM", ParaSupport = "PARA_SUPPORT", BehaviorSupport = "BEHAVIOR_SUPPORT", Other = "OTHER" } /** * Section 504 Plan */ export interface Section504Plan { readonly planId: Brand<string, 'Plan504Id'>; readonly studentId: StudentId; readonly disability: string; readonly effectiveDate: string; readonly reviewDate: string; readonly accommodations: Accommodation[]; readonly coordinatorId: string; } /** * Special education evaluation */ export interface SpecialEdEvaluation { readonly evaluationId: Brand<string, 'EvaluationId'>; readonly type: string; readonly date: string; readonly evaluator: string; readonly results: Record<string, unknown>; readonly recommendations: string[]; readonly nextEvaluationDue?: string; } /** * IEP team member */ export interface IEPTeamMember { readonly role: IEPTeamRole; readonly name: string; readonly title?: string; readonly participationDate: string; readonly signature?: string; } /** * IEP team roles */ export declare enum IEPTeamRole { Parent = "PARENT", Student = "STUDENT", GeneralEducationTeacher = "GENERAL_EDUCATION_TEACHER", SpecialEducationTeacher = "SPECIAL_EDUCATION_TEACHER", SchoolPsychologist = "SCHOOL_PSYCHOLOGIST", Administrator = "ADMINISTRATOR", RelatedServiceProvider = "RELATED_SERVICE_PROVIDER", Other = "OTHER" } /** * Student health information */ export interface StudentHealthInfo { readonly medicalConditions?: MedicalCondition[]; readonly allergies?: Allergy[]; readonly medications?: Medication[]; readonly immunizations: Immunization[]; readonly visionScreening?: HealthScreening; readonly hearingScreening?: HealthScreening; readonly dentalScreening?: HealthScreening; readonly physicalExam?: { readonly date: string; readonly provider: string; readonly clearedForSports: boolean; readonly restrictions?: string[]; }; readonly emergencyPlan?: string; readonly healthCarePlan?: string; } /** * Medical condition record */ export interface MedicalCondition { readonly condition: string; readonly severity: 'mild' | 'moderate' | 'severe'; readonly diagnosisDate?: string; readonly treatment?: string; readonly restrictions?: string[]; readonly emergencyProtocol?: string; } /** * Allergy information */ export interface Allergy { readonly allergen: string; readonly type: 'food' | 'drug' | 'environmental' | 'other'; readonly severity: 'mild' | 'moderate' | 'severe' | 'life-threatening'; readonly reaction: string; readonly treatment: string; readonly hasEpiPen: boolean; readonly actionPlan?: string; } /** * Medication administration record */ export interface Medication { readonly name: string; readonly dosage: string; readonly frequency: string; readonly administrationTime: string[]; readonly startDate: string; readonly endDate?: string; readonly prescribedBy: string; readonly administeredBy: 'self' | 'nurse' | 'designated-staff'; readonly storageLocation?: string; readonly sideEffects?: string[]; } /** * Immunization record */ export interface Immunization { readonly vaccine: string; readonly dateAdministered: string; readonly provider?: string; readonly doseNumber?: number; readonly seriesComplete: boolean; readonly exemption?: { readonly type: 'medical' | 'religious' | 'philosophical'; readonly documentation?: string; }; } /** * Health screening result */ export interface HealthScreening { readonly type: 'vision' | 'hearing' | 'dental' | 'scoliosis' | 'other'; readonly date: string; readonly result: 'pass' | 'fail' | 'refer'; readonly notes?: string; readonly followUpRequired: boolean; readonly followUpDate?: string; } /** * Student transportation information */ export interface StudentTransportation { readonly busNumber?: string; readonly busRoute?: string; readonly pickupStop?: { readonly location: string; readonly time: string; readonly distance?: number; }; readonly dropoffStop?: { readonly location: string; readonly time: string; readonly distance?: number; }; readonly specialNeeds?: { readonly wheelchairAccessible: boolean; readonly aide: boolean; readonly other?: string; }; readonly authorizedPickup: string[]; readonly walkToSchool?: boolean; readonly parentTransport?: boolean; } /** * Meal program enrollment */ export interface MealProgramEnrollment { readonly eligibility: MealProgramEligibility; readonly startDate: string; readonly endDate?: string; readonly dietaryRestrictions?: DietaryRestriction[]; readonly balance?: MonetaryAmount; readonly accountNumber?: string; } /** * Meal program eligibility levels */ export declare enum MealProgramEligibility { Free = "FREE", Reduced = "REDUCED", Paid = "PAID", NotEnrolled = "NOT_ENROLLED" } /** * Dietary restriction/preference */ export interface DietaryRestriction { readonly type: 'allergy' | 'intolerance' | 'religious' | 'ethical' | 'medical'; readonly description: string; readonly severity?: 'mild' | 'moderate' | 'severe'; readonly substitutions?: string[]; } /** * Validate grade level progression */ export declare function isValidGradeProgression(current: GradeLevel, next: GradeLevel): boolean; /** * Calculate age from date of birth */ export declare function calculateAge(dateOfBirth: string): number; /** * Validate enrollment eligibility based on age */ export declare function validateEnrollmentAge(dateOfBirth: string, gradeLevel: GradeLevel, cutoffDate?: string): Result<boolean, string>; export declare const educationTypes: { EnrollmentStatus: typeof EnrollmentStatus; GuardianType: typeof GuardianType; SubjectArea: typeof SubjectArea; StandardizedTestType: typeof StandardizedTestType; SchedulePattern: typeof SchedulePattern; DayOfWeek: typeof DayOfWeek; AssignmentType: typeof AssignmentType; SubmissionStatus: typeof SubmissionStatus; AttendanceStatus: typeof AttendanceStatus; AccommodationType: typeof AccommodationType; SpecialServiceType: typeof SpecialServiceType; IEPTeamRole: typeof IEPTeamRole; MealProgramEligibility: typeof MealProgramEligibility; isValidGradeProgression: typeof isValidGradeProgression; calculateAge: typeof calculateAge; validateEnrollmentAge: typeof validateEnrollmentAge; }; //# sourceMappingURL=education-types.d.ts.map