@kipicore/dbcore 1.1.286 → 1.1.288

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.
@@ -65,6 +65,7 @@ const CampusCarnivalModule = require('./seeders/Data/campusCarnival');
65
65
  const TransportModule = require('./seeders/Data/transportModule');
66
66
  const GreetingModule = require('./seeders/Data/greetingModule');
67
67
  const TaskManagementModule = require('./seeders/Data/taskManagementModule');
68
+ const UserRoleModule = require('./seeders/Data/UserRoleModule');
68
69
  // const DashboardManagementModule = require('./seeders/Data/dashboardManagementModule'); // Need to uncomment dashboard module is ready
69
70
  // const CertificateManagementModule = require('./seeders/Data/certificateManagementModule'); // Need to uncomment certificate module is ready
70
71
  const allModules = [
@@ -133,5 +134,6 @@ const allModules = [
133
134
  TaskManagementModule,
134
135
  // DashboardManagementModule // Need to uncomment dashboard module is ready
135
136
  // CertificateManagementModule // Need to uncomment certificate module is ready
137
+ UserRoleModule,
136
138
  ];
137
139
  module.exports = allModules;
@@ -0,0 +1,13 @@
1
+ export let name: string;
2
+ export let code: string;
3
+ export let appType: string[];
4
+ export let features: {
5
+ name: string;
6
+ code: string;
7
+ appType: string[];
8
+ actions: {
9
+ name: string;
10
+ code: string;
11
+ appType: string[];
12
+ }[];
13
+ }[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ const appTypeEnum = require('./appType');
3
+ const UserRoleModule = {
4
+ name: 'User Role',
5
+ code: 'USERROLE',
6
+ appType: [appTypeEnum.SCHOOL_APP],
7
+ features: [
8
+ {
9
+ name: 'User Role Management',
10
+ code: 'USERROLE.USERROLEMANAGEMENT',
11
+ appType: [appTypeEnum.SCHOOL_APP],
12
+ actions: [
13
+ { name: 'Principle', code: 'USERROLE.USERROLEMANAGEMENT.PRINCIPLE', appType: [appTypeEnum.SCHOOL_APP] },
14
+ ],
15
+ },
16
+ ],
17
+ };
18
+ module.exports = UserRoleModule;
@@ -103,13 +103,20 @@ class LectureModel extends sequelize_1.Model {
103
103
  if (classRoomConflict)
104
104
  throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.CLASSROOM_OCCUPIED);
105
105
  }
106
+ const teacherConflictWhere = (0, utils_1.omit)(where, ['slotId']);
106
107
  if (lecture.primaryUserId) {
107
- const teacherConflict = await LectureModel.findOne({ where: { ...where, primaryUserId: lecture.primaryUserId }, ...options });
108
+ const teacherConflict = await LectureModel.findOne({
109
+ where: { ...teacherConflictWhere, primaryUserId: lecture.primaryUserId },
110
+ ...options,
111
+ });
108
112
  if (teacherConflict)
109
113
  throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.TEACHER_OCCUPIED);
110
114
  }
111
115
  if (lecture.secondaryUserId) {
112
- const teacherConflict = await LectureModel.findOne({ where: { ...where, secondaryUserId: lecture.secondaryUserId }, ...options });
116
+ const teacherConflict = await LectureModel.findOne({
117
+ where: { ...teacherConflictWhere, secondaryUserId: lecture.secondaryUserId },
118
+ ...options,
119
+ });
113
120
  if (teacherConflict)
114
121
  throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.TEACHER_OCCUPIED);
115
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.286",
3
+ "version": "1.1.288",
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",