first commit

This commit is contained in:
Isuru Bimsara
2026-08-14 22:46:02 +05:30
commit 81d0e65686
132 changed files with 24398 additions and 0 deletions
@@ -0,0 +1,47 @@
/**
* Copyright (c) 2026 Niolla
* All rights reserved.
*
* This source code is proprietary and confidential.
* Unauthorized copying, modification, distribution, or use
* of this file, via any medium, is strictly prohibited.
*/
// app/models/permission/rolePermission.model.js
module.exports = (sequelize, DataTypes) => {
const rolePermission = sequelize.define(
"rolePermission",
{
rp_id: {
type: DataTypes.STRING,
primaryKey: true
},
role_id: {
type: DataTypes.STRING,
allowNull: false
},
permission_id: {
type: DataTypes.STRING,
allowNull: false
}
},
{
tableName: "rolePermission",
timestamps: true
}
);
rolePermission.associate = (db) => {
rolePermission.belongsTo(db.roles, {
foreignKey: "role_id",
as: "role"
});
rolePermission.belongsTo(db.permission, {
foreignKey: "permission_id",
as: "permission"
});
};
return rolePermission;
};