@kipicore/dbcore 1.1.371 → 1.1.372
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.
|
@@ -61,7 +61,7 @@ class FeeReminderModel extends sequelize_1.Model {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
static addHooks(models) {
|
|
64
|
-
const { BatchModel, UserHasBatchModel,
|
|
64
|
+
const { BatchModel, UserHasBatchModel, StudentFeeCollectionModel } = models;
|
|
65
65
|
const beforeCreateHook = async (feeReminder) => {
|
|
66
66
|
if (feeReminder.userId && feeReminder.batchId && feeReminder.instituteId) {
|
|
67
67
|
const { batchId, instituteId, userId } = feeReminder;
|
|
@@ -90,7 +90,7 @@ class FeeReminderModel extends sequelize_1.Model {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
if (feeReminder.feeCollectionId) {
|
|
93
|
-
const validFeeCollection = await
|
|
93
|
+
const validFeeCollection = await StudentFeeCollectionModel.findOne({
|
|
94
94
|
where: {
|
|
95
95
|
userId,
|
|
96
96
|
instituteId,
|
|
@@ -139,7 +139,7 @@ class FeeReminderModel extends sequelize_1.Model {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
if (feeReminder.feeCollectionId) {
|
|
142
|
-
const validFeeCollection = await
|
|
142
|
+
const validFeeCollection = await StudentFeeCollectionModel.findOne({
|
|
143
143
|
where: {
|
|
144
144
|
userId,
|
|
145
145
|
instituteId,
|
|
@@ -4,7 +4,7 @@ const sequelize_1 = require("sequelize");
|
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
class SubjectHasPayFeeHistory extends sequelize_1.Model {
|
|
6
6
|
static associate(models) {
|
|
7
|
-
const { InstituteModel,
|
|
7
|
+
const { InstituteModel, UserModel, InstituteEntityModel } = models;
|
|
8
8
|
SubjectHasPayFeeHistory.belongsTo(InstituteModel, {
|
|
9
9
|
foreignKey: {
|
|
10
10
|
name: 'instituteId',
|
|
@@ -16,17 +16,17 @@ class SubjectHasPayFeeHistory extends sequelize_1.Model {
|
|
|
16
16
|
foreignKey: 'instituteId',
|
|
17
17
|
as: 'instituteHasSubjectHasPayFeeHistory',
|
|
18
18
|
});
|
|
19
|
-
FeesCollectionModel.hasMany(SubjectHasPayFeeHistory, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
SubjectHasPayFeeHistory.belongsTo(FeesCollectionModel, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
19
|
+
// FeesCollectionModel.hasMany(SubjectHasPayFeeHistory, {
|
|
20
|
+
// foreignKey: 'feeCollectionId',
|
|
21
|
+
// as: 'feesCollectionHasSubjectHasPayFeeHistory',
|
|
22
|
+
// });
|
|
23
|
+
// SubjectHasPayFeeHistory.belongsTo(FeesCollectionModel, {
|
|
24
|
+
// foreignKey: {
|
|
25
|
+
// name: 'feeCollectionId',
|
|
26
|
+
// field: 'fee_collection_id',
|
|
27
|
+
// },
|
|
28
|
+
// as: 'subjectHasPayFeeHistoryFeesCollection',
|
|
29
|
+
// });
|
|
30
30
|
SubjectHasPayFeeHistory.belongsTo(UserModel, {
|
|
31
31
|
foreignKey: {
|
|
32
32
|
name: 'userId',
|
package/package.json
CHANGED