@kipicore/dbcore 1.1.539 → 1.1.541

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.
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("sequelize-cli").Migration;
2
+ export = _exports;
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const table = await queryInterface.describeTable('past_year_record');
6
+ if (!table.medium) {
7
+ await queryInterface.addColumn('past_year_record', 'medium', {
8
+ type: Sequelize.STRING,
9
+ allowNull: true,
10
+ });
11
+ }
12
+ if (!table.board) {
13
+ await queryInterface.addColumn('past_year_record', 'board', {
14
+ type: Sequelize.STRING,
15
+ allowNull: true,
16
+ });
17
+ }
18
+ },
19
+ async down(queryInterface, Sequelize) {
20
+ const table = await queryInterface.describeTable('past_year_record');
21
+ if (table.medium) {
22
+ await queryInterface.removeColumn('past_year_record', 'medium');
23
+ }
24
+ if (table.board) {
25
+ await queryInterface.removeColumn('past_year_record', 'board');
26
+ }
27
+ }
28
+ };
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('notifications');
4
+ if (!table.type) {
5
+ await queryInterface.addColumn('notifications', 'type', {
6
+ type: Sequelize.ARRAY(Sequelize.STRING),
7
+ allowNull: true,
8
+ defaultValue: ['PUSH', 'SOCKET'],
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface) => {
13
+ const table = await queryInterface.describeTable('notifications');
14
+ if (table.type) {
15
+ await queryInterface.removeColumn('notifications', 'type');
16
+ }
17
+ };
18
+ module.exports = {
19
+ up,
20
+ down,
21
+ };
@@ -9,6 +9,8 @@ export interface IPastYearRecordModelAttributes extends IDefaultAttributes {
9
9
  failedStudent: number;
10
10
  schoolResult: number;
11
11
  boardResult: number;
12
+ medium?: string;
13
+ board?: string;
12
14
  instituteId: string;
13
15
  academicCalendarId: string;
14
16
  }
@@ -1,9 +1,10 @@
1
1
  import { IDefaultAttributes } from './commonInterface';
2
- import { NOTIFICATION_MODULE_TYPE, NOTIFICATION_STATUS } from '../constants/app';
2
+ import { NOTIFICATION_MODULE_TYPE, NOTIFICATION_STATUS, NOTIFICATION_TYPE } from '../constants/app';
3
3
  export interface INotificationModelAttributes extends IDefaultAttributes {
4
4
  id: string;
5
5
  title: string;
6
6
  message: string;
7
+ type: NOTIFICATION_TYPE[];
7
8
  senderId: string;
8
9
  receiverId: string;
9
10
  viewDate?: Date;
@@ -11,6 +11,8 @@ export declare class PastYearRecordModel extends Model<IPastYearRecordModelAttri
11
11
  failedStudent: number;
12
12
  schoolResult: number;
13
13
  boardResult: number;
14
+ medium: string;
15
+ board: string;
14
16
  academicCalendarId: string;
15
17
  instituteId: string;
16
18
  createdBy: string;
@@ -74,6 +74,14 @@ PastYearRecordModel.init({
74
74
  type: sequelize_1.DataTypes.FLOAT,
75
75
  field: 'board_result',
76
76
  },
77
+ medium: {
78
+ type: sequelize_1.DataTypes.STRING,
79
+ allowNull: true,
80
+ },
81
+ board: {
82
+ type: sequelize_1.DataTypes.STRING,
83
+ allowNull: true,
84
+ },
77
85
  instituteId: {
78
86
  type: sequelize_1.DataTypes.UUID,
79
87
  field: 'institute_id',
@@ -1,5 +1,5 @@
1
1
  import { Model } from 'sequelize';
2
- import { NOTIFICATION_MODULE_TYPE, NOTIFICATION_STATUS } from '../../constants/app';
2
+ import { NOTIFICATION_MODULE_TYPE, NOTIFICATION_STATUS, NOTIFICATION_TYPE } from '../../constants/app';
3
3
  import { INotificationModelAttributes } from '../../interfaces/sendNotificationInerface';
4
4
  import { TNotificationModelCreationAttributes } from '../../types/sendNotificationType';
5
5
  declare class SendNotificationModel extends Model<INotificationModelAttributes, TNotificationModelCreationAttributes> {
@@ -12,6 +12,7 @@ declare class SendNotificationModel extends Model<INotificationModelAttributes,
12
12
  message: string;
13
13
  instituteId: string;
14
14
  moduleType: NOTIFICATION_MODULE_TYPE;
15
+ type: NOTIFICATION_TYPE[];
15
16
  createdBy: string;
16
17
  updatedBy: string;
17
18
  deletedBy: string;
@@ -84,6 +84,11 @@ SendNotificationModel.init({
84
84
  allowNull: true,
85
85
  field: 'module_type',
86
86
  },
87
+ type: {
88
+ type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.STRING),
89
+ allowNull: true,
90
+ defaultValue: [app_1.NOTIFICATION_TYPE.PUSH, app_1.NOTIFICATION_TYPE.SOCKET],
91
+ },
87
92
  }, {
88
93
  modelName: 'SendNotificationModel',
89
94
  tableName: 'notifications',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.539",
3
+ "version": "1.1.541",
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",