chore: relocate backend into apps/api ahead of monorepo merge

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-24 12:20:40 +08:00
co-authored by Claude Sonnet 5
parent af44598df6
commit eaa6d2276a
388 changed files with 0 additions and 13998 deletions
@@ -0,0 +1,32 @@
/***********************************************************************************************************************************************************************
* File Name: unit_lessons.mdl.js
* Type of Program: Model (junction)
* Description: Attaches a standalone Lesson to a Unit. A Lesson can live in many
* Units; per-unit ordering lives here (order_index), not on the
* Lesson itself. Detaching removes the row — the Lesson survives.
*
* Author: Kenneth Obsequio (@lash0000)
* Date Created: Jul. 7, 2026
***********************************************************************************************************************************************************************/
const { DataTypes } = require("sequelize");
const sequelize = require("../../config/db.config");
const UnitLesson = sequelize.define("UnitLesson", {
unit_lesson_id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
unit_id: { type: DataTypes.BIGINT, allowNull: false },
lesson_id: { type: DataTypes.BIGINT, allowNull: false },
order_index: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0 },
createdBy: { type: DataTypes.BIGINT, allowNull: true },
updatedBy: { type: DataTypes.BIGINT, allowNull: true },
}, {
tableName: "unit_lessons",
timestamps: true,
indexes: [
{ unique: true, fields: ["unit_id", "lesson_id"], name: "uq_unit_lessons_unit_lesson" },
{ fields: ["unit_id"], name: "idx_unit_lessons_unit_id" },
{ fields: ["lesson_id"], name: "idx_unit_lessons_lesson_id" },
{ fields: ["order_index"], name: "idx_unit_lessons_order" },
],
});
module.exports = UnitLesson;