@kipicore/dbcore 1.1.370 → 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, FeesCollectionModel } = models;
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 FeesCollectionModel.findOne({
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 FeesCollectionModel.findOne({
142
+ const validFeeCollection = await StudentFeeCollectionModel.findOne({
143
143
  where: {
144
144
  userId,
145
145
  instituteId,
@@ -5,7 +5,7 @@ const sequelize_1 = require("sequelize");
5
5
  const index_1 = require("./index");
6
6
  class StudentFeeTermsModel extends sequelize_1.Model {
7
7
  static associate(models) {
8
- const { UserModel, InstituteModel, AcademicCalendarModel, FeeType1Model, InstituteEntityModel, SchoolFeeCollectionModel } = models;
8
+ const { UserModel, InstituteModel, AcademicCalendarModel, FeeType1Model, InstituteEntityModel } = models;
9
9
  StudentFeeTermsModel.belongsTo(StudentFeeTermsModel, {
10
10
  foreignKey: { name: 'oldId', field: 'old_id', allowNull: true },
11
11
  as: 'studentOldFeeTerms',
@@ -22,14 +22,6 @@ class StudentFeeTermsModel extends sequelize_1.Model {
22
22
  foreignKey: { name: 'feeTypeId', field: 'fee_type_id', allowNull: true },
23
23
  as: 'studentTermsHasFeeType',
24
24
  });
25
- StudentFeeTermsModel.belongsTo(SchoolFeeCollectionModel, {
26
- foreignKey: { name: 'studentFeeCollectionId', field: 'student_fee_collection_id', allowNull: true },
27
- as: 'studentFeeTermsCollection',
28
- });
29
- SchoolFeeCollectionModel.hasMany(StudentFeeTermsModel, {
30
- foreignKey: { name: 'studentFeeCollectionId', field: 'student_fee_collection_id', allowNull: true },
31
- as: 'studentTermsHasFeeCollection',
32
- });
33
25
  StudentFeeTermsModel.belongsTo(UserModel, {
34
26
  foreignKey: { name: 'userId', field: 'user_id', allowNull: true },
35
27
  as: 'studentFeeTermsUser',
@@ -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, FeesCollectionModel, UserModel, InstituteEntityModel } = models;
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
- 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
- });
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.370",
3
+ "version": "1.1.372",
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",