gemcap-be-common 1.4.217 → 1.4.218
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.
- package/models/{ProspectFileAiSummary.model.d.ts → BorrowerNoteAiSummary.model.d.ts} +2 -2
- package/models/{ProspectFileAiSummary.model.js → BorrowerNoteAiSummary.model.js} +6 -6
- package/models/{ProspectFileAiSummary.model.ts → BorrowerNoteAiSummary.model.ts} +5 -5
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -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
|
|
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
|
|
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.
|
|
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.
|
|
18
|
+
exports.BorrowerNoteAiSummarySchema = new mongoose_1.default.Schema({
|
|
19
19
|
targetType: {
|
|
20
20
|
type: String,
|
|
21
21
|
enum: exports.AI_SUMMARY_TARGET_TYPES,
|
|
@@ -53,7 +53,7 @@ exports.ProspectFileAiSummarySchema = new mongoose_1.default.Schema({
|
|
|
53
53
|
timestamps: true,
|
|
54
54
|
versionKey: false,
|
|
55
55
|
});
|
|
56
|
-
exports.
|
|
56
|
+
exports.BorrowerNoteAiSummarySchema.pre('validate', function (next) {
|
|
57
57
|
if (this.targetType === exports.AI_SUMMARY_TARGET_TYPES.NOTE) {
|
|
58
58
|
this.fileId = null;
|
|
59
59
|
}
|
|
@@ -62,6 +62,6 @@ exports.ProspectFileAiSummarySchema.pre('validate', function (next) {
|
|
|
62
62
|
}
|
|
63
63
|
next();
|
|
64
64
|
});
|
|
65
|
-
exports.
|
|
66
|
-
exports.
|
|
67
|
-
exports.
|
|
65
|
+
exports.BorrowerNoteAiSummarySchema.index({ noteId: 1, targetType: 1 }, { unique: true, partialFilterExpression: { targetType: exports.AI_SUMMARY_TARGET_TYPES.NOTE } });
|
|
66
|
+
exports.BorrowerNoteAiSummarySchema.index({ noteId: 1, fileId: 1, targetType: 1 }, { unique: true, partialFilterExpression: { targetType: exports.AI_SUMMARY_TARGET_TYPES.NOTE_FILE } });
|
|
67
|
+
exports.BorrowerNoteAiSummary = mongoose_1.default.model(_models_1.MODEL_NAMES.BorrowerNoteAiSummary, exports.BorrowerNoteAiSummarySchema);
|
|
@@ -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
|
|
54
|
+
export const BorrowerNoteAiSummarySchema = new mongoose.Schema<IBorrowerNoteAiSummaryDoc>({
|
|
55
55
|
targetType: {
|
|
56
56
|
type: String,
|
|
57
57
|
enum: AI_SUMMARY_TARGET_TYPES,
|
|
@@ -90,7 +90,7 @@ export const ProspectFileAiSummarySchema = new mongoose.Schema<IBorrowerNoteAiSu
|
|
|
90
90
|
versionKey: false,
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
BorrowerNoteAiSummarySchema.pre('validate', function(next) {
|
|
94
94
|
if (this.targetType === AI_SUMMARY_TARGET_TYPES.NOTE) {
|
|
95
95
|
this.fileId = null as any;
|
|
96
96
|
}
|
|
@@ -102,14 +102,14 @@ ProspectFileAiSummarySchema.pre('validate', function(next) {
|
|
|
102
102
|
next();
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
BorrowerNoteAiSummarySchema.index(
|
|
106
106
|
{ noteId: 1, targetType: 1 },
|
|
107
107
|
{ unique: true, partialFilterExpression: { targetType: AI_SUMMARY_TARGET_TYPES.NOTE } },
|
|
108
108
|
);
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
BorrowerNoteAiSummarySchema.index(
|
|
111
111
|
{ noteId: 1, fileId: 1, targetType: 1 },
|
|
112
112
|
{ unique: true, partialFilterExpression: { targetType: AI_SUMMARY_TARGET_TYPES.NOTE_FILE } },
|
|
113
113
|
);
|
|
114
114
|
|
|
115
|
-
export const
|
|
115
|
+
export const BorrowerNoteAiSummary = mongoose.model<IBorrowerNoteAiSummaryDoc>(MODEL_NAMES.BorrowerNoteAiSummary, BorrowerNoteAiSummarySchema);
|