@cool-digital-solutions/interferir-models 1.0.88 → 1.0.90

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.
@@ -9,6 +9,8 @@ const _config_1 = require("../config");
9
9
  const instantResearchSchema = new mongoose_1.Schema({
10
10
  company: { type: mongoose_1.Schema.Types.ObjectId, required: true, ref: 'Company' },
11
11
  investor: { type: mongoose_1.Schema.Types.ObjectId, required: true, ref: 'Company' },
12
+ addedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
13
+ score: { score: { type: Number, required: true }, reason: { type: String, required: true } },
12
14
  createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
13
15
  updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
14
16
  updatedDate: { type: Number, index: -1 },
@@ -20,6 +22,8 @@ instantResearchSchema.pre('save', function (next) {
20
22
  if (user) {
21
23
  if (!this.createdBy)
22
24
  this.createdBy = user._id;
25
+ if (!this.addedBy)
26
+ this.addedBy = user._id;
23
27
  if (!notUpdatedBy)
24
28
  this.updatedBy = user._id;
25
29
  }
@@ -100,4 +100,8 @@ portiaArticleSchema.pre('findOneAndUpdate', function (next) {
100
100
  this._update.updatedBy = user._id;
101
101
  next();
102
102
  });
103
+ portiaArticleSchema.index({
104
+ title: -1,
105
+ 'analysisResult.summary': -1,
106
+ });
103
107
  exports.default = portiaArticleSchema;
@@ -24,9 +24,15 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { Types } from 'mongoose';
26
26
  import { BaseModel, BaseSchema } from '../config';
27
+ export interface scoreDetail {
28
+ score: number;
29
+ reason: string;
30
+ }
27
31
  export interface IInvestor extends BaseSchema {
28
32
  company: Types.ObjectId;
29
33
  investor: Types.ObjectId;
34
+ score: scoreDetail;
35
+ addedBy?: Types.ObjectId;
30
36
  }
31
37
  export interface IInvestorModel extends BaseModel<IInvestor> {
32
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cool-digital-solutions/interferir-models",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "main": "./dist/index.js",
5
5
  "files": [
6
6
  "dist/**/*"