@kipicore/dbcore 1.1.222 → 1.1.224

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.
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('student_fee_history');
4
+ // Check if column already exists
5
+ if (!table.history) {
6
+ await queryInterface.addColumn('student_fee_history', 'history', {
7
+ type: Sequelize.TEXT,
8
+ defaultValue: null,
9
+ allowNull: true,
10
+ field: 'history',
11
+ });
12
+ }
13
+ };
14
+ const down = async (queryInterface, Sequelize) => {
15
+ const table = await queryInterface.describeTable('student_fee_history');
16
+ // Remove only if column exists
17
+ if (table.history) {
18
+ await queryInterface.removeColumn('student_fee_history', 'history');
19
+ }
20
+ };
21
+ module.exports = {
22
+ up,
23
+ down,
24
+ };
@@ -7,7 +7,10 @@ export interface IFeeConfigModelAttributes extends IDefaultAttributes, Document
7
7
  academicCalendarId: string;
8
8
  feeCollectionTypes: FEE_COLLECTION_TYPE[];
9
9
  paymentMethods: PAYMENT_TYPE[];
10
- isRefundable: boolean;
11
- isTaxable: boolean;
12
10
  oldId?: string;
11
+ oldPendingFees: {
12
+ oldPendingAmount: string;
13
+ oldPaymentMethods: PAYMENT_TYPE[];
14
+ bankAccounts: string[];
15
+ };
13
16
  }
@@ -12,12 +12,13 @@ export interface IStudentFeeHistoryModelAttributes extends IDefaultAttributes {
12
12
  feeTypeId?: string;
13
13
  subjectId?: string;
14
14
  batchId?: string;
15
- bankAccountId?: string;
15
+ bankAccountId?: string | null;
16
16
  invoicePdf?: string;
17
17
  invoiceNumber?: string;
18
18
  studentFeeCollectionId: string;
19
19
  feeHistoryConfigId?: string;
20
20
  note?: string;
21
+ history?: string;
21
22
  paidDate: Date;
22
23
  upiId?: string;
23
24
  bankName?: string;
@@ -58,13 +58,22 @@ const FeeConfigSchema = new mongoose_1.Schema({
58
58
  required: true,
59
59
  },
60
60
  ],
61
- isRefundable: {
62
- type: Boolean,
63
- required: false,
64
- },
65
- isTaxable: {
66
- type: Boolean,
67
- required: false,
61
+ oldPendingFees: {
62
+ oldPendingAmount: {
63
+ type: String,
64
+ },
65
+ oldPaymentMethods: [
66
+ {
67
+ type: String,
68
+ enum: Object.values(app_1.PAYMENT_TYPE),
69
+ default: [],
70
+ },
71
+ ],
72
+ bankAccounts: [
73
+ {
74
+ type: String,
75
+ },
76
+ ],
68
77
  },
69
78
  oldId: {
70
79
  type: String,
@@ -5,7 +5,7 @@ const sequelize_1 = require("sequelize");
5
5
  const index_1 = require("./index");
6
6
  class SchoolFeeTermsModel extends sequelize_1.Model {
7
7
  static associate(models) {
8
- const { UserModel, InstituteModel, AcademicCalendarModel, FeeTypeModel, InstituteEntityModel } = models;
8
+ const { UserModel, InstituteModel, AcademicCalendarModel, FeeType1Model, InstituteEntityModel } = models;
9
9
  SchoolFeeTermsModel.belongsTo(SchoolFeeTermsModel, {
10
10
  foreignKey: { name: 'oldId', field: 'old_id', allowNull: true },
11
11
  as: 'schoolOldFeeTerms',
@@ -14,11 +14,11 @@ class SchoolFeeTermsModel extends sequelize_1.Model {
14
14
  foreignKey: { name: 'oldId', field: 'old_id', allowNull: true },
15
15
  as: 'schoolTermsHasOldTerms',
16
16
  });
17
- SchoolFeeTermsModel.belongsTo(FeeTypeModel, {
17
+ SchoolFeeTermsModel.belongsTo(FeeType1Model, {
18
18
  foreignKey: { name: 'feeTypeId', field: 'fee_type_id', allowNull: true },
19
19
  as: 'feeTermsFeeType',
20
20
  });
21
- FeeTypeModel.hasMany(SchoolFeeTermsModel, {
21
+ FeeType1Model.hasMany(SchoolFeeTermsModel, {
22
22
  foreignKey: { name: 'feeTypeId', field: 'fee_type_id', allowNull: true },
23
23
  as: 'schoolTermsHasFeeType',
24
24
  });
@@ -24,6 +24,7 @@ export declare class StudentFeeHistoryModel extends Model<IStudentFeeHistoryMode
24
24
  chequeNo?: string;
25
25
  batchId: string;
26
26
  subjectId: string;
27
+ history?: string;
27
28
  createdBy: string;
28
29
  updatedBy: string;
29
30
  deletedBy: string;
@@ -151,6 +151,7 @@ StudentFeeHistoryModel.init({
151
151
  chequeNo: { type: sequelize_1.DataTypes.STRING, allowNull: true },
152
152
  subjectId: { type: sequelize_1.DataTypes.UUID, field: 'subject_id', allowNull: true },
153
153
  batchId: { type: sequelize_1.DataTypes.UUID, field: 'batch_id', allowNull: true },
154
+ history: { type: sequelize_1.DataTypes.TEXT, field: 'history', allowNull: true },
154
155
  }, {
155
156
  modelName: 'StudentFeeHistoryModel',
156
157
  tableName: 'student_fee_history',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.222",
3
+ "version": "1.1.224",
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",