@kipicore/dbcore 1.1.292 → 1.1.294

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.
@@ -67,7 +67,8 @@ const TransportModule = require('./seeders/Data/transportModule');
67
67
  const GreetingModule = require('./seeders/Data/greetingModule');
68
68
  const TaskManagementModule = require('./seeders/Data/taskManagementModule');
69
69
  const UserRoleModule = require('./seeders/Data/UserRoleModule');
70
- // const DashboardManagementModule = require('./seeders/Data/dashboardManagementModule'); // Need to uncomment dashboard module is ready
70
+ const ReportManagementModule = require('./seeders/Data/ReportManagementModule');
71
+ const DashboardManagementModule = require('./seeders/Data/dashboardManagementModule'); // Need to uncomment dashboard module is ready
71
72
  const CertificateManagementModule = require('./seeders/Data/certificateManagementModule'); // Need to uncomment certificate module is ready
72
73
  const allModules = [
73
74
  AcademicCalendarModule,
@@ -134,8 +135,9 @@ const allModules = [
134
135
  TransportModule,
135
136
  GreetingModule,
136
137
  TaskManagementModule,
137
- // DashboardManagementModule // Need to uncomment dashboard module is ready
138
+ DashboardManagementModule, // Need to uncomment dashboard module is ready
138
139
  CertificateManagementModule, // Need to uncomment certificate module is ready
139
140
  UserRoleModule,
141
+ ReportManagementModule,
140
142
  ];
141
143
  module.exports = allModules;
@@ -104,34 +104,55 @@ module.exports = {
104
104
  if (newActions.length > 0) {
105
105
  await queryInterface.bulkInsert('feature_actions', newActions, { transaction });
106
106
  }
107
- // async function findOldCodes(queryInterface, table, validCodes) {
108
- // if (validCodes.length === 0) {
109
- // // If no codes in the new list, return all old ones
110
- // return (await queryInterface.sequelize.query(`SELECT code FROM ${table} WHERE is_default=true`, { raw: true ,transaction }))[0];
111
- // }
112
- // return (
113
- // await queryInterface.sequelize.query(`SELECT code FROM ${table} WHERE is_default=true AND code NOT IN (:codes)`, {
114
- // replacements: { codes: validCodes },
115
- // raw: true,
116
- // })
117
- // )[0];
107
+ // const modulesToDelete = existingModules.filter(m => !allModulesListCode.modules.has(m.code)).map(m => m.code);
108
+ // // Find features to delete
109
+ // const featuresToDelete = existingFeatures.filter(f => !allModulesListCode.features.has(f.code)).map(f => f.code);
110
+ // // Find actions to delete
111
+ // const actionsToDelete = existingActions.filter(a => !allModulesListCode.actions.has(a.code)).map(a => a.code);
112
+ // if (actionsToDelete.length) {
113
+ // await queryInterface.sequelize.query(`DELETE FROM feature_actions WHERE code IN (:codes)`, {
114
+ // replacements: { codes: actionsToDelete },
115
+ // transaction,
116
+ // });
118
117
  // }
118
+ // if (featuresToDelete.length) {
119
+ // await queryInterface.sequelize.query(`DELETE FROM module_features WHERE code IN (:codes)`, {
120
+ // replacements: { codes: featuresToDelete },
121
+ // transaction,
122
+ // });
123
+ // }
124
+ // if (modulesToDelete.length) {
125
+ // await queryInterface.sequelize.query(`DELETE FROM modules WHERE code IN (:codes)`, {
126
+ // replacements: { codes: modulesToDelete },
127
+ // transaction,
128
+ // });
129
+ // }
130
+ async function findOldCodes(queryInterface, table, validCodes) {
131
+ if (validCodes.length === 0) {
132
+ // If no codes in the new list, return all old ones
133
+ return (await queryInterface.sequelize.query(`SELECT code FROM ${table} WHERE is_default=true`, { raw: true, transaction }))[0];
134
+ }
135
+ return (await queryInterface.sequelize.query(`SELECT code FROM ${table} WHERE is_default=true AND code NOT IN (:codes)`, {
136
+ replacements: { codes: validCodes },
137
+ raw: true,
138
+ }))[0];
139
+ }
119
140
  // ✅ Delete old entries not in allModulesListCode
120
- await queryInterface.sequelize.query(`DELETE FROM feature_actions WHERE code NOT IN (:codes)`, {
121
- replacements: { codes: [...allModulesListCode.actions] },
122
- transaction,
123
- });
124
- await queryInterface.sequelize.query(`DELETE FROM module_features WHERE code NOT IN (:codes)`, {
125
- replacements: { codes: [...allModulesListCode.features] },
126
- transaction,
127
- });
128
- await queryInterface.sequelize.query(`DELETE FROM modules WHERE code NOT IN (:codes)`, {
129
- replacements: { codes: [...allModulesListCode.modules] },
130
- transaction,
131
- });
132
- // const oldActionsNotInNew = await findOldCodes(queryInterface, 'feature_actions', [...allModulesListCode.actions]);
133
- // const oldFeaturesNotInNew = await findOldCodes(queryInterface, 'module_features', [...allModulesListCode.features]);
134
- // const oldModulesNotInNew = await findOldCodes(queryInterface, 'modules', [...allModulesListCode.modules]);
141
+ // await queryInterface.sequelize.query(`DELETE FROM feature_actions WHERE code NOT IN (:codes)`, {
142
+ // replacements: { codes: [...allModulesListCode.actions] },
143
+ // transaction,
144
+ // });
145
+ // await queryInterface.sequelize.query(`DELETE FROM module_features WHERE code NOT IN (:codes)`, {
146
+ // replacements: { codes: [...allModulesListCode.features] },
147
+ // transaction,
148
+ // });
149
+ // await queryInterface.sequelize.query(`DELETE FROM modules WHERE code NOT IN (:codes)`, {
150
+ // replacements: { codes: [...allModulesListCode.modules] },
151
+ // transaction,
152
+ // });
153
+ await findOldCodes(queryInterface, 'feature_actions', [...allModulesListCode.actions]);
154
+ await findOldCodes(queryInterface, 'module_features', [...allModulesListCode.features]);
155
+ await findOldCodes(queryInterface, 'modules', [...allModulesListCode.modules]);
135
156
  // 2️⃣ Log them (or handle however you want)
136
157
  // console.log('🚨 Old Actions not in new list:', oldActionsNotInNew);
137
158
  // console.log('🚨 Old Features not in new list:', oldFeaturesNotInNew);
@@ -19,19 +19,19 @@ const ExamsAndResultsModule = {
19
19
  // { name: 'Approval', code: 'EXAMSRESULTS.EXAMMANAGEMENT.APPROVAL', appType: [appTypeEnum.INSTITUTE_APP] },
20
20
  // ],
21
21
  // },
22
- {
23
- name: 'Online Bulk Exam Management',
24
- code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT',
25
- appType: [appTypeEnum.SCHOOL_APP],
26
- actions: [
27
- { name: 'Add', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.ADD', appType: [appTypeEnum.SCHOOL_APP] },
28
- { name: 'Update', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.UPDATE', appType: [appTypeEnum.SCHOOL_APP] },
29
- { name: 'View', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.VIEW', appType: [appTypeEnum.SCHOOL_APP] },
30
- { name: 'Delete', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.DELETE', appType: [appTypeEnum.SCHOOL_APP] },
31
- // { name: 'Print', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.PRINT', appType: [appTypeEnum.SCHOOL_APP] },
32
- // { name: 'Approval', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.APPROVAL', appType: [appTypeEnum.SCHOOL_APP] },
33
- ],
34
- },
22
+ // {
23
+ // name: 'Online Bulk Exam Management',
24
+ // code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT',
25
+ // appType: [appTypeEnum.SCHOOL_APP],
26
+ // actions: [
27
+ // { name: 'Add', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.ADD', appType: [appTypeEnum.SCHOOL_APP] },
28
+ // { name: 'Update', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.UPDATE', appType: [appTypeEnum.SCHOOL_APP] },
29
+ // { name: 'View', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.VIEW', appType: [appTypeEnum.SCHOOL_APP] },
30
+ // { name: 'Delete', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.DELETE', appType: [appTypeEnum.SCHOOL_APP] },
31
+ // // { name: 'Print', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.PRINT', appType: [appTypeEnum.SCHOOL_APP] },
32
+ // // { name: 'Approval', code: 'EXAMSRESULTS.ONLINEBULKEXAMMANAGEMENT.APPROVAL', appType: [appTypeEnum.SCHOOL_APP] },
33
+ // ],
34
+ // },
35
35
  {
36
36
  name: 'Offline Bulk Exam Management',
37
37
  code: 'EXAMSRESULTS.OFFLINEBULKEXAMMANAGEMENT',
@@ -54,22 +54,22 @@ const ExamsAndResultsModule = {
54
54
  { name: 'Delete', code: 'EXAMSRESULTS.OFFLINEEXAMMANAGEMENT.DELETE', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
55
55
  ],
56
56
  },
57
- {
58
- name: 'Online Exam Management',
59
- code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT',
60
- appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP],
61
- actions: [
62
- { name: 'Add', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.ADD', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
63
- { name: 'Update', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.UPDATE', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
64
- { name: 'View', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.VIEW', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
65
- { name: 'Delete', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.DELETE', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
66
- {
67
- name: 'Attend Exam',
68
- code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.ATTENDEXAM',
69
- appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP],
70
- },
71
- ],
72
- },
57
+ // {
58
+ // name: 'Online Exam Management',
59
+ // code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT',
60
+ // appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP],
61
+ // actions: [
62
+ // { name: 'Add', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.ADD', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
63
+ // { name: 'Update', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.UPDATE', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
64
+ // { name: 'View', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.VIEW', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
65
+ // { name: 'Delete', code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.DELETE', appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP] },
66
+ // {
67
+ // name: 'Attend Exam',
68
+ // code: 'EXAMSRESULTS.ONLINEEXAMMANAGEMENT.ATTENDEXAM',
69
+ // appType: [appTypeEnum.SCHOOL_APP, appTypeEnum.INSTITUTE_APP],
70
+ // },
71
+ // ],
72
+ // },
73
73
  {
74
74
  name: 'Result Management',
75
75
  code: 'EXAMSRESULTS.RESULTMANAGEMENT',
@@ -102,19 +102,19 @@ const FeeAndDiscountModule = {
102
102
  // { name: 'Approval', code: 'FEE.HISTORY.APPROVAL', appType: [appTypeEnum.SCHOOL_APP] },
103
103
  ],
104
104
  },
105
- {
106
- name: 'Fees Report',
107
- code: 'FEE.REPORT',
108
- appType: [appTypeEnum.SCHOOL_APP],
109
- actions: [
110
- // { name: 'Add', code: 'FEE.REPORT.ADD', appType: [appTypeEnum.SCHOOL_APP] },
111
- { name: 'Update', code: 'FEE.REPORT.UPDATE', appType: [appTypeEnum.SCHOOL_APP] },
112
- { name: 'View', code: 'FEE.REPORT.VIEW', appType: [appTypeEnum.SCHOOL_APP] },
113
- // { name: 'Delete', code: 'FEE.REPORT.DELETE', appType: [appTypeEnum.SCHOOL_APP] },
114
- // { name: 'Approval', code: 'FEE.REPORT.APPROVAL', appType: [appTypeEnum.SCHOOL_APP] },
115
- { name: 'Print', code: 'FEE.REPORT.PRINT', appType: [appTypeEnum.SCHOOL_APP] },
116
- ],
117
- },
105
+ // {
106
+ // name: 'Fees Report',
107
+ // code: 'FEE.REPORT',
108
+ // appType: [appTypeEnum.SCHOOL_APP],
109
+ // actions: [
110
+ // // { name: 'Add', code: 'FEE.REPORT.ADD', appType: [appTypeEnum.SCHOOL_APP] },
111
+ // { name: 'Update', code: 'FEE.REPORT.UPDATE', appType: [appTypeEnum.SCHOOL_APP] },
112
+ // { name: 'View', code: 'FEE.REPORT.VIEW', appType: [appTypeEnum.SCHOOL_APP] },
113
+ // // { name: 'Delete', code: 'FEE.REPORT.DELETE', appType: [appTypeEnum.SCHOOL_APP] },
114
+ // // { name: 'Approval', code: 'FEE.REPORT.APPROVAL', appType: [appTypeEnum.SCHOOL_APP] },
115
+ // { name: 'Print', code: 'FEE.REPORT.PRINT', appType: [appTypeEnum.SCHOOL_APP] },
116
+ // ],
117
+ // },
118
118
  {
119
119
  name: 'Offers',
120
120
  code: 'FEE.OFFERS',
@@ -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,42 @@
1
+ "use strict";
2
+ const appTypeEnum = require('./appType');
3
+ const ReportManagementModule = {
4
+ name: 'Report Management',
5
+ code: 'REPORT',
6
+ appType: [appTypeEnum.SCHOOL_APP],
7
+ features: [
8
+ // {
9
+ // name: 'Quick Actions',
10
+ // code: ' REPORT.QUICKACTIONS',
11
+ // appType: [ appTypeEnum.SCHOOL_APP],
12
+ // actions: [
13
+ // { name: 'View', code: ' REPORT.QUICKACTIONS.VIEW', appType: [ appTypeEnum.SCHOOL_APP] },
14
+ // { name: 'Add', code: ' REPORT.QUICKACTIONS.ADD', appType: [ appTypeEnum.SCHOOL_APP] },
15
+ // { name: 'Update', code: ' REPORT.QUICKACTIONS.UPDATE', appType: [ appTypeEnum.SCHOOL_APP] },
16
+ // { name: 'Delete', code: ' REPORT.QUICKACTIONS.DELETE', appType: [ appTypeEnum.SCHOOL_APP] },
17
+ // ],
18
+ // },
19
+ {
20
+ name: 'Report',
21
+ code: ' REPORT.REPORT',
22
+ appType: [appTypeEnum.SCHOOL_APP],
23
+ actions: [
24
+ { name: 'Fee Report', code: ' REPORT.REPORT.FEE', appType: [appTypeEnum.SCHOOL_APP] },
25
+ { name: 'Student Report', code: ' REPORT.REPORT.STUDENT', appType: [appTypeEnum.SCHOOL_APP] },
26
+ { name: 'Attendance Report', code: ' REPORT.REPORT.ATTENDANCE', appType: [appTypeEnum.SCHOOL_APP] },
27
+ ],
28
+ },
29
+ // {
30
+ // name: 'Module List',
31
+ // code: ' REPORT.DASHBOARDLIST',
32
+ // appType: [ appTypeEnum.SCHOOL_APP],
33
+ // actions: [
34
+ // { name: 'View', code: ' REPORT.DASHBOARDLIST.VIEW', appType: [ appTypeEnum.SCHOOL_APP] },
35
+ // { name: 'Add', code: ' REPORT.DASHBOARDLIST.ADD', appType: [ appTypeEnum.SCHOOL_APP] },
36
+ // { name: 'Update', code: ' REPORT.DASHBOARDLIST.UPDATE', appType: [ appTypeEnum.SCHOOL_APP] },
37
+ // { name: 'Delete', code: ' REPORT.DASHBOARDLIST.DELETE', appType: [ appTypeEnum.SCHOOL_APP] },
38
+ // ],
39
+ // },
40
+ ],
41
+ };
42
+ module.exports = ReportManagementModule;
@@ -21,6 +21,7 @@ const UserModule = {
21
21
  { name: 'Basic Detail Update', code: 'USER.STUDENT.BASICDETAILUPDATE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
22
22
  { name: 'Basic Detail Add', code: 'USER.STUDENT.BASICDETAILADD', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
23
23
  { name: 'Action', code: 'USER.STUDENT.ACTION', appType: [appTypeEnum.SCHOOL_APP] },
24
+ { name: 'Archives', code: 'USER.STUDENT.ARCHIVES', appType: [appTypeEnum.SCHOOL_APP] },
24
25
  {
25
26
  name: 'Primary Contact Detail View',
26
27
  code: 'USER.STUDENT.PRIMARYDETAILVIEW',
@@ -5,34 +5,38 @@ const DashboardManagementModule = {
5
5
  code: 'DASHBOARD',
6
6
  appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP],
7
7
  features: [
8
- {
9
- name: 'Quick Actions',
10
- code: 'DASHBOARD.QUICKACTIONS',
11
- appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP],
12
- actions: [
13
- { name: 'View', code: 'DASHBOARD.QUICKACTIONS.VIEW', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
14
- { name: 'Add', code: 'DASHBOARD.QUICKACTIONS.ADD', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
15
- { name: 'Update', code: 'DASHBOARD.QUICKACTIONS.UPDATE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
16
- { name: 'Delete', code: 'DASHBOARD.QUICKACTIONS.DELETE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
17
- ],
18
- },
8
+ // {
9
+ // name: 'Quick Actions',
10
+ // code: 'DASHBOARD.QUICKACTIONS',
11
+ // appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP],
12
+ // actions: [
13
+ // { name: 'View', code: 'DASHBOARD.QUICKACTIONS.VIEW', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
14
+ // { name: 'Add', code: 'DASHBOARD.QUICKACTIONS.ADD', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
15
+ // { name: 'Update', code: 'DASHBOARD.QUICKACTIONS.UPDATE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
16
+ // { name: 'Delete', code: 'DASHBOARD.QUICKACTIONS.DELETE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
17
+ // ],
18
+ // },
19
19
  {
20
20
  name: 'Analytics',
21
21
  code: 'DASHBOARD.ANALYTICS',
22
- appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP],
23
- actions: [{ name: 'View', code: 'DASHBOARD.ANALYTICS.VIEW', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] }],
24
- },
25
- {
26
- name: 'Module List',
27
- code: 'DASHBOARD.DASHBOARDLIST',
28
- appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP],
22
+ appType: [appTypeEnum.SCHOOL_APP],
29
23
  actions: [
30
- { name: 'View', code: 'DASHBOARD.DASHBOARDLIST.VIEW', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
31
- { name: 'Add', code: 'DASHBOARD.DASHBOARDLIST.ADD', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
32
- { name: 'Update', code: 'DASHBOARD.DASHBOARDLIST.UPDATE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
33
- { name: 'Delete', code: 'DASHBOARD.DASHBOARDLIST.DELETE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
24
+ { name: 'Fee Analytics', code: 'DASHBOARD.ANALYTICS.FEE', appType: [appTypeEnum.SCHOOL_APP] },
25
+ { name: 'Student Analytics', code: 'DASHBOARD.ANALYTICS.STUDENT', appType: [appTypeEnum.SCHOOL_APP] },
26
+ { name: 'Attendance Analytics', code: 'DASHBOARD.ANALYTICS.ATTENDANCE', appType: [appTypeEnum.SCHOOL_APP] },
34
27
  ],
35
28
  },
29
+ // {
30
+ // name: 'Module List',
31
+ // code: 'DASHBOARD.DASHBOARDLIST',
32
+ // appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP],
33
+ // actions: [
34
+ // { name: 'View', code: 'DASHBOARD.DASHBOARDLIST.VIEW', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
35
+ // { name: 'Add', code: 'DASHBOARD.DASHBOARDLIST.ADD', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
36
+ // { name: 'Update', code: 'DASHBOARD.DASHBOARDLIST.UPDATE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
37
+ // { name: 'Delete', code: 'DASHBOARD.DASHBOARDLIST.DELETE', appType: [appTypeEnum.INSTITUTE_APP, appTypeEnum.SCHOOL_APP] },
38
+ // ],
39
+ // },
36
40
  ],
37
41
  };
38
42
  module.exports = DashboardManagementModule;
@@ -206,7 +206,27 @@ const createOrUpdateHook = async (examGroup) => {
206
206
  // subjects: standardSubjectList,
207
207
  days: [],
208
208
  };
209
- dateList.forEach(date => {
209
+ // dateList.forEach(date => {
210
+ // const dayObject = {
211
+ // date,
212
+ // note: '',
213
+ // subjectId: '',
214
+ // isHoliday: false,
215
+ // };
216
+ // if (existStandardByDays) {
217
+ // existStandardByDays.days = existStandardByDays.days.filter(day => {
218
+ // return dateList.map(date => new Date(date).getTime()).includes(new Date(day.date).getTime());
219
+ // });
220
+ // const existDate = existStandardByDays.days.find(day => {
221
+ // return dateList.map(date => new Date(date).getTime()).includes(new Date(day.date).getTime());
222
+ // });
223
+ // if (!existDate) existStandardByDays.days.push(dayObject);
224
+ // } else {
225
+ // standardByDays.days.push(dayObject);
226
+ // }
227
+ // });
228
+ const tempDateList = dateList.filter(d => !existStandardByDays?.days?.map(day => new Date(day.date).getTime()).includes(new Date(d).getTime()));
229
+ tempDateList.forEach(date => {
210
230
  const dayObject = {
211
231
  date,
212
232
  note: '',
@@ -214,14 +234,7 @@ const createOrUpdateHook = async (examGroup) => {
214
234
  isHoliday: false,
215
235
  };
216
236
  if (existStandardByDays) {
217
- existStandardByDays.days = existStandardByDays.days.filter(day => {
218
- return dateList.map(date => new Date(date).getTime()).includes(new Date(day.date).getTime());
219
- });
220
- const existDate = existStandardByDays.days.find(day => {
221
- return dateList.map(date => new Date(date).getTime()).includes(new Date(day.date).getTime());
222
- });
223
- if (!existDate)
224
- existStandardByDays.days.push(dayObject);
237
+ existStandardByDays.days.push(dayObject);
225
238
  }
226
239
  else {
227
240
  standardByDays.days.push(dayObject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.292",
3
+ "version": "1.1.294",
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",