@kipicore/dbcore 1.1.323 → 1.1.326
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
CHANGED
|
@@ -327,7 +327,8 @@ export declare enum TYPE_MANAGEMENT_TYPE {
|
|
|
327
327
|
GENERAL_FEE = "GENERAL_FEE",
|
|
328
328
|
BOOK_ASSESSMENT = "BOOK_ASSESSMENT",
|
|
329
329
|
PROJECT_ASSESSMENT = "PROJECT_ASSESSMENT",
|
|
330
|
-
ROOM_TYPE = "ROOM_TYPE"
|
|
330
|
+
ROOM_TYPE = "ROOM_TYPE",
|
|
331
|
+
EXAM_TERM_TYPE = "EXAM_TERM_TYPE"
|
|
331
332
|
}
|
|
332
333
|
export declare enum TYPE_MANAGEMENT_STATUS {
|
|
333
334
|
ACTIVE = "ACTIVE",
|
package/dist/constants/app.js
CHANGED
|
@@ -400,6 +400,7 @@ var TYPE_MANAGEMENT_TYPE;
|
|
|
400
400
|
TYPE_MANAGEMENT_TYPE["BOOK_ASSESSMENT"] = "BOOK_ASSESSMENT";
|
|
401
401
|
TYPE_MANAGEMENT_TYPE["PROJECT_ASSESSMENT"] = "PROJECT_ASSESSMENT";
|
|
402
402
|
TYPE_MANAGEMENT_TYPE["ROOM_TYPE"] = "ROOM_TYPE";
|
|
403
|
+
TYPE_MANAGEMENT_TYPE["EXAM_TERM_TYPE"] = "EXAM_TERM_TYPE";
|
|
403
404
|
})(TYPE_MANAGEMENT_TYPE || (exports.TYPE_MANAGEMENT_TYPE = TYPE_MANAGEMENT_TYPE = {}));
|
|
404
405
|
var TYPE_MANAGEMENT_STATUS;
|
|
405
406
|
(function (TYPE_MANAGEMENT_STATUS) {
|
|
@@ -45,6 +45,7 @@ const sequelize_1 = require("sequelize");
|
|
|
45
45
|
const userInstituteMetaModel_1 = __importDefault(require("./userInstituteMetaModel"));
|
|
46
46
|
const utils_1 = require("../../helpers/utils");
|
|
47
47
|
const date_fns_1 = require("date-fns");
|
|
48
|
+
const psql_1 = require("../psql");
|
|
48
49
|
const examGroupDaysSchema = new mongoose_1.Schema({
|
|
49
50
|
date: {
|
|
50
51
|
type: Date,
|
|
@@ -142,6 +143,10 @@ const examGroupModelSchema = new mongoose_1.Schema({
|
|
|
142
143
|
enum: app_1.EXAM_GROUP_STATUS,
|
|
143
144
|
default: app_1.EXAM_GROUP_STATUS.PENDING,
|
|
144
145
|
},
|
|
146
|
+
examTermType: {
|
|
147
|
+
type: String,
|
|
148
|
+
required: false,
|
|
149
|
+
},
|
|
145
150
|
}, {
|
|
146
151
|
timestamps: true,
|
|
147
152
|
versionKey: false,
|
|
@@ -158,6 +163,16 @@ const createOrUpdateHook = async (examGroup) => {
|
|
|
158
163
|
if (!institute)
|
|
159
164
|
throw new Error(errorMessages_1.INSTITUTE_ERROR_MESSAGES.NOT_FOUND);
|
|
160
165
|
}
|
|
166
|
+
if (examGroup.examTermType) {
|
|
167
|
+
const examTermType = await psql_1.TypeManagementModel.findOne({
|
|
168
|
+
where: {
|
|
169
|
+
id: examGroup.examTermType,
|
|
170
|
+
type: app_1.TYPE_MANAGEMENT_TYPE.EXAM_TERM_TYPE,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
if (!examTermType)
|
|
174
|
+
throw new Error(errorMessages_1.TYPE_MANAGEMENT_ERROR_MESSAGES.NOT_FOUND);
|
|
175
|
+
}
|
|
161
176
|
if (examGroup.standards) {
|
|
162
177
|
examGroup.standards = [...new Set(examGroup.standards)];
|
|
163
178
|
const standardCount = await instituteEntityModel_1.default.count({
|
|
@@ -57,7 +57,7 @@ class LectureModel extends sequelize_1.Model {
|
|
|
57
57
|
throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.INVALID_LECTURE_TIME);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
if (lecture.classRoomId
|
|
60
|
+
if (lecture.classRoomId) {
|
|
61
61
|
const classRoom = await ClassRoomModel.findByPk(lecture.classRoomId);
|
|
62
62
|
if (!classRoom)
|
|
63
63
|
throw new Error(errorMessages_1.CLASSROOM_ERROR_MESSAGES.NOT_FOUND);
|
|
@@ -91,7 +91,7 @@ class LectureModel extends sequelize_1.Model {
|
|
|
91
91
|
};
|
|
92
92
|
if (lecture.id)
|
|
93
93
|
where = { ...where, id: { [sequelize_1.Op.ne]: lecture.id } };
|
|
94
|
-
if (lecture.classRoomId) {
|
|
94
|
+
if (lecture.classRoomId && lecture?.title?.toLowerCase()?.includes('lecture')) {
|
|
95
95
|
const classRoomConflict = await LectureModel.findOne({
|
|
96
96
|
where: { ...where, classRoomId: lecture.classRoomId },
|
|
97
97
|
...options,
|
package/package.json
CHANGED