codebase-models 2.1.11 → 2.1.12

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.
@@ -24,9 +24,13 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import mongoose, { Document } from "mongoose";
26
26
  export interface IPortfolio extends Document {
27
- portfoliokey: mongoose.Schema.Types.Mixed;
27
+ name: string;
28
+ client: [mongoose.Schema.Types.ObjectId];
29
+ user: [mongoose.Schema.Types.ObjectId];
28
30
  portfolioData?: mongoose.Schema.Types.Mixed;
29
31
  organizationId?: mongoose.Schema.Types.ObjectId;
32
+ emails?: [string];
33
+ slackChannels?: [string];
30
34
  }
31
35
  declare const Portfolio: mongoose.Model<any, {}, {}, {}, any, any>;
32
36
  export default Portfolio;
@@ -25,10 +25,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const mongoose_1 = __importStar(require("mongoose"));
27
27
  const PortfolioSchema = new mongoose_1.Schema({
28
- portfoliokey: {
29
- type: mongoose_1.default.Schema.Types.Mixed,
28
+ name: {
29
+ type: String,
30
+ required: true,
31
+ },
32
+ client: {
33
+ type: [mongoose_1.default.Schema.Types.ObjectId],
34
+ ref: "client",
30
35
  required: true,
31
36
  },
37
+ user: {
38
+ type: [mongoose_1.default.Schema.Types.ObjectId],
39
+ ref: "user",
40
+ required: true,
41
+ },
42
+ emails: {
43
+ type: [String],
44
+ default: [],
45
+ },
32
46
  portfolioData: {
33
47
  type: mongoose_1.default.Schema.Types.Mixed,
34
48
  default: null,
@@ -38,6 +52,10 @@ const PortfolioSchema = new mongoose_1.Schema({
38
52
  ref: "organization",
39
53
  default: null,
40
54
  },
55
+ slackChannels: {
56
+ type: [String],
57
+ default: [],
58
+ },
41
59
  }, {
42
60
  timestamps: true,
43
61
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-models",
3
- "version": "2.1.11",
3
+ "version": "2.1.12",
4
4
  "description": "Common models for codebase",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,17 +1,35 @@
1
1
  import mongoose, { Document, Schema, model } from "mongoose";
2
2
 
3
3
  export interface IPortfolio extends Document {
4
- portfoliokey: mongoose.Schema.Types.Mixed;
4
+ name: string;
5
+ client: [mongoose.Schema.Types.ObjectId];
6
+ user: [mongoose.Schema.Types.ObjectId];
5
7
  portfolioData?: mongoose.Schema.Types.Mixed;
6
8
  organizationId?: mongoose.Schema.Types.ObjectId;
9
+ emails?: [string];
10
+ slackChannels?: [string];
7
11
  }
8
12
 
9
13
  const PortfolioSchema = new Schema<IPortfolio>(
10
14
  {
11
- portfoliokey: {
12
- type: mongoose.Schema.Types.Mixed,
15
+ name: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ client: {
20
+ type: [mongoose.Schema.Types.ObjectId],
21
+ ref: "client",
13
22
  required: true,
14
23
  },
24
+ user: {
25
+ type: [mongoose.Schema.Types.ObjectId],
26
+ ref: "user",
27
+ required: true,
28
+ },
29
+ emails: {
30
+ type: [String],
31
+ default: [],
32
+ },
15
33
  portfolioData: {
16
34
  type: mongoose.Schema.Types.Mixed,
17
35
  default: null,
@@ -21,6 +39,10 @@ const PortfolioSchema = new Schema<IPortfolio>(
21
39
  ref: "organization",
22
40
  default: null,
23
41
  },
42
+ slackChannels: {
43
+ type: [String],
44
+ default: [],
45
+ },
24
46
  },
25
47
  {
26
48
  timestamps: true,