gemcap-be-common 1.4.217 → 1.4.219

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.
@@ -41,10 +41,10 @@ export interface IBorrowerNoteAiSummary {
41
41
  summary: string;
42
42
  subject: string;
43
43
  status: TProspectFileAiSummaryStatus;
44
- model: string;
45
- promptSlug: string;
46
- promptVersion: number;
47
- contentHash: string;
44
+ model?: string;
45
+ promptSlug?: string;
46
+ promptVersion?: number;
47
+ contentHash?: string;
48
48
  error?: string;
49
49
  }
50
50
  export interface IBorrowerNoteAiSummaryDoc extends IBorrowerNoteAiSummary, Document {
@@ -65,11 +65,11 @@ export interface IBorrowerNoteAiSummaryPlain extends Omit<IBorrowerNoteAiSummary
65
65
  updatedAt: Date;
66
66
  }
67
67
  export type TProspectFileAiSummaryModel = mongoose.Model<IBorrowerNoteAiSummaryDoc>;
68
- export declare const ProspectFileAiSummarySchema: mongoose.Schema<IBorrowerNoteAiSummaryDoc, mongoose.Model<IBorrowerNoteAiSummaryDoc, any, any, any, mongoose.Document<unknown, any, IBorrowerNoteAiSummaryDoc> & IBorrowerNoteAiSummaryDoc & Required<{
68
+ export declare const BorrowerNoteAiSummarySchema: mongoose.Schema<IBorrowerNoteAiSummaryDoc, mongoose.Model<IBorrowerNoteAiSummaryDoc, any, any, any, mongoose.Document<unknown, any, IBorrowerNoteAiSummaryDoc> & IBorrowerNoteAiSummaryDoc & Required<{
69
69
  _id: mongoose.Types.ObjectId;
70
70
  }>, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IBorrowerNoteAiSummaryDoc, mongoose.Document<unknown, {}, mongoose.FlatRecord<IBorrowerNoteAiSummaryDoc>> & mongoose.FlatRecord<IBorrowerNoteAiSummaryDoc> & Required<{
71
71
  _id: mongoose.Types.ObjectId;
72
72
  }>>;
73
- export declare const ProspectFileAiSummary: mongoose.Model<IBorrowerNoteAiSummaryDoc, {}, {}, {}, mongoose.Document<unknown, {}, IBorrowerNoteAiSummaryDoc> & IBorrowerNoteAiSummaryDoc & Required<{
73
+ export declare const BorrowerNoteAiSummary: mongoose.Model<IBorrowerNoteAiSummaryDoc, {}, {}, {}, mongoose.Document<unknown, {}, IBorrowerNoteAiSummaryDoc> & IBorrowerNoteAiSummaryDoc & Required<{
74
74
  _id: mongoose.Types.ObjectId;
75
75
  }>, any>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ProspectFileAiSummary = exports.ProspectFileAiSummarySchema = exports.PROSPECT_FILE_AI_SUMMARY_STATUSES = exports.AI_SUMMARY_TARGET_TYPES = void 0;
6
+ exports.BorrowerNoteAiSummary = exports.BorrowerNoteAiSummarySchema = exports.PROSPECT_FILE_AI_SUMMARY_STATUSES = exports.AI_SUMMARY_TARGET_TYPES = void 0;
7
7
  const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const _models_1 = require("./_models");
9
9
  exports.AI_SUMMARY_TARGET_TYPES = {
@@ -15,7 +15,7 @@ exports.PROSPECT_FILE_AI_SUMMARY_STATUSES = {
15
15
  DONE: 'DONE',
16
16
  ERROR: 'ERROR',
17
17
  };
18
- exports.ProspectFileAiSummarySchema = new mongoose_1.default.Schema({
18
+ exports.BorrowerNoteAiSummarySchema = new mongoose_1.default.Schema({
19
19
  targetType: {
20
20
  type: String,
21
21
  enum: exports.AI_SUMMARY_TARGET_TYPES,
@@ -41,19 +41,31 @@ exports.ProspectFileAiSummarySchema = new mongoose_1.default.Schema({
41
41
  default: exports.PROSPECT_FILE_AI_SUMMARY_STATUSES.PENDING,
42
42
  index: true,
43
43
  },
44
- model: String,
45
- promptSlug: String,
46
- promptVersion: Number,
44
+ model: {
45
+ type: String,
46
+ required: false,
47
+ },
48
+ promptSlug: {
49
+ type: String,
50
+ required: false,
51
+ },
52
+ promptVersion: {
53
+ type: Number,
54
+ required: false,
55
+ },
47
56
  contentHash: {
48
57
  type: String,
49
- index: true,
58
+ required: false,
59
+ },
60
+ error: {
61
+ type: String,
62
+ required: false,
50
63
  },
51
- error: String,
52
64
  }, {
53
65
  timestamps: true,
54
66
  versionKey: false,
55
67
  });
56
- exports.ProspectFileAiSummarySchema.pre('validate', function (next) {
68
+ exports.BorrowerNoteAiSummarySchema.pre('validate', function (next) {
57
69
  if (this.targetType === exports.AI_SUMMARY_TARGET_TYPES.NOTE) {
58
70
  this.fileId = null;
59
71
  }
@@ -62,6 +74,6 @@ exports.ProspectFileAiSummarySchema.pre('validate', function (next) {
62
74
  }
63
75
  next();
64
76
  });
65
- exports.ProspectFileAiSummarySchema.index({ noteId: 1, targetType: 1 }, { unique: true, partialFilterExpression: { targetType: exports.AI_SUMMARY_TARGET_TYPES.NOTE } });
66
- exports.ProspectFileAiSummarySchema.index({ noteId: 1, fileId: 1, targetType: 1 }, { unique: true, partialFilterExpression: { targetType: exports.AI_SUMMARY_TARGET_TYPES.NOTE_FILE } });
67
- exports.ProspectFileAiSummary = mongoose_1.default.model(_models_1.MODEL_NAMES.BorrowerNoteAiSummary, exports.ProspectFileAiSummarySchema);
77
+ exports.BorrowerNoteAiSummarySchema.index({ noteId: 1, targetType: 1 }, { unique: true, partialFilterExpression: { targetType: exports.AI_SUMMARY_TARGET_TYPES.NOTE } });
78
+ exports.BorrowerNoteAiSummarySchema.index({ noteId: 1, fileId: 1, targetType: 1 }, { unique: true, partialFilterExpression: { targetType: exports.AI_SUMMARY_TARGET_TYPES.NOTE_FILE } });
79
+ exports.BorrowerNoteAiSummary = mongoose_1.default.model(_models_1.MODEL_NAMES.BorrowerNoteAiSummary, exports.BorrowerNoteAiSummarySchema);
@@ -22,10 +22,10 @@ export interface IBorrowerNoteAiSummary {
22
22
  summary: string;
23
23
  subject: string;
24
24
  status: TProspectFileAiSummaryStatus;
25
- model: string;
26
- promptSlug: string;
27
- promptVersion: number;
28
- contentHash: string;
25
+ model?: string;
26
+ promptSlug?: string;
27
+ promptVersion?: number;
28
+ contentHash?: string;
29
29
  error?: string;
30
30
  }
31
31
 
@@ -51,7 +51,7 @@ export interface IBorrowerNoteAiSummaryPlain extends Omit<IBorrowerNoteAiSummary
51
51
 
52
52
  export type TProspectFileAiSummaryModel = mongoose.Model<IBorrowerNoteAiSummaryDoc>;
53
53
 
54
- export const ProspectFileAiSummarySchema = new mongoose.Schema<IBorrowerNoteAiSummaryDoc>({
54
+ export const BorrowerNoteAiSummarySchema = new mongoose.Schema<IBorrowerNoteAiSummaryDoc>({
55
55
  targetType: {
56
56
  type: String,
57
57
  enum: AI_SUMMARY_TARGET_TYPES,
@@ -77,20 +77,32 @@ export const ProspectFileAiSummarySchema = new mongoose.Schema<IBorrowerNoteAiSu
77
77
  default: PROSPECT_FILE_AI_SUMMARY_STATUSES.PENDING,
78
78
  index: true,
79
79
  },
80
- model: String,
81
- promptSlug: String,
82
- promptVersion: Number,
80
+ model: {
81
+ type: String,
82
+ required: false,
83
+ },
84
+ promptSlug: {
85
+ type: String,
86
+ required: false,
87
+ },
88
+ promptVersion: {
89
+ type: Number,
90
+ required: false,
91
+ },
83
92
  contentHash: {
84
93
  type: String,
85
- index: true,
94
+ required: false,
95
+ },
96
+ error: {
97
+ type: String,
98
+ required: false,
86
99
  },
87
- error: String,
88
100
  }, {
89
101
  timestamps: true,
90
102
  versionKey: false,
91
103
  });
92
104
 
93
- ProspectFileAiSummarySchema.pre('validate', function(next) {
105
+ BorrowerNoteAiSummarySchema.pre('validate', function(next) {
94
106
  if (this.targetType === AI_SUMMARY_TARGET_TYPES.NOTE) {
95
107
  this.fileId = null as any;
96
108
  }
@@ -102,14 +114,14 @@ ProspectFileAiSummarySchema.pre('validate', function(next) {
102
114
  next();
103
115
  });
104
116
 
105
- ProspectFileAiSummarySchema.index(
117
+ BorrowerNoteAiSummarySchema.index(
106
118
  { noteId: 1, targetType: 1 },
107
119
  { unique: true, partialFilterExpression: { targetType: AI_SUMMARY_TARGET_TYPES.NOTE } },
108
120
  );
109
121
 
110
- ProspectFileAiSummarySchema.index(
122
+ BorrowerNoteAiSummarySchema.index(
111
123
  { noteId: 1, fileId: 1, targetType: 1 },
112
124
  { unique: true, partialFilterExpression: { targetType: AI_SUMMARY_TARGET_TYPES.NOTE_FILE } },
113
125
  );
114
126
 
115
- export const ProspectFileAiSummary = mongoose.model<IBorrowerNoteAiSummaryDoc>(MODEL_NAMES.BorrowerNoteAiSummary, ProspectFileAiSummarySchema);
127
+ export const BorrowerNoteAiSummary = mongoose.model<IBorrowerNoteAiSummaryDoc>(MODEL_NAMES.BorrowerNoteAiSummary, BorrowerNoteAiSummarySchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.217",
3
+ "version": "1.4.219",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {