@kipicore/dbcore 1.1.178 → 1.1.180
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 +3 -1
- package/dist/constants/app.js +2 -0
- package/dist/constants/errorMessages.d.ts +6 -5
- package/dist/constants/errorMessages.js +6 -5
- package/dist/constants/successMessages.d.ts +4 -4
- package/dist/constants/successMessages.js +4 -4
- package/dist/db/psql/migrations/20251226092557-update_index.d.ts +2 -0
- package/dist/db/psql/migrations/20251226092557-update_index.js +40 -0
- package/dist/models/psql/userProjectAssessmentOptionModel.js +1 -1
- package/package.json +1 -1
package/dist/constants/app.d.ts
CHANGED
|
@@ -911,7 +911,9 @@ export declare enum MAINTENANCE_MODULE_NAME {
|
|
|
911
911
|
DIVISION_MANAGEMENT = "DIVISION_MANAGEMENT",
|
|
912
912
|
SCHOOL_LESSON_PLAN = "SCHOOL_LESSON_PLAN",
|
|
913
913
|
TEACHER_SUBJECT_INDEX = "TEACHER_SUBJECTS_INDEX",
|
|
914
|
-
OPTIONAL_SUBJECT_ALLOCATION = "OPTIONAL_SUBJECT_ALLOCATION"
|
|
914
|
+
OPTIONAL_SUBJECT_ALLOCATION = "OPTIONAL_SUBJECT_ALLOCATION",
|
|
915
|
+
BIRTHDAY_LIST = "BIRTHDAY_LIST",
|
|
916
|
+
POLL = "POLL"
|
|
915
917
|
}
|
|
916
918
|
export declare enum MAINTENANCE_MODE {
|
|
917
919
|
WEB = "WEB",
|
package/dist/constants/app.js
CHANGED
|
@@ -1149,6 +1149,8 @@ var MAINTENANCE_MODULE_NAME;
|
|
|
1149
1149
|
MAINTENANCE_MODULE_NAME["SCHOOL_LESSON_PLAN"] = "SCHOOL_LESSON_PLAN";
|
|
1150
1150
|
MAINTENANCE_MODULE_NAME["TEACHER_SUBJECT_INDEX"] = "TEACHER_SUBJECTS_INDEX";
|
|
1151
1151
|
MAINTENANCE_MODULE_NAME["OPTIONAL_SUBJECT_ALLOCATION"] = "OPTIONAL_SUBJECT_ALLOCATION";
|
|
1152
|
+
MAINTENANCE_MODULE_NAME["BIRTHDAY_LIST"] = "BIRTHDAY_LIST";
|
|
1153
|
+
MAINTENANCE_MODULE_NAME["POLL"] = "POLL";
|
|
1152
1154
|
})(MAINTENANCE_MODULE_NAME || (exports.MAINTENANCE_MODULE_NAME = MAINTENANCE_MODULE_NAME = {}));
|
|
1153
1155
|
var MAINTENANCE_MODE;
|
|
1154
1156
|
(function (MAINTENANCE_MODE) {
|
|
@@ -1243,9 +1243,10 @@ export declare enum STUDENT_LEAVE_REQUEST_ERROR_MESSAGES {
|
|
|
1243
1243
|
DATE_PASSED = "Leave requested date is passed!"
|
|
1244
1244
|
}
|
|
1245
1245
|
export declare enum USER_DIRECTORY_ERROR_MESSAGES {
|
|
1246
|
-
CREATE_FAIL = "Failed to save data!",
|
|
1247
|
-
GET_FAIL = "Unable to retrieve data",
|
|
1248
|
-
UPDATE_FAIL = "Unable to update data",
|
|
1249
|
-
DELETE_FAIL = "Unable to delete data",
|
|
1250
|
-
NOT_FOUND = "Unable to find data"
|
|
1246
|
+
CREATE_FAIL = "Failed to save directory data!",
|
|
1247
|
+
GET_FAIL = "Unable to retrieve directory data",
|
|
1248
|
+
UPDATE_FAIL = "Unable to update directory data",
|
|
1249
|
+
DELETE_FAIL = "Unable to delete directory data",
|
|
1250
|
+
NOT_FOUND = "Unable to find directory data",
|
|
1251
|
+
ALREADY_EXISTS = "Directory name already exists!"
|
|
1251
1252
|
}
|
|
@@ -1380,9 +1380,10 @@ var STUDENT_LEAVE_REQUEST_ERROR_MESSAGES;
|
|
|
1380
1380
|
})(STUDENT_LEAVE_REQUEST_ERROR_MESSAGES || (exports.STUDENT_LEAVE_REQUEST_ERROR_MESSAGES = STUDENT_LEAVE_REQUEST_ERROR_MESSAGES = {}));
|
|
1381
1381
|
var USER_DIRECTORY_ERROR_MESSAGES;
|
|
1382
1382
|
(function (USER_DIRECTORY_ERROR_MESSAGES) {
|
|
1383
|
-
USER_DIRECTORY_ERROR_MESSAGES["CREATE_FAIL"] = "Failed to save data!";
|
|
1384
|
-
USER_DIRECTORY_ERROR_MESSAGES["GET_FAIL"] = "Unable to retrieve data";
|
|
1385
|
-
USER_DIRECTORY_ERROR_MESSAGES["UPDATE_FAIL"] = "Unable to update data";
|
|
1386
|
-
USER_DIRECTORY_ERROR_MESSAGES["DELETE_FAIL"] = "Unable to delete data";
|
|
1387
|
-
USER_DIRECTORY_ERROR_MESSAGES["NOT_FOUND"] = "Unable to find data";
|
|
1383
|
+
USER_DIRECTORY_ERROR_MESSAGES["CREATE_FAIL"] = "Failed to save directory data!";
|
|
1384
|
+
USER_DIRECTORY_ERROR_MESSAGES["GET_FAIL"] = "Unable to retrieve directory data";
|
|
1385
|
+
USER_DIRECTORY_ERROR_MESSAGES["UPDATE_FAIL"] = "Unable to update directory data";
|
|
1386
|
+
USER_DIRECTORY_ERROR_MESSAGES["DELETE_FAIL"] = "Unable to delete directory data";
|
|
1387
|
+
USER_DIRECTORY_ERROR_MESSAGES["NOT_FOUND"] = "Unable to find directory data";
|
|
1388
|
+
USER_DIRECTORY_ERROR_MESSAGES["ALREADY_EXISTS"] = "Directory name already exists!";
|
|
1388
1389
|
})(USER_DIRECTORY_ERROR_MESSAGES || (exports.USER_DIRECTORY_ERROR_MESSAGES = USER_DIRECTORY_ERROR_MESSAGES = {}));
|
|
@@ -853,8 +853,8 @@ export declare enum STUDENT_LEAVE_REQUEST_SUCCESS_MESSAGES {
|
|
|
853
853
|
DELETE_SUCCESS = "Student Leave data deleted successfully!"
|
|
854
854
|
}
|
|
855
855
|
export declare enum USER_DIRECTORY_SUCCESS_MESSAGES {
|
|
856
|
-
CREATE_SUCCESS = "
|
|
857
|
-
GET_SUCCESS = "
|
|
858
|
-
UPDATE_SUCCESS = "
|
|
859
|
-
DELETE_SUCCESS = "
|
|
856
|
+
CREATE_SUCCESS = "Directory created successfully!",
|
|
857
|
+
GET_SUCCESS = "Directory retrieved successfully!",
|
|
858
|
+
UPDATE_SUCCESS = "Directory updated successfully!",
|
|
859
|
+
DELETE_SUCCESS = "Directory deleted successfully!"
|
|
860
860
|
}
|
|
@@ -993,8 +993,8 @@ var STUDENT_LEAVE_REQUEST_SUCCESS_MESSAGES;
|
|
|
993
993
|
})(STUDENT_LEAVE_REQUEST_SUCCESS_MESSAGES || (exports.STUDENT_LEAVE_REQUEST_SUCCESS_MESSAGES = STUDENT_LEAVE_REQUEST_SUCCESS_MESSAGES = {}));
|
|
994
994
|
var USER_DIRECTORY_SUCCESS_MESSAGES;
|
|
995
995
|
(function (USER_DIRECTORY_SUCCESS_MESSAGES) {
|
|
996
|
-
USER_DIRECTORY_SUCCESS_MESSAGES["CREATE_SUCCESS"] = "
|
|
997
|
-
USER_DIRECTORY_SUCCESS_MESSAGES["GET_SUCCESS"] = "
|
|
998
|
-
USER_DIRECTORY_SUCCESS_MESSAGES["UPDATE_SUCCESS"] = "
|
|
999
|
-
USER_DIRECTORY_SUCCESS_MESSAGES["DELETE_SUCCESS"] = "
|
|
996
|
+
USER_DIRECTORY_SUCCESS_MESSAGES["CREATE_SUCCESS"] = "Directory created successfully!";
|
|
997
|
+
USER_DIRECTORY_SUCCESS_MESSAGES["GET_SUCCESS"] = "Directory retrieved successfully!";
|
|
998
|
+
USER_DIRECTORY_SUCCESS_MESSAGES["UPDATE_SUCCESS"] = "Directory updated successfully!";
|
|
999
|
+
USER_DIRECTORY_SUCCESS_MESSAGES["DELETE_SUCCESS"] = "Directory deleted successfully!";
|
|
1000
1000
|
})(USER_DIRECTORY_SUCCESS_MESSAGES || (exports.USER_DIRECTORY_SUCCESS_MESSAGES = USER_DIRECTORY_SUCCESS_MESSAGES = {}));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
// Remove old index if exists
|
|
4
|
+
const oldIndexes = await queryInterface.showIndex('user_project_assessment_options');
|
|
5
|
+
const hasOldIndex = oldIndexes.some(idx => idx.name === 'user_project_assessments_unique_key');
|
|
6
|
+
if (hasOldIndex) {
|
|
7
|
+
await queryInterface.removeIndex('user_project_assessment_options', 'user_project_assessments_unique_key');
|
|
8
|
+
}
|
|
9
|
+
// Add new index if not exists
|
|
10
|
+
const newIndexName = 'user_project_assessments_unique_key';
|
|
11
|
+
const newIndexes = await queryInterface.showIndex('user_project_assessment_options');
|
|
12
|
+
const hasNewIndex = newIndexes.some(idx => idx.name === newIndexName);
|
|
13
|
+
if (!hasNewIndex) {
|
|
14
|
+
await queryInterface.addIndex('user_project_assessment_options', ['user_id', 'assessment_project_id', 'academic_calendar_id'], {
|
|
15
|
+
name: newIndexName,
|
|
16
|
+
unique: true,
|
|
17
|
+
where: { deleted_at: null },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const down = async (queryInterface, Sequelize) => {
|
|
22
|
+
const newIndexName = 'user_project_assessments_unique_key';
|
|
23
|
+
const indexes = await queryInterface.showIndex('user_project_assessment_options');
|
|
24
|
+
const hasNewIndex = indexes.some(idx => idx.name === newIndexName);
|
|
25
|
+
if (hasNewIndex) {
|
|
26
|
+
await queryInterface.removeIndex('user_project_assessment_options', newIndexName);
|
|
27
|
+
}
|
|
28
|
+
const hasOldIndex = indexes.some(idx => idx.name === 'user_project_assessments_unique_key');
|
|
29
|
+
if (!hasOldIndex) {
|
|
30
|
+
await queryInterface.addIndex('user_project_assessment_options', ['user_id', 'assessment_project_id'], {
|
|
31
|
+
name: 'user_project_assessments_unique_key',
|
|
32
|
+
unique: true,
|
|
33
|
+
where: { deleted_at: null },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
module.exports = {
|
|
38
|
+
up,
|
|
39
|
+
down,
|
|
40
|
+
};
|
|
@@ -96,7 +96,7 @@ UserProjectAssessmentOptionModel.init({
|
|
|
96
96
|
{
|
|
97
97
|
name: 'user_project_assessments_unique_key',
|
|
98
98
|
unique: true,
|
|
99
|
-
fields: ['user_id', 'assessment_project_id'],
|
|
99
|
+
fields: ['user_id', 'assessment_project_id', 'academic_calendar_id'],
|
|
100
100
|
where: { deleted_at: null },
|
|
101
101
|
},
|
|
102
102
|
],
|
package/package.json
CHANGED