units,lesson as standalone

This commit is contained in:
2026-07-10 11:44:46 +08:00
parent 86fba50b95
commit e1ffdab190
46 changed files with 1463 additions and 197 deletions
+19 -1
View File
@@ -42,13 +42,31 @@ const TaskCompletion = sequelize.define('TaskCompletion', {
comment: 'Optional note the user attaches when submitting.',
order: 1,
},
response_text: {
type: DataTypes.TEXT,
allowNull: true,
comment: 'The learner\'s free-text answer, for submit_text requirements.',
order: 1.5,
},
submitted_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
allowNull: false,
order: 2,
},
// ── Review workflow (requires_review requirements only) ──────────────────
status: {
type: DataTypes.ENUM('submitted', 'approved', 'rejected'),
allowNull: false,
defaultValue: 'submitted',
order: 2.1,
filterable: true,
},
reviewed_by: { type: DataTypes.BIGINT, allowNull: true, order: 2.2 },
reviewed_at: { type: DataTypes.DATE, allowNull: true, order: 2.3 },
review_note: { type: DataTypes.TEXT, allowNull: true, comment: 'Optional note the admin leaves when approving/rejecting.', order: 2.4 },
// ── Audit trails ────────────────────────────────────────────────────────
createdBy: { type: DataTypes.BIGINT, allowNull: true, order: 6 },
updatedBy: { type: DataTypes.BIGINT, allowNull: true, order: 7 },