@kipicore/dbcore 1.1.308 → 1.1.310
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/migrations/20260313065122-ins_add_otp_clms.d.ts +2 -0
- package/dist/db/psql/migrations/20260313065122-ins_add_otp_clms.js +41 -0
- package/dist/db/psql/seeders/20250101122757-add-default-permissions-modules.js +6 -0
- package/dist/interfaces/instituteInterface.d.ts +4 -1
- package/dist/models/psql/instituteModel.d.ts +4 -1
- package/dist/models/psql/instituteModel.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('institutes');
|
|
4
|
+
if (!table.otp) {
|
|
5
|
+
await queryInterface.addColumn('institutes', 'otp', {
|
|
6
|
+
type: Sequelize.STRING,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
field: 'otp',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!table.email_verification) {
|
|
12
|
+
await queryInterface.addColumn('institutes', 'email_verification', {
|
|
13
|
+
type: Sequelize.STRING,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
field: 'email_verification',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (!table.mobile_verification) {
|
|
19
|
+
await queryInterface.addColumn('institutes', 'mobile_verification', {
|
|
20
|
+
type: Sequelize.STRING,
|
|
21
|
+
allowNull: true,
|
|
22
|
+
field: 'mobile_verification',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const down = async (queryInterface) => {
|
|
27
|
+
const table = await queryInterface.describeTable('institutes');
|
|
28
|
+
if (table.otp) {
|
|
29
|
+
await queryInterface.removeColumn('institutes', 'otp');
|
|
30
|
+
}
|
|
31
|
+
if (table.email_verification) {
|
|
32
|
+
await queryInterface.removeColumn('institutes', 'email_verification');
|
|
33
|
+
}
|
|
34
|
+
if (table.mobile_verification) {
|
|
35
|
+
await queryInterface.removeColumn('institutes', 'mobile_verification');
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
module.exports = {
|
|
39
|
+
up,
|
|
40
|
+
down,
|
|
41
|
+
};
|
|
@@ -20,6 +20,8 @@ module.exports = {
|
|
|
20
20
|
actions: new Set(),
|
|
21
21
|
};
|
|
22
22
|
for (const module of allModules) {
|
|
23
|
+
module.name = module.name.trim();
|
|
24
|
+
module.code = module.code.trim();
|
|
23
25
|
if (!module.name || !module.code) {
|
|
24
26
|
console.error(`Invalid module detected:`, module.name);
|
|
25
27
|
continue;
|
|
@@ -47,6 +49,8 @@ module.exports = {
|
|
|
47
49
|
}
|
|
48
50
|
const features = Array.isArray(module.features) ? module.features : [];
|
|
49
51
|
for (const feature of features) {
|
|
52
|
+
feature.name = feature.name.trim();
|
|
53
|
+
feature.code = feature.code.trim();
|
|
50
54
|
if (!feature.name || !feature.code) {
|
|
51
55
|
console.error(`Invalid feature detected in module ${module.name}:`, feature.name);
|
|
52
56
|
continue;
|
|
@@ -75,6 +79,8 @@ module.exports = {
|
|
|
75
79
|
}
|
|
76
80
|
const actions = Array.isArray(feature.actions) ? feature.actions : [];
|
|
77
81
|
for (const action of actions) {
|
|
82
|
+
action.name = action.name.trim();
|
|
83
|
+
action.code = action.code.trim();
|
|
78
84
|
if (!action.name || !action.code) {
|
|
79
85
|
console.error(`Invalid action in feature ${feature.name}:`, action);
|
|
80
86
|
continue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INSTITUTE_STATUS, PLANNER_SYNC_STATUS, SCHOOL_SUB_TYPE, SCHOOL_TYPE } from '../constants/app';
|
|
1
|
+
import { EMAIL_VERIFICATION, INSTITUTE_STATUS, MOBILE_VERIFICATION, PLANNER_SYNC_STATUS, SCHOOL_SUB_TYPE, SCHOOL_TYPE } from '../constants/app';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface IInstituteAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
@@ -36,4 +36,7 @@ export interface IInstituteAttributes extends IDefaultAttributes {
|
|
|
36
36
|
campusId?: string;
|
|
37
37
|
syncAcademicList?: string[];
|
|
38
38
|
establishmentYear?: number;
|
|
39
|
+
otp?: string;
|
|
40
|
+
emailVerification?: EMAIL_VERIFICATION;
|
|
41
|
+
mobileVerification?: MOBILE_VERIFICATION;
|
|
39
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Model } from 'sequelize';
|
|
2
|
-
import { INSTITUTE_STATUS, PLANNER_SYNC_STATUS, SCHOOL_SUB_TYPE, SCHOOL_TYPE } from '../../constants/app';
|
|
2
|
+
import { EMAIL_VERIFICATION, INSTITUTE_STATUS, MOBILE_VERIFICATION, PLANNER_SYNC_STATUS, SCHOOL_SUB_TYPE, SCHOOL_TYPE } from '../../constants/app';
|
|
3
3
|
import { IInstituteAttributes } from '../../interfaces/instituteInterface';
|
|
4
4
|
import { TInstituteCreationAttributes } from '../../types/instituteType';
|
|
5
5
|
declare class InstituteModel extends Model<IInstituteAttributes, TInstituteCreationAttributes> {
|
|
@@ -38,6 +38,9 @@ declare class InstituteModel extends Model<IInstituteAttributes, TInstituteCreat
|
|
|
38
38
|
taluka?: string;
|
|
39
39
|
syncAcademicList?: string[];
|
|
40
40
|
establishmentYear?: number;
|
|
41
|
+
otp?: string;
|
|
42
|
+
emailVerification?: EMAIL_VERIFICATION;
|
|
43
|
+
mobileVerification?: MOBILE_VERIFICATION;
|
|
41
44
|
createdBy: string;
|
|
42
45
|
updatedBy: string;
|
|
43
46
|
deletedBy: string;
|
|
@@ -117,6 +117,9 @@ InstituteModel.init({
|
|
|
117
117
|
brochure: { type: sequelize_1.DataTypes.UUID, allowNull: true },
|
|
118
118
|
coverImage: { type: sequelize_1.DataTypes.UUID, allowNull: true, field: 'cover_image' },
|
|
119
119
|
youtubeUrl: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'youtube_url' },
|
|
120
|
+
otp: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'otp' },
|
|
121
|
+
emailVerification: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'email_verification' },
|
|
122
|
+
mobileVerification: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'mobile_verification' },
|
|
120
123
|
country: { type: sequelize_1.DataTypes.INTEGER, allowNull: false },
|
|
121
124
|
state: { type: sequelize_1.DataTypes.INTEGER, allowNull: false },
|
|
122
125
|
city: { type: sequelize_1.DataTypes.INTEGER, allowNull: false },
|
package/package.json
CHANGED