@kipicore/dbcore 1.1.131 → 1.1.133

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.
Files changed (93) hide show
  1. package/dist/constants/app.d.ts +2 -1
  2. package/dist/constants/app.js +1 -0
  3. package/dist/constants/errorMessages.d.ts +2 -1
  4. package/dist/constants/errorMessages.js +1 -0
  5. package/dist/db/psql/migrations/20251125045339-income_expense_model.js +4 -4
  6. package/dist/db/psql/migrations/20251209061902-add-acl_id_feeTypeModel.d.ts +2 -0
  7. package/dist/db/psql/migrations/20251209061902-add-acl_id_feeTypeModel.js +21 -0
  8. package/dist/db/psql/migrations/20251210100917-id_add_typemanagement.d.ts +2 -0
  9. package/dist/db/psql/migrations/20251210100917-id_add_typemanagement.js +33 -0
  10. package/dist/db/psql/migrations/20251210101254-id_add_bankAccDetails.d.ts +2 -0
  11. package/dist/db/psql/migrations/20251210101254-id_add_bankAccDetails.js +22 -0
  12. package/dist/db/psql/migrations/20251210102112-id_add_accHasReceiptDetails.d.ts +2 -0
  13. package/dist/db/psql/migrations/20251210102112-id_add_accHasReceiptDetails.js +33 -0
  14. package/dist/db/psql/migrations/20251210102601-id_add_masterLeave.d.ts +2 -0
  15. package/dist/db/psql/migrations/20251210102601-id_add_masterLeave.js +22 -0
  16. package/dist/db/psql/migrations/20251210103020-id_add_slot.d.ts +2 -0
  17. package/dist/db/psql/migrations/20251210103020-id_add_slot.js +22 -0
  18. package/dist/db/psql/migrations/20251210103724-id_add_classRoom.d.ts +2 -0
  19. package/dist/db/psql/migrations/20251210103724-id_add_classRoom.js +22 -0
  20. package/dist/db/psql/migrations/20251210104353-id_add_floorManagement.d.ts +2 -0
  21. package/dist/db/psql/migrations/20251210104353-id_add_floorManagement.js +33 -0
  22. package/dist/db/psql/migrations/20251210105807-id_add_batch.d.ts +2 -0
  23. package/dist/db/psql/migrations/20251210105807-id_add_batch.js +22 -0
  24. package/dist/db/psql/migrations/20251210110340-id_add_workingshift.d.ts +2 -0
  25. package/dist/db/psql/migrations/20251210110340-id_add_workingshift.js +22 -0
  26. package/dist/db/psql/migrations/20251210110912-id_add_greetings.d.ts +2 -0
  27. package/dist/db/psql/migrations/20251210110912-id_add_greetings.js +22 -0
  28. package/dist/db/psql/migrations/20251210113530-id_add_role.d.ts +2 -0
  29. package/dist/db/psql/migrations/20251210113530-id_add_role.js +33 -0
  30. package/dist/db/psql/migrations/20251210122210-id_add_userHasRole.d.ts +2 -0
  31. package/dist/db/psql/migrations/20251210122210-id_add_userHasRole.js +33 -0
  32. package/dist/db/psql/migrations/20251210124921-id_add_subjectHFee.d.ts +2 -0
  33. package/dist/db/psql/migrations/20251210124921-id_add_subjectHFee.js +22 -0
  34. package/dist/db/psql/migrations/20251210130015-id_add_workingDay.d.ts +2 -0
  35. package/dist/db/psql/migrations/20251210130015-id_add_workingDay.js +22 -0
  36. package/dist/db/psql/migrations/20251210132959-id_add_reminderSetting.d.ts +2 -0
  37. package/dist/db/psql/migrations/20251210132959-id_add_reminderSetting.js +22 -0
  38. package/dist/interfaces/accountHasReceiptDetailsInterface.d.ts +2 -0
  39. package/dist/interfaces/bankAccountDetailsInterface.d.ts +1 -0
  40. package/dist/interfaces/batchInterface.d.ts +1 -0
  41. package/dist/interfaces/classRoomInterface.d.ts +1 -0
  42. package/dist/interfaces/feeReminderSettingInterface.d.ts +1 -0
  43. package/dist/interfaces/feeReminderTypeInterface.d.ts +1 -0
  44. package/dist/interfaces/floorManagementInterface.d.ts +2 -0
  45. package/dist/interfaces/greetingsInterface.d.ts +1 -0
  46. package/dist/interfaces/incomeExpenseInterface.d.ts +1 -1
  47. package/dist/interfaces/masterLeaveInterface.d.ts +1 -0
  48. package/dist/interfaces/roleInterface.d.ts +2 -0
  49. package/dist/interfaces/slotInterface.d.ts +1 -0
  50. package/dist/interfaces/subjectHasFeeInterface.d.ts +1 -0
  51. package/dist/interfaces/subjectIndexInterface.d.ts +2 -0
  52. package/dist/interfaces/typeManagementInterface.d.ts +2 -0
  53. package/dist/interfaces/userHasRoleInterface.d.ts +2 -0
  54. package/dist/interfaces/userInstituteMetaInterface.d.ts +2 -0
  55. package/dist/interfaces/workingDayInterface.d.ts +1 -0
  56. package/dist/interfaces/workingShiftInterface.d.ts +1 -0
  57. package/dist/models/mongodb/feeReminderTypeModel.js +4 -0
  58. package/dist/models/mongodb/subjectIndexModel.js +8 -0
  59. package/dist/models/mongodb/userInstituteMetaModel.js +8 -0
  60. package/dist/models/psql/accountHasReceiptDetailsModel.d.ts +2 -0
  61. package/dist/models/psql/accountHasReceiptDetailsModel.js +27 -1
  62. package/dist/models/psql/bankAccountDetailsModel.d.ts +1 -0
  63. package/dist/models/psql/bankAccountDetailsModel.js +13 -0
  64. package/dist/models/psql/batchModel.d.ts +1 -0
  65. package/dist/models/psql/batchModel.js +13 -0
  66. package/dist/models/psql/classRoomModel.d.ts +1 -0
  67. package/dist/models/psql/classRoomModel.js +13 -0
  68. package/dist/models/psql/feeHistoryModel.js +1 -0
  69. package/dist/models/psql/feeReminderSettingModel.d.ts +1 -0
  70. package/dist/models/psql/feeReminderSettingModel.js +12 -0
  71. package/dist/models/psql/floorManagementModel.d.ts +2 -0
  72. package/dist/models/psql/floorManagementModel.js +27 -1
  73. package/dist/models/psql/greetingsModel.d.ts +1 -0
  74. package/dist/models/psql/greetingsModel.js +13 -0
  75. package/dist/models/psql/incomeExpenseModel.d.ts +1 -1
  76. package/dist/models/psql/incomeExpenseModel.js +6 -6
  77. package/dist/models/psql/masterLeaveModel.d.ts +1 -0
  78. package/dist/models/psql/masterLeaveModel.js +13 -0
  79. package/dist/models/psql/roleModel.d.ts +2 -0
  80. package/dist/models/psql/roleModel.js +27 -1
  81. package/dist/models/psql/slotModel.d.ts +1 -0
  82. package/dist/models/psql/slotModel.js +13 -0
  83. package/dist/models/psql/subjectHasFeeModel.d.ts +2 -1
  84. package/dist/models/psql/subjectHasFeeModel.js +14 -1
  85. package/dist/models/psql/typeManagementModel.d.ts +2 -0
  86. package/dist/models/psql/typeManagementModel.js +39 -1
  87. package/dist/models/psql/userHasRoleModel.d.ts +2 -0
  88. package/dist/models/psql/userHasRoleModel.js +27 -1
  89. package/dist/models/psql/workingDayModel.d.ts +1 -0
  90. package/dist/models/psql/workingDayModel.js +13 -0
  91. package/dist/models/psql/workingShiftModel.d.ts +1 -0
  92. package/dist/models/psql/workingShiftModel.js +13 -0
  93. package/package.json +1 -1
