lms-sync 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apiConnections/apiConnects.js +268 -0
- package/apiConnections/mapping.js +1337 -0
- package/apiConnections/sequelizeConnection.js +24 -0
- package/app.js +27 -0
- package/config/config.json +0 -0
- package/models/academic.departments.model.js +95 -0
- package/models/academicYears.model.js +83 -0
- package/models/campuses.model.js +125 -0
- package/models/colleges.model.js +117 -0
- package/models/courses.model.js +99 -0
- package/models/departments.model.js +90 -0
- package/models/enrolledStudents.model.js +292 -0
- package/models/index.js +48 -0
- package/models/instructors.model.js +168 -0
- package/models/rooms.model.js +89 -0
- package/models/schedules.model.js +75 -0
- package/models/sections.model.js +301 -0
- package/models/semesters.model.js +81 -0
- package/models/students.model.js +214 -0
- package/models/subjects.model.js +104 -0
- package/models/users.model.js +198 -0
- package/package.json +36 -0
- package/recordError.log +0 -0
- package/recordSuccess.log +0 -0
- package/utils/Mixins.js +189 -0
- package/utils/logger.js +33 -0
| @@ -0,0 +1,292 @@ | |
| 1 | 
            +
            "use strict";
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module.exports = (sequelize, DataTypes,schema) => {
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              const EnrolledStudents = sequelize.define('EnrolledStudents',{
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                  _id: {
         | 
| 8 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 9 | 
            +
                    unique: true,
         | 
| 10 | 
            +
                    allowNull: false,
         | 
| 11 | 
            +
                    autoIncrement: true,
         | 
| 12 | 
            +
                    primaryKey: true,
         | 
| 13 | 
            +
                  },
         | 
| 14 | 
            +
                  studentId: {
         | 
| 15 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 16 | 
            +
                    unique: false,
         | 
| 17 | 
            +
                    allowNull: true,
         | 
| 18 | 
            +
                    autoIncrement: false,
         | 
| 19 | 
            +
                    primaryKey: false,
         | 
| 20 | 
            +
                  },
         | 
| 21 | 
            +
                  instructorId: {
         | 
| 22 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 23 | 
            +
                    unique: false,
         | 
| 24 | 
            +
                    allowNull: true,
         | 
| 25 | 
            +
                    autoIncrement: false,
         | 
| 26 | 
            +
                    primaryKey: false,
         | 
| 27 | 
            +
                  },
         | 
| 28 | 
            +
                  sectionId: {
         | 
| 29 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 30 | 
            +
                    unique: false,
         | 
| 31 | 
            +
                    allowNull: true,
         | 
| 32 | 
            +
                    autoIncrement: false,
         | 
| 33 | 
            +
                    primaryKey: false,
         | 
| 34 | 
            +
                  },
         | 
| 35 | 
            +
                  courseId: {
         | 
| 36 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 37 | 
            +
                    unique: false,
         | 
| 38 | 
            +
                    allowNull: true,
         | 
| 39 | 
            +
                    autoIncrement: false,
         | 
| 40 | 
            +
                    primaryKey: false,
         | 
| 41 | 
            +
                  },
         | 
| 42 | 
            +
                  yearLevel: {
         | 
| 43 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 44 | 
            +
                    unique: false,
         | 
| 45 | 
            +
                    allowNull: true,
         | 
| 46 | 
            +
                    autoIncrement: false,
         | 
| 47 | 
            +
                    primaryKey: false,
         | 
| 48 | 
            +
                  },
         | 
| 49 | 
            +
                  campusId: {
         | 
| 50 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 51 | 
            +
                    unique: false,
         | 
| 52 | 
            +
                    allowNull: true,
         | 
| 53 | 
            +
                    autoIncrement: false,
         | 
| 54 | 
            +
                    primaryKey: false,
         | 
| 55 | 
            +
                  },
         | 
| 56 | 
            +
                  draft: {
         | 
| 57 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 58 | 
            +
                    unique: false,
         | 
| 59 | 
            +
                    allowNull: true,
         | 
| 60 | 
            +
                    autoIncrement: false,
         | 
| 61 | 
            +
                    primaryKey: false,
         | 
| 62 | 
            +
                    defaultValue: false,
         | 
| 63 | 
            +
                  },
         | 
| 64 | 
            +
                  graded: {
         | 
| 65 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 66 | 
            +
                    unique: false,
         | 
| 67 | 
            +
                    allowNull: true,
         | 
| 68 | 
            +
                    autoIncrement: false,
         | 
| 69 | 
            +
                    primaryKey: false,
         | 
| 70 | 
            +
                    defaultValue: false,
         | 
| 71 | 
            +
                  },
         | 
| 72 | 
            +
                  finalGrade: {
         | 
| 73 | 
            +
                    type: DataTypes.FLOAT,
         | 
| 74 | 
            +
                    unique: false,
         | 
| 75 | 
            +
                    allowNull: false,
         | 
| 76 | 
            +
                    autoIncrement: false,
         | 
| 77 | 
            +
                    primaryKey: false,
         | 
| 78 | 
            +
                    defaultValue: 0
         | 
| 79 | 
            +
                  },
         | 
| 80 | 
            +
                  finalEquivalent: {
         | 
| 81 | 
            +
                    type: DataTypes.STRING,
         | 
| 82 | 
            +
                    unique: false,
         | 
| 83 | 
            +
                    allowNull: false,
         | 
| 84 | 
            +
                    autoIncrement: false,
         | 
| 85 | 
            +
                    primaryKey: false,
         | 
| 86 | 
            +
                    defaultValue: 0
         | 
| 87 | 
            +
                  },
         | 
| 88 | 
            +
                  equivalent: {
         | 
| 89 | 
            +
                    type: DataTypes.STRING,
         | 
| 90 | 
            +
                    unique: false,
         | 
| 91 | 
            +
                    allowNull: true,
         | 
| 92 | 
            +
                    autoIncrement: false,
         | 
| 93 | 
            +
                    primaryKey: false,
         | 
| 94 | 
            +
                  },
         | 
| 95 | 
            +
                  midterm: {
         | 
| 96 | 
            +
                    type: DataTypes.FLOAT,
         | 
| 97 | 
            +
                    unique: false,
         | 
| 98 | 
            +
                    allowNull: true,
         | 
| 99 | 
            +
                    autoIncrement: false,
         | 
| 100 | 
            +
                    primaryKey: false,
         | 
| 101 | 
            +
                    defaultValue: 0
         | 
| 102 | 
            +
                  },
         | 
| 103 | 
            +
                  finals: {
         | 
| 104 | 
            +
                    type: DataTypes.FLOAT,
         | 
| 105 | 
            +
                    unique: false,
         | 
| 106 | 
            +
                    allowNull: true,
         | 
| 107 | 
            +
                    autoIncrement: false,
         | 
| 108 | 
            +
                    primaryKey: false,
         | 
| 109 | 
            +
                    defaultValue: 0
         | 
| 110 | 
            +
                  },
         | 
| 111 | 
            +
                  academicYearId: {
         | 
| 112 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 113 | 
            +
                    unique: false,
         | 
| 114 | 
            +
                    allowNull: true,
         | 
| 115 | 
            +
                    autoIncrement: false,
         | 
| 116 | 
            +
                    primaryKey: false,
         | 
| 117 | 
            +
             | 
| 118 | 
            +
                  },
         | 
| 119 | 
            +
                  semesterId: {
         | 
| 120 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 121 | 
            +
                    unique: false,
         | 
| 122 | 
            +
                    allowNull: true,
         | 
| 123 | 
            +
                    autoIncrement: false,
         | 
| 124 | 
            +
                    primaryKey: false,
         | 
| 125 | 
            +
             | 
| 126 | 
            +
                  },
         | 
| 127 | 
            +
                  presentFinals: {
         | 
| 128 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 129 | 
            +
                    unique: false,
         | 
| 130 | 
            +
                    allowNull: true,
         | 
| 131 | 
            +
                    autoIncrement: false,
         | 
| 132 | 
            +
                    primaryKey: false,
         | 
| 133 | 
            +
                    defaultValue: 0
         | 
| 134 | 
            +
                  },
         | 
| 135 | 
            +
                  presentMidterm: {
         | 
| 136 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 137 | 
            +
                    unique: false,
         | 
| 138 | 
            +
                    allowNull: true,
         | 
| 139 | 
            +
                    autoIncrement: false,
         | 
| 140 | 
            +
                    primaryKey: false,
         | 
| 141 | 
            +
                    defaultValue: 0
         | 
| 142 | 
            +
                  },
         | 
| 143 | 
            +
                  participationMidterm: {
         | 
| 144 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 145 | 
            +
                    unique: false,
         | 
| 146 | 
            +
                    allowNull: true,
         | 
| 147 | 
            +
                    autoIncrement: false,
         | 
| 148 | 
            +
                    primaryKey: false,
         | 
| 149 | 
            +
                    defaultValue: 0
         | 
| 150 | 
            +
                  },
         | 
| 151 | 
            +
                  participationFinals: {
         | 
| 152 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 153 | 
            +
                    unique: false,
         | 
| 154 | 
            +
                    allowNull: true,
         | 
| 155 | 
            +
                    autoIncrement: false,
         | 
| 156 | 
            +
                    primaryKey: false,
         | 
| 157 | 
            +
                    defaultValue: 0
         | 
| 158 | 
            +
                  },
         | 
| 159 | 
            +
                  recitationMidterm: {
         | 
| 160 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 161 | 
            +
                    unique: false,
         | 
| 162 | 
            +
                    allowNull: true,
         | 
| 163 | 
            +
                    autoIncrement: false,
         | 
| 164 | 
            +
                    primaryKey: false,
         | 
| 165 | 
            +
                    defaultValue: 0
         | 
| 166 | 
            +
                  },
         | 
| 167 | 
            +
                  recitationFinals: {
         | 
| 168 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 169 | 
            +
                    unique: false,
         | 
| 170 | 
            +
                    allowNull: true,
         | 
| 171 | 
            +
                    autoIncrement: false,
         | 
| 172 | 
            +
                    primaryKey: false,
         | 
| 173 | 
            +
                    defaultValue: 0
         | 
| 174 | 
            +
                  },
         | 
| 175 | 
            +
                  experimentMidterm: {
         | 
| 176 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 177 | 
            +
                    unique: false,
         | 
| 178 | 
            +
                    allowNull: true,
         | 
| 179 | 
            +
                    autoIncrement: false,
         | 
| 180 | 
            +
                    primaryKey: false,
         | 
| 181 | 
            +
                    defaultValue: 0
         | 
| 182 | 
            +
                  },
         | 
| 183 | 
            +
                  experimentFinals: {
         | 
| 184 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 185 | 
            +
                    unique: false,
         | 
| 186 | 
            +
                    allowNull: true,
         | 
| 187 | 
            +
                    autoIncrement: false,
         | 
| 188 | 
            +
                    primaryKey: false,
         | 
| 189 | 
            +
                    defaultValue: 0
         | 
| 190 | 
            +
                  },
         | 
| 191 | 
            +
                  status: {
         | 
| 192 | 
            +
                    type: DataTypes.STRING,
         | 
| 193 | 
            +
                    unique: false,
         | 
| 194 | 
            +
                    allowNull: true,
         | 
| 195 | 
            +
                    autoIncrement: false,
         | 
| 196 | 
            +
                    primaryKey: false,
         | 
| 197 | 
            +
                    defaultValue: 'ENROLLED',
         | 
| 198 | 
            +
                  },
         | 
| 199 | 
            +
                  midtermStatus: {
         | 
| 200 | 
            +
                    type: DataTypes.STRING,
         | 
| 201 | 
            +
                    unique: false,
         | 
| 202 | 
            +
                    allowNull: true,
         | 
| 203 | 
            +
                    autoIncrement: false,
         | 
| 204 | 
            +
                    primaryKey: false,
         | 
| 205 | 
            +
                  },
         | 
| 206 | 
            +
                  finalsStatus: {
         | 
| 207 | 
            +
                    type: DataTypes.STRING,
         | 
| 208 | 
            +
                    unique: false,
         | 
| 209 | 
            +
                    allowNull: true,
         | 
| 210 | 
            +
                    autoIncrement: false,
         | 
| 211 | 
            +
                    primaryKey: false,
         | 
| 212 | 
            +
                  },
         | 
| 213 | 
            +
                  overAllStatus: {
         | 
| 214 | 
            +
                    type: DataTypes.STRING,
         | 
| 215 | 
            +
                    unique: false,
         | 
| 216 | 
            +
                    allowNull: true,
         | 
| 217 | 
            +
                    autoIncrement: false,
         | 
| 218 | 
            +
                    primaryKey: false,
         | 
| 219 | 
            +
                  },
         | 
| 220 | 
            +
                  isDrop: {
         | 
| 221 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 222 | 
            +
                    unique: false,
         | 
| 223 | 
            +
                    allowNull: true,
         | 
| 224 | 
            +
                    autoIncrement: false,
         | 
| 225 | 
            +
                    primaryKey: false,
         | 
| 226 | 
            +
                    defaultValue: false,
         | 
| 227 | 
            +
                  },
         | 
| 228 | 
            +
                  attendanceGrade: {
         | 
| 229 | 
            +
                    type: DataTypes.FLOAT,
         | 
| 230 | 
            +
                    unique: false,
         | 
| 231 | 
            +
                    allowNull: false,
         | 
| 232 | 
            +
                    autoIncrement: false,
         | 
| 233 | 
            +
                    primaryKey: false,
         | 
| 234 | 
            +
                    defaultValue: 0
         | 
| 235 | 
            +
                  }, 
         | 
| 236 | 
            +
                  isFinalGrade: {
         | 
| 237 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 238 | 
            +
                    unique: false,
         | 
| 239 | 
            +
                    allowNull: true,
         | 
| 240 | 
            +
                    autoIncrement: false,
         | 
| 241 | 
            +
                    primaryKey: false,
         | 
| 242 | 
            +
                    defaultValue: false
         | 
| 243 | 
            +
                  },
         | 
| 244 | 
            +
                  remarks: {
         | 
| 245 | 
            +
                    type: DataTypes.STRING,
         | 
| 246 | 
            +
                    unique: false,
         | 
| 247 | 
            +
                    allowNull: true,
         | 
| 248 | 
            +
                    autoIncrement: false,
         | 
| 249 | 
            +
                    primaryKey: false,
         | 
| 250 | 
            +
             | 
| 251 | 
            +
                  },
         | 
| 252 | 
            +
                  isActive: {
         | 
| 253 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 254 | 
            +
                    unique: false,
         | 
| 255 | 
            +
                    allowNull: true,
         | 
| 256 | 
            +
                    autoIncrement: false,
         | 
| 257 | 
            +
                    primaryKey: false,
         | 
| 258 | 
            +
                    defaultValue: true,
         | 
| 259 | 
            +
                  },
         | 
| 260 | 
            +
                  createdById: {
         | 
| 261 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 262 | 
            +
                    unique: false,
         | 
| 263 | 
            +
                    allowNull: true,
         | 
| 264 | 
            +
                    autoIncrement: false,
         | 
| 265 | 
            +
                    primaryKey: false,
         | 
| 266 | 
            +
                  },
         | 
| 267 | 
            +
                  modifiedById: {
         | 
| 268 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 269 | 
            +
                    unique: false,
         | 
| 270 | 
            +
                    allowNull: true,
         | 
| 271 | 
            +
                    autoIncrement: false,
         | 
| 272 | 
            +
                    primaryKey: false,
         | 
| 273 | 
            +
                  },
         | 
| 274 | 
            +
                  createdAt: {
         | 
| 275 | 
            +
                    type: DataTypes.DATE,
         | 
| 276 | 
            +
                    allowNull: true,
         | 
| 277 | 
            +
                  },
         | 
| 278 | 
            +
                  updatedAt: {
         | 
| 279 | 
            +
                    type: DataTypes.DATE,
         | 
| 280 | 
            +
                    allowNull: true,
         | 
| 281 | 
            +
                  },
         | 
| 282 | 
            +
                },
         | 
| 283 | 
            +
                {
         | 
| 284 | 
            +
                  sequelize,
         | 
| 285 | 
            +
                  schema: schema,
         | 
| 286 | 
            +
                  modelName: "EnrolledStudents",
         | 
| 287 | 
            +
                }
         | 
| 288 | 
            +
              );
         | 
| 289 | 
            +
             | 
| 290 | 
            +
             | 
| 291 | 
            +
              return EnrolledStudents;
         | 
| 292 | 
            +
            };
         | 
    
        package/models/index.js
    ADDED
    
    | @@ -0,0 +1,48 @@ | |
