@kipicore/dbcore 1.1.4 → 1.1.6

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 (71) hide show
  1. package/README.md +1 -1
  2. package/dist/constants/app.js +0 -1
  3. package/dist/db/mongodb.js +4 -4
  4. package/dist/db/postgres.d.ts +1 -1
  5. package/dist/db/postgres.js +5 -5
  6. package/dist/index.d.ts +417 -415
  7. package/dist/index.js +742 -428
  8. package/dist/models/mongodb/attendanceModel.d.ts +2 -2
  9. package/dist/models/mongodb/attendanceModel.js +7 -8
  10. package/dist/models/mongodb/eventModel.d.ts +2 -2
  11. package/dist/models/mongodb/eventModel.js +3 -3
  12. package/dist/models/mongodb/examGroupModel.d.ts +2 -2
  13. package/dist/models/mongodb/examGroupModel.js +22 -28
  14. package/dist/models/mongodb/examHasAnswerSheetModel.d.ts +2 -2
  15. package/dist/models/mongodb/examHasAnswerSheetModel.js +5 -6
  16. package/dist/models/mongodb/examModel.d.ts +2 -2
  17. package/dist/models/mongodb/examModel.js +7 -10
  18. package/dist/models/mongodb/holidayModel.d.ts +2 -2
  19. package/dist/models/mongodb/holidayModel.js +4 -6
  20. package/dist/models/mongodb/inquiryModel.d.ts +2 -2
  21. package/dist/models/mongodb/inquiryModel.js +3 -4
  22. package/dist/models/mongodb/plugin/transformIdInResponsePlugin.d.ts +1 -1
  23. package/dist/models/mongodb/plugin/transformIdInResponsePlugin.js +4 -6
  24. package/dist/models/mongodb/schoolFeeModel.d.ts +2 -2
  25. package/dist/models/mongodb/schoolFeeModel.js +3 -3
  26. package/dist/models/mongodb/subjectIndexModel.d.ts +2 -2
  27. package/dist/models/mongodb/subjectIndexModel.js +66 -108
  28. package/dist/models/mongodb/subscriptionPlanModel.d.ts +2 -2
  29. package/dist/models/mongodb/subscriptionPlanModel.js +1 -1
  30. package/dist/models/mongodb/taskManagementModel.d.ts +2 -2
  31. package/dist/models/mongodb/taskManagementModel.js +3 -3
  32. package/dist/models/mongodb/userDoc.d.ts +1 -1
  33. package/dist/models/mongodb/userDoc.js +1 -1
  34. package/dist/models/mongodb/userSchoolMetaModel.d.ts +1 -1
  35. package/dist/models/mongodb/userSchoolMetaModel.js +8 -8
  36. package/dist/models/psql/announcementModel.d.ts +4 -4
  37. package/dist/models/psql/announcementModel.js +25 -25
  38. package/dist/models/psql/batchModel.d.ts +4 -4
  39. package/dist/models/psql/batchModel.js +51 -51
  40. package/dist/models/psql/driverModel.d.ts +4 -4
  41. package/dist/models/psql/driverModel.js +28 -28
  42. package/dist/models/psql/facilityModel.d.ts +4 -4
  43. package/dist/models/psql/facilityModel.js +23 -23
  44. package/dist/models/psql/feeHistoryModel.d.ts +4 -4
  45. package/dist/models/psql/feeHistoryModel.js +64 -65
  46. package/dist/models/psql/feeReminderModel.d.ts +3 -3
  47. package/dist/models/psql/feeReminderModel.js +32 -32
  48. package/dist/models/psql/feesCollectionModel.d.ts +4 -4
  49. package/dist/models/psql/feesCollectionModel.js +36 -37
  50. package/dist/models/psql/index.d.ts +1 -1
  51. package/dist/models/psql/index.js +12 -12
  52. package/dist/models/psql/lectureModel.d.ts +4 -4
  53. package/dist/models/psql/lectureModel.js +75 -84
  54. package/dist/models/psql/masterLeaveModel.d.ts +4 -4
  55. package/dist/models/psql/masterLeaveModel.js +22 -23
  56. package/dist/models/psql/testimonialModel.d.ts +4 -4
  57. package/dist/models/psql/testimonialModel.js +25 -27
  58. package/dist/models/psql/toDoModel.d.ts +4 -4
  59. package/dist/models/psql/toDoModel.js +23 -23
  60. package/dist/models/psql/typeManagementModel.d.ts +4 -4
  61. package/dist/models/psql/typeManagementModel.js +19 -19
  62. package/dist/models/psql/userModel.d.ts +4 -4
  63. package/dist/models/psql/userModel.js +47 -48
  64. package/dist/models/psql/userPayoutModel.d.ts +4 -4
  65. package/dist/models/psql/userPayoutModel.js +55 -70
  66. package/dist/services/Concrete/mongooseCommonService.d.ts +4 -4
  67. package/dist/services/Concrete/mongooseCommonService.js +2 -4
  68. package/dist/services/Contracts/IMongooseCommonService.d.ts +2 -2
  69. package/dist/services/Contracts/ISequelizeCommonService.d.ts +12 -12
  70. package/dist/types/generateIdCardType.d.ts +2 -2
  71. package/package.json +49 -47
