@kipicore/dbcore 1.1.325 → 1.1.327

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.
@@ -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",
@@ -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) {
@@ -28,4 +28,5 @@ export interface IExamGroupModelAttributes extends IDefaultAttributes, Document
28
28
  subjects?: string[];
29
29
  status: EXAM_GROUP_STATUS;
30
30
  academicCalendarId?: string;
31
+ examTermType: string;
31
32
  }
@@ -2,6 +2,7 @@ import { Document } from 'mongoose';
2
2
  import { IDefaultAttributes } from './commonInterface';
3
3
  export interface IExamList {
4
4
  examId: string;
5
+ typeId?: string;
5
6
  number: number;
6
7
  }
7
8
  export interface IMarkSheetArrangement {
@@ -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({
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const mongoose_1 = __importStar(require("mongoose"));
37
37
  const examListSchema = new mongoose_1.Schema({
38
38
  examId: { type: String, required: false },
39
+ typeId: { type: String, required: false },
39
40
  number: { type: Number, required: false },
40
41
  }, { _id: false });
41
42
  const markSheetArrangementSchema = new mongoose_1.Schema({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.325",
3
+ "version": "1.1.327",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",