| 1 | 
            +
            'use strict';
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            const fs = require('fs');
         | 
| 4 | 
            +
            const path = require('path');
         | 
| 5 | 
            +
            const Sequelize = require('sequelize');
         | 
| 6 | 
            +
            const process = require('process');
         | 
| 7 | 
            +
            const basename = path.basename(__filename);
         | 
| 8 | 
            +
            const env = process.env.NODE_ENV || 'development';
         | 
| 9 | 
            +
            const db = {};
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            const config = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'target.json')).toString())
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            const schema = config.schema || "default_schema"
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            let sequelize = new Sequelize(config.database, config.username, config.password, config)
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            fs
         | 
| 18 | 
            +
              .readdirSync(__dirname)
         | 
| 19 | 
            +
              .filter(file => {
         | 
| 20 | 
            +
                return (
         | 
| 21 | 
            +
                  file.indexOf('.') !== 0 &&
         | 
| 22 | 
            +
                  file !== basename &&
         | 
| 23 | 
            +
                  file.slice(-3) === '.js' &&
         | 
| 24 | 
            +
                  file.indexOf('.test.js') === -1
         | 
| 25 | 
            +
                );
         | 
| 26 | 
            +
              })
         | 
| 27 | 
            +
              .forEach(file => {
         | 
| 28 | 
            +
                try {
         | 
| 29 | 
            +
                  const modelPath = path.join(__dirname, file)
         | 
| 30 | 
            +
                  
         | 
| 31 | 
            +
                  const model = require(modelPath)(sequelize, Sequelize.DataTypes, schema)
         | 
| 32 | 
            +
                  db [model.name] = model
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                } catch (error) {
         | 
| 35 | 
            +
                  console.error(error);
         | 
| 36 | 
            +
                }
         | 
| 37 | 
            +
              });
         | 