@@ -59,12 +59,12 @@ AnnouncementModel.init({
59
59
  },
60
60
  instituteId: {
61
61
  type: sequelize_1.DataTypes.UUID,
62
- field: "institute_id",
62
+ field: 'institute_id',
63
63
  allowNull: true,
64
64
  },
65
65
  userIds: {
66
66
  type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.UUID),
67
- field: "user_ids",
67
+ field: 'user_ids',
68
68
  defaultValue: [],
69
69
  allowNull: true,
70
70
  },
@@ -84,67 +84,67 @@ AnnouncementModel.init({
84
84
  },
85
85
  entityIds: {
86
86
  type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.UUID),
87
- field: "entity_ids",
87
+ field: 'entity_ids',
88
88
  defaultValue: [],
89
89
  allowNull: false,
90
90
  },
91
91
  }, {
92
- modelName: "AnnouncementModel",
93
- tableName: "announcementes",
92
+ modelName: 'AnnouncementModel',
93
+ tableName: 'announcementes',
94
94
  timestamps: true,
95
95
  sequelize: index_js_1.sequelize,
96
96
  });
97
97
  AnnouncementModel.belongsTo(userModel_js_1.default, {
98
98
  foreignKey: {
99
- name: "createdBy",
99
+ name: 'createdBy',
100
100
  allowNull: true,
101
- field: "created_by",
101
+ field: 'created_by',
102
102
  },
103
- as: "createdByUser",
103
+ as: 'createdByUser',
104
104
  });
105
105
  AnnouncementModel.belongsTo(userModel_js_1.default, {
106
106
  foreignKey: {
107
- name: "updatedBy",
107
+ name: 'updatedBy',
108
108
  allowNull: true,
109
- field: "updated_by",
109
+ field: 'updated_by',
110
110
  },
111
- as: "updatedByUser",
111
+ as: 'updatedByUser',
112
112
  });
113
113
  AnnouncementModel.belongsTo(userModel_js_1.default, {
114
114
  foreignKey: {
115
- name: "deletedBy",
115
+ name: 'deletedBy',
116
116
  allowNull: true,
117
- field: "deleted_by",
117
+ field: 'deleted_by',
118
118
  },
119
- as: "deletedByUser",
119
+ as: 'deletedByUser',
120
120
  });
121
121
  AnnouncementModel.belongsTo(instituteModel_js_1.default, {
122
122
  foreignKey: {
123
- name: "instituteId",
123
+ name: 'instituteId',
124
124
  },
125
- as: "institute",
125
+ as: 'institute',
126
126
  });
127
127
  instituteModel_js_1.default.hasMany(AnnouncementModel, {
128
128
  foreignKey: {
129
- name: "instituteId",
129
+ name: 'instituteId',
130
130
  },
131
- as: "instituteHasAnnouncementList",
131
+ as: 'instituteHasAnnouncementList',
132
132
  });
133
133
  AnnouncementModel.belongsTo(fileStorageModel_js_1.default, {
134
134
  foreignKey: {
135
- name: "fileStorageId",
135
+ name: 'fileStorageId',
136
136
  },
137
- as: "announcementFileStorage",
137
+ as: 'announcementFileStorage',
138
138
  });
