@kipicore/dbcore 1.1.188 → 1.1.190

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.
Files changed (49) hide show
  1. package/README.md +3 -0
  2. package/dist/constants/app.d.ts +7 -0
  3. package/dist/constants/app.js +12 -4
  4. package/dist/constants/errorMessages.d.ts +2 -1
  5. package/dist/constants/errorMessages.js +1 -0
  6. package/dist/db/psql/migrations/20260101103458-student_fee_collection.d.ts +2 -0
  7. package/dist/db/psql/migrations/20260101103458-student_fee_collection.js +218 -0
  8. package/dist/db/psql/migrations/20260102085140-student_histroy.d.ts +2 -0
  9. package/dist/db/psql/migrations/20260102085140-student_histroy.js +258 -0
  10. package/dist/db/psql/migrations/20260105053705-school_fee_terms.d.ts +2 -0
  11. package/dist/db/psql/migrations/20260105053705-school_fee_terms.js +192 -0
  12. package/dist/db/psql/migrations/20260105070348-student_feeType_collection.d.ts +2 -0
  13. package/dist/db/psql/migrations/20260105070348-student_feeType_collection.js +204 -0
  14. package/dist/interfaces/feeTypeInterface.d.ts +6 -1
  15. package/dist/interfaces/index.d.ts +4 -0
  16. package/dist/interfaces/index.js +4 -0
  17. package/dist/interfaces/schoolFee1Interface.d.ts +1 -6
  18. package/dist/interfaces/schoolFeeTermsInterface.d.ts +14 -0
  19. package/dist/interfaces/schoolFeeTermsInterface.js +2 -0
  20. package/dist/interfaces/studentFeeCollectionInterface.d.ts +18 -0
  21. package/dist/interfaces/studentFeeCollectionInterface.js +2 -0
  22. package/dist/interfaces/studentFeeHistoryInterface.d.ts +23 -0
  23. package/dist/interfaces/studentFeeHistoryInterface.js +2 -0
  24. package/dist/interfaces/studentFeeTypeCollectionInterface.d.ts +15 -0
  25. package/dist/interfaces/studentFeeTypeCollectionInterface.js +2 -0
  26. package/dist/models/mongodb/schoolFee1Model.js +24 -21
  27. package/dist/models/psql/feeTypeModel.d.ts +6 -1
  28. package/dist/models/psql/feeTypeModel.js +26 -11
  29. package/dist/models/psql/index.d.ts +4 -0
  30. package/dist/models/psql/index.js +9 -1
  31. package/dist/models/psql/schoolFeeTermsModel.d.ts +24 -0
  32. package/dist/models/psql/schoolFeeTermsModel.js +121 -0
  33. package/dist/models/psql/studentFeeCollectionModel.d.ts +29 -0
  34. package/dist/models/psql/studentFeeCollectionModel.js +152 -0
  35. package/dist/models/psql/studentFeeHistoryModel.d.ts +34 -0
  36. package/dist/models/psql/studentFeeHistoryModel.js +134 -0
  37. package/dist/models/psql/studentFeeTypeCollectionModel.d.ts +26 -0
  38. package/dist/models/psql/studentFeeTypeCollectionModel.js +96 -0
  39. package/dist/types/index.d.ts +4 -0
  40. package/dist/types/index.js +4 -0
  41. package/dist/types/schoolFeeTermsType.d.ts +3 -0
  42. package/dist/types/schoolFeeTermsType.js +2 -0
  43. package/dist/types/studentFeeCollectionType.d.ts +3 -0
  44. package/dist/types/studentFeeCollectionType.js +2 -0
  45. package/dist/types/studentFeeHistoryType.d.ts +3 -0
  46. package/dist/types/studentFeeHistoryType.js +2 -0
  47. package/dist/types/studentFeeTypeCollectionType.d.ts +3 -0
  48. package/dist/types/studentFeeTypeCollectionType.js +2 -0
  49. package/package.json +3 -2
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const tableName = 'school_fee_terms';
4
+ const tableExists = await queryInterface
5
+ .describeTable(tableName)
6
+ .then(() => true)
7
+ .catch(() => false);
8
+ if (!tableExists) {
9
+ await queryInterface.createTable(tableName, {
10
+ id: {
11
+ type: Sequelize.UUID,
12
+ defaultValue: Sequelize.UUIDV4,
13
+ allowNull: false,
14
+ primaryKey: true,
15
+ },
16
+ instituteId: {
17
+ type: Sequelize.UUID,
18
+ allowNull: true,
19
+ field: 'institute_id',
20
+ },
21
+ academicCalendarId: {
22
+ type: Sequelize.UUID,
23
+ allowNull: true,
24
+ field: 'academic_calendar_id',
25
+ },
26
+ stdId: {
27
+ type: Sequelize.UUID,
28
+ allowNull: true,
29
+ field: 'std_id',
30
+ },
31
+ feeTypeId: {
32
+ type: Sequelize.UUID,
33
+ allowNull: true,
34
+ field: 'fee_type_id',
35
+ },
36
+ frequency: {
37
+ type: Sequelize.STRING,
38
+ allowNull: true,
39
+ },
40
+ amount: {
41
+ type: Sequelize.INTEGER,
42
+ allowNull: true,
43
+ },
44
+ date: {
45
+ type: Sequelize.DATE,
46
+ allowNull: true,
47
+ },
48
+ oldId: {
49
+ type: Sequelize.UUID,
50
+ allowNull: true,
51
+ field: 'old_id',
52
+ },
53
+ termsDependedId: {
54
+ type: Sequelize.STRING,
55
+ allowNull: true,
56
+ field: 'terms_depended_id',
57
+ },
58
+ createdBy: {
59
+ type: Sequelize.UUID,
60
+ allowNull: true,
61
+ field: 'created_by',
62
+ },
63
+ updatedBy: {
64
+ type: Sequelize.UUID,
65
+ allowNull: true,
66
+ field: 'updated_by',
67
+ },
68
+ deletedBy: {
69
+ type: Sequelize.UUID,
70
+ allowNull: true,
71
+ field: 'deleted_by',
72
+ },
73
+ createdAt: {
74
+ type: Sequelize.DATE,
75
+ allowNull: false,
76
+ defaultValue: Sequelize.NOW,
77
+ field: 'created_at',
78
+ },
79
+ updatedAt: {
80
+ type: Sequelize.DATE,
81
+ allowNull: false,
82
+ defaultValue: Sequelize.NOW,
83
+ field: 'updated_at',
84
+ },
85
+ deletedAt: {
86
+ type: Sequelize.DATE,
87
+ allowNull: true,
88
+ field: 'deleted_at',
89
+ },
90
+ });
91
+ }
92
+ else {
93
+ const tableDefinition = await queryInterface.describeTable(tableName);
94
+ const columnsToAdd = {
95
+ instituteId: {
96
+ type: Sequelize.UUID,
97
+ allowNull: true,
98
+ field: 'institute_id',
99
+ },
100
+ academicCalendarId: {
101
+ type: Sequelize.UUID,
102
+ allowNull: true,
103
+ field: 'academic_calendar_id',
104
+ },
105
+ stdId: {
106
+ type: Sequelize.UUID,
107
+ allowNull: true,
108
+ field: 'std_id',
109
+ },
110
+ feeTypeId: {
111
+ type: Sequelize.UUID,
112
+ allowNull: true,
113
+ field: 'fee_type_id',
114
+ },
115
+ frequency: {
116
+ type: Sequelize.STRING,
117
+ allowNull: true,
118
+ },
119
+ amount: {
120
+ type: Sequelize.INTEGER,
121
+ allowNull: true,
122
+ },
123
+ date: {
124
+ type: Sequelize.DATE,
125
+ allowNull: true,
126
+ },
127
+ oldId: {
128
+ type: Sequelize.UUID,
129
+ allowNull: true,
130
+ field: 'old_id',
131
+ },
132
+ termsDependedId: {
133
+ type: Sequelize.STRING,
134
+ allowNull: true,
135
+ field: 'terms_depended_id',
136
+ },
137
+ createdBy: {
138
+ type: Sequelize.UUID,
139
+ allowNull: true,
140
+ field: 'created_by',
141
+ },
142
+ updatedBy: {
143
+ type: Sequelize.UUID,
144
+ allowNull: true,
145
+ field: 'updated_by',
146
+ },
147
+ deletedBy: {
148
+ type: Sequelize.UUID,
149
+ allowNull: true,
150
+ field: 'deleted_by',
151
+ },
152
+ createdAt: {
153
+ type: Sequelize.DATE,
154
+ allowNull: false,
155
+ defaultValue: Sequelize.NOW,
156
+ field: 'created_at',
157
+ },
158
+ updatedAt: {
159
+ type: Sequelize.DATE,
160
+ allowNull: false,
161
+ defaultValue: Sequelize.NOW,
162
+ field: 'updated_at',
163
+ },
164
+ deletedAt: {
165
+ type: Sequelize.DATE,
166
+ allowNull: true,
167
+ field: 'deleted_at',
168
+ },
169
+ };
170
+ for (const column of Object.keys(columnsToAdd)) {
171
+ const columnToAdd = columnsToAdd[column];
172
+ const tableColumn = columnToAdd.field || column;
173
+ if (!tableDefinition[tableColumn]) {
174
+ await queryInterface.addColumn(tableName, tableColumn, columnToAdd);
175
+ }
176
+ }
177
+ }
178
+ };
179
+ const down = async (queryInterface) => {
180
+ const tableName = 'school_fee_terms';
181
+ const tableExists = await queryInterface
182
+ .describeTable(tableName)
183
+ .then(() => true)
184
+ .catch(() => false);
185
+ if (tableExists) {
186
+ await queryInterface.dropTable(tableName);
187
+ }
188
+ };
189
+ module.exports = {
190
+ up,
191
+ down,
192
+ };
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -0,0 +1,204 @@
1
+ "use strict";
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const tableName = 'student_fee_type_collection';
4
+ const tableExists = await queryInterface
5
+ .describeTable(tableName)
6
+ .then(() => true)
7
+ .catch(() => false);
8
+ if (!tableExists) {
9
+ await queryInterface.createTable(tableName, {
10
+ id: {
11
+ type: Sequelize.UUID,
12
+ defaultValue: Sequelize.UUIDV4,
13
+ allowNull: false,
14
+ primaryKey: true,
15
+ },
16
+ instituteId: {
17
+ type: Sequelize.UUID,
18
+ allowNull: true,
19
+ field: 'institute_id',
20
+ },
21
+ userId: {
22
+ type: Sequelize.UUID,
23
+ allowNull: true,
24
+ field: 'user_id',
25
+ },
26
+ academicCalendarId: {
27
+ type: Sequelize.UUID,
28
+ allowNull: true,
29
+ field: 'academic_calendar_id',
30
+ },
31
+ studentFeeCollectionId: {
32
+ type: Sequelize.UUID,
33
+ allowNull: true,
34
+ field: 'student_fee_collection_id',
35
+ },
36
+ feeTypeId: {
37
+ type: Sequelize.UUID,
38
+ allowNull: true,
39
+ field: 'fee_type_id',
40
+ },
41
+ oldId: {
42
+ type: Sequelize.UUID,
43
+ allowNull: true,
44
+ field: 'old_id',
45
+ },
46
+ amount: {
47
+ type: Sequelize.INTEGER,
48
+ allowNull: true,
49
+ },
50
+ paidAmount: {
51
+ type: Sequelize.INTEGER,
52
+ allowNull: true,
53
+ field: 'paid_amount',
54
+ },
55
+ discount: {
56
+ type: Sequelize.INTEGER,
57
+ allowNull: true,
58
+ },
59
+ status: {
60
+ type: Sequelize.STRING,
61
+ allowNull: true,
62
+ defaultValue: 'PENDING',
63
+ },
64
+ createdBy: {
65
+ type: Sequelize.UUID,
66
+ allowNull: true,
67
+ field: 'created_by',
68
+ },
69
+ updatedBy: {
70
+ type: Sequelize.UUID,
71
+ allowNull: true,
72
+ field: 'updated_by',
73
+ },
74
+ deletedBy: {
75
+ type: Sequelize.UUID,
76
+ allowNull: true,
77
+ field: 'deleted_by',
78
+ },
79
+ createdAt: {
80
+ type: Sequelize.DATE,
81
+ allowNull: false,
82
+ defaultValue: Sequelize.NOW,
83
+ field: 'created_at',
84
+ },
85
+ updatedAt: {
86
+ type: Sequelize.DATE,
87
+ allowNull: false,
88
+ defaultValue: Sequelize.NOW,
89
+ field: 'updated_at',
90
+ },
91
+ deletedAt: {
92
+ type: Sequelize.DATE,
93
+ allowNull: true,
94
+ field: 'deleted_at',
95
+ },
96
+ });
97
+ }
98
+ else {
99
+ const tableDefinition = await queryInterface.describeTable(tableName);
100
+ const columnsToAdd = {
101
+ instituteId: {
102
+ type: Sequelize.UUID,
103
+ allowNull: true,
104
+ field: 'institute_id',
105
+ },
106
+ userId: {
107
+ type: Sequelize.UUID,
108
+ allowNull: true,
109
+ field: 'user_id',
110
+ },
111
+ academicCalendarId: {
112
+ type: Sequelize.UUID,
113
+ allowNull: true,
114
+ field: 'academic_calendar_id',
115
+ },
116
+ studentFeeCollectionId: {
117
+ type: Sequelize.UUID,
118
+ allowNull: true,
119
+ field: 'student_fee_collection_id',
120
+ },
121
+ feeTypeId: {
122
+ type: Sequelize.UUID,
123
+ allowNull: true,
124
+ field: 'fee_type_id',
125
+ },
126
+ oldId: {
127
+ type: Sequelize.UUID,
128
+ allowNull: true,
129
+ field: 'old_id',
130
+ },
131
+ amount: {
132
+ type: Sequelize.INTEGER,
133
+ allowNull: true,
134
+ },
135
+ paidAmount: {
136
+ type: Sequelize.INTEGER,
137
+ allowNull: true,
138
+ field: 'paid_amount',
139
+ },
140
+ discount: {
141
+ type: Sequelize.INTEGER,
142
+ allowNull: true,
143
+ },
144
+ status: {
145
+ type: Sequelize.STRING,
146
+ allowNull: true,
147
+ defaultValue: 'PENDING',
148
+ },
149
+ createdBy: {
150
+ type: Sequelize.UUID,
151
+ allowNull: true,
152
+ field: 'created_by',
153
+ },
154
+ updatedBy: {
155
+ type: Sequelize.UUID,
156
+ allowNull: true,
157
+ field: 'updated_by',
158
+ },
159
+ deletedBy: {
160
+ type: Sequelize.UUID,
161
+ allowNull: true,
162
+ field: 'deleted_by',
163
+ },
164
+ createdAt: {
165
+ type: Sequelize.DATE,
166
+ allowNull: false,
167
+ defaultValue: Sequelize.NOW,
168
+ field: 'created_at',
169
+ },
170
+ updatedAt: {
171
+ type: Sequelize.DATE,
172
+ allowNull: false,
173
+ defaultValue: Sequelize.NOW,
174
+ field: 'updated_at',
175
+ },
176
+ deletedAt: {
177
+ type: Sequelize.DATE,
178
+ allowNull: true,
179
+ field: 'deleted_at',
180
+ },
181
+ };
182
+ for (const column of Object.keys(columnsToAdd)) {
183
+ const columnToAdd = columnsToAdd[column];
184
+ const tableColumn = columnToAdd.field || column;
185
+ if (!tableDefinition[tableColumn]) {
186
+ await queryInterface.addColumn(tableName, tableColumn, columnToAdd);
187
+ }
188
+ }
189
+ }
190
+ };
191
+ const down = async (queryInterface) => {
192
+ const tableName = 'student_fee_type_collection';
193
+ const tableExists = await queryInterface
194
+ .describeTable(tableName)
195
+ .then(() => true)
196
+ .catch(() => false);
197
+ if (tableExists) {
198
+ await queryInterface.dropTable(tableName);
199
+ }
200
+ };
201
+ module.exports = {
202
+ up,
203
+ down,
204
+ };
@@ -7,7 +7,12 @@ export interface IFeeTypeModelAttributes extends IDefaultAttributes {
7
7
  feeType: FEE_TYPE;
8
8
  module: COMMAN_STATUS;
9
9
  status: COMMAN_STATUS;
10
- account: string;
10
+ account: string[];
11
+ isCreditAllowed: boolean;
12
+ isCashAllowed: boolean;
13
+ isRefundable: boolean;
14
+ isTaxable: boolean;
15
+ isRequired: boolean;
11
16
  instituteId: string;
12
17
  isDefault: BOOLEAN_STATUS;
13
18
  academicCalendarId: string;
@@ -165,5 +165,9 @@ export * from './userDirectoryInterface';
165
165
  export * from './feeConfigInterface';
166
166
  export * from './schoolFee1Interface';
167
167
  export * from './instituteFeeInterface';
168
+ export * from './studentFeeCollectionInterface';
169
+ export * from './studentFeeHistoryInterface';
170
+ export * from './schoolFeeTermsInterface';
171
+ export * from './studentFeeTypeCollectionInterface';
168
172
  export * from './classRoomEventInterface';
169
173
  export * from './classRoomCollectionInterface';
@@ -181,5 +181,9 @@ __exportStar(require("./userDirectoryInterface"), exports);
181
181
  __exportStar(require("./feeConfigInterface"), exports);
182
182
  __exportStar(require("./schoolFee1Interface"), exports);
183
183
  __exportStar(require("./instituteFeeInterface"), exports);
184
+ __exportStar(require("./studentFeeCollectionInterface"), exports);
185
+ __exportStar(require("./studentFeeHistoryInterface"), exports);
186
+ __exportStar(require("./schoolFeeTermsInterface"), exports);
187
+ __exportStar(require("./studentFeeTypeCollectionInterface"), exports);
184
188
  __exportStar(require("./classRoomEventInterface"), exports);
185
189
  __exportStar(require("./classRoomCollectionInterface"), exports);
@@ -10,17 +10,12 @@ export interface IFeeStructure {
10
10
  totalAmount: number;
11
11
  frequency: PAYMENT_TERMS_TYPE;
12
12
  isNotApplicableForGirls: boolean;
13
- isRefundable: boolean;
14
- isTaxable: boolean;
15
- isRequired: boolean;
16
13
  title: string;
17
14
  }
18
15
  export interface IFee1Schema {
19
16
  feeTypeId: string;
20
- isCreditAllowed: boolean;
21
17
  paymentMethod: PAYMENT_TYPE[];
22
- bankIds: string[];
23
- fesStructure: IFeeStructure[];
18
+ feeStructure: IFeeStructure[];
24
19
  }
25
20
  export interface ISchoolFee1ModelAttributes extends IDefaultAttributes, Document {
26
21
  id: string;
@@ -0,0 +1,14 @@
1
+ import { PAYMENT_TERMS_TYPE } from '../constants';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface ISchoolFeeTermsModelAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ academicCalendarId: string;
7
+ stdId: string;
8
+ feeTypeId: string;
9
+ frequency: PAYMENT_TERMS_TYPE;
10
+ amount: number;
11
+ date: Date;
12
+ oldId?: string;
13
+ termsDependedId: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { STUDENT_FEE_COLLECTION_STATUS } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IStudentFeeCollectionModelAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ userId: string;
6
+ academicCalendarId: string;
7
+ instituteId: string;
8
+ oldId?: string;
9
+ status: STUDENT_FEE_COLLECTION_STATUS;
10
+ oldPendingAmount: number;
11
+ discount: number;
12
+ settleUpFee: number;
13
+ paidFee: number;
14
+ totalFee: number;
15
+ collectionDependedId: string;
16
+ carryForwardTo: string;
17
+ carryForwardFee: number;
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { FEE_HISTORY_STATUS, PAYMENT_TYPE } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IStudentFeeHistoryModelAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ userId: string;
7
+ academicCalendarId: string;
8
+ parentHistoryId?: string;
9
+ paymentType: PAYMENT_TYPE;
10
+ paidFee: number;
11
+ status: FEE_HISTORY_STATUS;
12
+ feeTypeId?: string[];
13
+ bankAccountId?: string;
14
+ invoicePdf?: string;
15
+ invoiceNumber?: string;
16
+ studentFeeCollectionId: string;
17
+ feeHistoryConfigId?: string;
18
+ note?: string;
19
+ paidDate: Date;
20
+ upiId?: string;
21
+ bankName?: string;
22
+ chequeNo?: string;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import { STUDENT_FEE_COLLECTION_STATUS } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IStudentFeeTypeCollectionModelAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ userId: string;
7
+ academicCalendarId: string;
8
+ studentFeeCollectionId: string;
9
+ feeTypeId: string;
10
+ amount: number;
11
+ status: STUDENT_FEE_COLLECTION_STATUS;
12
+ paidAmount: number;
13
+ discount: number;
14
+ oldId?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -82,36 +82,39 @@ const feeStructureSchema = new mongoose_1.Schema({
82
82
  type: Boolean,
83
83
  default: false,
84
84
  },
85
- isRefundable: {
86
- type: Boolean,
87
- default: false,
88
- },
89
- isTaxable: {
90
- type: Boolean,
91
- default: false,
92
- },
93
- isRequired: {
94
- type: Boolean,
95
- },
85
+ // isRefundable: {
86
+ // type: Boolean,
87
+ // default: false,
88
+ // },
89
+ // isTaxable: {
90
+ // type: Boolean,
91
+ // default: false,
92
+ // },
93
+ // isRequired: {
94
+ // type: Boolean,
95
+ // },
96
96
  }, { _id: false });
97
97
  const feeSchema = new mongoose_1.Schema({
98
98
  feeTypeId: {
99
99
  type: String,
100
100
  required: true,
101
101
  },
102
- isCreditAllowed: {
103
- type: Boolean,
104
- },
102
+ // isCreditAllowed: {
103
+ // type: Boolean,
104
+ // },
105
105
  paymentMethod: {
106
106
  type: [String],
107
107
  enum: Object.values(app_1.PAYMENT_TYPE),
108
108
  default: [],
109
109
  },
110
- bankIds: {
111
- type: [String],
112
- default: [],
113
- },
114
- fesStructure: {
110
+ // bankIds: {
111
+ // type: [String],
112
+ // default: [],
113
+ // },
114
+ // isCashAllowed: {
115
+ // type: Boolean,
116
+ // },
117
+ feeStructure: {
115
118
  type: [feeStructureSchema],
116
119
  required: true,
117
120
  default: [],
@@ -162,7 +165,7 @@ const schoolFee1Schema = new mongoose_1.Schema({
162
165
  schoolFee1Schema.pre('save', async function (next) {
163
166
  const schoolFee1 = this;
164
167
  try {
165
- if (!schoolFee1.fees || schoolFee1.fees.length === 0 || schoolFee1.fees.every(fee => fee.fesStructure.length === 0)) {
168
+ if (!schoolFee1.fees || schoolFee1.fees.length === 0 || schoolFee1.fees.every(fee => fee.feeStructure.length === 0)) {
166
169
  return next(new Error('Fees array cannot be empty.'));
167
170
  }
168
171
  if (schoolFee1.instituteId) {
@@ -195,7 +198,7 @@ schoolFee1Schema.pre('save', async function (next) {
195
198
  if (!feeType)
196
199
  return next(new Error(errorMessages_1.FEE_TYPE_ERROR_MESSAGES.NOT_FOUND));
197
200
  }
198
- for (const structure of fee.fesStructure) {
201
+ for (const structure of fee.feeStructure) {
199
202
  // OPTIONAL: Frequency-based term length validation
200
203
  // if (
201
204
  // structure.frequency &&
@@ -10,7 +10,12 @@ declare class FeeTypeModel extends Model<IFeeTypeModelAttributes, TFeeTypeModelC
10
10
  feeType: FEE_TYPE;
11
11
  module: COMMAN_STATUS;
12
12
  status: COMMAN_STATUS;
13
- account: string;
13
+ account: string[];
14
+ isCreditAllowed: boolean;
15
+ isCashAllowed: boolean;
16
+ isRefundable: boolean;
17
+ isTaxable: boolean;
18
+ isRequired: boolean;
14
19
  isDefault: BOOLEAN_STATUS;
15
20
  academicCalendarId: string;
16
21
  createdBy: string;