| 38 | 
            +
             | 
| 39 | 
            +
            Object.keys(db).forEach(modelName => {
         | 
| 40 | 
            +
              if (db[modelName].associate) {
         | 
| 41 | 
            +
                db[modelName].associate(db);
         | 
| 42 | 
            +
              }
         | 
| 43 | 
            +
            });
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            db.sequelize = sequelize;
         | 
| 46 | 
            +
            db.Sequelize = Sequelize;
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            module.exports = db;
         | 
| @@ -0,0 +1,168 @@ | |
| 1 | 
            +
            "use strict";
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module.exports = (sequelize, DataTypes,schema) => {
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              const Instructors = sequelize.define('Instructors',{
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                  userId:{
         | 
| 8 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 9 | 
            +
                    unique: false,
         | 
| 10 | 
            +
                    allowNull: true,
         | 
| 11 | 
            +
                    autoIncrement: false,
         | 
| 12 | 
            +
                    primaryKey: false,
         | 
| 13 | 
            +
                  },
         | 
| 14 | 
            +
                  employeeId:{
         | 
| 15 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 16 | 
            +
                    unique: false,
         | 
| 17 | 
            +
                    allowNull: true,
         | 
| 18 | 
            +
                    autoIncrement: false,
         | 
| 19 | 
            +
                    primaryKey: false,
         | 
| 20 | 
            +
                  },
         | 
| 21 | 
            +
                  departmentId:{
         | 
| 22 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 23 | 
            +
                    unique: false,
         | 
| 24 | 
            +
                    allowNull: true,
         | 
| 25 | 
            +
                    autoIncrement: false,
         | 
| 26 | 
            +
                    primaryKey: false,
         | 
| 27 | 
            +
                  },
         | 
| 28 | 
            +
                  campusId:{
         | 
| 29 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 30 | 
            +
                    unique: false,
         | 
| 31 | 
            +
                    allowNull: true,
         | 
| 32 | 
            +
                    autoIncrement: false,
         | 
| 33 | 
            +
                    primaryKey: false,
         | 
| 34 | 
            +
                  },
         | 
| 35 | 
            +
                  isDean: {
         | 
| 36 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 37 | 
            +
                    unique: false,
         | 
| 38 | 
            +
                    allowNull: true,
         | 
| 39 | 
            +
                    autoIncrement: false,
         | 
| 40 | 
            +
                    primaryKey: false,
         | 
| 41 | 
            +
                    defaultValue: false,
         | 
| 42 | 
            +
                  },
         | 
| 43 | 
            +
                  isChairPerson: {
         | 
| 44 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 45 | 
            +
                    unique: false,
         | 
| 46 | 
            +
                    allowNull: true,
         | 
| 47 | 
            +
                    autoIncrement: false,
         | 
| 48 | 
            +
                    primaryKey: false,
         | 
| 49 | 
            +
                    defaultValue: false,
         | 
| 50 | 
            +
                  },
         | 
| 51 | 
            +
                  isProgramHead: {
         | 
| 52 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 53 | 
            +
                    unique: false,
         | 
| 54 | 
            +
                    allowNull: true,
         | 
| 55 | 
            +
                    autoIncrement: false,
         | 
| 56 | 
            +
                    primaryKey: false,
         | 
| 57 | 
            +
                    defaultValue: false,
         | 
| 58 | 
            +
                  },
         | 
| 59 | 
            +
                  contactNumber:{
         | 
| 60 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 61 | 
            +
                    unique: false,
         | 
| 62 | 
            +
                    allowNull: true,
         | 
| 63 | 
            +
                    autoIncrement: false,
         | 
| 64 | 
            +
                    primaryKey: false,
         | 
| 65 | 
            +
                  },
         | 
| 66 | 
            +
                  firstName:{
         | 
| 67 | 
            +
                    type: DataTypes.STRING,
         | 
| 68 | 
            +
                    unique: false,
         | 
| 69 | 
            +
                    allowNull: true,
         | 
| 70 | 
            +
                    autoIncrement: false,
         | 
| 71 | 
            +
                    primaryKey: false,
         | 
| 72 | 
            +
                  },
         | 
| 73 | 
            +
                  middleName:{
         | 
| 74 | 
            +
                    type: DataTypes.STRING,
         | 
| 75 | 
            +
                    unique: false,
         | 
| 76 | 
            +
                    allowNull: true,
         | 
| 77 | 
            +
                    autoIncrement: false,
         | 
| 78 | 
            +
                    primaryKey: false,
         | 
| 79 | 
            +
                  },
         | 
| 80 | 
            +
                  lastName:{
         | 
| 81 | 
            +
                    type: DataTypes.STRING,
         | 
| 82 | 
            +
                    unique: false,
         | 
| 83 | 
            +
                    allowNull: true,
         | 
| 84 | 
            +
                    autoIncrement: false,
         | 
| 85 | 
            +
                    primaryKey: false,
         | 
| 86 | 
            +
                  },
         | 
| 87 | 
            +
                  signature:{
         | 
| 88 | 
            +
                    type: DataTypes.STRING,
         | 
| 89 | 
            +
                    unique: false,
         | 
| 90 | 
            +
                    allowNull: true,
         | 
| 91 | 
            +
                    autoIncrement: false,
         | 
| 92 | 
            +
                    primaryKey: false,
         | 
| 93 | 
            +
                  },
         | 
| 94 | 
            +
                  isActive: {
         | 
| 95 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 96 | 
            +
                    unique: false,
         | 
| 97 | 
            +
                    allowNull: true,
         | 
| 98 | 
            +
                    autoIncrement: false,
         | 
| 99 | 
            +
                    primaryKey: false,
         | 
| 100 | 
            +
                    defaultValue: true,
         | 
| 101 | 
            +
                  },
         | 
| 102 | 
            +
                  _id: {
         | 
| 103 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 104 | 
            +
                    unique: true,
         | 
| 105 | 
            +
                    allowNull: false,
         | 
| 106 | 
            +
                    autoIncrement: true,
         | 
| 107 | 
            +
                    primaryKey: true,
         | 
| 108 | 
            +
                  },
         | 
| 109 | 
            +
                  createdById: {
         | 
| 110 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 111 | 
            +
                    unique: false,
         | 
| 112 | 
            +
                    allowNull: true,
         | 
| 113 | 
            +
                    autoIncrement: false,
         | 
| 114 | 
            +
                    primaryKey: false,
         | 
| 115 | 
            +
                  },
         | 
| 116 | 
            +
                  modifiedById: {
         | 
| 117 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 118 | 
            +
                    unique: false,
         | 
| 119 | 
            +
                    allowNull: true,
         | 
| 120 | 
            +
                    autoIncrement: false,
         | 
| 121 | 
            +
                    primaryKey: false,
         | 
| 122 | 
            +
                  },
         | 
| 123 | 
            +
                  employeeNumber: {
         | 
| 124 | 
            +
                    type: DataTypes.STRING,
         | 
| 125 | 
            +
                    unique: false,
         | 
| 126 | 
            +
                    allowNull: true,
         | 
| 127 | 
            +
                    autoIncrement: false,
         | 
| 128 | 
            +
                    primaryKey: false,
         | 
| 129 | 
            +
                  },
         | 
| 130 | 
            +
                  avatar: {
         | 
| 131 | 
            +
                    type: DataTypes.STRING,
         | 
| 132 | 
            +
                    unique: false,
         | 
| 133 | 
            +
                    allowNull: true,
         | 
| 134 | 
            +
                    autoIncrement: false,
         | 
| 135 | 
            +
                    primaryKey: false,
         | 
| 136 | 
            +
                  },
         | 
| 137 | 
            +
                  createdAt: {
         | 
| 138 | 
            +
                    type: DataTypes.DATE,
         | 
| 139 | 
            +
                    allowNull: true,
         | 
| 140 | 
            +
                  },
         | 
| 141 | 
            +
                  updatedAt: {
         | 
| 142 | 
            +
                    type: DataTypes.DATE,
         | 
| 143 | 
            +
                    allowNull: true,
         | 
| 144 | 
            +
                  },
         | 
| 145 | 
            +
                },
         | 
| 146 | 
            +
                {
         | 
| 147 | 
            +
                  // createdAt: 'createdDate',
         | 
| 148 | 
            +
                  // updatedAt: 'modifiedDate',
         | 
| 149 | 
            +
                  sequelize,
         | 
| 150 | 
            +
                  schema: schema,
         | 
| 151 | 
            +
                  modelName: "Instructors",
         | 
| 152 | 
            +
                }
         | 
| 153 | 
            +
              );
         | 
| 154 | 
            +
             | 
| 155 | 
            +
              // Instructors.beforeCreate(async (user, options) => {
         | 
| 156 | 
            +
              //   user.createdDate = new Date();
         | 
| 157 | 
            +
              //   user.active = true;
         | 
| 158 | 
            +
              // });
         | 
| 159 | 
            +
             | 
| 160 | 
            +
              // Instructors.beforeSave(async (user, options) => {
         | 
| 161 | 
            +
              //   user.modifiedDate = new Date()
         | 
| 162 | 
            +
              // })
         | 
| 163 | 
            +
             | 
| 164 | 
            +
             | 
| 165 | 
            +
             | 
| 166 | 
            +
             | 
| 167 | 
            +
              return Instructors;
         | 
| 168 | 
            +
            };
         | 
