@kipicore/dbcore 1.1.491 → 1.1.493

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.
@@ -13,4 +13,8 @@ export interface IFeeConfigModelAttributes extends IDefaultAttributes, Document
13
13
  oldPaymentMethods: PAYMENT_TYPE[];
14
14
  bankAccounts: string[];
15
15
  };
16
+ penaltyFees: {
17
+ penaltyPaymentMethods: PAYMENT_TYPE[];
18
+ bankAccounts: string[];
19
+ };
16
20
  }
@@ -75,6 +75,20 @@ const FeeConfigSchema = new mongoose_1.Schema({
75
75
  },
76
76
  ],
77
77
  },
78
+ penaltyFees: {
79
+ penaltyPaymentMethods: [
80
+ {
81
+ type: String,
82
+ enum: Object.values(app_1.PAYMENT_TYPE),
83
+ default: [],
84
+ },
85
+ ],
86
+ bankAccounts: [
87
+ {
88
+ type: String,
89
+ },
90
+ ],
91
+ },
78
92
  oldId: {
79
93
  type: String,
80
94
  },
@@ -91,14 +91,13 @@ class LectureModel extends sequelize_1.Model {
91
91
  };
92
92
  if (lecture.id)
93
93
  where = { ...where, id: { [sequelize_1.Op.ne]: lecture.id } };
94
- if (lecture.classRoomId && lecture?.title?.toLowerCase()?.includes('lecture')) {
95
- const classRoomConflict = await LectureModel.findOne({
96
- where: { ...where, classRoomId: lecture.classRoomId },
97
- ...options,
98
- });
99
- if (classRoomConflict)
100
- throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.CLASSROOM_OCCUPIED);
101
- }
94
+ // if (lecture.classRoomId && lecture?.title?.toLowerCase()?.includes('lecture')) {
95
+ // const classRoomConflict = await LectureModel.findOne({
96
+ // where: { ...where, classRoomId: lecture.classRoomId },
97
+ // ...options,
98
+ // });
99
+ // if (classRoomConflict) throw new Error(LECTURE_ERROR_MESSAGES.CLASSROOM_OCCUPIED);
100
+ // }
102
101
  if (lecture.primaryUserId) {
103
102
  const teacherConflict = await LectureModel.findOne({
104
103
  where: { ...where, primaryUserId: lecture.primaryUserId },
@@ -115,13 +114,11 @@ class LectureModel extends sequelize_1.Model {
115
114
  if (teacherConflict)
116
115
  throw new Error(errorMessages_1.LECTURE_ERROR_MESSAGES.TEACHER_OCCUPIED);
117
116
  }
118
- if (lecture.batchId) {
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
- }
117
+ // if (lecture.batchId) {
118
+ // if (lecture.slotId) where.slotId = lecture.slotId;
119
+ // const batchConflict = await LectureModel.findOne({ where: { ...where, batchId: lecture.batchId }, ...options });
120
+ // if (batchConflict) throw new Error(LECTURE_ERROR_MESSAGES.BATCH_OCCUPIED);
121
+ // }
125
122
  // const teacherConflictWhere = omit(where, ['slotId']);
126
123
  }
127
124
  if (lecture.batchId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.491",
3
+ "version": "1.1.493",
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",