courseworx/backend/models/ClassroomSession.js
mmabdalla 5477297914 v2.0.2 - Complete Plugin Architecture System and Multi-Currency Implementation
Major Features Added:
- Complete Plugin Architecture System with financial plugin
- Multi-currency support with exchange rates
- Course type system (online, classroom, hybrid)
- Attendance tracking and QR code scanning
- Classroom sessions management
- Course sections and content management
- Professional video player with authentication
- Secure media serving system
- Shopping cart and checkout system
- Financial dashboard and earnings tracking
- Trainee progress tracking
- User notes and assignments system

Backend Infrastructure:
- Plugin loader and registry system
- Multi-currency database models
- Secure media middleware
- Course access middleware
- Financial plugin with payment processing
- Database migrations for new features
- API endpoints for all new functionality

Frontend Components:
- Course management interface
- Content creation and editing
- Section management with drag-and-drop
- Professional video player
- QR scanner for attendance
- Shopping cart and checkout flow
- Financial dashboard
- Plugin management interface
- Trainee details and progress views

This represents a major evolution of CourseWorx from a basic LMS to a comprehensive educational platform with plugin architecture.
2025-09-14 04:20:37 +03:00

83 lines
1.4 KiB
JavaScript

const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');
const ClassroomSession = sequelize.define('ClassroomSession', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
courseId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'courses',
key: 'id'
}
},
sessionDate: {
type: DataTypes.DATEONLY,
allowNull: false
},
startTime: {
type: DataTypes.TIME,
allowNull: false
},
endTime: {
type: DataTypes.TIME,
allowNull: false
},
location: {
type: DataTypes.STRING,
allowNull: true
},
roomNumber: {
type: DataTypes.STRING,
allowNull: true
},
qrCode: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
qrCodeExpiry: {
type: DataTypes.DATE,
allowNull: false
},
isActive: {
type: DataTypes.BOOLEAN,
defaultValue: true
},
maxCapacity: {
type: DataTypes.INTEGER,
allowNull: true
},
notes: {
type: DataTypes.TEXT,
allowNull: true
},
status: {
type: DataTypes.ENUM('scheduled', 'in_progress', 'completed', 'cancelled'),
defaultValue: 'scheduled'
}
}, {
tableName: 'classroom_sessions',
indexes: [
{
fields: ['courseId']
},
{
fields: ['sessionDate']
},
{
fields: ['qrCode']
},
{
fields: ['status']
}
]
});
module.exports = ClassroomSession;