@kipicore/dbcore 1.1.367 → 1.1.369
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.
- package/dist/db/psql/migrations/20260401061046-update_pdc.d.ts +2 -0
- package/dist/db/psql/migrations/20260401061046-update_pdc.js +35 -0
- package/dist/db/psql/migrations/20260401063714-update_pdc_histroy.d.ts +2 -0
- package/dist/db/psql/migrations/20260401063714-update_pdc_histroy.js +45 -0
- package/dist/interfaces/feeReminderTypeInterface.d.ts +2 -2
- package/dist/interfaces/index.d.ts +0 -11
- package/dist/interfaces/index.js +0 -11
- package/dist/interfaces/pdcChequeInterface.d.ts +1 -3
- package/dist/interfaces/pdcHistoryInterface.d.ts +4 -4
- package/dist/models/mongodb/feeReminderTypeModel.js +1 -2
- package/dist/models/mongodb/index.d.ts +0 -1
- package/dist/models/mongodb/index.js +2 -4
- package/dist/models/psql/index.d.ts +0 -10
- package/dist/models/psql/index.js +3 -23
- package/dist/models/psql/pdcChequeModel.d.ts +1 -3
- package/dist/models/psql/pdcChequeModel.js +17 -31
- package/dist/models/psql/pdcHistoryModel.d.ts +3 -3
- package/dist/models/psql/pdcHistoryModel.js +30 -14
- package/dist/types/index.d.ts +0 -11
- package/dist/types/index.js +0 -11
- package/package.json +1 -1
- package/dist/interfaces/feeHistoryDetailsInterface.d.ts +0 -17
- package/dist/interfaces/feeHistoryDetailsInterface.js +0 -2
- package/dist/interfaces/feeHistoryInterface.d.ts +0 -22
- package/dist/interfaces/feeHistoryInterface.js +0 -2
- package/dist/interfaces/feeTypeHasTermsInterface.d.ts +0 -12
- package/dist/interfaces/feeTypeHasTermsInterface.js +0 -2
- package/dist/interfaces/feeTypeInterface.d.ts +0 -14
- package/dist/interfaces/feeTypeInterface.js +0 -4
- package/dist/interfaces/feesCollectionInterface.d.ts +0 -19
- package/dist/interfaces/feesCollectionInterface.js +0 -2
- package/dist/interfaces/paymentTermsInterface.d.ts +0 -16
- package/dist/interfaces/paymentTermsInterface.js +0 -2
- package/dist/interfaces/schoolFeeCollectionInterface.d.ts +0 -13
- package/dist/interfaces/schoolFeeCollectionInterface.js +0 -2
- package/dist/interfaces/schoolFeeInterface.d.ts +0 -22
- package/dist/interfaces/schoolFeeInterface.js +0 -2
- package/dist/interfaces/userFeeTypeByAccountInterface.d.ts +0 -19
- package/dist/interfaces/userFeeTypeByAccountInterface.js +0 -2
- package/dist/interfaces/userFeeTypeInterface.d.ts +0 -17
- package/dist/interfaces/userFeeTypeInterface.js +0 -2
- package/dist/interfaces/userHasFeeTermsInterface.d.ts +0 -37
- package/dist/interfaces/userHasFeeTermsInterface.js +0 -2
- package/dist/models/mongodb/schoolFeeModel.d.ts +0 -4
- package/dist/models/mongodb/schoolFeeModel.js +0 -182
- package/dist/models/psql/feeHistoryDetailsModel.d.ts +0 -27
- package/dist/models/psql/feeHistoryDetailsModel.js +0 -145
- package/dist/models/psql/feeHistoryModel.d.ts +0 -33
- package/dist/models/psql/feeHistoryModel.js +0 -189
- package/dist/models/psql/feeTypeHasTermsModel.d.ts +0 -22
- package/dist/models/psql/feeTypeHasTermsModel.js +0 -99
- package/dist/models/psql/feeTypeModel.d.ts +0 -24
- package/dist/models/psql/feeTypeModel.js +0 -110
- package/dist/models/psql/feesCollectionModel.d.ts +0 -30
- package/dist/models/psql/feesCollectionModel.js +0 -200
- package/dist/models/psql/paymentTermsModel.d.ts +0 -19
- package/dist/models/psql/paymentTermsModel.js +0 -125
- package/dist/models/psql/schoolFeeCollectionModel.d.ts +0 -23
- package/dist/models/psql/schoolFeeCollectionModel.js +0 -109
- package/dist/models/psql/userFeeTypeByAccountModel.d.ts +0 -23
- package/dist/models/psql/userFeeTypeByAccountModel.js +0 -179
- package/dist/models/psql/userFeeTypeModel.d.ts +0 -26
- package/dist/models/psql/userFeeTypeModel.js +0 -180
- package/dist/models/psql/userHasFeeTermsModel.d.ts +0 -28
- package/dist/models/psql/userHasFeeTermsModel.js +0 -136
- package/dist/types/feeHistoryDetailsType.d.ts +0 -6
- package/dist/types/feeHistoryDetailsType.js +0 -2
- package/dist/types/feeHistoryType.d.ts +0 -18
- package/dist/types/feeHistoryType.js +0 -2
- package/dist/types/feeTypeHasTermsType.d.ts +0 -3
- package/dist/types/feeTypeHasTermsType.js +0 -2
- package/dist/types/feeTypeType.d.ts +0 -3
- package/dist/types/feeTypeType.js +0 -2
- package/dist/types/feesCollectionType.d.ts +0 -3
- package/dist/types/feesCollectionType.js +0 -2
- package/dist/types/paymentTermsType.d.ts +0 -3
- package/dist/types/paymentTermsType.js +0 -3
- package/dist/types/schoolFeeCollectionType.d.ts +0 -3
- package/dist/types/schoolFeeCollectionType.js +0 -2
- package/dist/types/schoolFeeType.d.ts +0 -3
- package/dist/types/schoolFeeType.js +0 -2
- package/dist/types/userFeeTypeByAccountType.d.ts +0 -3
- package/dist/types/userFeeTypeByAccountType.js +0 -2
- package/dist/types/userFeeTypeType.d.ts +0 -6
- package/dist/types/userFeeTypeType.js +0 -2
- package/dist/types/userHasFeeTermsType.d.ts +0 -3
- package/dist/types/userHasFeeTermsType.js +0 -2
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sequelize_1 = require("sequelize");
|
|
4
|
-
const index_1 = require("./index");
|
|
5
|
-
const app_1 = require("../../constants/app");
|
|
6
|
-
const errorMessages_1 = require("../../constants/errorMessages");
|
|
7
|
-
class FeesCollectionModel extends sequelize_1.Model {
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
-
static addHooks(models) {
|
|
10
|
-
const beforeCreateOrUpdateHook = async (feeCollection) => {
|
|
11
|
-
let existingRecord = null;
|
|
12
|
-
if ((feeCollection.userId && feeCollection.instituteId) || feeCollection.id) {
|
|
13
|
-
if (feeCollection.userId && feeCollection.instituteId) {
|
|
14
|
-
existingRecord = await FeesCollectionModel.findOne({
|
|
15
|
-
where: {
|
|
16
|
-
userId: feeCollection.userId,
|
|
17
|
-
instituteId: feeCollection.instituteId,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
existingRecord = await FeesCollectionModel.findByPk(feeCollection.id);
|
|
23
|
-
}
|
|
24
|
-
if (existingRecord?.status === app_1.FEE_PAYMENT_STATUS.COMPLETED && feeCollection.paidFee) {
|
|
25
|
-
throw new Error(errorMessages_1.FEESCOLLECTION_ERROR_MESSAGES.FEE_PAID);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
existingRecord = await FeesCollectionModel.findOne({
|
|
30
|
-
where: {
|
|
31
|
-
userId: feeCollection.userId,
|
|
32
|
-
instituteId: feeCollection.instituteId,
|
|
33
|
-
status: { [sequelize_1.Op.ne]: app_1.FEE_PAYMENT_STATUS.COMPLETED },
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (feeCollection.paymentType === app_1.PAYMENT_TYPE.CHEQUE) {
|
|
38
|
-
feeCollection.upiId = null;
|
|
39
|
-
if (!feeCollection.chequeNo || !feeCollection.bankName) {
|
|
40
|
-
throw new Error(errorMessages_1.FEESCOLLECTION_ERROR_MESSAGES.FEE_PAID_BY_CHQUE);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else if (feeCollection.paymentType === app_1.PAYMENT_TYPE.UPI) {
|
|
44
|
-
feeCollection.chequeNo = null;
|
|
45
|
-
feeCollection.bankName = null;
|
|
46
|
-
if (!feeCollection.upiId) {
|
|
47
|
-
throw new Error(errorMessages_1.FEESCOLLECTION_ERROR_MESSAGES.FEE_PAID_BY_UPI);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else if (feeCollection.paymentType === app_1.PAYMENT_TYPE.CASH) {
|
|
51
|
-
feeCollection.bankName = null;
|
|
52
|
-
feeCollection.chequeNo = null;
|
|
53
|
-
feeCollection.upiId = null;
|
|
54
|
-
}
|
|
55
|
-
const discount = feeCollection.discount ?? existingRecord?.discount ?? 0;
|
|
56
|
-
const paidFee = feeCollection.paidFee ?? existingRecord?.paidFee ?? 0;
|
|
57
|
-
const feeAmount = feeCollection.feeAmount ?? existingRecord?.feeAmount;
|
|
58
|
-
if (feeAmount !== 0) {
|
|
59
|
-
if (feeAmount === discount + paidFee) {
|
|
60
|
-
feeCollection.status = app_1.FEE_PAYMENT_STATUS.COMPLETED;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
FeesCollectionModel.beforeBulkCreate(async (instances) => {
|
|
65
|
-
for (const instance of instances) {
|
|
66
|
-
await beforeCreateOrUpdateHook(instance);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
FeesCollectionModel.beforeCreate(beforeCreateOrUpdateHook);
|
|
70
|
-
FeesCollectionModel.beforeBulkUpdate(async (options) => {
|
|
71
|
-
await beforeCreateOrUpdateHook(options.attributes);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
static associate(models) {
|
|
75
|
-
const { InstituteModel, UserModel, AcademicCalendarModel, PaymentTermsModel } = models;
|
|
76
|
-
FeesCollectionModel.belongsTo(InstituteModel, {
|
|
77
|
-
foreignKey: { name: 'instituteId', field: 'institute_id' },
|
|
78
|
-
as: 'feeCollectionInstitute',
|
|
79
|
-
});
|
|
80
|
-
InstituteModel.hasMany(FeesCollectionModel, {
|
|
81
|
-
foreignKey: 'instituteId',
|
|
82
|
-
as: 'instituteHasFeeCollection',
|
|
83
|
-
});
|
|
84
|
-
FeesCollectionModel.belongsTo(UserModel, {
|
|
85
|
-
foreignKey: { name: 'userId', field: 'user_id' },
|
|
86
|
-
as: 'feeCollectionUser',
|
|
87
|
-
});
|
|
88
|
-
UserModel.hasMany(FeesCollectionModel, {
|
|
89
|
-
foreignKey: 'userId',
|
|
90
|
-
as: 'userHasFeeCollection',
|
|
91
|
-
});
|
|
92
|
-
FeesCollectionModel.belongsTo(AcademicCalendarModel, {
|
|
93
|
-
foreignKey: { name: 'academicCalendarId', field: 'academic_calendar_id', allowNull: true },
|
|
94
|
-
as: 'CollectionCalendar',
|
|
95
|
-
});
|
|
96
|
-
AcademicCalendarModel.hasMany(FeesCollectionModel, {
|
|
97
|
-
foreignKey: { name: 'academicCalendarId', field: 'academic_calendar_id', allowNull: true },
|
|
98
|
-
as: 'CollectionHasCalendar',
|
|
99
|
-
});
|
|
100
|
-
FeesCollectionModel.belongsTo(UserModel, {
|
|
101
|
-
foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
|
|
102
|
-
as: 'createdByUser',
|
|
103
|
-
});
|
|
104
|
-
FeesCollectionModel.belongsTo(UserModel, {
|
|
105
|
-
foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
|
|
106
|
-
as: 'updatedByUser',
|
|
107
|
-
});
|
|
108
|
-
FeesCollectionModel.belongsTo(UserModel, {
|
|
109
|
-
foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
|
|
110
|
-
as: 'deletedByUser',
|
|
111
|
-
});
|
|
112
|
-
PaymentTermsModel.belongsTo(FeesCollectionModel, {
|
|
113
|
-
foreignKey: { name: 'feeCollectionId', field: 'fee_collection_id' },
|
|
114
|
-
as: 'feeCollection',
|
|
115
|
-
});
|
|
116
|
-
FeesCollectionModel.hasMany(PaymentTermsModel, {
|
|
117
|
-
foreignKey: 'feeCollectionId',
|
|
118
|
-
as: 'feeCollectionHasPaymentTerms',
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
FeesCollectionModel.init({
|
|
123
|
-
id: {
|
|
124
|
-
type: sequelize_1.DataTypes.UUID,
|
|
125
|
-
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
126
|
-
allowNull: false,
|
|
127
|
-
primaryKey: true,
|
|
128
|
-
},
|
|
129
|
-
date: {
|
|
130
|
-
type: sequelize_1.DataTypes.DATE,
|
|
131
|
-
defaultValue: sequelize_1.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
132
|
-
allowNull: true,
|
|
133
|
-
},
|
|
134
|
-
dueDate: {
|
|
135
|
-
type: sequelize_1.DataTypes.DATE,
|
|
136
|
-
allowNull: true,
|
|
137
|
-
},
|
|
138
|
-
feeAmount: {
|
|
139
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
140
|
-
defaultValue: 0,
|
|
141
|
-
allowNull: true,
|
|
142
|
-
},
|
|
143
|
-
discount: {
|
|
144
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
145
|
-
defaultValue: 0,
|
|
146
|
-
allowNull: true,
|
|
147
|
-
},
|
|
148
|
-
paidFee: {
|
|
149
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
150
|
-
defaultValue: 0,
|
|
151
|
-
allowNull: true,
|
|
152
|
-
},
|
|
153
|
-
bankName: {
|
|
154
|
-
type: sequelize_1.DataTypes.STRING,
|
|
155
|
-
allowNull: true,
|
|
156
|
-
},
|
|
157
|
-
chequeNo: {
|
|
158
|
-
type: sequelize_1.DataTypes.STRING,
|
|
159
|
-
allowNull: true,
|
|
160
|
-
},
|
|
161
|
-
upiId: {
|
|
162
|
-
type: sequelize_1.DataTypes.STRING,
|
|
163
|
-
allowNull: true,
|
|
164
|
-
},
|
|
165
|
-
status: {
|
|
166
|
-
type: sequelize_1.DataTypes.STRING,
|
|
167
|
-
allowNull: true,
|
|
168
|
-
defaultValue: app_1.FEE_PAYMENT_STATUS.PENDING,
|
|
169
|
-
},
|
|
170
|
-
paymentType: {
|
|
171
|
-
type: sequelize_1.DataTypes.ENUM,
|
|
172
|
-
values: Object.values(app_1.PAYMENT_TYPE),
|
|
173
|
-
allowNull: true,
|
|
174
|
-
},
|
|
175
|
-
academicCalendarId: {
|
|
176
|
-
type: sequelize_1.DataTypes.UUID,
|
|
177
|
-
field: 'academic_calendar_id',
|
|
178
|
-
allowNull: false,
|
|
179
|
-
},
|
|
180
|
-
userId: {
|
|
181
|
-
type: sequelize_1.DataTypes.UUID,
|
|
182
|
-
allowNull: false,
|
|
183
|
-
},
|
|
184
|
-
instituteId: {
|
|
185
|
-
type: sequelize_1.DataTypes.UUID,
|
|
186
|
-
allowNull: false,
|
|
187
|
-
},
|
|
188
|
-
isLeft: {
|
|
189
|
-
type: sequelize_1.DataTypes.BOOLEAN,
|
|
190
|
-
field: 'is_left',
|
|
191
|
-
defaultValue: false,
|
|
192
|
-
allowNull: true,
|
|
193
|
-
},
|
|
194
|
-
}, {
|
|
195
|
-
modelName: 'FeesCollectionModel',
|
|
196
|
-
tableName: 'fees_collections',
|
|
197
|
-
timestamps: true,
|
|
198
|
-
sequelize: index_1.sequelize,
|
|
199
|
-
});
|
|
200
|
-
exports.default = FeesCollectionModel;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Model } from 'sequelize';
|
|
2
|
-
import { IPaymentTermsModelAttributes } from '../../interfaces/paymentTermsInterface';
|
|
3
|
-
import { PAYMENT_TERMS_STATUS, PAYMENT_TERMS_TYPE } from '../../constants/app';
|
|
4
|
-
declare class PaymentTermsModel extends Model<IPaymentTermsModelAttributes> {
|
|
5
|
-
id: string;
|
|
6
|
-
date?: Date;
|
|
7
|
-
type: PAYMENT_TERMS_TYPE;
|
|
8
|
-
amount: number;
|
|
9
|
-
paidAmount: number;
|
|
10
|
-
status: PAYMENT_TERMS_STATUS;
|
|
11
|
-
instituteId: string;
|
|
12
|
-
userId: string;
|
|
13
|
-
feeCollectionId: string;
|
|
14
|
-
startDate: Date;
|
|
15
|
-
endDate: Date;
|
|
16
|
-
academicCalendarId: string;
|
|
17
|
-
static associate(models: any): void;
|
|
18
|
-
}
|
|
19
|
-
export default PaymentTermsModel;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sequelize_1 = require("sequelize");
|
|
4
|
-
const index_1 = require("./index");
|
|
5
|
-
const app_1 = require("../../constants/app");
|
|
6
|
-
class PaymentTermsModel extends sequelize_1.Model {
|
|
7
|
-
static associate(models) {
|
|
8
|
-
const { UserModel, InstituteModel, AcademicCalendarModel } = models;
|
|
9
|
-
PaymentTermsModel.belongsTo(InstituteModel, {
|
|
10
|
-
foreignKey: {
|
|
11
|
-
name: 'instituteId',
|
|
12
|
-
field: 'institute_id',
|
|
13
|
-
},
|
|
14
|
-
as: 'institute',
|
|
15
|
-
});
|
|
16
|
-
PaymentTermsModel.belongsTo(UserModel, {
|
|
17
|
-
foreignKey: {
|
|
18
|
-
name: 'userId',
|
|
19
|
-
field: 'user_id',
|
|
20
|
-
},
|
|
21
|
-
as: 'user',
|
|
22
|
-
});
|
|
23
|
-
UserModel.hasMany(PaymentTermsModel, { foreignKey: 'userId', as: 'userHasPaymentTerms' });
|
|
24
|
-
InstituteModel.hasMany(PaymentTermsModel, { foreignKey: 'instituteId', as: 'instituteHasPaymentTerms' });
|
|
25
|
-
PaymentTermsModel.belongsTo(UserModel, {
|
|
26
|
-
foreignKey: {
|
|
27
|
-
name: 'createdBy',
|
|
28
|
-
allowNull: true,
|
|
29
|
-
field: 'created_by',
|
|
30
|
-
},
|
|
31
|
-
as: 'createdByUser',
|
|
32
|
-
});
|
|
33
|
-
PaymentTermsModel.belongsTo(UserModel, {
|
|
34
|
-
foreignKey: {
|
|
35
|
-
name: 'updatedBy',
|
|
36
|
-
allowNull: true,
|
|
37
|
-
field: 'updated_by',
|
|
38
|
-
},
|
|
39
|
-
as: 'updatedByUser',
|
|
40
|
-
});
|
|
41
|
-
PaymentTermsModel.belongsTo(UserModel, {
|
|
42
|
-
foreignKey: {
|
|
43
|
-
name: 'deletedBy',
|
|
44
|
-
allowNull: true,
|
|
45
|
-
field: 'deleted_by',
|
|
46
|
-
},
|
|
47
|
-
as: 'deletedByUser',
|
|
48
|
-
});
|
|
49
|
-
PaymentTermsModel.belongsTo(AcademicCalendarModel, {
|
|
50
|
-
foreignKey: { name: 'academicCalendarId', field: 'academic_calendar_id' },
|
|
51
|
-
as: 'paymentTermsAcaCal',
|
|
52
|
-
});
|
|
53
|
-
AcademicCalendarModel.hasMany(PaymentTermsModel, {
|
|
54
|
-
foreignKey: { name: 'academicCalendarId', field: 'academic_calendar_id' },
|
|
55
|
-
as: 'acaCalPaymentTerms',
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
PaymentTermsModel.init({
|
|
60
|
-
id: {
|
|
61
|
-
type: sequelize_1.DataTypes.UUID,
|
|
62
|
-
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
63
|
-
allowNull: false,
|
|
64
|
-
primaryKey: true,
|
|
65
|
-
},
|
|
66
|
-
date: {
|
|
67
|
-
type: sequelize_1.DataTypes.DATE,
|
|
68
|
-
allowNull: true,
|
|
69
|
-
},
|
|
70
|
-
endDate: {
|
|
71
|
-
type: sequelize_1.DataTypes.DATE,
|
|
72
|
-
allowNull: true,
|
|
73
|
-
},
|
|
74
|
-
startDate: {
|
|
75
|
-
type: sequelize_1.DataTypes.DATE,
|
|
76
|
-
allowNull: false,
|
|
77
|
-
},
|
|
78
|
-
type: {
|
|
79
|
-
type: sequelize_1.DataTypes.ENUM,
|
|
80
|
-
values: Object.values(app_1.PAYMENT_TERMS_TYPE),
|
|
81
|
-
allowNull: false,
|
|
82
|
-
},
|
|
83
|
-
amount: {
|
|
84
|
-
type: sequelize_1.DataTypes.FLOAT,
|
|
85
|
-
defaultValue: 0,
|
|
86
|
-
allowNull: false,
|
|
87
|
-
},
|
|
88
|
-
paidAmount: {
|
|
89
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
90
|
-
defaultValue: 0,
|
|
91
|
-
allowNull: false,
|
|
92
|
-
},
|
|
93
|
-
status: {
|
|
94
|
-
type: sequelize_1.DataTypes.ENUM,
|
|
95
|
-
values: Object.values(app_1.PAYMENT_TERMS_STATUS),
|
|
96
|
-
defaultValue: app_1.PAYMENT_TERMS_STATUS.DUE,
|
|
97
|
-
allowNull: false,
|
|
98
|
-
},
|
|
99
|
-
instituteId: {
|
|
100
|
-
type: sequelize_1.DataTypes.UUID,
|
|
101
|
-
field: 'institute_id',
|
|
102
|
-
allowNull: false,
|
|
103
|
-
},
|
|
104
|
-
userId: {
|
|
105
|
-
type: sequelize_1.DataTypes.UUID,
|
|
106
|
-
field: 'user_id',
|
|
107
|
-
allowNull: false,
|
|
108
|
-
},
|
|
109
|
-
feeCollectionId: {
|
|
110
|
-
type: sequelize_1.DataTypes.UUID,
|
|
111
|
-
field: 'fee_collection_id',
|
|
112
|
-
allowNull: false,
|
|
113
|
-
},
|
|
114
|
-
academicCalendarId: {
|
|
115
|
-
type: sequelize_1.DataTypes.UUID,
|
|
116
|
-
field: 'academic_calendar_id',
|
|
117
|
-
allowNull: true,
|
|
118
|
-
},
|
|
119
|
-
}, {
|
|
120
|
-
modelName: 'PaymentTermsModel',
|
|
121
|
-
tableName: 'payment_terms',
|
|
122
|
-
timestamps: true,
|
|
123
|
-
sequelize: index_1.sequelize,
|
|
124
|
-
});
|
|
125
|
-
exports.default = PaymentTermsModel;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Model } from 'sequelize';
|
|
2
|
-
import { ISchoolFeesCollectionModelAttributes } from '../../interfaces/schoolFeeCollectionInterface';
|
|
3
|
-
import { TSchoolFeeCollectionModelCreationAttributes } from '../../types/schoolFeeCollectionType';
|
|
4
|
-
declare class SchoolFeeCollectionModel extends Model<ISchoolFeesCollectionModelAttributes, TSchoolFeeCollectionModelCreationAttributes> {
|
|
5
|
-
id: string;
|
|
6
|
-
date?: Date;
|
|
7
|
-
totalFeeAmount: number;
|
|
8
|
-
userId: string;
|
|
9
|
-
instituteId: string;
|
|
10
|
-
discount: number;
|
|
11
|
-
paidFee: number;
|
|
12
|
-
dueDate?: Date;
|
|
13
|
-
academicCalendarId: string;
|
|
14
|
-
perviousFeeCollectionId: string;
|
|
15
|
-
createdBy: string;
|
|
16
|
-
updatedBy: string;
|
|
17
|
-
deletedBy: string;
|
|
18
|
-
readonly createdAt: Date;
|
|
19
|
-
readonly updatedAt: Date;
|
|
20
|
-
readonly deletedAt: Date;
|
|
21
|
-
static associate(models: any): void;
|
|
22
|
-
}
|
|
23
|
-
export default SchoolFeeCollectionModel;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sequelize_1 = require("sequelize");
|
|
4
|
-
const index_1 = require("./index");
|
|
5
|
-
class SchoolFeeCollectionModel extends sequelize_1.Model {
|
|
6
|
-
static associate(models) {
|
|
7
|
-
const { UserModel, InstituteModel, AcademicCalendarModel, SchoolFeeCollectionModel } = models;
|
|
8
|
-
SchoolFeeCollectionModel.belongsTo(UserModel, {
|
|
9
|
-
foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
|
|
10
|
-
as: 'createdByUser',
|
|
11
|
-
});
|
|
12
|
-
SchoolFeeCollectionModel.belongsTo(UserModel, {
|
|
13
|
-
foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
|
|
14
|
-
as: 'updatedByUser',
|
|
15
|
-
});
|
|
16
|
-
SchoolFeeCollectionModel.belongsTo(UserModel, {
|
|
17
|
-
foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
|
|
18
|
-
as: 'deletedByUser',
|
|
19
|
-
});
|
|
20
|
-
SchoolFeeCollectionModel.belongsTo(InstituteModel, {
|
|
21
|
-
foreignKey: { name: 'instituteId', field: 'institute_id', allowNull: true },
|
|
22
|
-
as: 'schoolCollectionInstitute',
|
|
23
|
-
});
|
|
24
|
-
InstituteModel.hasMany(SchoolFeeCollectionModel, {
|
|
25
|
-
foreignKey: { name: 'instituteId', field: 'institute_id', allowNull: true },
|
|
26
|
-
as: 'instituteSchoolCollection',
|
|
27
|
-
});
|
|
28
|
-
SchoolFeeCollectionModel.belongsTo(UserModel, {
|
|
29
|
-
foreignKey: { name: 'userId', field: 'user_id', allowNull: true },
|
|
30
|
-
as: 'schoolCollectionUser',
|
|
31
|
-
});
|
|
32
|
-
UserModel.hasMany(SchoolFeeCollectionModel, {
|
|
33
|
-
foreignKey: { name: 'userId', field: 'user_id', allowNull: true },
|
|
34
|
-
as: 'schoolCollectionHasUser',
|
|
35
|
-
});
|
|
36
|
-
SchoolFeeCollectionModel.belongsTo(SchoolFeeCollectionModel, {
|
|
37
|
-
foreignKey: { name: 'perviousFeeCollectionId', field: 'previous_fee_collection_id', allowNull: true },
|
|
38
|
-
as: 'previousFeeCollection',
|
|
39
|
-
});
|
|
40
|
-
SchoolFeeCollectionModel.hasMany(SchoolFeeCollectionModel, {
|
|
41
|
-
foreignKey: { name: 'perviousFeeCollectionId', field: 'previous_fee_collection_id', allowNull: true },
|
|
42
|
-
as: 'collectionPreviousCollection',
|
|
43
|
-
});
|
|
44
|
-
SchoolFeeCollectionModel.belongsTo(AcademicCalendarModel, {
|
|
45
|
-
foreignKey: { name: 'academicCalendarId', field: 'academic_calendar_id', allowNull: true },
|
|
46
|
-
as: 'schoolCollectionCalendar',
|
|
47
|
-
});
|
|
48
|
-
AcademicCalendarModel.hasMany(SchoolFeeCollectionModel, {
|
|
49
|
-
foreignKey: { name: 'academicCalendarId', field: 'academic_calendar_id', allowNull: true },
|
|
50
|
-
as: 'schoolCollectionHasCalendar',
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
SchoolFeeCollectionModel.init({
|
|
55
|
-
id: {
|
|
56
|
-
type: sequelize_1.DataTypes.UUID,
|
|
57
|
-
primaryKey: true,
|
|
58
|
-
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
59
|
-
},
|
|
60
|
-
date: {
|
|
61
|
-
type: sequelize_1.DataTypes.DATE,
|
|
62
|
-
defaultValue: sequelize_1.DataTypes.NOW,
|
|
63
|
-
allowNull: false,
|
|
64
|
-
},
|
|
65
|
-
totalFeeAmount: {
|
|
66
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
67
|
-
field: 'total_fee_amount',
|
|
68
|
-
defaultValue: 0,
|
|
69
|
-
allowNull: false,
|
|
70
|
-
},
|
|
71
|
-
userId: {
|
|
72
|
-
type: sequelize_1.DataTypes.UUID,
|
|
73
|
-
allowNull: false,
|
|
74
|
-
},
|
|
75
|
-
instituteId: {
|
|
76
|
-
type: sequelize_1.DataTypes.UUID,
|
|
77
|
-
allowNull: false,
|
|
78
|
-
},
|
|
79
|
-
discount: {
|
|
80
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
81
|
-
defaultValue: 0,
|
|
82
|
-
allowNull: false,
|
|
83
|
-
},
|
|
84
|
-
paidFee: {
|
|
85
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
86
|
-
defaultValue: 0,
|
|
87
|
-
allowNull: false,
|
|
88
|
-
},
|
|
89
|
-
dueDate: {
|
|
90
|
-
type: sequelize_1.DataTypes.DATE,
|
|
91
|
-
allowNull: true,
|
|
92
|
-
},
|
|
93
|
-
academicCalendarId: {
|
|
94
|
-
type: sequelize_1.DataTypes.UUID,
|
|
95
|
-
field: 'academic_calendar_id',
|
|
96
|
-
allowNull: false,
|
|
97
|
-
},
|
|
98
|
-
perviousFeeCollectionId: {
|
|
99
|
-
type: sequelize_1.DataTypes.UUID,
|
|
100
|
-
field: 'previous_fee_collection_id',
|
|
101
|
-
allowNull: true,
|
|
102
|
-
},
|
|
103
|
-
}, {
|
|
104
|
-
modelName: 'SchoolFeeCollectionModel',
|
|
105
|
-
tableName: 'school_fee_collection',
|
|
106
|
-
timestamps: true,
|
|
107
|
-
sequelize: index_1.sequelize,
|
|
108
|
-
});
|
|
109
|
-
exports.default = SchoolFeeCollectionModel;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Model } from 'sequelize';
|
|
2
|
-
import { IUserFeeTypeByAccountModelAttributes } from '../../interfaces/userFeeTypeByAccountInterface';
|
|
3
|
-
import { TUserFeeTypeByAccountModelCreationAttributes } from '../../types/userFeeTypeByAccountType';
|
|
4
|
-
declare class UserFeeTypeByAccountModel extends Model<IUserFeeTypeByAccountModelAttributes, TUserFeeTypeByAccountModelCreationAttributes> {
|
|
5
|
-
id: string;
|
|
6
|
-
userId: string;
|
|
7
|
-
instituteId: string;
|
|
8
|
-
bankAccountId: string;
|
|
9
|
-
feeCollectionId: string;
|
|
10
|
-
amount: number;
|
|
11
|
-
discount: number;
|
|
12
|
-
perviousFeeCollectionId: string;
|
|
13
|
-
academicCalendarId: string;
|
|
14
|
-
paidAmount: number;
|
|
15
|
-
createdBy: string;
|
|
16
|
-
updatedBy: string;
|
|
17
|
-
deletedBy: string;
|
|
18
|
-
readonly createdAt: Date;
|
|
19
|
-
readonly deletedAt: string;
|
|
20
|
-
readonly updatedAt: Date;
|
|
21
|
-
static associate(models: any): void;
|
|
22
|
-
}
|
|
23
|
-
export default UserFeeTypeByAccountModel;
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sequelize_1 = require("sequelize");
|
|
4
|
-
const index_1 = require("./index");
|
|
5
|
-
class UserFeeTypeByAccountModel extends sequelize_1.Model {
|
|
6
|
-
static associate(models) {
|
|
7
|
-
const { UserModel, InstituteModel, AcademicCalendarModel, SchoolFeeCollectionModel, BankAccountDetailsModel } = models;
|
|
8
|
-
UserFeeTypeByAccountModel.belongsTo(UserModel, {
|
|
9
|
-
foreignKey: {
|
|
10
|
-
name: 'createdBy',
|
|
11
|
-
allowNull: true,
|
|
12
|
-
field: 'created_by',
|
|
13
|
-
},
|
|
14
|
-
as: 'createdByUser',
|
|
15
|
-
});
|
|
16
|
-
UserFeeTypeByAccountModel.belongsTo(UserModel, {
|
|
17
|
-
foreignKey: {
|
|
18
|
-
name: 'updatedBy',
|
|
19
|
-
allowNull: true,
|
|
20
|
-
field: 'updated_by',
|
|
21
|
-
},
|
|
22
|
-
as: 'updatedByUser',
|
|
23
|
-
});
|
|
24
|
-
UserFeeTypeByAccountModel.belongsTo(UserModel, {
|
|
25
|
-
foreignKey: {
|
|
26
|
-
name: 'deletedBy',
|
|
27
|
-
allowNull: true,
|
|
28
|
-
field: 'deleted_by',
|
|
29
|
-
},
|
|
30
|
-
as: 'deletedByUser',
|
|
31
|
-
});
|
|
32
|
-
UserFeeTypeByAccountModel.belongsTo(InstituteModel, {
|
|
33
|
-
foreignKey: {
|
|
34
|
-
name: 'instituteId',
|
|
35
|
-
field: 'institute_id',
|
|
36
|
-
},
|
|
37
|
-
as: 'userAccountInstituted',
|
|
38
|
-
});
|
|
39
|
-
InstituteModel.hasMany(UserFeeTypeByAccountModel, {
|
|
40
|
-
foreignKey: {
|
|
41
|
-
name: 'instituteId',
|
|
42
|
-
field: 'institute_id',
|
|
43
|
-
},
|
|
44
|
-
as: 'institutedHasUserAccount',
|
|
45
|
-
});
|
|
46
|
-
UserFeeTypeByAccountModel.belongsTo(UserModel, {
|
|
47
|
-
foreignKey: {
|
|
48
|
-
name: 'userId',
|
|
49
|
-
field: 'user_id',
|
|
50
|
-
},
|
|
51
|
-
as: 'accountUser',
|
|
52
|
-
});
|
|
53
|
-
UserModel.hasMany(UserFeeTypeByAccountModel, {
|
|
54
|
-
foreignKey: {
|
|
55
|
-
name: 'userId',
|
|
56
|
-
field: 'user_id',
|
|
57
|
-
},
|
|
58
|
-
as: 'userHasAccount',
|
|
59
|
-
});
|
|
60
|
-
UserFeeTypeByAccountModel.belongsTo(BankAccountDetailsModel, {
|
|
61
|
-
foreignKey: {
|
|
62
|
-
name: 'bankAccountId',
|
|
63
|
-
field: 'bank_account_id',
|
|
64
|
-
},
|
|
65
|
-
as: 'accountBank',
|
|
66
|
-
});
|
|
67
|
-
BankAccountDetailsModel.hasMany(UserFeeTypeByAccountModel, {
|
|
68
|
-
foreignKey: {
|
|
69
|
-
name: 'bankAccountId',
|
|
70
|
-
field: 'bank_account_id',
|
|
71
|
-
},
|
|
72
|
-
as: 'bankHasAccount',
|
|
73
|
-
});
|
|
74
|
-
UserFeeTypeByAccountModel.belongsTo(AcademicCalendarModel, {
|
|
75
|
-
foreignKey: {
|
|
76
|
-
name: 'academicCalendarId',
|
|
77
|
-
field: 'academic_calendar_id',
|
|
78
|
-
allowNull: true,
|
|
79
|
-
},
|
|
80
|
-
as: 'accountAcademicCalendar',
|
|
81
|
-
});
|
|
82
|
-
AcademicCalendarModel.hasMany(UserFeeTypeByAccountModel, {
|
|
83
|
-
foreignKey: {
|
|
84
|
-
name: 'academicCalendarId',
|
|
85
|
-
field: 'academic_calendar_id',
|
|
86
|
-
allowNull: true,
|
|
87
|
-
},
|
|
88
|
-
as: 'accountHasAcademicCalendar',
|
|
89
|
-
});
|
|
90
|
-
UserFeeTypeByAccountModel.belongsTo(SchoolFeeCollectionModel, {
|
|
91
|
-
foreignKey: {
|
|
92
|
-
name: 'perviousFeeCollectionId',
|
|
93
|
-
field: 'previous_fee_collection_id',
|
|
94
|
-
allowNull: true,
|
|
95
|
-
},
|
|
96
|
-
as: 'accountPreviousCollection',
|
|
97
|
-
});
|
|
98
|
-
SchoolFeeCollectionModel.hasMany(UserFeeTypeByAccountModel, {
|
|
99
|
-
foreignKey: {
|
|
100
|
-
name: 'perviousFeeCollectionId',
|
|
101
|
-
field: 'previous_fee_collection_id',
|
|
102
|
-
allowNull: true,
|
|
103
|
-
},
|
|
104
|
-
as: 'previousCollectionHasAccount',
|
|
105
|
-
});
|
|
106
|
-
UserFeeTypeByAccountModel.belongsTo(SchoolFeeCollectionModel, {
|
|
107
|
-
foreignKey: {
|
|
108
|
-
name: 'feeCollectionId',
|
|
109
|
-
field: 'fee_collection_id',
|
|
110
|
-
allowNull: true,
|
|
111
|
-
},
|
|
112
|
-
as: 'accountFeeCollection',
|
|
113
|
-
});
|
|
114
|
-
SchoolFeeCollectionModel.hasMany(UserFeeTypeByAccountModel, {
|
|
115
|
-
foreignKey: {
|
|
116
|
-
name: 'feeCollectionId',
|
|
117
|
-
field: 'fee_collection_id',
|
|
118
|
-
allowNull: true,
|
|
119
|
-
},
|
|
120
|
-
as: 'accountHasFeeCollection',
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
UserFeeTypeByAccountModel.init({
|
|
125
|
-
id: {
|
|
126
|
-
type: sequelize_1.DataTypes.UUID,
|
|
127
|
-
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
128
|
-
allowNull: false,
|
|
129
|
-
primaryKey: true,
|
|
130
|
-
},
|
|
131
|
-
userId: {
|
|
132
|
-
type: sequelize_1.DataTypes.UUID,
|
|
133
|
-
allowNull: false,
|
|
134
|
-
},
|
|
135
|
-
instituteId: {
|
|
136
|
-
type: sequelize_1.DataTypes.UUID,
|
|
137
|
-
allowNull: false,
|
|
138
|
-
},
|
|
139
|
-
bankAccountId: {
|
|
140
|
-
type: sequelize_1.DataTypes.UUID,
|
|
141
|
-
field: 'bank_account_id',
|
|
142
|
-
allowNull: false,
|
|
143
|
-
},
|
|
144
|
-
feeCollectionId: {
|
|
145
|
-
type: sequelize_1.DataTypes.UUID,
|
|
146
|
-
field: 'fee_collection_id',
|
|
147
|
-
allowNull: false,
|
|
148
|
-
},
|
|
149
|
-
amount: {
|
|
150
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
151
|
-
allowNull: false,
|
|
152
|
-
},
|
|
153
|
-
discount: {
|
|
154
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
155
|
-
allowNull: true,
|
|
156
|
-
defaultValue: 0,
|
|
157
|
-
},
|
|
158
|
-
perviousFeeCollectionId: {
|
|
159
|
-
type: sequelize_1.DataTypes.UUID,
|
|
160
|
-
field: 'pervious_fee_collection_id',
|
|
161
|
-
allowNull: true,
|
|
162
|
-
},
|
|
163
|
-
academicCalendarId: {
|
|
164
|
-
type: sequelize_1.DataTypes.UUID,
|
|
165
|
-
field: 'academic_calendar_id',
|
|
166
|
-
allowNull: false,
|
|
167
|
-
},
|
|
168
|
-
paidAmount: {
|
|
169
|
-
type: sequelize_1.DataTypes.INTEGER,
|
|
170
|
-
field: 'paid_amount',
|
|
171
|
-
allowNull: false,
|
|
172
|
-
},
|
|
173
|
-
}, {
|
|
174
|
-
modelName: 'UserFeeTypeByAccountModel',
|
|
175
|
-
tableName: 'user_fee_type_by_account',
|
|
176
|
-
timestamps: true,
|
|
177
|
-
sequelize: index_1.sequelize,
|
|
178
|
-
});
|
|
179
|
-
exports.default = UserFeeTypeByAccountModel;
|