@kipicore/dbcore 1.1.240 → 1.1.242

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.
@@ -486,7 +486,8 @@ export declare enum USER_CHAPTER_INDEX_STATUS {
486
486
  }
487
487
  export declare enum FEE_HISTORY_STATUS {
488
488
  COMPLETED = "COMPLETED",
489
- PENDING = "PENDING"
489
+ PENDING = "PENDING",
490
+ DELETED = "DELETED"
490
491
  }
491
492
  export declare enum CHAPTER_INDEX_FILE_TYPE {
492
493
  VIDEO = "VIDEO",
@@ -591,6 +591,7 @@ var FEE_HISTORY_STATUS;
591
591
  (function (FEE_HISTORY_STATUS) {
592
592
  FEE_HISTORY_STATUS["COMPLETED"] = "COMPLETED";
593
593
  FEE_HISTORY_STATUS["PENDING"] = "PENDING";
594
+ FEE_HISTORY_STATUS["DELETED"] = "DELETED";
594
595
  })(FEE_HISTORY_STATUS || (exports.FEE_HISTORY_STATUS = FEE_HISTORY_STATUS = {}));
595
596
  var CHAPTER_INDEX_FILE_TYPE;
596
597
  (function (CHAPTER_INDEX_FILE_TYPE) {
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface) {
5
+ const academic_calendars = await queryInterface.describeTable('academic_calendars');
6
+ if (academic_calendars.parent_id) {
7
+ await queryInterface.removeColumn('academic_calendars', 'parent_id');
8
+ }
9
+ const entity_wise_calendar = await queryInterface.describeTable('entity_wise_calendar');
10
+ if (entity_wise_calendar.parent_id) {
11
+ await queryInterface.removeColumn('entity_wise_calendar', 'parent_id');
12
+ }
13
+ },
14
+ async down() {
15
+ //
16
+ },
17
+ };
@@ -6,7 +6,6 @@ export interface IAcademicCalendarModelAttributes extends IDefaultAttributes {
6
6
  endDate: Date;
7
7
  instituteId: string;
8
8
  status: ACADEMIC_CALENDARS_STATUS;
9
- parentId: string;
10
9
  entityId: string;
11
10
  baseId: string;
12
11
  startYear: number;
@@ -2,7 +2,6 @@ import { ACADEMIC_CALENDARS_STATUS } from '../constants/app';
2
2
  import { IDefaultAttributes } from './commonInterface';
3
3
  export interface IEntityWiseCalendarModelAttributes extends IDefaultAttributes {
4
4
  id: string;
5
- parentId?: string;
6
5
  entityId: string;
7
6
  status: ACADEMIC_CALENDARS_STATUS;
8
7
  startDate: Date;
@@ -8,7 +8,6 @@ export declare class AcademicCalendarModel extends Model<IAcademicCalendarModelA
8
8
  startDate: Date;
9
9
  endDate: Date;
10
10
  status: ACADEMIC_CALENDARS_STATUS;
11
- parentId: string;
12
11
  entityId: string;
13
12
  baseId: string;
14
13
  startYear: number;
@@ -42,15 +42,6 @@ class AcademicCalendarModel extends sequelize_1.Model {
42
42
  foreignKey: 'instituteId',
43
43
  as: 'instituteHasAcademicCalendars',
44
44
  });
45
- // Self-referencing hierarchy
46
- AcademicCalendarModel.belongsTo(AcademicCalendarModel, {
47
- foreignKey: { name: 'parentId', field: 'parent_id' },
48
- as: 'parentAcademicCalendar',
49
- });
50
- AcademicCalendarModel.hasMany(AcademicCalendarModel, {
51
- foreignKey: { name: 'parentId', field: 'parent_id' },
52
- as: 'subAcademicCalendarList',
53
- });
54
45
  // Entity relation
55
46
  AcademicCalendarModel.belongsTo(InstituteEntityModel, {
56
47
  foreignKey: { name: 'entityId', field: 'entity_id' },
@@ -101,11 +92,6 @@ AcademicCalendarModel.init({
101
92
  field: 'end_year',
102
93
  allowNull: true,
103
94
  },
104
- parentId: {
105
- type: sequelize_1.DataTypes.UUID,
106
- field: 'parent_id',
107
- allowNull: true,
108
- },
109
95
  entityId: {
110
96
  type: sequelize_1.DataTypes.UUID,
111
97
  field: 'entity_id',
@@ -4,7 +4,6 @@ import { TEntityWiseCalendarModelCreationAttributes } from '../../types/entityWi
4
4
  import { ACADEMIC_CALENDARS_STATUS } from '../../constants/app';
5
5
  declare class EntityWiseCalendarModel extends Model<IEntityWiseCalendarModelAttributes, TEntityWiseCalendarModelCreationAttributes> {
6
6
  id: string;
7
- parentId?: string;
8
7
  entityId: string;
9
8
  status: ACADEMIC_CALENDARS_STATUS;
10
9
  startDate: Date;
@@ -18,15 +18,6 @@ class EntityWiseCalendarModel extends sequelize_1.Model {
18
18
  foreignKey: { name: 'deletedBy', field: 'deleted_by' },
19
19
  as: 'deletedByUser',
20
20
  });
21
- // Self-referencing hierarchy
22
- EntityWiseCalendarModel.belongsTo(EntityWiseCalendarModel, {
23
- foreignKey: { name: 'parentId', field: 'parent_id' },
24
- as: 'parentEntityWiseCalendar',
25
- });
26
- EntityWiseCalendarModel.hasMany(EntityWiseCalendarModel, {
27
- foreignKey: { name: 'parentId', field: 'parent_id' },
28
- as: 'subEntityWiseCalendarList',
29
- });
30
21
  // Entity relation
31
22
  EntityWiseCalendarModel.belongsTo(InstituteEntityModel, {
32
23
  foreignKey: { name: 'entityId', field: 'entity_id' },
@@ -45,11 +36,6 @@ EntityWiseCalendarModel.init({
45
36
  allowNull: false,
46
37
  primaryKey: true,
47
38
  },
48
- parentId: {
49
- type: sequelize_1.DataTypes.UUID,
50
- field: 'parent_id',
51
- allowNull: true,
52
- },
53
39
  entityId: {
54
40
  type: sequelize_1.DataTypes.UUID,
55
41
  field: 'entity_id',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.240",
3
+ "version": "1.1.242",
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",