139
139
  fileStorageModel_js_1.default.hasMany(AnnouncementModel, {
140
- foreignKey: "fileStorageId",
141
- as: "announcementHasFileList",
140
+ foreignKey: 'fileStorageId',
141
+ as: 'announcementHasFileList',
142
142
  });
143
143
  AnnouncementModel.beforeCreate(async (announcement) => {
144
144
  if (announcement.subjects && announcement.subjects.length) {
145
145
  const where = { id: { [sequelize_1.Op.in]: announcement.subjects } };
146
146
  const options = {
147
- include: { association: "entityType", where: { sequence: "LAST" } },
147
+ include: { association: 'entityType', where: { sequence: 'LAST' } },
148
148
  raw: false,
149
149
  };
150
150
  const entityListCount = await instituteEntityModel_js_1.default.count({
@@ -178,8 +178,8 @@ AnnouncementModel.beforeBulkUpdate(async (options) => {
178
178
  const entityList = await instituteEntityModel_js_1.default.findAll({
179
179
  where,
180
180
  include: {
181
- association: "entityType",
182
- where: { sequene: "LAST" },
181
+ association: 'entityType',
182
+ where: { sequene: 'LAST' },
183
183
  },
184
184
  raw: false, // Ensure you get Sequelize instances
185
185
  });
@@ -1,7 +1,7 @@
1
- import { Model } from "sequelize";
2
- import { IBatchModelAttributes } from "../../interfaces/batchInterface.js";
3
- import { TBatchModelCreationAttributes } from "../../types/batchType.js";
4
- import { COMMAN_STATUS, PLANNER_SYNC_STATUS } from "../../constants/app.js";
1
+ import { Model } from 'sequelize';
2
+ import { IBatchModelAttributes } from '../../interfaces/batchInterface.js';
3
+ import { TBatchModelCreationAttributes } from '../../types/batchType.js';
4
+ import { COMMAN_STATUS, PLANNER_SYNC_STATUS } from '../../constants/app.js';
5
5
  declare class BatchModel extends Model<IBatchModelAttributes, TBatchModelCreationAttributes> {
6
6
  id: string;
7
7
  title: string;
@@ -38,12 +38,12 @@ BatchModel.init({
38
38
  },
39
39
  startTime: {
40
40
  type: sequelize_1.DataTypes.DATE,
41
- field: "start_time",
41
+ field: 'start_time',
42
42
  allowNull: false,
43
43
  },
44
44
  endTime: {
45
45
  type: sequelize_1.DataTypes.DATE,
46
- field: "end_time",
46
+ field: 'end_time',
47
47
  allowNull: false,
48
48
  },
49
49
  capacity: {
@@ -52,22 +52,22 @@ BatchModel.init({
52
52
  },
53
53
  instituteId: {
54
54
  type: sequelize_1.DataTypes.UUID,
55
- field: "institute_id",
55
+ field: 'institute_id',
56
56
  allowNull: false,
57
57
  },
58
58
  shiftId: {
59
59
  type: sequelize_1.DataTypes.UUID,
60
- field: "shift_id",
60
+ field: 'shift_id',
61
61
  allowNull: true,
62
62
  },
63
63
  slotId: {
64
64
  type: sequelize_1.DataTypes.UUID,
65
- field: "slot_id",
65
+ field: 'slot_id',
66
66
  allowNull: true,
67
67
  },
68
68
  teacherId: {
69
69
  type: sequelize_1.DataTypes.UUID,
70
- field: "teacher_id",
70
+ field: 'teacher_id',
71
71
  defaultValue: null,
72
72
  allowNull: true,
73
73
  },
@@ -78,132 +78,132 @@ BatchModel.init({
78
78
  },
79
79
  plannerSyncStatus: {
80
80
  type: sequelize_1.DataTypes.STRING,
81
- field: "planner_sync_status",
81
+ field: 'planner_sync_status',
82
82
  allowNull: true,
83
83
  defaultValue: app_js_1.PLANNER_SYNC_STATUS.PENDING,
84
84
  },
85
85
  academicCalendarId: {
86
86
  type: sequelize_1.DataTypes.UUID,
87
- field: "academic_calendar_id",
87
+ field: 'academic_calendar_id',
88
88
  defaultValue: null,
89
89
  allowNull: true,
90
90
  },
91
91
  }, {
92
- modelName: "BatchModel",
93
- tableName: "batches",
92
+ modelName: 'BatchModel',
93
+ tableName: 'batches',
94
94
  timestamps: true,
95
95
  sequelize: index_js_1.sequelize,
96
96
  });
97
97
  BatchModel.belongsTo(userModel_js_1.default, {
98
98
  foreignKey: {
99
- name: "createdBy",
99
+ name: 'createdBy',
100
100
  allowNull: true,
101
- field: "created_by",
101
+ field: 'created_by',
102
102
  },
103
- as: "createdByUser",
103
+ as: 'createdByUser',
104
104
  });
105
105
  BatchModel.belongsTo(userModel_js_1.default, {
106
106
  foreignKey: {
107
- name: "updatedBy",
107
+ name: 'updatedBy',
108
108
  allowNull: true,
109
- field: "updated_by",
109
+ field: 'updated_by',
110
110
  },
111
- as: "updatedByUser",
111
+ as: 'updatedByUser',
112
112
  });
113
113
  BatchModel.belongsTo(userModel_js_1.default, {
114
114
  foreignKey: {
115
- name: "deletedBy",
115
+ name: 'deletedBy',
116
116
  allowNull: true,
117
- field: "deleted_by",
117
+ field: 'deleted_by',
118
118
  },
119
- as: "deletedByUser",
119
+ as: 'deletedByUser',
120
120
  });
121
121
  BatchModel.belongsTo(typeManagementModel_js_1.default, {
122
122
  foreignKey: {
123
- name: "type",
123
+ name: 'type',
124
124
  allowNull: false,
125
125
  },
126
- as: "batchType",
126
+ as: 'batchType',
127
127
  });
128
128
  BatchModel.belongsTo(instituteModel_js_1.default, {
129
129
  foreignKey: {
130
- name: "instituteId",
131
- field: "institute_id",
130
+ name: 'instituteId',
131
+ field: 'institute_id',
132
132
  allowNull: false,
133
133
  },
134
- as: "institute",
134
+ as: 'institute',
135
135
  });
136
136
  userModel_js_1.default.hasMany(BatchModel, {
137
137
  foreignKey: {
138
- name: "teacherId",
139
- field: "teacher_id",
138
+ name: 'teacherId',
139
+ field: 'teacher_id',
140
140
  allowNull: true,
141
141
  },
142
- as: "batchesHasTeacher",
142
+ as: 'batchesHasTeacher',
143
143
  });
144
144
  BatchModel.belongsTo(userModel_js_1.default, {
145
145
  foreignKey: {
146
- name: "teacherId",
147
- field: "teacher_id",
146
+ name: 'teacherId',
147
+ field: 'teacher_id',
148
148
  allowNull: true,
149
149
  },
150
- as: "batchTeacher",
150
+ as: 'batchTeacher',
151
151
  });
152
152
  instituteModel_js_1.default.hasMany(BatchModel, {
153
153
  foreignKey: {
154
- name: "instituteId",
155
- field: "institute_id",
154
+ name: 'instituteId',
155
+ field: 'institute_id',
156
156
  allowNull: false,
157
157
  },
158
- as: "batches",
158
+ as: 'batches',
159
159
  });
160
160
  BatchModel.belongsTo(workingShiftModel_js_1.default, {
161
161
  foreignKey: {
162
- name: "shiftId",
163
- field: "shift_id",
162
+ name: 'shiftId',
163
+ field: 'shift_id',
164
164
  allowNull: false,
165
165
  },
166
- as: "shiftBatch",
166
+ as: 'shiftBatch',
167
167
  });
168
168
  slotModel_js_1.default.hasMany(BatchModel, {
169
169
  foreignKey: {
170
- name: "slotId",
171
- field: "slot_id",
170
+ name: 'slotId',
171
+ field: 'slot_id',
172
172
  allowNull: false,
173
173
  },
174
- as: "batchesSlot",
174
+ as: 'batchesSlot',
175
175
  });
176
176
  BatchModel.belongsTo(slotModel_js_1.default, {
177
177
  foreignKey: {
178
- name: "slotId",
179
- field: "slot_id",
178
+ name: 'slotId',
179
+ field: 'slot_id',
180
180
  allowNull: false,
181
181
  },
182
- as: "slotBatch",
182
+ as: 'slotBatch',
183
183
  });
184
184
  workingShiftModel_js_1.default.hasMany(BatchModel, {
185
185
  foreignKey: {
186
- name: "shiftId",
187
- field: "shift_id",
186
+ name: 'shiftId',
187
+ field: 'shift_id',
188
188
  allowNull: false,
189
189
  },
190
- as: "batchesShift",
190
+ as: 'batchesShift',
191
191
  });
192
192
  academicCalendarModel_js_1.default.hasMany(BatchModel, {
193
193
  foreignKey: {
194
- name: "academicCalendarId",
195
- field: "academic_calendar_id",
194
+ name: 'academicCalendarId',
195
+ field: 'academic_calendar_id',
196
196
  allowNull: true,
197
197
  },
198
- as: "academicCalendarBatchList",
198
+ as: 'academicCalendarBatchList',
199
199
  });
200
200
  BatchModel.belongsTo(academicCalendarModel_js_1.default, {
201
201
  foreignKey: {
202
- name: "academicCalendarId",
203
- field: "academic_calendar_id",
202
+ name: 'academicCalendarId',
203
+ field: 'academic_calendar_id',
204
204
  allowNull: true,
205
205
  },
206
- as: "batchAcademicCalendar",
206
+ as: 'batchAcademicCalendar',
207
207
  });
208
208
  BatchModel.afterBulkCreate(async (instances, options) => {
209
209
  for (const instance of instances) {
@@ -1,7 +1,7 @@
1
- import { Model } from "sequelize";
2
- import { IDriverModelAttributes } from "../../interfaces/driverInterface.js";
3
- import { TDriverModelCreationAttributes } from "../../types/driverType.js";
4
- import { APP_TYPE, COMMAN_STATUS } from "../../constants/app.js";
1
+ import { Model } from 'sequelize';
2
+ import { IDriverModelAttributes } from '../../interfaces/driverInterface.js';
3
+ import { TDriverModelCreationAttributes } from '../../types/driverType.js';
4
+ import { APP_TYPE, COMMAN_STATUS } from '../../constants/app.js';
5
5
  declare class DriverModel extends Model<IDriverModelAttributes, TDriverModelCreationAttributes> {
6
6
  id: string;
7
7
  instituteId: string;
@@ -25,16 +25,16 @@ DriverModel.init({
25
25
  firstName: {
26
26
  type: sequelize_1.DataTypes.STRING(25),
27
27
  allowNull: false,
28
- field: "first_name",
28
+ field: 'first_name',
29
29
  },
30
30
  lastName: {
31
31
  type: sequelize_1.DataTypes.STRING(25),
32
32
  allowNull: false,
33
- field: "last_name",
33
+ field: 'last_name',
34
34
  },
35
35
  instituteId: {
36
36
  type: sequelize_1.DataTypes.UUID,
37
- field: "institute_id",
37
+ field: 'institute_id',
38
38
  allowNull: true,
39
39
  },
40
40
  address1: {
@@ -48,7 +48,7 @@ DriverModel.init({
48
48
  pinCode: {
49
49
  type: sequelize_1.DataTypes.STRING,
50
50
  allowNull: true,
51
- field: "pin_code",
51
+ field: 'pin_code',
52
52
  },
53
53
  country: {
54
54
  type: sequelize_1.DataTypes.INTEGER,
@@ -86,7 +86,7 @@ DriverModel.init({
86
86
  type: sequelize_1.DataTypes.ENUM,
87
87
  values: Object.values(app_js_1.APP_TYPE),
88
88
  allowNull: true,
89
- field: "app_type",
89
+ field: 'app_type',
90
90
  // defaultValue: APP_TYPE.SCHOOL_APP,
91
91
  },
92
92
  status: {
@@ -96,57 +96,57 @@ DriverModel.init({
96
96
  defaultValue: app_js_1.COMMAN_STATUS.ACTIVE,
97
97
  },
98
98
  }, {
99
- modelName: "DriverModel",
100
- tableName: "drivers",
99
+ modelName: 'DriverModel',
100
+ tableName: 'drivers',
101
101
  timestamps: true,
102
102
  sequelize: index_js_1.sequelize,
103
103
  });
104
104
  // Associations
105
105
  DriverModel.belongsTo(userModel_js_1.default, {
106
106
  foreignKey: {
107
- name: "createdBy",
107
+ name: 'createdBy',
108
108
  allowNull: true,
109
- field: "created_by",
109
+ field: 'created_by',
110
110
  },
111
- as: "createdByUser",
111
+ as: 'createdByUser',
112
112
  });
113
113
  DriverModel.belongsTo(userModel_js_1.default, {
114
114
  foreignKey: {
115
- name: "updatedBy",
115
+ name: 'updatedBy',
116
116
  allowNull: true,
117
- field: "updated_by",
117
+ field: 'updated_by',
118
118
  },
119
- as: "updatedByUser",
119
+ as: 'updatedByUser',
120
120
  });
121
121
  DriverModel.belongsTo(userModel_js_1.default, {
122
122
  foreignKey: {
123
- name: "deletedBy",
123
+ name: 'deletedBy',
124
124
  allowNull: true,
125
- field: "deleted_by",
125
+ field: 'deleted_by',
126
126
  },
127
- as: "deletedByUser",
127
+ as: 'deletedByUser',
128
128
  });
129
129
  DriverModel.belongsTo(countryModel_js_1.default, {
130
- foreignKey: "country",
131
- as: "countryDetails",
130
+ foreignKey: 'country',
131
+ as: 'countryDetails',
132
132
  });
133
- DriverModel.belongsTo(stateModel_js_1.default, { foreignKey: "state", as: "stateDetails" });
134
- DriverModel.belongsTo(cityModel_js_1.default, { foreignKey: "city", as: "cityDetails" });
133
+ DriverModel.belongsTo(stateModel_js_1.default, { foreignKey: 'state', as: 'stateDetails' });
134
+ DriverModel.belongsTo(cityModel_js_1.default, { foreignKey: 'city', as: 'cityDetails' });
135
135
  DriverModel.belongsTo(fileStorageModel_js_1.default, {
136
- foreignKey: "drivingLicense",
137
- as: "drivingLicenseDetails",
136
+ foreignKey: 'drivingLicense',
137
+ as: 'drivingLicenseDetails',
138
138
  });
139
139
  DriverModel.belongsTo(fileStorageModel_js_1.default, {
140
- foreignKey: "aadharCard",
141
- as: "aadharCardDetails",
140
+ foreignKey: 'aadharCard',
141
+ as: 'aadharCardDetails',
142
142
  });
143
143
  DriverModel.belongsTo(instituteModel_js_1.default, {
144
- foreignKey: "instituteId",
145
- as: "driverInstitute",
144
+ foreignKey: 'instituteId',
145
+ as: 'driverInstitute',
146
146
  });
147
147
  instituteModel_js_1.default.hasMany(DriverModel, {
148
- foreignKey: "instituteId",
149
- as: "instituteHasDrivers",
148
+ foreignKey: 'instituteId',
149
+ as: 'instituteHasDrivers',
150
150
  });
151
151
  const beforeCreateOrUpdateHook = async (driver) => {
152
152
  if (driver.instituteId) {
@@ -1,7 +1,7 @@
1
- import { Model } from "sequelize";
2
- import { IFacilityAttributes } from "../../interfaces/facilityInterface.js";
3
- import { TFacilityCreationAttributes } from "../../types/facilityType.js";
4
- import { FACILITY_TYPE } from "../../constants/app.js";
1
+ import { Model } from 'sequelize';
2
+ import { IFacilityAttributes } from '../../interfaces/facilityInterface.js';
3
+ import { TFacilityCreationAttributes } from '../../types/facilityType.js';
4
+ import { FACILITY_TYPE } from '../../constants/app.js';
5
5
  declare class FacilityModel extends Model<IFacilityAttributes, TFacilityCreationAttributes> {
6
6
  id: string;
7
7
  typeManagementId: string;
@@ -21,7 +21,7 @@ FacilityModel.init({
21
21
  },
22
22
  typeManagementId: {
23
23
  type: sequelize_1.DataTypes.UUID,
24
- field: "type_management_id",
24
+ field: 'type_management_id',
25
25
  allowNull: false,
26
26
  },
27
27
  quantity: {
@@ -36,12 +36,12 @@ FacilityModel.init({
36
36
  },
37
37
  instituteId: {
38
38
  type: sequelize_1.DataTypes.UUID,
39
- field: "institute_id",
39
+ field: 'institute_id',
40
40
  allowNull: false,
41
41
  },
42
42
  }, {
43
- modelName: "FacilityModel",
44
- tableName: "facilities",
43
+ modelName: 'FacilityModel',
44
+ tableName: 'facilities',
45
45
  timestamps: true,
46
46
  sequelize: index_js_1.sequelize,
47
47
  });
@@ -73,48 +73,48 @@ FacilityModel.beforeBulkCreate(async (instances) => {
73
73
  });
74
74
  FacilityModel.belongsTo(instituteModel_js_1.default, {
75
75
  foreignKey: {
76
- name: "instituteId",
77
- field: "institute_id",
76
+ name: 'instituteId',
77
+ field: 'institute_id',
78
78
  },
79
- as: "facilityInstitute",
79
+ as: 'facilityInstitute',
80
80
  });
81
81
  instituteModel_js_1.default.hasMany(FacilityModel, {
82
- foreignKey: "instituteId",
83
- as: "instituteHasFacilities",
82
+ foreignKey: 'instituteId',
83
+ as: 'instituteHasFacilities',
84
84
  });
85
85
  FacilityModel.belongsTo(typeManagementModel_js_1.default, {
86
86
  foreignKey: {
87
- name: "typeManagementId",
88
- field: "type_management_id",
87
+ name: 'typeManagementId',
88
+ field: 'type_management_id',
89
89
  },
90
- as: "facilityType",
90
+ as: 'facilityType',
91
91
  });
92
92
  typeManagementModel_js_1.default.hasMany(FacilityModel, {
93
- foreignKey: "typeManagementId",
94
- as: "instituteHasFacilitiesType",
93
+ foreignKey: 'typeManagementId',
94
+ as: 'instituteHasFacilitiesType',
95
95
  });
96
96
  FacilityModel.belongsTo(userModel_js_1.default, {
97
97
  foreignKey: {
98
- name: "createdBy",
98
+ name: 'createdBy',
99
99
  allowNull: true,
100
- field: "created_by",
100
+ field: 'created_by',
101
101
  },
102
- as: "createdByUser",
102
+ as: 'createdByUser',
103
103
  });
104
104
  FacilityModel.belongsTo(userModel_js_1.default, {
105
105
  foreignKey: {
106
- name: "updatedBy",
106
+ name: 'updatedBy',
107
107
  allowNull: true,
108
- field: "updated_by",
108
+ field: 'updated_by',
109
109
  },
110
- as: "updatedByUser",
110
+ as: 'updatedByUser',
111
111
  });
112
112
  FacilityModel.belongsTo(userModel_js_1.default, {
113
113
  foreignKey: {
114
- name: "deletedBy",
114
+ name: 'deletedBy',
115
115
  allowNull: true,
116
- field: "deleted_by",
116
+ field: 'deleted_by',
117
117
  },
118
- as: "deletedByUser",
118
+ as: 'deletedByUser',
119
119
  });
120
120
  exports.default = FacilityModel;
@@ -1,7 +1,7 @@
1
- import { Model } from "sequelize";
2
- import { IFeeHistoryModelAttributes } from "../../interfaces/feeHistoryInterface.js";
3
- import { TFeeHistoryModelCreationAttributes } from "../../types/feeHistoryType.js";
4
- import { FEE_HISTORY_STATUS, PAYMENT_TYPE } from "../../constants/app.js";
1
+ import { Model } from 'sequelize';
2
+ import { IFeeHistoryModelAttributes } from '../../interfaces/feeHistoryInterface.js';
3
+ import { TFeeHistoryModelCreationAttributes } from '../../types/feeHistoryType.js';
4
+ import { FEE_HISTORY_STATUS, PAYMENT_TYPE } from '../../constants/app.js';
5
5
  declare class FeeHistoryModel extends Model<IFeeHistoryModelAttributes, TFeeHistoryModelCreationAttributes> {
6
6
  id: string;
7
7
  instituteId: string;