| @@ -0,0 +1,89 @@ | |
| 1 | 
            +
            "use strict";
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module.exports = (sequelize, DataTypes,schema) => {
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              const Rooms = sequelize.define('Rooms',{
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                  campusId: {
         | 
| 8 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 9 | 
            +
                    unique: false,
         | 
| 10 | 
            +
                    allowNull: true,
         | 
| 11 | 
            +
                    autoIncrement: false,
         | 
| 12 | 
            +
                    primaryKey: false,
         | 
| 13 | 
            +
                  },
         | 
| 14 | 
            +
                  name: {
         | 
| 15 | 
            +
                    type: DataTypes.STRING,
         | 
| 16 | 
            +
                    unique: false,
         | 
| 17 | 
            +
                    allowNull: true,
         | 
| 18 | 
            +
                    autoIncrement: false,
         | 
| 19 | 
            +
                    primaryKey: false,
         | 
| 20 | 
            +
                  },
         | 
| 21 | 
            +
                  floor: {
         | 
| 22 | 
            +
                    type: DataTypes.STRING,
         | 
| 23 | 
            +
                    unique: false,
         | 
| 24 | 
            +
                    allowNull: true,
         | 
| 25 | 
            +
                    autoIncrement: false,
         | 
| 26 | 
            +
                    primaryKey: false,
         | 
| 27 | 
            +
                  },
         | 
| 28 | 
            +
                  building: {
         | 
| 29 | 
            +
                    type: DataTypes.STRING,
         | 
| 30 | 
            +
                    unique: false,
         | 
| 31 | 
            +
                    allowNull: true,
         | 
| 32 | 
            +
                    autoIncrement: false,
         | 
| 33 | 
            +
                    primaryKey: false,
         | 
| 34 | 
            +
                  },
         | 
| 35 | 
            +
                  capacity: {
         | 
| 36 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 37 | 
            +
                    unique: false,
         | 
| 38 | 
            +
                    allowNull: true,
         | 
| 39 | 
            +
                    autoIncrement: false,
         | 
| 40 | 
            +
                    primaryKey: false,
         | 
| 41 | 
            +
                  },
         | 
| 42 | 
            +
                  isActive: {
         | 
| 43 | 
            +
                    type: DataTypes.BOOLEAN,
         | 
| 44 | 
            +
                    unique: false,
         | 
| 45 | 
            +
                    allowNull: true,
         | 
| 46 | 
            +
                    autoIncrement: false,
         | 
| 47 | 
            +
                    primaryKey: false,
         | 
| 48 | 
            +
                    defaultValue: true,
         | 
| 49 | 
            +
                  },
         | 
| 50 | 
            +
                  createdAt: {
         | 
| 51 | 
            +
                    type: DataTypes.DATE,
         | 
| 52 | 
            +
                    allowNull: true,
         | 
| 53 | 
            +
                  },
         | 
| 54 | 
            +
                  updatedAt: {
         | 
| 55 | 
            +
                    type: DataTypes.DATE,
         | 
| 56 | 
            +
                    allowNull: true,
         | 
| 57 | 
            +
                  },
         | 
| 58 | 
            +
                  _id: {
         | 
| 59 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 60 | 
            +
                    unique: true,
         | 
| 61 | 
            +
                    allowNull: false,
         | 
| 62 | 
            +
                    autoIncrement: true,
         | 
| 63 | 
            +
                    primaryKey: true,
         | 
| 64 | 
            +
                  },
         | 
| 65 | 
            +
                  createdById: {
         | 
| 66 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 67 | 
            +
                    unique: false,
         | 
| 68 | 
            +
                    allowNull: true,
         | 
| 69 | 
            +
                    autoIncrement: false,
         | 
| 70 | 
            +
                    primaryKey: false,
         | 
| 71 | 
            +
                  },
         | 
| 72 | 
            +
                  modifiedById: {
         | 
| 73 | 
            +
                    type: DataTypes.INTEGER,
         | 
| 74 | 
            +
                    unique: false,
         | 
| 75 | 
            +
                    allowNull: true,
         | 
| 76 | 
            +
                    autoIncrement: false,
         | 
| 77 | 
            +
                    primaryKey: false,
         | 
| 78 | 
            +
                  },
         | 
| 79 | 
            +
                },
         | 
| 80 | 
            +
                {
         | 
| 81 | 
            +
                  sequelize,
         | 
| 82 | 
            +
                  schema: schema,
         | 
| 83 | 
            +
                  modelName: "Rooms",
         | 
| 84 | 
            +
                }
         | 
| 85 | 
            +
              );
         | 
| 86 | 
            +
             | 
| 87 | 
            +
             | 
| 88 | 
            +
              return Rooms;
         | 
| 89 | 
            +
            };
         | 
