@kipicore/dbcore 1.1.117 → 1.1.119
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/20251205062200-add_ids_subjectHFee.d.ts +2 -0
- package/dist/db/psql/migrations/20251205062200-add_ids_subjectHFee.js +41 -0
- package/dist/interfaces/competitionInterface.d.ts +1 -1
- package/dist/interfaces/seatingArrangement.d.ts +1 -0
- package/dist/interfaces/subjectHasFeeInterface.d.ts +3 -0
- package/dist/models/mongodb/competitionModel.js +1 -1
- package/dist/models/mongodb/seatingArrangementModel.js +1 -0
- package/dist/models/psql/subjectHasFeeModel.d.ts +3 -0
- package/dist/models/psql/subjectHasFeeModel.js +40 -1
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const up = async (queryInterface, Sequelize) => {
|
|
3
|
+
const table = await queryInterface.describeTable('subject_has_fee');
|
|
4
|
+
if (!table.batch_id) {
|
|
5
|
+
await queryInterface.addColumn('subject_has_fee', 'batch_id', {
|
|
6
|
+
type: Sequelize.UUID,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
field: 'batch_id',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!table.batch_type) {
|
|
12
|
+
await queryInterface.addColumn('subject_has_fee', 'batch_type', {
|
|
13
|
+
type: Sequelize.UUID,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
field: 'batch_type',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (!table.academic_calender_id) {
|
|
19
|
+
await queryInterface.addColumn('subject_has_fee', 'academic_calender_id', {
|
|
20
|
+
type: Sequelize.UUID,
|
|
21
|
+
allowNull: true,
|
|
22
|
+
field: 'academic_calender_id',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const down = async (queryInterface, Sequelize) => {
|
|
27
|
+
const table = await queryInterface.describeTable('subject_has_fee');
|
|
28
|
+
if (table.batch_id) {
|
|
29
|
+
await queryInterface.removeColumn('subject_has_fee', 'batch_id');
|
|
30
|
+
}
|
|
31
|
+
if (table.batch_type) {
|
|
32
|
+
await queryInterface.removeColumn('subject_has_fee', 'batch_type');
|
|
33
|
+
}
|
|
34
|
+
if (table.academic_calender_id) {
|
|
35
|
+
await queryInterface.removeColumn('subject_has_fee', 'academic_calender_id');
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
module.exports = {
|
|
39
|
+
up,
|
|
40
|
+
down,
|
|
41
|
+
};
|
|
@@ -16,7 +16,7 @@ export interface ICompetitionAttributes extends IDefaultAttributes, Document {
|
|
|
16
16
|
type: COMPETITION_TYPE;
|
|
17
17
|
rules: string;
|
|
18
18
|
maxGroupSize: number;
|
|
19
|
-
|
|
19
|
+
venue: string;
|
|
20
20
|
rounds: IRoundsInformationAttributes[];
|
|
21
21
|
competitionPoster: string[];
|
|
22
22
|
startTime: Date;
|
|
@@ -8,6 +8,7 @@ export interface IExamRoomStudentRangeAttributes {
|
|
|
8
8
|
}
|
|
9
9
|
export interface ISeatingClassroomAttributes {
|
|
10
10
|
classRoomId: string;
|
|
11
|
+
capacity: number;
|
|
11
12
|
examDetails: IExamRoomStudentRangeAttributes[];
|
|
12
13
|
}
|
|
13
14
|
export interface ISeatingArrangementModelAttributes extends IDefaultAttributes, Document {
|
|
@@ -42,6 +42,7 @@ const ExamRoomStudentRangeSchema = new mongoose_1.Schema({
|
|
|
42
42
|
}, { _id: false });
|
|
43
43
|
const SeatingClassroomSchema = new mongoose_1.Schema({
|
|
44
44
|
classRoomId: { type: String, required: true },
|
|
45
|
+
capacity: { type: Number, required: false },
|
|
45
46
|
examDetails: { type: [ExamRoomStudentRangeSchema], required: true },
|
|
46
47
|
}, { _id: false });
|
|
47
48
|
const SeatingArrangementSchema = new mongoose_1.Schema({
|
|
@@ -6,6 +6,9 @@ declare class SubjectHasFeeModel extends Model<ISubjectHasFeeModelAttributes, TS
|
|
|
6
6
|
instituteId: string;
|
|
7
7
|
subjectId: string;
|
|
8
8
|
fee: number;
|
|
9
|
+
academicCalenderId?: string;
|
|
10
|
+
batchId?: string;
|
|
11
|
+
batchType?: string;
|
|
9
12
|
createdBy: string;
|
|
10
13
|
updatedBy: string;
|
|
11
14
|
deletedBy: string;
|
|
@@ -4,7 +4,7 @@ const sequelize_1 = require("sequelize");
|
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
class SubjectHasFeeModel extends sequelize_1.Model {
|
|
6
6
|
static associate(models) {
|
|
7
|
-
const { InstituteModel, InstituteEntityModel, UserModel } = models;
|
|
7
|
+
const { InstituteModel, InstituteEntityModel, UserModel, BatchModel, TypeManagementModel, AcademicCalendarModel } = models;
|
|
8
8
|
SubjectHasFeeModel.belongsTo(InstituteModel, {
|
|
9
9
|
foreignKey: {
|
|
10
10
|
name: 'instituteId',
|
|
@@ -27,6 +27,30 @@ class SubjectHasFeeModel extends sequelize_1.Model {
|
|
|
27
27
|
foreignKey: 'subjectId',
|
|
28
28
|
as: 'subjectHasSubjectHasFee',
|
|
29
29
|
});
|
|
30
|
+
SubjectHasFeeModel.belongsTo(AcademicCalendarModel, {
|
|
31
|
+
foreignKey: { name: 'academicCalenderId', field: 'academic_calender_id' },
|
|
32
|
+
as: 'subHFeeAcaCal',
|
|
33
|
+
});
|
|
34
|
+
AcademicCalendarModel.hasMany(SubjectHasFeeModel, {
|
|
35
|
+
foreignKey: { name: 'academicCalenderId', field: 'academic_calender_id' },
|
|
36
|
+
as: 'acaCalSubHFee',
|
|
37
|
+
});
|
|
38
|
+
SubjectHasFeeModel.belongsTo(BatchModel, {
|
|
39
|
+
foreignKey: { name: 'batchId', field: 'batch_id' },
|
|
40
|
+
as: 'subHFeeBatchDetails',
|
|
41
|
+
});
|
|
42
|
+
BatchModel.hasMany(SubjectHasFeeModel, {
|
|
43
|
+
foreignKey: { name: 'batchId', field: 'batch_id' },
|
|
44
|
+
as: 'batchSubHFee',
|
|
45
|
+
});
|
|
46
|
+
SubjectHasFeeModel.belongsTo(TypeManagementModel, {
|
|
47
|
+
foreignKey: { name: 'batchType', field: 'batch_type' },
|
|
48
|
+
as: 'subHFeeBatchType',
|
|
49
|
+
});
|
|
50
|
+
TypeManagementModel.hasMany(SubjectHasFeeModel, {
|
|
51
|
+
foreignKey: { name: 'batchType', field: 'batch_type' },
|
|
52
|
+
as: 'batchTypeSubHFee',
|
|
53
|
+
});
|
|
30
54
|
SubjectHasFeeModel.belongsTo(UserModel, {
|
|
31
55
|
foreignKey: {
|
|
32
56
|
name: 'createdBy',
|
|
@@ -72,6 +96,21 @@ SubjectHasFeeModel.init({
|
|
|
72
96
|
type: sequelize_1.DataTypes.INTEGER,
|
|
73
97
|
allowNull: false,
|
|
74
98
|
},
|
|
99
|
+
academicCalenderId: {
|
|
100
|
+
type: sequelize_1.DataTypes.UUID,
|
|
101
|
+
field: 'academic_calender_id',
|
|
102
|
+
allowNull: true,
|
|
103
|
+
},
|
|
104
|
+
batchId: {
|
|
105
|
+
type: sequelize_1.DataTypes.UUID,
|
|
106
|
+
field: 'batch_id',
|
|
107
|
+
allowNull: true,
|
|
108
|
+
},
|
|
109
|
+
batchType: {
|
|
110
|
+
type: sequelize_1.DataTypes.UUID,
|
|
111
|
+
field: 'batch_type',
|
|
112
|
+
allowNull: true,
|
|
113
|
+
},
|
|
75
114
|
}, {
|
|
76
115
|
modelName: 'SubjectHasFeeModel',
|
|
77
116
|
tableName: 'subject_has_fee',
|
package/package.json
CHANGED