@@ -6,7 +6,7 @@ const app_1 = require("../../constants/app");
6
6
  const errorMessages_1 = require("../../constants/errorMessages");
7
7
  class TypeManagementModel extends sequelize_1.Model {
8
8
  static associate(models) {
9
- const { UserModel, InstituteModel } = models;
9
+ const { UserModel, InstituteModel, AcademicCalendarModel } = models;
10
10
  TypeManagementModel.belongsTo(InstituteModel, {
11
11
  foreignKey: {
12
12
  name: 'instituteId',
@@ -18,6 +18,34 @@ class TypeManagementModel extends sequelize_1.Model {
18
18
  foreignKey: 'instituteId',
19
19
  as: 'typeManagements',
20
20
  });
21
+ TypeManagementModel.belongsTo(AcademicCalendarModel, {
22
+ foreignKey: {
23
+ name: 'academicCalendarId',
24
+ field: 'academic_calendar_id',
25
+ },
26
+ as: 'typeManagementAcaCal',
27
+ });
28
+ AcademicCalendarModel.hasMany(TypeManagementModel, {
29
+ foreignKey: {
30
+ name: 'academicCalendarId',
31
+ field: 'academic_calendar_id',
32
+ },
33
+ as: 'AcaCalTypeManagement',
34
+ });
35
+ TypeManagementModel.belongsTo(TypeManagementModel, {
36
+ foreignKey: {
37
+ name: 'oldId',
38
+ field: 'old_id',
39
+ },
40
+ as: 'typeManagementParent',
41
+ });
42
+ TypeManagementModel.hasMany(TypeManagementModel, {
43
+ foreignKey: {
44
+ name: 'oldId',
45
+ field: 'old_id',
46
+ },
47
+ as: 'typeManagementChild',
48
+ });
21
49
  TypeManagementModel.belongsTo(UserModel, {
22
50
  foreignKey: {
23
51
  name: 'createdBy',
@@ -113,6 +141,16 @@ TypeManagementModel.init({
113
141
  field: 'is_default',
114
142
  defaultValue: false,
115
143
  },
144
+ academicCalendarId: {
145
+ type: sequelize_1.DataTypes.UUID,
146
+ field: 'academic_calendar_id',
147
+ allowNull: true,
148
+ },
149
+ oldId: {
150
+ type: sequelize_1.DataTypes.UUID,
151
+ field: 'old_id',
152
+ allowNull: true,
153
+ },
116
154
  }, {
117
155
  modelName: 'TypeManagementModel',
118
156
  tableName: 'type_management',
@@ -8,6 +8,8 @@ declare class UserHasRoleModel extends Model<IUserHasRoleAttributes, TUserHasRol
8
8
  userId: string;
9
9
  roleId: string;
10
10
  instituteId?: string;
11
+ oldId?: string;
12
+ academicCalendarId?: string;
11
13
  createdBy?: string;
12
14
  updatedBy?: string;
13
15
  deletedBy?: string;
@@ -5,7 +5,7 @@ const index_1 = require("./index");
5
5
  const app_1 = require("../../constants/app");
6
6
  class UserHasRoleModel extends sequelize_1.Model {
7
7
  static associate(models) {
8
- const { UserModel, RoleModel, InstituteModel } = models;
8
+ const { UserModel, RoleModel, InstituteModel, AcademicCalendarModel } = models;
9
9
  UserHasRoleModel.belongsTo(InstituteModel, {
10
10
  foreignKey: { name: 'instituteId', allowNull: true, field: 'institute_id' },
11
11
  as: 'institute',
@@ -18,6 +18,22 @@ class UserHasRoleModel extends sequelize_1.Model {
18
18
  foreignKey: { name: 'roleId', allowNull: false, field: 'role_id' },
19
19
  as: 'role',
20
20
  });
21
+ UserHasRoleModel.belongsTo(UserHasRoleModel, {
22
+ foreignKey: { name: 'oldId', allowNull: true, field: 'old_id' },
23
+ as: 'oldParentUserHRole',
24
+ });
25
+ UserHasRoleModel.hasMany(UserHasRoleModel, {
26
+ foreignKey: { name: 'oldId', allowNull: true, field: 'old_id' },
27
+ as: 'childUserHRole',
28
+ });
29
+ UserHasRoleModel.belongsTo(AcademicCalendarModel, {
30
+ foreignKey: { name: 'academicCalendarId', allowNull: true, field: 'academic_calendar_id' },
31
+ as: 'userHRollAcaCal',
32
+ });
33
+ AcademicCalendarModel.hasMany(UserHasRoleModel, {
34
+ foreignKey: { name: 'academicCalendarId', allowNull: true, field: 'academic_calendar_id' },
35
+ as: 'acaCalUserHasR',
36
+ });
21
37
  UserHasRoleModel.belongsTo(UserModel, {
22
38
  foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
23
39
  as: 'createdByUser',
@@ -59,6 +75,16 @@ UserHasRoleModel.init({
59
75
  field: 'institute_id',
60
76
  allowNull: true,
61
77
  },
78
+ oldId: {
79
+ type: sequelize_1.DataTypes.UUID,
80
+ field: 'old_id',
81
+ allowNull: true,
82
+ },
83
+ academicCalendarId: {
84
+ type: sequelize_1.DataTypes.UUID,
85
+ field: 'academic_calendar_id',
86
+ allowNull: true,
87
+ },
62
88
  }, {
63
89
  modelName: 'UserHasRoleModel',
64
90
  tableName: 'user_has_roles',
@@ -11,6 +11,7 @@ declare class WorkingDayModel extends Model<IWorkingDayAttributes, TWorkingDayCr
11
11
  instituteId: string;
12
12
  dayOfWeek: number;
13
13
  academicCalendarId: string;
14
+ oldId?: string;
14
15
  createdBy: string;
15
16
  updatedBy: string;
16
17
  deletedBy: string;
@@ -22,6 +22,14 @@ class WorkingDayModel extends sequelize_1.Model {
22
22
  foreignKey: { name: 'academicCalendarId', allowNull: true, field: 'academic_calendar_id' },
23
23
  as: 'workingDayAcaCal',
24
24
  });
25
+ WorkingDayModel.belongsTo(WorkingDayModel, {
26
+ foreignKey: { name: 'oldId', allowNull: true, field: 'old_id' },
27
+ as: 'workingDayOldParent',
28
+ });
29
+ WorkingDayModel.hasMany(WorkingDayModel, {
30
+ foreignKey: { name: 'oldId', allowNull: true, field: 'old_id' },
31
+ as: 'workingDayOldChild',
32
+ });
25
33
  }
26
34
  }
27
35
  WorkingDayModel.init({
@@ -66,6 +74,11 @@ WorkingDayModel.init({
66
74
  field: 'academic_calendar_id',
67
75
  allowNull: true,
68
76
  },
77
+ oldId: {
78
+ type: sequelize_1.DataTypes.UUID,
79
+ field: 'old_id',
80
+ allowNull: true,
81
+ },
69
82
  }, {
70
83
  modelName: 'WorkingDayModel',
71
84
  tableName: 'working_days',
@@ -12,6 +12,7 @@ declare class WorkingShiftModel extends Model<IWorkingShiftAttributes, TWorkingS
12
12
  instituteId: string;
13
13
  slotId: string;
14
14
  academicCalendarId: string;
15
+ oldId?: string;
15
16
  createdBy: string;
16
17
  updatedBy: string;
17
18
  deletedBy: string;
@@ -46,6 +46,14 @@ class WorkingShiftModel extends sequelize_1.Model {
46
46
  foreignKey: { name: 'academicCalendarId', allowNull: true, field: 'academic_calendar_id' },
47
47
  as: 'workingShiftAcaCal',
48
48
  });
49
+ WorkingShiftModel.belongsTo(WorkingShiftModel, {
50
+ foreignKey: { name: 'oldId', field: 'old_id', allowNull: true },
51
+ as: 'workingShiftParent',
52
+ });
53
+ WorkingShiftModel.hasMany(WorkingShiftModel, {
54
+ foreignKey: { name: 'oldId', field: 'old_id', allowNull: true },
55
+ as: 'childWorkingShift',
56
+ });
49
57
  }
50
58
  }
51
59
  WorkingShiftModel.init({
@@ -95,6 +103,11 @@ WorkingShiftModel.init({
95
103
  field: 'academic_calendar_id',
96
104
  allowNull: true,
97
105
  },
106
+ oldId: {
107
+ type: sequelize_1.DataTypes.UUID,
108
+ field: 'old_id',
109
+ allowNull: true,
110
+ },
98
111
  }, {
99
112
  modelName: 'WorkingShiftModel',
100
113
  tableName: 'working_shift_days',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.131",
3
+ "version": "1.1.133",
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",