@kipicore/dbcore 1.1.173 → 1.1.175
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/constants/app.d.ts +2 -1
- package/dist/constants/app.js +1 -0
- package/dist/db/psql/migrations/20251224062435-student_leave_request.d.ts +2 -0
- package/dist/db/psql/migrations/20251224062435-student_leave_request.js +200 -0
- package/dist/models/psql/studentLeaveRequestModel.js +16 -0
- package/package.json +1 -1
package/dist/constants/app.d.ts
CHANGED
|
@@ -662,7 +662,8 @@ export declare enum PDF_TEMPLATES {
|
|
|
662
662
|
BONAFIDE_CERTIFICATE_TEMPLATE = "bonafideCertificateTemplate",
|
|
663
663
|
CHARACTER_CERTIFICATES_TEMPLATE = "characterCertificateTemplate",
|
|
664
664
|
TRIAL_CERTIFICATE_TEMPLATE = "trialCertificateTemplate",
|
|
665
|
-
HALL_TICKET_TEMPLATE = "hallTicketTemplate"
|
|
665
|
+
HALL_TICKET_TEMPLATE = "hallTicketTemplate",
|
|
666
|
+
EVENT_CERTIFICATES = "eventCertificateTemplate"
|
|
666
667
|
}
|
|
667
668
|
export declare enum EMAIL_SUBJECTS {
|
|
668
669
|
CREATE_GUARDIAN_VERIFICATION = "Verification Of Guardian Request",
|
package/dist/constants/app.js
CHANGED
|
@@ -809,6 +809,7 @@ var PDF_TEMPLATES;
|
|
|
809
809
|
PDF_TEMPLATES["CHARACTER_CERTIFICATES_TEMPLATE"] = "characterCertificateTemplate";
|
|
810
810
|
PDF_TEMPLATES["TRIAL_CERTIFICATE_TEMPLATE"] = "trialCertificateTemplate";
|
|
811
811
|
PDF_TEMPLATES["HALL_TICKET_TEMPLATE"] = "hallTicketTemplate";
|
|
812
|
+
PDF_TEMPLATES["EVENT_CERTIFICATES"] = "eventCertificateTemplate";
|
|
812
813
|
})(PDF_TEMPLATES || (exports.PDF_TEMPLATES = PDF_TEMPLATES = {}));
|
|
813
814
|
var EMAIL_SUBJECTS;
|
|
814
815
|
(function (EMAIL_SUBJECTS) {
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const tableName = 'student_leave_requests';
|
|
4
|
+
const tableExists = await queryInterface
|
|
5
|
+
.describeTable(tableName)
|
|
6
|
+
.then(() => true)
|
|
7
|
+
.catch(() => false);
|
|
8
|
+
if (!tableExists) {
|
|
9
|
+
await queryInterface.createTable(tableName, {
|
|
10
|
+
id: {
|
|
11
|
+
type: Sequelize.UUID,
|
|
12
|
+
defaultValue: Sequelize.UUIDV4,
|
|
13
|
+
allowNull: false,
|
|
14
|
+
primaryKey: true,
|
|
15
|
+
},
|
|
16
|
+
startDate: {
|
|
17
|
+
type: Sequelize.DATE,
|
|
18
|
+
field: 'start_date',
|
|
19
|
+
allowNull: true,
|
|
20
|
+
},
|
|
21
|
+
endDate: {
|
|
22
|
+
type: Sequelize.DATE,
|
|
23
|
+
field: 'end_date',
|
|
24
|
+
allowNull: true,
|
|
25
|
+
},
|
|
26
|
+
reason: {
|
|
27
|
+
type: Sequelize.STRING,
|
|
28
|
+
allowNull: true,
|
|
29
|
+
},
|
|
30
|
+
fileStorageId: {
|
|
31
|
+
type: Sequelize.UUID,
|
|
32
|
+
allowNull: true,
|
|
33
|
+
field: 'file_storage_id',
|
|
34
|
+
},
|
|
35
|
+
userId: {
|
|
36
|
+
type: Sequelize.UUID,
|
|
37
|
+
allowNull: true,
|
|
38
|
+
field: 'user_id',
|
|
39
|
+
},
|
|
40
|
+
academicCalendarId: {
|
|
41
|
+
type: Sequelize.UUID,
|
|
42
|
+
field: 'academic_calendar_id',
|
|
43
|
+
allowNull: true,
|
|
44
|
+
},
|
|
45
|
+
status: {
|
|
46
|
+
type: Sequelize.STRING,
|
|
47
|
+
allowNull: true,
|
|
48
|
+
},
|
|
49
|
+
leaveType: {
|
|
50
|
+
type: Sequelize.STRING,
|
|
51
|
+
field: 'leave_type',
|
|
52
|
+
allowNull: true,
|
|
53
|
+
},
|
|
54
|
+
instituteId: {
|
|
55
|
+
type: Sequelize.UUID,
|
|
56
|
+
allowNull: true,
|
|
57
|
+
field: 'institute_id',
|
|
58
|
+
},
|
|
59
|
+
createdBy: {
|
|
60
|
+
type: Sequelize.UUID,
|
|
61
|
+
allowNull: true,
|
|
62
|
+
field: 'created_by',
|
|
63
|
+
},
|
|
64
|
+
updatedBy: {
|
|
65
|
+
type: Sequelize.UUID,
|
|
66
|
+
allowNull: true,
|
|
67
|
+
field: 'updated_by',
|
|
68
|
+
},
|
|
69
|
+
deletedBy: {
|
|
70
|
+
type: Sequelize.UUID,
|
|
71
|
+
allowNull: true,
|
|
72
|
+
field: 'deleted_by',
|
|
73
|
+
},
|
|
74
|
+
createdAt: {
|
|
75
|
+
type: Sequelize.DATE,
|
|
76
|
+
allowNull: false,
|
|
77
|
+
defaultValue: Sequelize.NOW,
|
|
78
|
+
field: 'created_at',
|
|
79
|
+
},
|
|
80
|
+
updatedAt: {
|
|
81
|
+
type: Sequelize.DATE,
|
|
82
|
+
allowNull: false,
|
|
83
|
+
defaultValue: Sequelize.NOW,
|
|
84
|
+
field: 'updated_at',
|
|
85
|
+
},
|
|
86
|
+
deletedAt: {
|
|
87
|
+
type: Sequelize.DATE,
|
|
88
|
+
allowNull: true,
|
|
89
|
+
field: 'deleted_at',
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const tableDefinition = await queryInterface.describeTable(tableName);
|
|
95
|
+
const columnsToAdd = {
|
|
96
|
+
id: {
|
|
97
|
+
type: Sequelize.UUID,
|
|
98
|
+
defaultValue: Sequelize.UUIDV4,
|
|
99
|
+
allowNull: false,
|
|
100
|
+
primaryKey: true,
|
|
101
|
+
},
|
|
102
|
+
startDate: {
|
|
103
|
+
type: Sequelize.DATE,
|
|
104
|
+
field: 'start_date',
|
|
105
|
+
allowNull: true,
|
|
106
|
+
},
|
|
107
|
+
endDate: {
|
|
108
|
+
type: Sequelize.DATE,
|
|
109
|
+
field: 'end_date',
|
|
110
|
+
allowNull: true,
|
|
111
|
+
},
|
|
112
|
+
reason: {
|
|
113
|
+
type: Sequelize.STRING,
|
|
114
|
+
allowNull: true,
|
|
115
|
+
},
|
|
116
|
+
fileStorageId: {
|
|
117
|
+
type: Sequelize.UUID,
|
|
118
|
+
allowNull: true,
|
|
119
|
+
field: 'file_storage_id',
|
|
120
|
+
},
|
|
121
|
+
userId: {
|
|
122
|
+
type: Sequelize.UUID,
|
|
123
|
+
allowNull: true,
|
|
124
|
+
field: 'user_id',
|
|
125
|
+
},
|
|
126
|
+
academicCalendarId: {
|
|
127
|
+
type: Sequelize.UUID,
|
|
128
|
+
field: 'academic_calendar_id',
|
|
129
|
+
allowNull: true,
|
|
130
|
+
},
|
|
131
|
+
status: {
|
|
132
|
+
type: Sequelize.STRING,
|
|
133
|
+
allowNull: true,
|
|
134
|
+
},
|
|
135
|
+
leaveType: {
|
|
136
|
+
type: Sequelize.STRING,
|
|
137
|
+
field: 'leave_type',
|
|
138
|
+
allowNull: true,
|
|
139
|
+
},
|
|
140
|
+
instituteId: {
|
|
141
|
+
type: Sequelize.UUID,
|
|
142
|
+
allowNull: true,
|
|
143
|
+
field: 'institute_id',
|
|
144
|
+
},
|
|
145
|
+
createdBy: {
|
|
146
|
+
type: Sequelize.UUID,
|
|
147
|
+
allowNull: true,
|
|
148
|
+
field: 'created_by',
|
|
149
|
+
},
|
|
150
|
+
updatedBy: {
|
|
151
|
+
type: Sequelize.UUID,
|
|
152
|
+
allowNull: true,
|
|
153
|
+
field: 'updated_by',
|
|
154
|
+
},
|
|
155
|
+
deletedBy: {
|
|
156
|
+
type: Sequelize.UUID,
|
|
157
|
+
allowNull: true,
|
|
158
|
+
field: 'deleted_by',
|
|
159
|
+
},
|
|
160
|
+
createdAt: {
|
|
161
|
+
type: Sequelize.DATE,
|
|
162
|
+
allowNull: false,
|
|
163
|
+
defaultValue: Sequelize.NOW,
|
|
164
|
+
field: 'created_at',
|
|
165
|
+
},
|
|
166
|
+
updatedAt: {
|
|
167
|
+
type: Sequelize.DATE,
|
|
168
|
+
allowNull: false,
|
|
169
|
+
defaultValue: Sequelize.NOW,
|
|
170
|
+
field: 'updated_at',
|
|
171
|
+
},
|
|
172
|
+
deletedAt: {
|
|
173
|
+
type: Sequelize.DATE,
|
|
174
|
+
allowNull: true,
|
|
175
|
+
field: 'deleted_at',
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
for (const column of Object.keys(columnsToAdd)) {
|
|
179
|
+
const columnToAdd = columnsToAdd[column];
|
|
180
|
+
const tableColumn = columnToAdd.field || column;
|
|
181
|
+
if (!tableDefinition[tableColumn]) {
|
|
182
|
+
await queryInterface.addColumn(tableName, tableColumn, columnToAdd);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const down = async (queryInterface) => {
|
|
188
|
+
const tableName = 'student_leave_requests';
|
|
189
|
+
const tableExists = await queryInterface
|
|
190
|
+
.describeTable(tableName)
|
|
191
|
+
.then(() => true)
|
|
192
|
+
.catch(() => false);
|
|
193
|
+
if (tableExists) {
|
|
194
|
+
await queryInterface.dropTable(tableName);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
module.exports = {
|
|
198
|
+
up,
|
|
199
|
+
down,
|
|
200
|
+
};
|
|
@@ -45,6 +45,22 @@ class StudentLeaveRequestModel extends sequelize_1.Model {
|
|
|
45
45
|
},
|
|
46
46
|
as: 'fileStudentLeave',
|
|
47
47
|
});
|
|
48
|
+
StudentLeaveRequestModel.belongsTo(UserModel, {
|
|
49
|
+
foreignKey: {
|
|
50
|
+
name: 'userId',
|
|
51
|
+
allowNull: true,
|
|
52
|
+
field: 'user_id',
|
|
53
|
+
},
|
|
54
|
+
as: 'leaveUserDetails',
|
|
55
|
+
});
|
|
56
|
+
UserModel.hasMany(StudentLeaveRequestModel, {
|
|
57
|
+
foreignKey: {
|
|
58
|
+
name: 'userId',
|
|
59
|
+
allowNull: true,
|
|
60
|
+
field: 'user_id',
|
|
61
|
+
},
|
|
62
|
+
as: 'userDetailsLeaveRequest',
|
|
63
|
+
});
|
|
48
64
|
StudentLeaveRequestModel.belongsTo(UserModel, {
|
|
49
65
|
foreignKey: {
|
|
50
66
|
name: 'createdBy',
|
package/package.json
CHANGED