@kipicore/dbcore 1.1.512 → 1.1.513

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.
@@ -1373,5 +1373,6 @@ export declare enum FEE_SUBMISSION_STATUS {
1373
1373
  PENDING = "PENDING",
1374
1374
  ACCEPTED = "ACCEPTED",
1375
1375
  NOT_ACCEPTED = "NOT_ACCEPTED",
1376
- RECEIVED = "RECEIVED"
1376
+ RECEIVED = "RECEIVED",
1377
+ SENT = "SENT"
1377
1378
  }
@@ -1670,4 +1670,5 @@ var FEE_SUBMISSION_STATUS;
1670
1670
  FEE_SUBMISSION_STATUS["ACCEPTED"] = "ACCEPTED";
1671
1671
  FEE_SUBMISSION_STATUS["NOT_ACCEPTED"] = "NOT_ACCEPTED";
1672
1672
  FEE_SUBMISSION_STATUS["RECEIVED"] = "RECEIVED";
1673
+ FEE_SUBMISSION_STATUS["SENT"] = "SENT";
1673
1674
  })(FEE_SUBMISSION_STATUS || (exports.FEE_SUBMISSION_STATUS = FEE_SUBMISSION_STATUS = {}));
@@ -14,7 +14,7 @@ const up = async (queryInterface, Sequelize) => {
14
14
  primaryKey: true,
15
15
  },
16
16
  parentId: {
17
- type: Sequelize.UUID,
17
+ type: Sequelize.ARRAY(Sequelize.UUID),
18
18
  allowNull: true,
19
19
  field: 'parent_id',
20
20
  },
@@ -98,7 +98,7 @@ const up = async (queryInterface, Sequelize) => {
98
98
  primaryKey: true,
99
99
  },
100
100
  parentId: {
101
- type: Sequelize.UUID,
101
+ type: Sequelize.ARRAY(Sequelize.UUID),
102
102
  allowNull: true,
103
103
  field: 'parent_id',
104
104
  },
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const tableName = 'fee_submission_track';
4
+ const tableDescription = await queryInterface.describeTable(tableName);
5
+ // If column exists -> change datatype
6
+ if (tableDescription.parent_id) {
7
+ await queryInterface.changeColumn(tableName, 'parent_id', {
8
+ type: Sequelize.ARRAY(Sequelize.UUID),
9
+ allowNull: true,
10
+ });
11
+ }
12
+ else {
13
+ await queryInterface.addColumn(tableName, 'parent_id', {
14
+ type: Sequelize.ARRAY(Sequelize.UUID),
15
+ allowNull: true,
16
+ });
17
+ }
18
+ };
19
+ const down = async (queryInterface, Sequelize) => {
20
+ const tableName = 'fee_submission_track';
21
+ const tableDescription = await queryInterface.describeTable(tableName);
22
+ if (tableDescription.parent_id) {
23
+ await queryInterface.changeColumn(tableName, 'parent_id', {
24
+ type: Sequelize.ARRAY(Sequelize.UUID),
25
+ allowNull: true,
26
+ });
27
+ }
28
+ };
29
+ module.exports = {
30
+ up,
31
+ down,
32
+ };
@@ -8,7 +8,7 @@ export interface IFeeSubmissionTrackModelAttributes extends IDefaultAttributes {
8
8
  instituteId?: string;
9
9
  academicCalendarId?: string;
10
10
  submittedUserId?: string;
11
- parentId?: string;
11
+ parentId?: string[];
12
12
  submittedDate?: Date;
13
13
  collectedDate?: Date;
14
14
  }
@@ -10,7 +10,7 @@ declare class FeeSubmissionTrackModel extends Model<IFeeSubmissionTrackModelAttr
10
10
  academicCalendarId?: string;
11
11
  status: FEE_SUBMISSION_STATUS;
12
12
  submittedUserId?: string;
13
- parentId?: string;
13
+ parentId?: string[];
14
14
  submittedDate?: Date;
15
15
  collectedDate?: Date;
16
16
  createdBy?: string;
@@ -5,14 +5,6 @@ const index_1 = require("./index");
5
5
  class FeeSubmissionTrackModel extends sequelize_1.Model {
6
6
  static associate(models) {
7
7
  const { UserModel, InstituteModel, AcademicCalendarModel } = models;
8
- FeeSubmissionTrackModel.hasMany(FeeSubmissionTrackModel, {
9
- foreignKey: {
10
- name: 'parentId',
11
- allowNull: true,
12
- field: 'parent_id',
13
- },
14
- as: 'feeSubmissionTrackChildren',
15
- });
16
8
  FeeSubmissionTrackModel.belongsTo(UserModel, {
17
9
  foreignKey: { name: 'collectorId', allowNull: true, field: 'collector_id' },
18
10
  as: 'feeSubmissionTrackCollector',
@@ -81,7 +73,7 @@ FeeSubmissionTrackModel.init({
81
73
  allowNull: true,
82
74
  },
83
75
  parentId: {
84
- type: sequelize_1.DataTypes.UUID,
76
+ type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.UUID),
85
77
  allowNull: true,
86
78
  field: 'parent_id',
87
79
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.512",
3
+ "version": "1.1.513",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",