@kipicore/dbcore 1.1.271 → 1.1.273

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
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('campus');
4
+ if (!table.cover_image) {
5
+ await queryInterface.addColumn('campus', 'cover_image', {
6
+ type: Sequelize.UUID,
7
+ allowNull: true,
8
+ field: 'cover_image',
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface, Sequelize) => {
13
+ const table = await queryInterface.describeTable('campus');
14
+ if (table.cover_image) {
15
+ await queryInterface.removeColumn('campus', 'cover_image');
16
+ }
17
+ };
18
+ module.exports = {
19
+ up,
20
+ down,
21
+ };
@@ -6,4 +6,5 @@ export interface ICampusAttributes extends IDefaultAttributes {
6
6
  subTitle: string;
7
7
  ownerId: string;
8
8
  status: COMMAN_STATUS;
9
+ coverImage?: string;
9
10
  }
@@ -56,4 +56,5 @@ export interface IUserInstituteMetaAttributes extends IDefaultAttributes, Docume
56
56
  studentFeeService?: IStudentFeeService[];
57
57
  studentFeeType?: FEE_COLLECTION_TYPE;
58
58
  isSchoolMeta?: boolean;
59
+ isFeeCarryForward: boolean;
59
60
  }
@@ -227,6 +227,10 @@ const userInstituteMetaSchema = new mongoose_1.Schema({
227
227
  type: Boolean,
228
228
  default: true,
229
229
  },
230
+ isFeeCarryForward: {
231
+ type: Boolean,
232
+ default: false,
233
+ },
230
234
  }, {
231
235
  timestamps: true,
232
236
  versionKey: false,
@@ -6,6 +6,7 @@ export declare class CampusModel extends Model<ICampusAttributes> implements ICa
6
6
  title: string;
7
7
  subTitle: string;
8
8
  ownerId: string;
9
+ coverImage?: string;
9
10
  status: COMMAN_STATUS;
10
11
  readonly createdAt: Date;
11
12
  readonly deletedAt: string;
@@ -6,7 +6,7 @@ const constants_1 = require("../../constants");
6
6
  const index_1 = require("./index");
7
7
  class CampusModel extends sequelize_1.Model {
8
8
  static associate(models) {
9
- const { UserModel } = models;
9
+ const { UserModel, FileStorageModel } = models;
10
10
  CampusModel.belongsTo(UserModel, {
11
11
  foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
12
12
  as: 'createdByUser',
@@ -27,6 +27,10 @@ class CampusModel extends sequelize_1.Model {
27
27
  foreignKey: { name: 'ownerId', allowNull: true, field: 'owner_id' },
28
28
  as: 'campusUserDetails',
29
29
  });
30
+ CampusModel.belongsTo(FileStorageModel, {
31
+ foreignKey: { name: 'coverImage', allowNull: true, field: 'cover_image' },
32
+ as: 'CampusImage',
33
+ });
30
34
  }
31
35
  }
32
36
  exports.CampusModel = CampusModel;
@@ -44,7 +48,7 @@ CampusModel.init({
44
48
  subTitle: {
45
49
  type: sequelize_1.DataTypes.STRING,
46
50
  allowNull: true,
47
- field: 'sub_title'
51
+ field: 'sub_title',
48
52
  },
49
53
  ownerId: {
50
54
  type: sequelize_1.DataTypes.UUID,
@@ -53,7 +57,12 @@ CampusModel.init({
53
57
  },
54
58
  status: {
55
59
  type: sequelize_1.DataTypes.STRING,
56
- defaultValue: constants_1.COMMAN_STATUS.ACTIVE
60
+ defaultValue: constants_1.COMMAN_STATUS.ACTIVE,
61
+ },
62
+ coverImage: {
63
+ type: sequelize_1.DataTypes.UUID,
64
+ defaultValue: null,
65
+ field: 'cover_image'
57
66
  },
58
67
  }, {
59
68
  sequelize: index_1.sequelize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.271",
3
+ "version": "1.1.273",
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",