@kipicore/dbcore 1.1.454 → 1.1.457

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.
@@ -1432,9 +1432,10 @@ export declare enum ROLE_HAS_PERMISSION_ERROR_MESSAGES {
1432
1432
  GET_FAIL = "Unable to retrieve role permission!"
1433
1433
  }
1434
1434
  export declare enum ROLE_MANAGEMENT_ERROR_MESSAGES {
1435
- ALREADY_EXISTS = "Role already for this model exists!"
1435
+ ALREADY_EXISTS = "Role already for this model exists!",
1436
+ NOT_FOUND = "Role not found"
1436
1437
  }
1437
1438
  export declare enum USER_HAS_PERMISSION_ERROR_MESSAGES {
1438
1439
  ALREADY_EXISTS = "Role and Permission already exists!",
1439
- NOT_FOUND = "Role and Permission has been removed!"
1440
+ NOT_FOUND = "Role and Permission not found!"
1440
1441
  }
@@ -1596,9 +1596,10 @@ var ROLE_HAS_PERMISSION_ERROR_MESSAGES;
1596
1596
  var ROLE_MANAGEMENT_ERROR_MESSAGES;
1597
1597
  (function (ROLE_MANAGEMENT_ERROR_MESSAGES) {
1598
1598
  ROLE_MANAGEMENT_ERROR_MESSAGES["ALREADY_EXISTS"] = "Role already for this model exists!";
1599
+ ROLE_MANAGEMENT_ERROR_MESSAGES["NOT_FOUND"] = "Role not found";
1599
1600
  })(ROLE_MANAGEMENT_ERROR_MESSAGES || (exports.ROLE_MANAGEMENT_ERROR_MESSAGES = ROLE_MANAGEMENT_ERROR_MESSAGES = {}));
1600
1601
  var USER_HAS_PERMISSION_ERROR_MESSAGES;
1601
1602
  (function (USER_HAS_PERMISSION_ERROR_MESSAGES) {
1602
1603
  USER_HAS_PERMISSION_ERROR_MESSAGES["ALREADY_EXISTS"] = "Role and Permission already exists!";
1603
- USER_HAS_PERMISSION_ERROR_MESSAGES["NOT_FOUND"] = "Role and Permission has been removed!";
1604
+ USER_HAS_PERMISSION_ERROR_MESSAGES["NOT_FOUND"] = "Role and Permission not found!";
1604
1605
  })(USER_HAS_PERMISSION_ERROR_MESSAGES || (exports.USER_HAS_PERMISSION_ERROR_MESSAGES = USER_HAS_PERMISSION_ERROR_MESSAGES = {}));
@@ -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('advertisements');
4
+ if (!table.media_url) {
5
+ await queryInterface.addColumn('advertisements', 'media_url', {
6
+ type: Sequelize.STRING,
7
+ allowNull: true,
8
+ field: 'media_url',
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface) => {
13
+ const table = await queryInterface.describeTable('advertisements');
14
+ // Remove only if column exists
15
+ if (table.media_url) {
16
+ await queryInterface.removeColumn('advertisements', 'media_url');
17
+ }
18
+ };
19
+ module.exports = {
20
+ up,
21
+ down,
22
+ };
@@ -11,4 +11,5 @@ export interface IAdvertisementModelAttributes extends IDefaultAttributes {
11
11
  description: string;
12
12
  fileStorageId: string;
13
13
  status: COMMAN_STATUS;
14
+ mediaUrl?: string;
14
15
  }
@@ -190,4 +190,4 @@ export * from './communityMessageInterface';
190
190
  export * from './permissionsInterface';
191
191
  export * from './roleHasPermissionInterface';
192
192
  export * from './userHasPermissionInterface';
193
- export * from './roleInterface';
193
+ export * from './roleManagementInterface';
@@ -206,4 +206,4 @@ __exportStar(require("./communityMessageInterface"), exports);
206
206
  __exportStar(require("./permissionsInterface"), exports);
207
207
  __exportStar(require("./roleHasPermissionInterface"), exports);
208
208
  __exportStar(require("./userHasPermissionInterface"), exports);
209
- __exportStar(require("./roleInterface"), exports);
209
+ __exportStar(require("./roleManagementInterface"), exports);
@@ -13,6 +13,7 @@ declare class AdvertisementModel extends Model<IAdvertisementModelAttributes, TA
13
13
  userType: USER_TYPES;
14
14
  fileStorageId: string;
15
15
  status: COMMAN_STATUS;
16
+ mediaUrl?: string;
16
17
  createdBy: string;
17
18
  updatedBy: string;
18
19
  deletedBy: string;
@@ -98,6 +98,11 @@ AdvertisementModel.init({
98
98
  allowNull: true,
99
99
  field: 'institute_id',
100
100
  },
101
+ mediaUrl: {
102
+ type: sequelize_1.DataTypes.STRING,
103
+ allowNull: true,
104
+ field: 'media_url',
105
+ },
101
106
  }, {
102
107
  modelName: 'advertisement',
103
108
  tableName: 'advertisements',
@@ -4,7 +4,7 @@ const sequelize_1 = require("sequelize");
4
4
  const index_1 = require("./index");
5
5
  class PermissionModel extends sequelize_1.Model {
6
6
  static associate(models) {
7
- const { UserModel, InstituteEntityTypeModel, InstituteModel } = models;
7
+ const { UserModel } = models;
8
8
  PermissionModel.belongsTo(UserModel, {
9
9
  foreignKey: {
10
10
  name: 'createdBy',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.454",
3
+ "version": "1.1.457",
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",