@kipicore/dbcore 1.1.371 → 1.1.373
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/interfaces/pdcChequeConfigurationInterface.d.ts +18 -0
- package/dist/interfaces/pdcChequeConfigurationInterface.js +2 -0
- package/dist/models/mongodb/pdcChequeConfigurationModel.d.ts +4 -0
- package/dist/models/mongodb/pdcChequeConfigurationModel.js +63 -0
- package/dist/models/psql/feeReminderModel.js +3 -3
- package/dist/models/psql/subjectHasPayFeeHistoryModel.js +12 -12
- package/dist/models/psql/userHasOfferModel.js +10 -10
- package/dist/types/pdcChequeConfigurationType.d.ts +2 -0
- package/dist/types/pdcChequeConfigurationType.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Document } from 'mongoose';
|
|
2
|
+
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
+
import { PAYMENT_TERMS_TYPE } from '../constants';
|
|
4
|
+
export interface IFeeTypeList {
|
|
5
|
+
feeTypeId: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
}
|
|
8
|
+
export interface IFeeTypeGroup {
|
|
9
|
+
date: Date;
|
|
10
|
+
feeTypeList: IFeeTypeList[];
|
|
11
|
+
}
|
|
12
|
+
export interface IPdcChequeConfigurationModelAttributes extends IDefaultAttributes, Document {
|
|
13
|
+
id: string;
|
|
14
|
+
instituteId: string;
|
|
15
|
+
academicCalendarId: string;
|
|
16
|
+
frequency: PAYMENT_TERMS_TYPE;
|
|
17
|
+
feeTypeGroup: IFeeTypeGroup[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Model } from 'mongoose';
|
|
2
|
+
import { IPdcChequeConfigurationModelAttributes } from '../../interfaces/pdcChequeConfigurationInterface';
|
|
3
|
+
declare const PdcChequeConfigurationModel: Model<IPdcChequeConfigurationModelAttributes>;
|
|
4
|
+
export default PdcChequeConfigurationModel;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const constants_1 = require("../../constants");
|
|
38
|
+
const feeTypeListSchema = new mongoose_1.Schema({
|
|
39
|
+
feeTypeId: { type: String, required: true },
|
|
40
|
+
amount: { type: Number, required: true },
|
|
41
|
+
}, { _id: false });
|
|
42
|
+
const feeTypeGroupSchema = new mongoose_1.Schema({
|
|
43
|
+
date: { type: Date, required: true },
|
|
44
|
+
feeTypeList: { type: [feeTypeListSchema], default: [] },
|
|
45
|
+
}, { _id: false });
|
|
46
|
+
const pdcChequeConfigurationSchema = new mongoose_1.Schema({
|
|
47
|
+
instituteId: { type: String, required: false },
|
|
48
|
+
academicCalendarId: { type: String, required: false },
|
|
49
|
+
frequency: {
|
|
50
|
+
type: String,
|
|
51
|
+
enum: Object.values(constants_1.PAYMENT_TERMS_TYPE),
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
feeTypeGroup: { type: [feeTypeGroupSchema], default: [] },
|
|
55
|
+
createdBy: { type: String, required: false },
|
|
56
|
+
updatedBy: { type: String, required: false },
|
|
57
|
+
deletedBy: { type: String, required: false },
|
|
58
|
+
}, {
|
|
59
|
+
timestamps: true,
|
|
60
|
+
versionKey: false,
|
|
61
|
+
});
|
|
62
|
+
const PdcChequeConfigurationModel = mongoose_1.default.model('pdc_cheque_configuration', pdcChequeConfigurationSchema);
|
|
63
|
+
exports.default = PdcChequeConfigurationModel;
|
|
@@ -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',
|
|
@@ -4,7 +4,7 @@ const sequelize_1 = require("sequelize");
|
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
class UserHasOfferModel extends sequelize_1.Model {
|
|
6
6
|
static associate(models) {
|
|
7
|
-
const { UserModel, InstituteModel,
|
|
7
|
+
const { UserModel, InstituteModel, OfferModel, CourseModel, AcademicCalendarModel } = models;
|
|
8
8
|
UserHasOfferModel.belongsTo(InstituteModel, {
|
|
9
9
|
foreignKey: { name: 'instituteId', field: 'institute_id' },
|
|
10
10
|
as: 'userHasOfferInstitute',
|
|
@@ -32,14 +32,14 @@ class UserHasOfferModel extends sequelize_1.Model {
|
|
|
32
32
|
foreignKey: 'userId',
|
|
33
33
|
as: 'userHasOffer',
|
|
34
34
|
});
|
|
35
|
-
UserHasOfferModel.belongsTo(FeesCollectionModel, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
FeesCollectionModel.hasMany(UserHasOfferModel, {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
35
|
+
// UserHasOfferModel.belongsTo(FeesCollectionModel, {
|
|
36
|
+
// foreignKey: { name: 'feeCollectionId', field: 'fee_collection_id' },
|
|
37
|
+
// as: 'offerFeeCollection',
|
|
38
|
+
// });
|
|
39
|
+
// FeesCollectionModel.hasMany(UserHasOfferModel, {
|
|
40
|
+
// foreignKey: 'feeCollectionId',
|
|
41
|
+
// as: 'feeCollectionUserHasOffer',
|
|
42
|
+
// });
|
|
43
43
|
UserHasOfferModel.belongsTo(OfferModel, {
|
|
44
44
|
foreignKey: { name: 'offerId', field: 'offer_id' },
|
|
45
45
|
as: 'offerHasUserHasOffer',
|
|
@@ -101,7 +101,7 @@ UserHasOfferModel.init({
|
|
|
101
101
|
academicCalendarId: {
|
|
102
102
|
type: sequelize_1.DataTypes.UUID,
|
|
103
103
|
allowNull: true,
|
|
104
|
-
}
|
|
104
|
+
},
|
|
105
105
|
}, {
|
|
106
106
|
modelName: 'UserHasOfferModel',
|
|
107
107
|
tableName: 'user_has_offers',
|
package/package.json
CHANGED