| @@ -0,0 +1,75 @@ | |
| 1 | 
            +
            "use strict";
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module.exports = (sequelize, DataTypes,schema) => {
         | 
| 4 | 
            +
              const Schedules = sequelize.define('Schedules',
         | 
| 5 | 
            +
                      {
         | 
| 6 | 
            +
                           _id: {
         | 
| 7 | 
            +
                                type: DataTypes.INTEGER,
         | 
| 8 | 
            +
                                unique: true,
         | 
| 9 | 
            +
                                allowNull: false,
         | 
| 10 | 
            +
                                autoIncrement: true,
         | 
| 11 | 
            +
                                primaryKey: true,
         | 
| 12 | 
            +
                              },
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                              from: {
         | 
| 15 | 
            +
                                type: DataTypes.TIME,
         | 
| 16 | 
            +
                                unique: false,
         | 
| 17 | 
            +
                                allowNull: true,
         | 
| 18 | 
            +
                                autoIncrement: false,
         | 
| 19 | 
            +
                                primaryKey: false,
         | 
| 20 | 
            +
                              },
         | 
| 21 | 
            +
                              to: {
         | 
| 22 | 
            +
                                type: DataTypes.TIME,
         | 
| 23 | 
            +
                                unique: false,
         | 
| 24 | 
            +
                                allowNull: true,
         | 
| 25 | 
            +
                                autoIncrement: false,
         | 
| 26 | 
            +
                                primaryKey: false,
         | 
| 27 | 
            +
                              },
         | 
| 28 | 
            +
                              days: {
         | 
| 29 | 
            +
                                type: DataTypes.STRING,
         | 
| 30 | 
            +
                                unique: false,
         | 
| 31 | 
            +
                                allowNull: true,
         | 
| 32 | 
            +
                                autoIncrement: false,
         | 
| 33 | 
            +
                                primaryKey: false,
         | 
| 34 | 
            +
                        
         | 
| 35 | 
            +
                              },
         | 
| 36 | 
            +
                              name: {
         | 
| 37 | 
            +
                                type: DataTypes.STRING,
         | 
| 38 | 
            +
                                unique: false,
         | 
| 39 | 
            +
                                allowNull: true,
         | 
| 40 | 
            +
                                autoIncrement: false,
         | 
| 41 | 
            +
                                primaryKey: false,
         | 
| 42 | 
            +
                        
         | 
| 43 | 
            +
                              },
         | 
| 44 | 
            +
                              createdById: {
         | 
| 45 | 
            +
                                type: DataTypes.INTEGER,
         | 
| 46 | 
            +
                                unique: false,
         | 
| 47 | 
            +
                                allowNull: true,
         | 
| 48 | 
            +
                                autoIncrement: false,
         | 
| 49 | 
            +
                                primaryKey: false,
         | 
| 50 | 
            +
                              },
         | 
| 51 | 
            +
                              modifiedById: {
         | 
| 52 | 
            +
                                type: DataTypes.INTEGER,
         | 
| 53 | 
            +
                                unique: false,
         | 
| 54 | 
            +
                                allowNull: true,
         | 
| 55 | 
            +
                                autoIncrement: false,
         | 
| 56 | 
            +
                                primaryKey: false,
         | 
| 57 | 
            +
                              },            
         | 
| 58 | 
            +
                              status: {
         | 
| 59 | 
            +
                                type: DataTypes.BOOLEAN,
         | 
| 60 | 
            +
                                unique: false,
         | 
| 61 | 
            +
                                allowNull: true,
         | 
| 62 | 
            +
                                autoIncrement: false,
         | 
| 63 | 
            +
                                primaryKey: false,
         | 
| 64 | 
            +
                                defaultValue: true,
         | 
| 65 | 
            +
                              },
         | 
| 66 | 
            +
                            },
         | 
| 67 | 
            +
                            {
         | 
| 68 | 
            +
                              sequelize,
         | 
| 69 | 
            +
                  schema: schema,
         | 
| 70 | 
            +
                              modelName: "Schedules",
         | 
| 71 | 
            +
                            }
         | 
| 72 | 
            +
                          );
         | 
| 73 | 
            +
                                  
         | 
| 74 | 
            +
                          return Schedules;
         | 
| 75 | 
            +
                        };
         |