UNPKG

@iota-big3/sdk-gateway

Version:

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

328 lines 12 kB
"use strict"; /** * 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 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.educationTypes = exports.MealProgramEligibility = exports.IEPTeamRole = exports.SpecialServiceType = exports.AccommodationType = exports.AttendanceStatus = exports.SubmissionStatus = exports.AssignmentType = exports.DayOfWeek = exports.SchedulePattern = exports.SubjectArea = exports.StandardizedTestType = exports.GuardianType = exports.EnrollmentStatus = void 0; exports.isValidGradeProgression = isValidGradeProgression; exports.calculateAge = calculateAge; exports.validateEnrollmentAge = validateEnrollmentAge; /** * Student enrollment status */ var EnrollmentStatus; (function (EnrollmentStatus) { EnrollmentStatus["PreEnrolled"] = "PRE_ENROLLED"; EnrollmentStatus["Active"] = "ACTIVE"; EnrollmentStatus["Inactive"] = "INACTIVE"; EnrollmentStatus["Withdrawn"] = "WITHDRAWN"; EnrollmentStatus["Graduated"] = "GRADUATED"; EnrollmentStatus["Expelled"] = "EXPELLED"; EnrollmentStatus["Transferred"] = "TRANSFERRED"; EnrollmentStatus["Deceased"] = "DECEASED"; })(EnrollmentStatus || (exports.EnrollmentStatus = EnrollmentStatus = {})); /** * Types of guardian relationships */ var GuardianType; (function (GuardianType) { GuardianType["Mother"] = "MOTHER"; GuardianType["Father"] = "FATHER"; GuardianType["Stepmother"] = "STEPMOTHER"; GuardianType["Stepfather"] = "STEPFATHER"; GuardianType["Grandmother"] = "GRANDMOTHER"; GuardianType["Grandfather"] = "GRANDFATHER"; GuardianType["Aunt"] = "AUNT"; GuardianType["Uncle"] = "UNCLE"; GuardianType["LegalGuardian"] = "LEGAL_GUARDIAN"; GuardianType["FosterParent"] = "FOSTER_PARENT"; GuardianType["Other"] = "OTHER"; })(GuardianType || (exports.GuardianType = GuardianType = {})); /** * Types of standardized tests */ var StandardizedTestType; (function (StandardizedTestType) { StandardizedTestType["SAT"] = "SAT"; StandardizedTestType["ACT"] = "ACT"; StandardizedTestType["PSAT"] = "PSAT"; StandardizedTestType["AP"] = "AP"; StandardizedTestType["IB"] = "IB"; StandardizedTestType["StateAssessment"] = "STATE_ASSESSMENT"; StandardizedTestType["TOEFL"] = "TOEFL"; StandardizedTestType["IELTS"] = "IELTS"; StandardizedTestType["GRE"] = "GRE"; StandardizedTestType["GMAT"] = "GMAT"; })(StandardizedTestType || (exports.StandardizedTestType = StandardizedTestType = {})); /** * Subject areas in curriculum */ var SubjectArea; (function (SubjectArea) { SubjectArea["EnglishLanguageArts"] = "ENGLISH_LANGUAGE_ARTS"; SubjectArea["Mathematics"] = "MATHEMATICS"; SubjectArea["Science"] = "SCIENCE"; SubjectArea["SocialStudies"] = "SOCIAL_STUDIES"; SubjectArea["ForeignLanguage"] = "FOREIGN_LANGUAGE"; SubjectArea["Arts"] = "ARTS"; SubjectArea["Music"] = "MUSIC"; SubjectArea["PhysicalEducation"] = "PHYSICAL_EDUCATION"; SubjectArea["Health"] = "HEALTH"; SubjectArea["Technology"] = "TECHNOLOGY"; SubjectArea["BusinessEducation"] = "BUSINESS_EDUCATION"; SubjectArea["CareerTechnical"] = "CAREER_TECHNICAL"; SubjectArea["SpecialEducation"] = "SPECIAL_EDUCATION"; SubjectArea["ESL"] = "ESL"; SubjectArea["Other"] = "OTHER"; })(SubjectArea || (exports.SubjectArea = SubjectArea = {})); /** * Schedule patterns */ var SchedulePattern; (function (SchedulePattern) { SchedulePattern["Traditional"] = "TRADITIONAL"; SchedulePattern["Block"] = "BLOCK"; SchedulePattern["Rotating"] = "ROTATING"; SchedulePattern["ModifiedBlock"] = "MODIFIED_BLOCK"; SchedulePattern["Flexible"] = "FLEXIBLE"; })(SchedulePattern || (exports.SchedulePattern = SchedulePattern = {})); /** * Days of the week */ var DayOfWeek; (function (DayOfWeek) { DayOfWeek["Monday"] = "MONDAY"; DayOfWeek["Tuesday"] = "TUESDAY"; DayOfWeek["Wednesday"] = "WEDNESDAY"; DayOfWeek["Thursday"] = "THURSDAY"; DayOfWeek["Friday"] = "FRIDAY"; DayOfWeek["Saturday"] = "SATURDAY"; DayOfWeek["Sunday"] = "SUNDAY"; })(DayOfWeek || (exports.DayOfWeek = DayOfWeek = {})); /** * Types of assignments */ var AssignmentType; (function (AssignmentType) { AssignmentType["Homework"] = "HOMEWORK"; AssignmentType["Quiz"] = "QUIZ"; AssignmentType["Test"] = "TEST"; AssignmentType["Essay"] = "ESSAY"; AssignmentType["Project"] = "PROJECT"; AssignmentType["Presentation"] = "PRESENTATION"; AssignmentType["Lab"] = "LAB"; AssignmentType["Participation"] = "PARTICIPATION"; AssignmentType["Other"] = "OTHER"; })(AssignmentType || (exports.AssignmentType = AssignmentType = {})); /** * Assignment submission status */ var SubmissionStatus; (function (SubmissionStatus) { SubmissionStatus["NotStarted"] = "NOT_STARTED"; SubmissionStatus["InProgress"] = "IN_PROGRESS"; SubmissionStatus["Submitted"] = "SUBMITTED"; SubmissionStatus["Late"] = "LATE"; SubmissionStatus["Missing"] = "MISSING"; SubmissionStatus["Graded"] = "GRADED"; SubmissionStatus["Returned"] = "RETURNED"; SubmissionStatus["Resubmitted"] = "RESUBMITTED"; })(SubmissionStatus || (exports.SubmissionStatus = SubmissionStatus = {})); /** * Attendance status */ var AttendanceStatus; (function (AttendanceStatus) { AttendanceStatus["Present"] = "PRESENT"; AttendanceStatus["Absent"] = "ABSENT"; AttendanceStatus["Tardy"] = "TARDY"; AttendanceStatus["EarlyDismissal"] = "EARLY_DISMISSAL"; AttendanceStatus["Excused"] = "EXCUSED"; AttendanceStatus["Unexcused"] = "UNEXCUSED"; AttendanceStatus["Suspended"] = "SUSPENDED"; AttendanceStatus["FieldTrip"] = "FIELD_TRIP"; AttendanceStatus["SchoolActivity"] = "SCHOOL_ACTIVITY"; })(AttendanceStatus || (exports.AttendanceStatus = AttendanceStatus = {})); /** * Types of accommodations */ var AccommodationType; (function (AccommodationType) { AccommodationType["ExtendedTime"] = "EXTENDED_TIME"; AccommodationType["ReducedAssignments"] = "REDUCED_ASSIGNMENTS"; AccommodationType["PreferentialSeating"] = "PREFERENTIAL_SEATING"; AccommodationType["BreaksAllowed"] = "BREAKS_ALLOWED"; AccommodationType["OralTesting"] = "ORAL_TESTING"; AccommodationType["LargeText"] = "LARGE_TEXT"; AccommodationType["AudioBooks"] = "AUDIO_BOOKS"; AccommodationType["Calculator"] = "CALCULATOR"; AccommodationType["SpeechToText"] = "SPEECH_TO_TEXT"; AccommodationType["Other"] = "OTHER"; })(AccommodationType || (exports.AccommodationType = AccommodationType = {})); /** * Types of special education services */ var SpecialServiceType; (function (SpecialServiceType) { SpecialServiceType["SpeechTherapy"] = "SPEECH_THERAPY"; SpecialServiceType["OccupationalTherapy"] = "OCCUPATIONAL_THERAPY"; SpecialServiceType["PhysicalTherapy"] = "PHYSICAL_THERAPY"; SpecialServiceType["Counseling"] = "COUNSELING"; SpecialServiceType["ResourceRoom"] = "RESOURCE_ROOM"; SpecialServiceType["ParaSupport"] = "PARA_SUPPORT"; SpecialServiceType["BehaviorSupport"] = "BEHAVIOR_SUPPORT"; SpecialServiceType["Other"] = "OTHER"; })(SpecialServiceType || (exports.SpecialServiceType = SpecialServiceType = {})); /** * IEP team roles */ var IEPTeamRole; (function (IEPTeamRole) { IEPTeamRole["Parent"] = "PARENT"; IEPTeamRole["Student"] = "STUDENT"; IEPTeamRole["GeneralEducationTeacher"] = "GENERAL_EDUCATION_TEACHER"; IEPTeamRole["SpecialEducationTeacher"] = "SPECIAL_EDUCATION_TEACHER"; IEPTeamRole["SchoolPsychologist"] = "SCHOOL_PSYCHOLOGIST"; IEPTeamRole["Administrator"] = "ADMINISTRATOR"; IEPTeamRole["RelatedServiceProvider"] = "RELATED_SERVICE_PROVIDER"; IEPTeamRole["Other"] = "OTHER"; })(IEPTeamRole || (exports.IEPTeamRole = IEPTeamRole = {})); /** * Meal program eligibility levels */ var MealProgramEligibility; (function (MealProgramEligibility) { MealProgramEligibility["Free"] = "FREE"; MealProgramEligibility["Reduced"] = "REDUCED"; MealProgramEligibility["Paid"] = "PAID"; MealProgramEligibility["NotEnrolled"] = "NOT_ENROLLED"; })(MealProgramEligibility || (exports.MealProgramEligibility = MealProgramEligibility = {})); // ============================================ // Validation Functions // ============================================ /** * Validate grade level progression */ function isValidGradeProgression(current, next) { const progression = { 'PK': ['K'], 'K': ['1'], '1': ['2'], '2': ['3'], '3': ['4'], '4': ['5'], '5': ['6'], '6': ['7'], '7': ['8'], '8': ['9'], '9': ['10'], '10': ['11'], '11': ['12'], '12': ['PS', 'UG'], 'PS': ['UG'], 'UG': ['GR'], 'GR': [] }; return progression[current]?.includes(next) || false; } /** * Calculate age from date of birth */ function calculateAge(dateOfBirth) { const today = new Date(); const birthDate = new Date(dateOfBirth); let age = today.getFullYear() - birthDate.getFullYear(); const monthDiff = today.getMonth() - birthDate.getMonth(); if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) { age--; } return age; } /** * Validate enrollment eligibility based on age */ function validateEnrollmentAge(dateOfBirth, gradeLevel, cutoffDate = '09-01' // September 1st default ) { const age = calculateAge(dateOfBirth); const birthDate = new Date(dateOfBirth); const currentYear = new Date().getFullYear(); const cutoff = new Date(`${currentYear}-${cutoffDate}`); // Check if student meets age cutoff if (birthDate > cutoff) { return { success: false, error: `Student born after cutoff date ${cutoffDate}` }; } // Age requirements by grade (approximate) const ageRequirements = { 'PK': { min: 3, max: 5 }, 'K': { min: 4, max: 6 }, '1': { min: 5, max: 7 }, '2': { min: 6, max: 8 }, '3': { min: 7, max: 9 }, '4': { min: 8, max: 10 }, '5': { min: 9, max: 11 }, '6': { min: 10, max: 12 }, '7': { min: 11, max: 13 }, '8': { min: 12, max: 14 }, '9': { min: 13, max: 15 }, '10': { min: 14, max: 16 }, '11': { min: 15, max: 17 }, '12': { min: 16, max: 19 }, 'PS': { min: 16, max: 99 }, 'UG': { min: 17, max: 99 }, 'GR': { min: 21, max: 99 } }; const req = ageRequirements[gradeLevel]; if (age < req.min) { return { success: false, error: `Student too young for grade ${gradeLevel} (min age: ${req.min})` }; } if (age > req.max) { return { success: false, error: `Student too old for grade ${gradeLevel} (max age: ${req.max})` }; } return { success: true, data: true }; } // ============================================ // Export Education Types // ============================================ exports.educationTypes = { // Enums EnrollmentStatus, GuardianType, SubjectArea, StandardizedTestType, SchedulePattern, DayOfWeek, AssignmentType, SubmissionStatus, AttendanceStatus, AccommodationType, SpecialServiceType, IEPTeamRole, MealProgramEligibility, // Functions isValidGradeProgression, calculateAge, validateEnrollmentAge }; //# sourceMappingURL=education-types.js.map