UNPKG

cloud-ide-model-schema

Version:

Pachage for schema management of Cloud IDEsys LMS

999 lines (998 loc) 29.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CAdmissionApplicationMain = void 0; var mongoose_1 = require("mongoose"); /* SCHEMA START */ var admission_application_main = new mongoose_1.Schema({ // APPLICATION IDENTIFIERS admap_application_number: { type: String, required: true, unique: true, maxlength: 50, trim: true, comment: "Unique application number (e.g., APP2026-EL-001)" }, admap_student_id: { type: String, maxlength: 50, trim: true, unique: true, sparse: true, comment: "Assigned after admission acceptance (NULL until admission)" }, // SECTION 1: STUDENT PERSONAL IDENTIFICATION admap_first_name: { type: String, minlength: 1, maxlength: 100, trim: true }, admap_middle_name: { type: String, maxlength: 100, trim: true }, admap_last_name: { type: String, minlength: 1, maxlength: 100, trim: true }, admap_mother_name: { type: String, maxlength: 100, trim: true, comment: "Student's mother name" }, admap_preferred_name: { type: String, maxlength: 255, trim: true }, admap_primary_email: { type: String, maxlength: 255, trim: true, lowercase: true, comment: "Student/Applicant primary email" }, admap_mobile_phone: { type: String, maxlength: 20, trim: true, comment: "Student/Applicant mobile phone number" }, admap_date_of_birth: { type: Date }, admap_place_of_birth: { type: String, maxlength: 255, trim: true }, admap_gender_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Gender (Male, Female, Non-binary, Prefer not to state) - Reference to core_general_master with type 'GENDER'" }, admap_citizenship_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Citizenship status (Citizen, Permanent Resident, International, Other) - Reference to core_general_master with type 'CITIZENSHIP_STATUS'" }, admap_nationality_id_synat: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_system_nationality", comment: "Nationality - Reference to core_system_nationality" }, admap_passport_number: { type: String, maxlength: 100, trim: true, comment: "Required for international students" }, admap_passport_expiry_date: { type: Date, comment: "Required for international students" }, admap_visa_status: { type: String, maxlength: 100, trim: true, enum: ["Student Visa", "Tourist Visa", "Pending", "Not Required"] }, admap_marital_status: { type: String, maxlength: 50, trim: true, enum: ["Single", "Married", "Divorced", "Widowed"] }, admap_blood_group_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Blood group (A+, A-, B+, B-, AB+, AB-, O+, O-) - Reference to core_general_master with type 'BLOOD_GROUP'" }, admap_photo_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Student photo file manager ID" }, admap_identification_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Student identification status (Alive, Passed Away, etc.) - Reference to core_general_master with type 'IDENTIFICATION_STATUS'" }, admap_is_rte_scheme: { type: Boolean, default: false, comment: "Is student under Right to Education (RTE) scheme - if true, RTE details will be required" }, admap_grn: { type: String, maxlength: 100, trim: true, comment: "General Registration Number assigned by authority (CBSE, State Board, etc.)" }, admap_grn_authority_id_edbrd: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "academics_education_board", comment: "Education board/authority that assigned GRN - Reference to core_education_board" }, admap_handicap_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Handicap certificate file manager ID" }, admap_handicap_certificate_number: { type: String, maxlength: 100, trim: true, comment: "Handicap certificate number" }, admap_handicap_percentage: { type: Number, min: 0, max: 100, comment: "Handicap percentage (0-100)" }, admap_accessibility_requirements: { type: String, maxlength: 1000, trim: true, comment: "Accessibility requirements and special accommodations needed" }, // SECTION 2: CONTACT & ADDRESS INFORMATION // Note: Some address fields might be managed via separate tab, but pin code reference is needed here admap_pin_sypin: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_pin_code", comment: "Permanent Address PIN Code" }, // SECTION 3: ACADEMIC HISTORY admap_program_applying_for: { type: String, maxlength: 255, trim: true, comment: "Program name (e.g., Kindergarten, Grade 10, BBA, Engineering)" }, admap_program_category_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Program category - Reference to core_general_master (type code: program_category)" }, admap_class_program_id_acacpm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "aca_class_program_master", comment: "Class/Program applying for - Reference to aca_class_program_master" }, admap_class_program_branch_id_acabrn: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "aca_class_prg_branch", comment: "Class/Program branch - Reference to aca_class_prg_branch (conditional - shown if program has branchType: true)" }, admap_class_program_term_id_acapt: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "aca_class_program_term", comment: "Class/Program term/semester - Reference to aca_class_program_term (conditional - shown if program has termType: true and getAdmission: true)" }, admap_grade_level_applying_for_id_acacpm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "aca_class_program_master", comment: "Foreign key to aca_class_program_master - Grade level applying for" }, admap_age_at_enrollment: { type: Number, min: 0, max: 100, comment: "Calculated from date of birth and entry semester" }, admap_entry_semester_term: { type: String, maxlength: 50, trim: true, comment: "Entry semester/term (e.g., Fall 2026, Spring 2027)" }, admap_academic_year_id_acayr: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "aca_academic_year" }, admap_highest_level_of_education: { type: String, maxlength: 100, trim: true, comment: "Previous education level (e.g., Pre-Kindergarten, Grade 9, High School Diploma)" }, admap_previous_institution_name: { type: String, maxlength: 255, trim: true }, admap_previous_institution_type: { type: String, maxlength: 100, trim: true, enum: ["Public", "Private", "International", "Homeschool", "Other"] }, admap_previous_institution_location: { type: String, maxlength: 255, trim: true }, admap_previous_institution_country: { type: String, maxlength: 100, trim: true }, admap_previous_grade_level: { type: String, maxlength: 50, trim: true }, admap_graduation_date_previous: { type: Date, comment: "Graduation date from previous institution" }, admap_gpa_final_grade: { type: Number, min: 0, max: 10, comment: "GPA from previous institution" }, admap_gpa_scale: { type: String, maxlength: 10, trim: true, default: "4.0", comment: "GPA scale (e.g., 4.0, 5.0, 100)" }, admap_grade_percentage: { type: Number, min: 0, max: 100, comment: "Grade percentage" }, admap_standardized_test_scores: { type: String, maxlength: 500, trim: true, comment: "Test scores (e.g., SAT: 1520, ACT: 34, TOEFL: 95)" }, admap_sat_score: { type: Number, min: 0, max: 1600, comment: "SAT Score" }, admap_act_score: { type: Number, min: 0, max: 36, comment: "ACT Score" }, admap_psat_score: { type: Number, min: 0, max: 1520, comment: "PSAT Score" }, admap_entrance_exam_score: { type: Number, min: 0, comment: "Entrance exam score" }, admap_entrance_exam_date: { type: Date, comment: "Entrance exam date" }, admap_attendance_record: { type: String, maxlength: 100, trim: true, comment: "Attendance percentage or record" }, admap_behavior_record: { type: String, maxlength: 500, trim: true, comment: "Behavior record description" }, admap_school_district: { type: String, maxlength: 255, trim: true, comment: "School district (for public schools)" }, admap_residency_verification_status: { type: Boolean, default: false, comment: "Residency verification status (for public schools)" }, // BOARD INFORMATION - Previous Education Board admap_previous_education_board_id_edbrd: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "academics_education_board", comment: "Previous education board (CBSE, State Board, ICSE, etc.)" }, admap_previous_board_name: { type: String, maxlength: 200, trim: true, comment: "Previous board name (if not in master)" }, admap_previous_board_type_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Previous board type (CBSE, ICSE, State Board, IB, IGCSE, Other) - Reference to core_general_master with type 'EDUCATION_BOARD_TYPE'" }, admap_previous_board_roll_number: { type: String, maxlength: 100, trim: true, comment: "Previous board roll number" }, admap_previous_board_registration_number: { type: String, maxlength: 100, trim: true, comment: "Previous board registration number" }, admap_previous_board_exam_year: { type: String, maxlength: 10, trim: true, comment: "Previous board exam year (e.g., 2024)" }, admap_previous_board_exam_center: { type: String, maxlength: 255, trim: true, comment: "Previous board exam center" }, admap_previous_board_percentage: { type: Number, min: 0, max: 100, comment: "Previous board exam percentage" }, admap_previous_board_cgpa: { type: Number, min: 0, max: 10, comment: "Previous board exam CGPA (if applicable)" }, admap_previous_board_grade: { type: String, maxlength: 10, trim: true, comment: "Previous board exam grade (e.g., A+, First Class, Distinction)" }, admap_previous_board_marksheet_number: { type: String, maxlength: 100, trim: true, comment: "Previous board marksheet number" }, admap_previous_board_marksheet_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Previous board marksheet file ID" }, admap_previous_board_migration_certificate: { type: Boolean, default: false, comment: "Migration certificate available" }, admap_previous_board_migration_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Migration certificate file ID" }, admap_previous_board_transfer_certificate: { type: Boolean, default: false, comment: "Transfer certificate available" }, admap_previous_board_transfer_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Transfer certificate file ID" }, admap_previous_board_character_certificate: { type: Boolean, default: false, comment: "Character certificate available" }, admap_previous_board_character_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Character certificate file ID" }, // BOARD INFORMATION - Current School Board admap_current_school_board_id_edbrd: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "academics_education_board", comment: "Current school's education board" }, admap_applying_for_board_id_edbrd: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "academics_education_board", comment: "Board student is applying for (if different from current)" }, // SECTION 4: EMERGENCY CONTACT // Note: Guardian information is managed through Family Members & Guardians section admap_parent_volunteer_interest: { type: Boolean, default: false }, admap_custody_documentation_status: { type: Boolean, default: false, comment: "Custody documentation upload status" }, // SECTION 5: FINANCIAL & BILLING INFORMATION admap_tuition_payer_name: { type: String, maxlength: 255, trim: true }, admap_tuition_payer_relationship: { type: String, maxlength: 100, trim: true, enum: ["Parent", "Guardian", "Self", "Sponsor", "Other"] }, admap_billing_email_address: { type: String, maxlength: 255, trim: true, lowercase: true }, admap_billing_address: { type: String, maxlength: 500, trim: true }, admap_intended_payment_method: { type: String, maxlength: 100, trim: true, comment: "Legacy string field" }, admap_intended_payment_method_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Intended payment method - Reference to core_general_master (type code: payment_method)" }, admap_application_fee_payment_status: { type: Boolean, default: false }, admap_application_fee_amount: { type: Number, min: 0, default: 0, comment: "Application fee amount" }, admap_application_fee_payment_date: { type: Date, comment: "Application fee payment date" }, admap_application_fee_transaction_id: { type: String, maxlength: 100, trim: true }, admap_scholarship_application_status: { type: Boolean, default: false }, admap_financial_aid_amount: { type: Number, min: 0, default: 0 }, admap_sponsor_name: { type: String, maxlength: 255, trim: true }, admap_sponsor_contact: { type: String, maxlength: 255, trim: true }, admap_financial_hold_status: { type: Boolean, default: false }, admap_deposit_paid_status: { type: Boolean, default: false }, admap_deposit_amount: { type: Number, min: 0, default: 0 }, admap_deposit_payment_date: { type: Date }, // SECTION 6: MEDICAL & HEALTH INFORMATION admap_known_allergies: { type: String, maxlength: 500, trim: true }, admap_chronic_medical_conditions: { type: String, maxlength: 500, trim: true }, admap_current_medications: { type: String, maxlength: 500, trim: true }, admap_insurance_provider: { type: String, maxlength: 255, trim: true }, admap_insurance_policy_number: { type: String, maxlength: 100, trim: true }, admap_insurance_expiry_date: { type: Date }, admap_emergency_health_consent: { type: Boolean, default: false }, admap_disability_status: { type: Boolean, default: false }, admap_disability_type: { type: String, maxlength: 255, trim: true }, admap_special_accommodation_needs: { type: String, maxlength: 500, trim: true }, admap_medical_clearance_status: { type: Boolean, default: false }, admap_immunization_record_upload_status: { type: Boolean, default: false }, admap_immunization_complete: { type: Boolean, default: false }, admap_immunization_exemption: { type: Boolean, default: false }, admap_immunization_exemption_reason: { type: String, maxlength: 500, trim: true }, admap_primary_care_physician_name: { type: String, maxlength: 255, trim: true }, admap_primary_care_physician_phone: { type: String, maxlength: 50, trim: true }, admap_medical_alert_information: { type: String, maxlength: 500, trim: true }, admap_iep_status: { type: Boolean, default: false, comment: "Individualized Education Program status" }, admap_plan_504_status: { type: Boolean, default: false, comment: "504 Plan status" }, admap_special_education_services: { type: String, maxlength: 500, trim: true }, // SECTION 7: ELECTIVE SUBJECT SELECTION admap_elective_selection_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Elective selection status - Reference to core_general_master (type code: elective_selection_status)" }, admap_counseling_notes: { type: String, maxlength: 1000, trim: true }, admap_prerequisite_acknowledgment: { type: Boolean, default: false }, admap_maximum_electives_allowed: { type: Number, min: 0, default: 0, comment: "Maximum number of electives allowed" }, // SECTION 8: ESSAY & SUPPORTING DOCUMENTS admap_personal_statement_text: { type: String, maxlength: 10000, trim: true, comment: "Personal statement/essay text" }, admap_personal_statement_word_count: { type: Number, min: 0, default: 0 }, admap_personal_statement_min_word_count: { type: Number, min: 0, default: 0 }, admap_personal_statement_max_word_count: { type: Number, min: 0, default: 0 }, admap_transcript_upload_status: { type: Boolean, default: false }, admap_transcript_upload_date: { type: Date }, admap_transcript_file_path_url: { type: String, maxlength: 500, trim: true }, admap_report_card_upload_status: { type: Boolean, default: false }, admap_report_card_years: { type: String, maxlength: 255, trim: true, comment: "Comma-separated list of years (e.g., 2024-2025, 2023-2024)" }, admap_letter_of_rec_1_status: { type: Boolean, default: false }, admap_letter_of_rec_1_upload_date: { type: Date }, admap_letter_of_rec_1_recommender_name: { type: String, maxlength: 255, trim: true }, admap_letter_of_rec_1_recommender_type_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Letter of recommendation 1 recommender type - Reference to core_general_master (type code: recommender_type)" }, admap_letter_of_rec_2_status: { type: Boolean, default: false }, admap_letter_of_rec_2_upload_date: { type: Date }, admap_letter_of_rec_2_recommender_name: { type: String, maxlength: 255, trim: true }, admap_letter_of_rec_2_recommender_type_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Letter of recommendation 2 recommender type - Reference to core_general_master (type code: recommender_type)" }, admap_teacher_recommendation_status: { type: Boolean, default: false }, admap_portfolio_url: { type: String, maxlength: 500, trim: true }, admap_portfolio_upload_status: { type: Boolean, default: false }, admap_identity_document_upload_status: { type: Boolean, default: false }, admap_identity_document_type: { type: String, maxlength: 100, trim: true, enum: ["Birth Certificate", "Passport", "Driver's License", "National ID", "Other"] }, admap_birth_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Birth certificate file manager ID" }, admap_birth_certificate_upload_status: { type: Boolean, default: false }, admap_transfer_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Transfer certificate file manager ID" }, admap_character_certificate_id_cyfm: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_file_manager", comment: "Character certificate file manager ID" }, admap_custody_documents_upload_status: { type: Boolean, default: false }, admap_additional_documents_upload_status: { type: Boolean, default: false }, // SECTION 9: SUPPLEMENTARY & CONSENT admap_language_of_instruction: { type: String, maxlength: 100, trim: true, default: "English" }, admap_native_language: { type: String, maxlength: 100, trim: true }, admap_source_of_referral: { type: String, maxlength: 255, trim: true, comment: "How did you hear about us?" }, admap_referral_details: { type: String, maxlength: 500, trim: true }, admap_how_did_you_hear_about_us: { type: String, maxlength: 500, trim: true }, admap_signature_date: { type: Date }, admap_declaration_of_accuracy: { type: Boolean, default: false }, admap_privacy_policy_consent: { type: Boolean, default: false }, admap_terms_and_conditions_consent: { type: Boolean, default: false }, admap_applicant_signature: { type: String, maxlength: 255, trim: true }, admap_parent_guardian_signature: { type: String, maxlength: 255, trim: true }, admap_ip_address: { type: String, maxlength: 50, trim: true }, admap_browser_information: { type: String, maxlength: 255, trim: true }, // SECTION 10: APPLICATION STATUS & WORKFLOW admap_application_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Application status - Reference to core_general_master (type code: admission_application_status)" }, admap_status_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", index: true, comment: "Overall status - Reference to core_general_master (type code: admission_status)" }, admap_application_submission_date: { type: Date, comment: "Date when application was submitted" }, admap_submission_date: { type: Date, comment: "Date when application was submitted (alternative field name)" }, admap_interview_scheduled_date: { type: Date, comment: "Scheduled interview date" }, admap_interview_status: { type: String, maxlength: 50, trim: true, enum: ["Scheduled", "Completed", "Cancelled", "Rescheduled", "Not Required"] }, admap_interview_notes: { type: String, maxlength: 1000, trim: true }, admap_admission_decision_date: { type: Date, comment: "Date when admission decision was made" }, admap_admission_decision_notes: { type: String, maxlength: 1000, trim: true }, admap_waitlist_position: { type: Number, min: 0, comment: "Position on waitlist (if applicable)" }, admap_enrollment_deadline: { type: Date, comment: "Deadline for enrollment if accepted" }, admap_enrollment_completed: { type: Boolean, default: false }, admap_enrollment_date: { type: Date, comment: "Date when enrollment was completed" }, admap_confirmed_at: { type: Date, comment: "Date when admission was confirmed" }, admap_confirmed_by_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", comment: "User who confirmed the admission" }, admap_confirmation_remarks: { type: String, maxlength: 1000, trim: true, comment: "Remarks or notes about the admission confirmation" }, admap_islocked: { type: Boolean, default: false, comment: "Lock admission form to prevent editing after confirmation" }, // FOREIGN KEYS & REFERENCES admap_entity_id_syen: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_system_entity", comment: "Entity/School ID" }, admap_program_id_sygms: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "core_general_master", comment: "Program type from general master" }, admap_created_by_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", comment: "User who created the application (usually student/parent)" }, admap_reviewed_by_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", comment: "User who reviewed the application" }, admap_assigned_counselor_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", comment: "Assigned counselor/admissions officer" }, admap_user_id_auth: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst", comment: "User account ID created when admission is confirmed - Reference to auth_user_mst" }, // METADATA admap_created_date: { type: Date, default: Date.now }, admap_modified_date: { type: Date, default: Date.now }, admap_modified_by_user: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "auth_user_mst" }, admap_isactive: { type: Boolean, default: true } }, { collection: 'admission_application_main', timestamps: true }); // Indexes for performance // Note: admap_application_number and admap_student_id indexes are automatically created by unique: true, so we don't need to add them explicitly admission_application_main.index({ admap_entity_id_syen: 1 }); admission_application_main.index({ admap_application_status_id_sygms: 1 }); admission_application_main.index({ admap_user_id_auth: 1 }); admission_application_main.index({ admap_program_category_id_sygms: 1 }); admission_application_main.index({ admap_class_program_id_acacpm: 1 }); admission_application_main.index({ admap_class_program_branch_id_acabrn: 1 }); admission_application_main.index({ admap_class_program_term_id_acapt: 1 }); admission_application_main.index({ admap_elective_selection_status_id_sygms: 1 }); admission_application_main.index({ admap_letter_of_rec_1_recommender_type_id_sygms: 1 }); admission_application_main.index({ admap_letter_of_rec_2_recommender_type_id_sygms: 1 }); admission_application_main.index({ admap_created_date: -1 }); var CAdmissionApplicationMain = mongoose_1.default.model("admission_application_main", admission_application_main); exports.CAdmissionApplicationMain = CAdmissionApplicationMain;