@kipicore/dbcore 1.1.285 → 1.1.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/db/psql/index.js +2 -0
- package/dist/db/psql/migrations/20260219115218-parentId_type_userDirectory.d.ts +2 -0
- package/dist/db/psql/migrations/20260219115218-parentId_type_userDirectory.js +29 -0
- package/dist/db/psql/seeders/Data/UserRoleModule.d.ts +13 -0
- package/dist/db/psql/seeders/Data/UserRoleModule.js +18 -0
- package/dist/models/psql/userDirectoryModel.js +1 -1
- package/package.json +1 -1
package/dist/db/psql/index.js
CHANGED
|
@@ -65,6 +65,7 @@ const CampusCarnivalModule = require('./seeders/Data/campusCarnival');
|
|
|
65
65
|
const TransportModule = require('./seeders/Data/transportModule');
|
|
66
66
|
const GreetingModule = require('./seeders/Data/greetingModule');
|
|
67
67
|
const TaskManagementModule = require('./seeders/Data/taskManagementModule');
|
|
68
|
+
const UserRoleModule = require('./seeders/Data/UserRoleModule');
|
|
68
69
|
// const DashboardManagementModule = require('./seeders/Data/dashboardManagementModule'); // Need to uncomment dashboard module is ready
|
|
69
70
|
// const CertificateManagementModule = require('./seeders/Data/certificateManagementModule'); // Need to uncomment certificate module is ready
|
|
70
71
|
const allModules = [
|
|
@@ -133,5 +134,6 @@ const allModules = [
|
|
|
133
134
|
TaskManagementModule,
|
|
134
135
|
// DashboardManagementModule // Need to uncomment dashboard module is ready
|
|
135
136
|
// CertificateManagementModule // Need to uncomment certificate module is ready
|
|
137
|
+
UserRoleModule,
|
|
136
138
|
];
|
|
137
139
|
module.exports = allModules;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('user_directories');
|
|
4
|
+
// Case 1: parent_id column does NOT exist → add as STRING
|
|
5
|
+
if (!table.parent_id) {
|
|
6
|
+
await queryInterface.addColumn('user_directories', 'parent_id', {
|
|
7
|
+
type: Sequelize.STRING,
|
|
8
|
+
allowNull: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
// Case 2: parent_id exists AND type is UUID → change to STRING
|
|
12
|
+
else if (table.parent_id.type &&
|
|
13
|
+
table.parent_id.type.toLowerCase().includes('uuid')) {
|
|
14
|
+
await queryInterface.changeColumn('user_directories', 'parent_id', {
|
|
15
|
+
type: Sequelize.STRING,
|
|
16
|
+
allowNull: true,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const down = async (queryInterface, Sequelize) => {
|
|
21
|
+
const table = await queryInterface.describeTable('user_directories');
|
|
22
|
+
if (table.parent_id) {
|
|
23
|
+
await queryInterface.removeColumn('user_directories', 'parent_id');
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
module.exports = {
|
|
27
|
+
up,
|
|
28
|
+
down,
|
|
29
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const appTypeEnum = require('./appType');
|
|
3
|
+
const UserRoleModule = {
|
|
4
|
+
name: 'User Role',
|
|
5
|
+
code: 'USERROLE',
|
|
6
|
+
appType: [appTypeEnum.SCHOOL_APP],
|
|
7
|
+
features: [
|
|
8
|
+
{
|
|
9
|
+
name: 'User Role Management',
|
|
10
|
+
code: 'USERROLE.USERROLEMANAGEMENT',
|
|
11
|
+
appType: [appTypeEnum.SCHOOL_APP],
|
|
12
|
+
actions: [
|
|
13
|
+
{ name: 'Principle', code: 'USERROLE.USERROLEMANAGEMENT.PRINCIPLE', appType: [appTypeEnum.SCHOOL_APP] },
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
module.exports = UserRoleModule;
|
package/package.json
CHANGED