cloud-ide-model-schema
Version:
Pachage for schema management of Cloud IDEsys LMS
145 lines (144 loc) • 5.35 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAcademicsEducationBoard = void 0;
var mongoose_1 = require("mongoose");
/* SCHEMA START */
var academics_education_board = new mongoose_1.Schema({
edbrd_code: {
type: String,
required: true,
unique: true,
maxlength: 50,
trim: true,
uppercase: true,
comment: "Board code (e.g., CBSE, ICSE, MAH-SSC, KAR-SSC, etc.)"
},
edbrd_name: {
type: String,
required: true,
maxlength: 200,
trim: true,
comment: "Board name (e.g., Central Board of Secondary Education)"
},
edbrd_short_name: {
type: String,
required: true,
maxlength: 50,
trim: true,
comment: "Short name (e.g., CBSE, ICSE, State Board)"
},
edbrd_type_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "Board type (National, State, International, Higher Education, Other) - Reference to core_general_master with type 'EDUCATION_BOARD_TYPE'"
},
edbrd_category_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
required: true,
comment: "Board category (School, Higher Education, Both) - Reference to core_general_master with type 'EDUCATION_BOARD_CATEGORY'"
},
edbrd_state: {
type: String,
maxlength: 100,
trim: true,
comment: "State name (for state boards, e.g., Maharashtra, Karnataka)"
},
edbrd_country_id_syctr: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_system_country",
comment: "Country ID (default: India)"
},
edbrd_website: {
type: String,
maxlength: 255,
trim: true,
comment: "Board official website"
},
edbrd_contact_email: {
type: String,
maxlength: 255,
trim: true,
lowercase: true,
comment: "Board contact email"
},
edbrd_contact_phone: {
type: String,
maxlength: 50,
trim: true,
comment: "Board contact phone"
},
edbrd_address: {
type: String,
maxlength: 500,
trim: true,
comment: "Board address"
},
edbrd_pin_sypin: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_pin_code",
comment: "PIN ID - Auto-populated from PIN search"
},
edbrd_city_sypin: {
type: String,
maxlength: 100,
trim: true,
comment: "City - Auto-populated from PIN"
},
edbrd_state_sypin: {
type: String,
maxlength: 100,
trim: true,
comment: "State - Auto-populated from PIN"
},
edbrd_udise_format_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "UDISE code format - Reference to core_general_master with type 'EDUCATION_BOARD_UDISE_FORMAT'"
},
edbrd_affiliation_format_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "Affiliation number format - Reference to core_general_master with type 'EDUCATION_BOARD_AFFILIATION_FORMAT'"
},
edbrd_roll_number_format_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "Roll number format - Reference to core_general_master with type 'EDUCATION_BOARD_ROLL_NUMBER_FORMAT'"
},
edbrd_registration_number_format_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "Registration number format - Reference to core_general_master with type 'EDUCATION_BOARD_REGISTRATION_NUM_FORMAT'"
},
edbrd_grading_system_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "Grading system (Percentage, CGPA, Letter Grade, Both) - Reference to core_general_master with type 'EDUCATION_BOARD_GRADING_SYSTEM'"
},
edbrd_grade_scale_sygms: {
type: mongoose_1.default.Schema.Types.ObjectId,
ref: "core_general_master",
comment: "Grade scale - Reference to core_general_master with type 'EDUCATION_BOARD_GRADE_SCALE'"
},
edbrd_configuration: {
type: Object,
default: {},
comment: "Board-specific configuration (subjects, streams, etc.) - Note: Exam patterns are managed in core_board_exam_pattern table"
},
edbrd_isactive: {
type: Boolean,
default: true,
comment: "Board active status"
}
}, { collection: 'academics_education_board' });
// Indexes for performance
// Note: edbrd_code index is automatically created by unique: true, so we don't need to add it explicitly
academics_education_board.index({ edbrd_type_sygms: 1 });
academics_education_board.index({ edbrd_category_sygms: 1 });
academics_education_board.index({ edbrd_state: 1 });
academics_education_board.index({ edbrd_pin_sypin: 1 });
academics_education_board.index({ edbrd_isactive: 1 });
var CAcademicsEducationBoard = mongoose_1.default.model("academics_education_board", academics_education_board);
exports.CAcademicsEducationBoard = CAcademicsEducationBoard;