@kipicore/dbcore 1.1.492 → 1.1.494
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.
- package/dist/db/psql/migrations/20260105092543-user_has_penalties.js +50 -50
- package/dist/db/psql/migrations/20260501054431-add_field_to_for_cheque_user_has_penalties.js +2 -2
- package/dist/db/psql/migrations/20260504120741-remove-cheque-and-bank-columns_from_user_has_penalties.d.ts +2 -0
- package/dist/db/psql/migrations/20260504120741-remove-cheque-and-bank-columns_from_user_has_penalties.js +26 -0
- package/dist/interfaces/userHasPenaltyInterface.d.ts +1 -6
- package/dist/models/psql/lectureModel.js +36 -42
- package/dist/models/psql/userHasPenaltyModel.d.ts +1 -6
- package/dist/models/psql/userHasPenaltyModel.js +25 -25
- package/package.json +1 -1
|
@@ -83,31 +83,31 @@ const up = async (queryInterface, Sequelize) => {
|
|
|
83
83
|
allowNull: true,
|
|
84
84
|
field: 'adjustment_by',
|
|
85
85
|
},
|
|
86
|
-
paymentType: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
upiId: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
bankAccId: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
bankName: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
chequeNo: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
86
|
+
// paymentType: {
|
|
87
|
+
// type: Sequelize.STRING,
|
|
88
|
+
// allowNull: true,
|
|
89
|
+
// field: 'payment_type',
|
|
90
|
+
// },
|
|
91
|
+
// upiId: {
|
|
92
|
+
// type: Sequelize.STRING,
|
|
93
|
+
// allowNull: true,
|
|
94
|
+
// field: 'upi_id',
|
|
95
|
+
// },
|
|
96
|
+
// bankAccId: {
|
|
97
|
+
// type: Sequelize.UUID,
|
|
98
|
+
// allowNull: true,
|
|
99
|
+
// field: 'bank_acc_id',
|
|
100
|
+
// },
|
|
101
|
+
// bankName: {
|
|
102
|
+
// type: Sequelize.STRING,
|
|
103
|
+
// allowNull: true,
|
|
104
|
+
// field: 'bank_name',
|
|
105
|
+
// },
|
|
106
|
+
// chequeNo: {
|
|
107
|
+
// type: Sequelize.STRING,
|
|
108
|
+
// allowNull: true,
|
|
109
|
+
// field: 'cheque_no',
|
|
110
|
+
// },
|
|
111
111
|
createdBy: {
|
|
112
112
|
type: Sequelize.UUID,
|
|
113
113
|
allowNull: true,
|
|
@@ -220,31 +220,31 @@ const up = async (queryInterface, Sequelize) => {
|
|
|
220
220
|
allowNull: true,
|
|
221
221
|
field: 'adjustment_by',
|
|
222
222
|
},
|
|
223
|
-
paymentType: {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
},
|
|
228
|
-
upiId: {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
bankAccId: {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
bankName: {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
chequeNo: {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
},
|
|
223
|
+
// paymentType: {
|
|
224
|
+
// type: Sequelize.STRING,
|
|
225
|
+
// allowNull: true,
|
|
226
|
+
// field: 'payment_type',
|
|
227
|
+
// },
|
|
228
|
+
// upiId: {
|
|
229
|
+
// type: Sequelize.STRING,
|
|
230
|
+
// allowNull: true,
|
|
231
|
+
// field: 'upi_id',
|
|
232
|
+
// },
|
|
233
|
+
// bankAccId: {
|
|
234
|
+
// type: Sequelize.UUID,
|
|
235
|
+
// allowNull: true,
|
|
236
|
+
// field: 'bank_acc_id',
|
|
237
|
+
// },
|
|
238
|
+
// bankName: {
|
|
239
|
+
// type: Sequelize.STRING,
|
|
240
|
+
// allowNull: true,
|
|
241
|
+
// field: 'bank_name',
|
|
242
|
+
// },
|
|
243
|
+
// chequeNo: {
|
|
244
|
+
// type: Sequelize.STRING,
|
|
245
|
+
// allowNull: true,
|
|
246
|
+
// field: 'cheque_no',
|
|
247
|
+
// },
|
|
248
248
|
createdBy: {
|
|
249
249
|
type: Sequelize.UUID,
|
|
250
250
|
allowNull: true,
|
package/dist/db/psql/migrations/20260501054431-add_field_to_for_cheque_user_has_penalties.js
CHANGED
|
@@ -39,8 +39,8 @@ const up = async (queryInterface, Sequelize) => {
|
|
|
39
39
|
};
|
|
40
40
|
const down = async (queryInterface) => {
|
|
41
41
|
const table = await queryInterface.describeTable('user_has_penalties');
|
|
42
|
-
if (table.
|
|
43
|
-
await queryInterface.removeColumn('user_has_penalties', '
|
|
42
|
+
if (table.payment_type) {
|
|
43
|
+
await queryInterface.removeColumn('user_has_penalties', 'payment_type');
|
|
44
44
|
}
|
|
45
45
|
if (table.upi_id) {
|
|
46
46
|
await queryInterface.removeColumn('user_has_penalties', 'upi_id');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const up = async (queryInterface) => {
|
|
3
|
+
const table = await queryInterface.describeTable('user_has_penalties');
|
|
4
|
+
if (table.payment_type) {
|
|
5
|
+
await queryInterface.removeColumn('user_has_penalties', 'payment_type');
|
|
6
|
+
}
|
|
7
|
+
if (table.upi_id) {
|
|
8
|
+
await queryInterface.removeColumn('user_has_penalties', 'upi_id');
|
|
9
|
+
}
|
|
10
|
+
if (table.bank_acc_id) {
|
|
11
|
+
await queryInterface.removeColumn('user_has_penalties', 'bank_acc_id');
|
|
12
|
+
}
|
|
13
|
+
if (table.bank_name) {
|
|
14
|
+
await queryInterface.removeColumn('user_has_penalties', 'bank_name');
|
|
15
|
+
}
|
|
16
|
+
if (table.cheque_no) {
|
|
17
|
+
await queryInterface.removeColumn('user_has_penalties', 'cheque_no');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const down = () => {
|
|
21
|
+
// intentionally empty — no rollback
|
|
22
|
+
};
|
|
23
|
+
module.exports = {
|
|
24
|
+
up,
|
|
25
|
+
down,
|
|
26
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PAYMENT_STATUS,
|
|
1
|
+
import { PAYMENT_STATUS, USER_HAS_PENALTY_TITLE, USER_HAS_PENALTY_TYPE } from '../constants';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface IUserHasPenaltyModelAttributes extends IDefaultAttributes {
|
|
4
4
|
id?: string;
|
|
@@ -15,9 +15,4 @@ export interface IUserHasPenaltyModelAttributes extends IDefaultAttributes {
|
|
|
15
15
|
description?: string;
|
|
16
16
|
adjustmentAt?: Date;
|
|
17
17
|
adjustmentBy?: string;
|
|
18
|
-
paymentType: PAYMENT_TYPE;
|
|
19
|
-
upiId: string;
|
|
20
|
-
bankName: string;
|
|
21
|
-
chequeNo: string;
|
|
22
|
-
bankAccId: string;
|
|
23
18
|
}
|
|
@@ -80,48 +80,42 @@ class LectureModel extends sequelize_1.Model {
|
|
|
80
80
|
throw new Error(errorMessages_1.BATCH_ERROR_MESSAGES.INVALID_SELECTED);
|
|
81
81
|
}
|
|
82
82
|
if (lecture.workingDayId && lecture.startTime && lecture.endTime) {
|
|
83
|
-
let where = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
};
|
|
92
|
-
if (lecture.id)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (lecture.slotId)
|
|
120
|
-
where.slotId = lecture.slotId;
|
|
121
|
-
const batchConflict = await LectureModel.findOne({ where: { ...where, batchId: lecture.batchId }, ...options });
|
|
122
|
-
if (batchConflict)
|
|
123
|
-
throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.BATCH_OCCUPIED);
|
|
124
|
-
}
|
|
83
|
+
// let where: WhereOptions = {
|
|
84
|
+
// [Op.or]: [
|
|
85
|
+
// { [Op.and]: [{ startTime: { [Op.lte]: lecture.startTime } }, { endTime: { [Op.gt]: lecture.startTime } }] },
|
|
86
|
+
// { [Op.and]: [{ startTime: { [Op.lt]: lecture.endTime } }, { endTime: { [Op.gte]: lecture.endTime } }] },
|
|
87
|
+
// { [Op.and]: [{ startTime: { [Op.gte]: lecture.startTime } }, { endTime: { [Op.lte]: lecture.endTime } }] },
|
|
88
|
+
// ],
|
|
89
|
+
// instituteId: lecture.instituteId,
|
|
90
|
+
// workingDayId: lecture.workingDayId,
|
|
91
|
+
// };
|
|
92
|
+
// if (lecture.id) where = { ...where, id: { [Op.ne]: lecture.id } };
|
|
93
|
+
// if (lecture.classRoomId && lecture?.title?.toLowerCase()?.includes('lecture')) {
|
|
94
|
+
// const classRoomConflict = await LectureModel.findOne({
|
|
95
|
+
// where: { ...where, classRoomId: lecture.classRoomId },
|
|
96
|
+
// ...options,
|
|
97
|
+
// });
|
|
98
|
+
// if (classRoomConflict) throw new Error(LECTURE_ERROR_MESSAGES.CLASSROOM_OCCUPIED);
|
|
99
|
+
// }
|
|
100
|
+
// if (lecture.primaryUserId) {
|
|
101
|
+
// const teacherConflict = await LectureModel.findOne({
|
|
102
|
+
// where: { ...where, primaryUserId: lecture.primaryUserId },
|
|
103
|
+
// ...options,
|
|
104
|
+
// });
|
|
105
|
+
// if (teacherConflict) throw new Error(LECTURE_ERROR_MESSAGES.TEACHER_OCCUPIED);
|
|
106
|
+
// }
|
|
107
|
+
// if (lecture.secondaryUserId) {
|
|
108
|
+
// const teacherConflict = await LectureModel.findOne({
|
|
109
|
+
// where: { ...where, secondaryUserId: lecture.secondaryUserId },
|
|
110
|
+
// ...options,
|
|
111
|
+
// });
|
|
112
|
+
// if (teacherConflict) throw new Error(LECTURE_ERROR_MESSAGES.TEACHER_OCCUPIED);
|
|
113
|
+
// }
|
|
114
|
+
// if (lecture.batchId) {
|
|
115
|
+
// if (lecture.slotId) where.slotId = lecture.slotId;
|
|
116
|
+
// const batchConflict = await LectureModel.findOne({ where: { ...where, batchId: lecture.batchId }, ...options });
|
|
117
|
+
// if (batchConflict) throw new Error(LECTURE_ERROR_MESSAGES.BATCH_OCCUPIED);
|
|
118
|
+
// }
|
|
125
119
|
// const teacherConflictWhere = omit(where, ['slotId']);
|
|
126
120
|
}
|
|
127
121
|
if (lecture.batchId) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Model } from 'sequelize';
|
|
2
2
|
import { IUserHasPenaltyModelAttributes } from '../../interfaces/userHasPenaltyInterface';
|
|
3
3
|
import { TUserHasPenaltyModelCreationAttributes } from '../../types/userHasPenaltyType';
|
|
4
|
-
import { PAYMENT_STATUS,
|
|
4
|
+
import { PAYMENT_STATUS, USER_HAS_PENALTY_TITLE, USER_HAS_PENALTY_TYPE } from '../../constants';
|
|
5
5
|
declare class UserHasPenaltyModel extends Model<IUserHasPenaltyModelAttributes, TUserHasPenaltyModelCreationAttributes> {
|
|
6
6
|
id: string;
|
|
7
7
|
userId: string;
|
|
@@ -17,11 +17,6 @@ declare class UserHasPenaltyModel extends Model<IUserHasPenaltyModelAttributes,
|
|
|
17
17
|
academicCalendarId?: string;
|
|
18
18
|
type?: USER_HAS_PENALTY_TYPE;
|
|
19
19
|
title?: USER_HAS_PENALTY_TITLE;
|
|
20
|
-
paymentType?: PAYMENT_TYPE;
|
|
21
|
-
upiId: string;
|
|
22
|
-
bankName: string;
|
|
23
|
-
chequeNo: string;
|
|
24
|
-
bankAccId: string;
|
|
25
20
|
createdBy: string;
|
|
26
21
|
updatedBy: string;
|
|
27
22
|
deletedBy: string;
|
|
@@ -153,32 +153,32 @@ UserHasPenaltyModel.init({
|
|
|
153
153
|
type: sequelize_1.DataTypes.UUID,
|
|
154
154
|
allowNull: true,
|
|
155
155
|
field: 'adjustment_by'
|
|
156
|
-
},
|
|
157
|
-
paymentType: {
|
|
158
|
-
type: sequelize_1.DataTypes.STRING,
|
|
159
|
-
allowNull: true,
|
|
160
|
-
field: 'payment_type',
|
|
161
|
-
},
|
|
162
|
-
upiId: {
|
|
163
|
-
type: sequelize_1.DataTypes.STRING,
|
|
164
|
-
allowNull: true,
|
|
165
|
-
field: 'upi_id'
|
|
166
|
-
},
|
|
167
|
-
bankAccId: {
|
|
168
|
-
type: sequelize_1.DataTypes.UUID,
|
|
169
|
-
allowNull: true,
|
|
170
|
-
field: 'bank_acc_id',
|
|
171
|
-
},
|
|
172
|
-
bankName: {
|
|
173
|
-
type: sequelize_1.DataTypes.STRING,
|
|
174
|
-
allowNull: true,
|
|
175
|
-
field: 'bank_name'
|
|
176
|
-
},
|
|
177
|
-
chequeNo: {
|
|
178
|
-
type: sequelize_1.DataTypes.STRING,
|
|
179
|
-
allowNull: true,
|
|
180
|
-
field: 'cheque_no'
|
|
181
156
|
}
|
|
157
|
+
// paymentType: {
|
|
158
|
+
// type: DataTypes.STRING,
|
|
159
|
+
// allowNull: true,
|
|
160
|
+
// field: 'payment_type',
|
|
161
|
+
// },
|
|
162
|
+
// upiId: {
|
|
163
|
+
// type: DataTypes.STRING,
|
|
164
|
+
// allowNull: true,
|
|
165
|
+
// field: 'upi_id'
|
|
166
|
+
// },
|
|
167
|
+
// bankAccId: {
|
|
168
|
+
// type: DataTypes.UUID,
|
|
169
|
+
// allowNull: true,
|
|
170
|
+
// field: 'bank_acc_id',
|
|
171
|
+
// },
|
|
172
|
+
// bankName: {
|
|
173
|
+
// type: DataTypes.STRING,
|
|
174
|
+
// allowNull: true,
|
|
175
|
+
// field: 'bank_name'
|
|
176
|
+
// },
|
|
177
|
+
// chequeNo: {
|
|
178
|
+
// type: DataTypes.STRING,
|
|
179
|
+
// allowNull: true,
|
|
180
|
+
// field: 'cheque_no'
|
|
181
|
+
// }
|
|
182
182
|
}, {
|
|
183
183
|
modelName: 'UserHasPenaltyModel',
|
|
184
184
|
tableName: 'user_has_penalties',
|
package/package.json
CHANGED