courseworx/backend/models/UserNotes.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

72 lines
1.5 KiB
JavaScript

const { DataTypes } = require('sequelize');
module.exports = (sequelize) => {
const UserNotes = sequelize.define('UserNotes', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
userId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'users',
key: 'id'
}
},
courseId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'courses',
key: 'id'
}
},
contentId: {
type: DataTypes.UUID,
allowNull: true, // null for course-level notes
references: {
model: 'course_contents',
key: 'id'
}
},
notes: {
type: DataTypes.TEXT,
allowNull: false,
defaultValue: ''
},
tabType: {
type: DataTypes.ENUM('overview', 'notes', 'announcements', 'reviews', 'learning-tools', 'resources', 'analysis'),
allowNull: false,
defaultValue: 'notes'
},
isPublic: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false
}
}, {
tableName: 'user_notes',
timestamps: true
});
UserNotes.associate = (models) => {
UserNotes.belongsTo(models.User, {
foreignKey: 'userId',
as: 'user'
});
UserNotes.belongsTo(models.Course, {
foreignKey: 'courseId',
as: 'course'
});
UserNotes.belongsTo(models.CourseContent, {
foreignKey: 'contentId',
as: 'content'
});
};
return UserNotes;
};