mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
chore: relocate backend into apps/api ahead of monorepo merge
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/***********************************************************************************************************************************************************************
|
||||
* File Name: plan_courses.mdl.js
|
||||
* Type of Program: Model
|
||||
* Description: Junction table — links courses to a specific tier plan.
|
||||
* Composite UNIQUE on (plan_id, course_id) only prevents adding
|
||||
* the same course twice to the same plan — a course may belong
|
||||
* to many plans simultaneously (Tier Plans v2, silent duplication
|
||||
* across bundles is intentional; see admin/tiers.controller.js).
|
||||
* Bundling/display only, not an access-control mechanism — see
|
||||
* controllers/client/courses.controller.js (hasItemGrant) /
|
||||
* user_tier_grants for entitlement.
|
||||
* Author: Kenneth Obsequio (@lash0000)
|
||||
* Date Created: Jun. 6, 2026
|
||||
***********************************************************************************************************************************************************************/
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../../config/db.config');
|
||||
|
||||
const mdl_PlanCourses = sequelize.define('PlanCourse', {
|
||||
id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
|
||||
plan_id: { type: DataTypes.BIGINT, allowNull: false },
|
||||
course_id: { type: DataTypes.BIGINT, allowNull: false },
|
||||
}, {
|
||||
tableName: 'plan_courses',
|
||||
timestamps: true,
|
||||
paranoid: false,
|
||||
});
|
||||
|
||||
module.exports = mdl_PlanCourses;
|
||||
Reference in New Issue
Block a user