@kipicore/dbcore 1.1.636 → 1.1.638
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/constants/app.d.ts +1 -1
- package/dist/constants/app.js +1 -1
- package/dist/db/psql/migrations/20260708000000-add-batch-id-to-class-room-collection.d.ts +2 -0
- package/dist/db/psql/migrations/20260708000000-add-batch-id-to-class-room-collection.js +18 -0
- package/dist/interfaces/classRoomCollectionInterface.d.ts +1 -0
- package/dist/models/psql/classRoomCollectionModel.d.ts +1 -0
- package/dist/models/psql/classRoomCollectionModel.js +22 -1
- package/package.json +1 -1
package/dist/constants/app.d.ts
CHANGED
|
@@ -1252,7 +1252,7 @@ export declare enum PAYMENT_STATUS {
|
|
|
1252
1252
|
PAID = "PAID",
|
|
1253
1253
|
UNPAID = "UNPAID",
|
|
1254
1254
|
PENDING = "PENDING",
|
|
1255
|
-
PENDING_REFUND = "
|
|
1255
|
+
PENDING_REFUND = "PENDING_REFUND",
|
|
1256
1256
|
REFUND = "REFUND"
|
|
1257
1257
|
}
|
|
1258
1258
|
export declare enum COMPETITION_EVENTS {
|
package/dist/constants/app.js
CHANGED
|
@@ -1514,7 +1514,7 @@ var PAYMENT_STATUS;
|
|
|
1514
1514
|
PAYMENT_STATUS["PAID"] = "PAID";
|
|
1515
1515
|
PAYMENT_STATUS["UNPAID"] = "UNPAID";
|
|
1516
1516
|
PAYMENT_STATUS["PENDING"] = "PENDING";
|
|
1517
|
-
PAYMENT_STATUS["PENDING_REFUND"] = "
|
|
1517
|
+
PAYMENT_STATUS["PENDING_REFUND"] = "PENDING_REFUND";
|
|
1518
1518
|
PAYMENT_STATUS["REFUND"] = "REFUND";
|
|
1519
1519
|
})(PAYMENT_STATUS || (exports.PAYMENT_STATUS = PAYMENT_STATUS = {}));
|
|
1520
1520
|
var COMPETITION_EVENTS;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
module.exports = {
|
|
3
|
+
up: async (queryInterface, Sequelize) => {
|
|
4
|
+
const tableInfo = await queryInterface.describeTable('class_room_collection');
|
|
5
|
+
if (!tableInfo.batch_id) {
|
|
6
|
+
await queryInterface.addColumn('class_room_collection', 'batch_id', {
|
|
7
|
+
type: Sequelize.UUID,
|
|
8
|
+
allowNull: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
down: async (queryInterface, Sequelize) => {
|
|
13
|
+
const tableInfo = await queryInterface.describeTable('class_room_collection');
|
|
14
|
+
if (tableInfo.batch_id) {
|
|
15
|
+
await queryInterface.removeColumn('class_room_collection', 'batch_id');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -5,7 +5,7 @@ const index_1 = require("./index");
|
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
class ClassRoomCollectionModel extends sequelize_1.Model {
|
|
7
7
|
static associate(models) {
|
|
8
|
-
const { UserModel, InstituteModel, AcademicCalendarModel, ClassRoomEventModel } = models;
|
|
8
|
+
const { UserModel, InstituteModel, AcademicCalendarModel, ClassRoomEventModel, BatchModel } = models;
|
|
9
9
|
ClassRoomCollectionModel.belongsTo(UserModel, {
|
|
10
10
|
foreignKey: {
|
|
11
11
|
name: 'createdBy',
|
|
@@ -106,6 +106,22 @@ class ClassRoomCollectionModel extends sequelize_1.Model {
|
|
|
106
106
|
},
|
|
107
107
|
as: 'classEventClassRCol',
|
|
108
108
|
});
|
|
109
|
+
ClassRoomCollectionModel.belongsTo(BatchModel, {
|
|
110
|
+
foreignKey: {
|
|
111
|
+
name: 'batchId',
|
|
112
|
+
allowNull: true,
|
|
113
|
+
field: 'batch_id',
|
|
114
|
+
},
|
|
115
|
+
as: 'classRColBatch',
|
|
116
|
+
});
|
|
117
|
+
BatchModel.hasMany(ClassRoomCollectionModel, {
|
|
118
|
+
foreignKey: {
|
|
119
|
+
name: 'batchId',
|
|
120
|
+
allowNull: true,
|
|
121
|
+
field: 'batch_id',
|
|
122
|
+
},
|
|
123
|
+
as: 'batchClassRCol',
|
|
124
|
+
});
|
|
109
125
|
}
|
|
110
126
|
}
|
|
111
127
|
ClassRoomCollectionModel.init({
|
|
@@ -154,6 +170,11 @@ ClassRoomCollectionModel.init({
|
|
|
154
170
|
field: 'class_room_event_id',
|
|
155
171
|
allowNull: true,
|
|
156
172
|
},
|
|
173
|
+
batchId: {
|
|
174
|
+
type: sequelize_1.DataTypes.UUID,
|
|
175
|
+
field: 'batch_id',
|
|
176
|
+
allowNull: true,
|
|
177
|
+
},
|
|
157
178
|
paidDate: {
|
|
158
179
|
type: sequelize_1.DataTypes.DATE,
|
|
159
180
|
field: 'paid_date',
|
package/package.json
CHANGED