@kipicore/dbcore 1.1.101 → 1.1.103

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.
@@ -418,7 +418,8 @@ export declare enum SUBJECT_INDEX_TYPE {
418
418
  INSTITUTE = "INSTITUTE",
419
419
  PRIVATE = "PRIVATE",
420
420
  BATCH = "BATCH",
421
- MASTER = "MASTER"
421
+ MASTER = "MASTER",
422
+ COURSE = "COURSE"
422
423
  }
423
424
  export declare enum EXAM_GROUP_STATUS {
424
425
  PENDING = "PENDING",
@@ -510,6 +510,7 @@ var SUBJECT_INDEX_TYPE;
510
510
  SUBJECT_INDEX_TYPE["PRIVATE"] = "PRIVATE";
511
511
  SUBJECT_INDEX_TYPE["BATCH"] = "BATCH";
512
512
  SUBJECT_INDEX_TYPE["MASTER"] = "MASTER";
513
+ SUBJECT_INDEX_TYPE["COURSE"] = "COURSE";
513
514
  })(SUBJECT_INDEX_TYPE || (exports.SUBJECT_INDEX_TYPE = SUBJECT_INDEX_TYPE = {}));
514
515
  var EXAM_GROUP_STATUS;
515
516
  (function (EXAM_GROUP_STATUS) {
@@ -14,4 +14,9 @@ export interface IAppointmentHistoryModelAttributes extends IDefaultAttributes,
14
14
  reScheduledBy: string;
15
15
  appointmentId: string;
16
16
  appointmentNumber: string;
17
+ isGuest: boolean;
18
+ guestName: string;
19
+ email: string;
20
+ metaId: string;
21
+ mobile: string;
17
22
  }
@@ -13,4 +13,9 @@ export interface IAppointmentModelAttributes extends IDefaultAttributes, Documen
13
13
  rejectedBy: string;
14
14
  reScheduledBy: string;
15
15
  appointmentNumber: string;
16
+ isGuest: boolean;
17
+ guestName: string;
18
+ email: string;
19
+ metaId: string;
20
+ mobile: string;
16
21
  }
@@ -45,4 +45,5 @@ export interface ISubjectIndexModelAttributes extends IDefaultAttributes, Docume
45
45
  userId?: string;
46
46
  assignedUsers?: IAssignedUsersAttributes[];
47
47
  selectedCategoryIds?: string[];
48
+ courseId?: string;
48
49
  }
@@ -36,11 +36,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const mongoose_1 = __importStar(require("mongoose"));
37
37
  const appointmentHistorySchema = new mongoose_1.Schema({
38
38
  date: {
39
- type: Date
39
+ type: Date,
40
40
  },
41
41
  appointmentNumber: {
42
42
  type: String,
43
- required: false
43
+ required: false,
44
44
  },
45
45
  appointmentStatus: {
46
46
  type: String,
@@ -54,7 +54,7 @@ const appointmentHistorySchema = new mongoose_1.Schema({
54
54
  trim: true,
55
55
  },
56
56
  note: {
57
- type: String
57
+ type: String,
58
58
  },
59
59
  scheduledBy: {
60
60
  type: String,
@@ -75,6 +75,25 @@ const appointmentHistorySchema = new mongoose_1.Schema({
75
75
  appointmentId: {
76
76
  type: String,
77
77
  trim: true,
78
+ },
79
+ isGuest: {
80
+ type: Boolean,
81
+ },
82
+ guestName: {
83
+ type: String,
84
+ trim: true,
85
+ },
86
+ email: {
87
+ type: String,
88
+ trim: true,
89
+ },
90
+ metaId: {
91
+ type: String,
92
+ trim: true,
93
+ },
94
+ mobile: {
95
+ type: String,
96
+ trim: true,
78
97
  }
79
98
  }, {
80
99
  timestamps: true,
@@ -73,6 +73,25 @@ const appointmentSchema = new mongoose_1.Schema({
73
73
  type: String,
74
74
  trim: true,
75
75
  },
76
+ isGuest: {
77
+ type: Boolean,
78
+ },
79
+ guestName: {
80
+ type: String,
81
+ trim: true,
82
+ },
83
+ email: {
84
+ type: String,
85
+ trim: true,
86
+ },
87
+ metaId: {
88
+ type: String,
89
+ trim: true,
90
+ },
91
+ mobile: {
92
+ type: String,
93
+ trim: true,
94
+ }
76
95
  }, {
77
96
  timestamps: true,
78
97
  versionKey: false,
@@ -220,6 +220,10 @@ const SubjectIndexSchema = new mongoose_1.Schema({
220
220
  required: false,
221
221
  default: [],
222
222
  },
223
+ courseId: {
224
+ type: String,
225
+ required: false,
226
+ },
223
227
  }, {
224
228
  timestamps: true, // Adds createdAt and updatedAt fields
225
229
  versionKey: false, // Disables the __v field
@@ -525,7 +529,11 @@ const addDocsDetailsHook = async (subjectIndexList, where = {}, options = {}) =>
525
529
  let completedChapterLastLecture = [];
526
530
  if (subject.assignedUsers && subject.assignedUsers.length && options?.reqUser?.type === app_1.USER_TYPES.STUDENT) {
527
531
  const lectureList = await lectureModel_1.default.findAll({
528
- where: { subject: { [sequelize_1.Op.in]: [subject.subject] }, checkedOutAt: { [sequelize_1.Op.not]: null }, checkedInAt: { [sequelize_1.Op.not]: null } },
532
+ where: {
533
+ subject: { [sequelize_1.Op.in]: [subject.subject] },
534
+ checkedOutAt: { [sequelize_1.Op.not]: null },
535
+ checkedInAt: { [sequelize_1.Op.not]: null },
536
+ },
529
537
  order: [['checkedInAt', 'DESC']],
530
538
  limit: 1,
531
539
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.101",
3
+ "version": "1.1.103",
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",