@kipicore/dbcore 1.1.458 → 1.1.460

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/README.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # kipi-db-core
2
2
 
3
3
 
4
- // yarn pgdb:model --name student_fee_collection
4
+ // yarn pgdb:model --name student_fee_collection
5
+
6
+
7
+ name as par Aadharcard
8
+ passPort number
9
+ passPort as name
10
+ hight and wight
@@ -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,22 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('permissions');
4
+ if (!table.user_types) {
5
+ await queryInterface.addColumn('permissions', 'user_types', {
6
+ type: Sequelize.ARRAY(Sequelize.STRING),
7
+ allowNull: true,
8
+ field: 'user_types',
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface) => {
13
+ const table = await queryInterface.describeTable('permissions');
14
+ // Remove only if column exists
15
+ if (table.user_types) {
16
+ await queryInterface.removeColumn('permissions', 'user_types');
17
+ }
18
+ };
19
+ module.exports = {
20
+ up,
21
+ down,
22
+ };
@@ -1,4 +1,4 @@
1
- import { APP_TYPE, PERMISSION_TYPE } from '../constants/app';
1
+ import { APP_TYPE, PERMISSION_TYPE, USER_TYPES } from '../constants/app';
2
2
  import { IDefaultAttributes } from './commonInterface';
3
3
  export interface IPermissionAttributes extends IDefaultAttributes {
4
4
  id: string;
@@ -8,4 +8,9 @@ export interface IPermissionAttributes extends IDefaultAttributes {
8
8
  permissionId: string;
9
9
  code: string;
10
10
  appType: APP_TYPE;
11
+ userTypes: USER_TYPES[];
12
+ }
13
+ export interface IPermissionTree extends IPermissionAttributes {
14
+ features?: IPermissionTree[];
15
+ actions?: IPermissionTree[];
11
16
  }
@@ -1,5 +1,5 @@
1
1
  import { Model } from 'sequelize';
2
- import { PERMISSION_TYPE } from '../../constants/app';
2
+ import { PERMISSION_TYPE, USER_TYPES } from '../../constants/app';
3
3
  import { IPermissionAttributes } from '../../interfaces';
4
4
  import { TPermissionCreationAttributes } from '../../types';
5
5
  declare class PermissionModel extends Model<IPermissionAttributes, TPermissionCreationAttributes> {
@@ -10,6 +10,7 @@ declare class PermissionModel extends Model<IPermissionAttributes, TPermissionCr
10
10
  permissionId: string;
11
11
  code: string;
12
12
  appType: string;
13
+ userTypes: USER_TYPES[];
13
14
  createdBy: string;
14
15
  updatedBy: string;
15
16
  deletedBy: string;
@@ -66,6 +66,10 @@ PermissionModel.init({
66
66
  code: {
67
67
  type: sequelize_1.DataTypes.STRING,
68
68
  },
69
+ userTypes: {
70
+ type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.STRING),
71
+ defaultValue: [],
72
+ },
69
73
  }, {
70
74
  modelName: 'PermissionModel',
71
75
  tableName: 'permissions',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.458",
3
+ "version": "1.1.460",
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",