gemcap-be-common 1.3.71 → 1.3.73
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/CRMProspectExternalUpdate.model.d.ts +35 -0
- package/models/CRMProspectExternalUpdate.model.js +32 -0
- package/models/CRMProspectExternalUpdate.model.ts +43 -0
- package/models/Prospect.model.js +15 -5
- package/models/Prospect.model.ts +15 -5
- package/models/_models.d.ts +1 -0
- package/models/_models.js +1 -0
- package/models/_models.ts +1 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import mongoose, { Model } from 'mongoose';
|
|
26
|
+
export declare const PROSPECT_UPDATE_TYPES: readonly ["fields_update", "files_update"];
|
|
27
|
+
export type TProspectUpdateType = typeof PROSPECT_UPDATE_TYPES[number];
|
|
28
|
+
export interface IProspectExternalUpdate {
|
|
29
|
+
prospectId: mongoose.Types.ObjectId;
|
|
30
|
+
update: unknown;
|
|
31
|
+
type: TProspectUpdateType;
|
|
32
|
+
updatedBy: string;
|
|
33
|
+
}
|
|
34
|
+
export type TProspectExternalUpdateModel = Model<IProspectExternalUpdate, object, object>;
|
|
35
|
+
export declare const ProspectExternalUpdate: TProspectExternalUpdateModel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProspectExternalUpdate = exports.PROSPECT_UPDATE_TYPES = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const _models_1 = require("./_models");
|
|
9
|
+
exports.PROSPECT_UPDATE_TYPES = ['fields_update', 'files_update'];
|
|
10
|
+
const ProspectExternalUpdateSchema = new mongoose_1.default.Schema({
|
|
11
|
+
prospectId: {
|
|
12
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
13
|
+
ref: _models_1.MODEL_NAMES.CRMProspects,
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
enum: exports.PROSPECT_UPDATE_TYPES,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
update: {
|
|
23
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
24
|
+
},
|
|
25
|
+
updatedBy: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
}, {
|
|
29
|
+
timestamps: { createdAt: true, updatedAt: false },
|
|
30
|
+
versionKey: false,
|
|
31
|
+
});
|
|
32
|
+
exports.ProspectExternalUpdate = mongoose_1.default.model(_models_1.MODEL_NAMES.CRMProspectExternalUpdates, ProspectExternalUpdateSchema);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import mongoose, { Model } from 'mongoose';
|
|
2
|
+
|
|
3
|
+
import { MODEL_NAMES } from './_models';
|
|
4
|
+
|
|
5
|
+
export const PROSPECT_UPDATE_TYPES = ['fields_update', 'files_update'] as const;
|
|
6
|
+
export type TProspectUpdateType = typeof PROSPECT_UPDATE_TYPES[number];
|
|
7
|
+
|
|
8
|
+
export interface IProspectExternalUpdate {
|
|
9
|
+
prospectId: mongoose.Types.ObjectId;
|
|
10
|
+
update: unknown;
|
|
11
|
+
type: TProspectUpdateType;
|
|
12
|
+
updatedBy: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type TProspectExternalUpdateModel = Model<IProspectExternalUpdate, object, object>;
|
|
16
|
+
|
|
17
|
+
const ProspectExternalUpdateSchema = new mongoose.Schema<IProspectExternalUpdate, TProspectExternalUpdateModel>(
|
|
18
|
+
{
|
|
19
|
+
prospectId: {
|
|
20
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
21
|
+
ref: MODEL_NAMES.CRMProspects,
|
|
22
|
+
required: true,
|
|
23
|
+
index: true,
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: String,
|
|
27
|
+
enum: PROSPECT_UPDATE_TYPES,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
update: {
|
|
31
|
+
type: mongoose.Schema.Types.Mixed,
|
|
32
|
+
},
|
|
33
|
+
updatedBy: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
timestamps: { createdAt: true, updatedAt: false },
|
|
39
|
+
versionKey: false,
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export const ProspectExternalUpdate = mongoose.model<IProspectExternalUpdate, TProspectExternalUpdateModel>(MODEL_NAMES.CRMProspectExternalUpdates, ProspectExternalUpdateSchema);
|
package/models/Prospect.model.js
CHANGED
|
@@ -313,11 +313,11 @@ exports.CRMProspectValidationSchema = joi_1.default.object({
|
|
|
313
313
|
expectedLoanYield: joi_1.default.number().required().allow(null, 0).default(0),
|
|
314
314
|
state: joi_1.default.string().required(),
|
|
315
315
|
contacts: joi_1.default.array().items(joi_1.default.object({
|
|
316
|
-
name: joi_1.default.string().required().
|
|
317
|
-
email: joi_1.default.string().required().
|
|
318
|
-
phone: joi_1.default.string().required().
|
|
319
|
-
comment: joi_1.default.string().required().
|
|
320
|
-
companyName: joi_1.default.string().required().
|
|
316
|
+
name: joi_1.default.string().required().allow('', null).default(''),
|
|
317
|
+
email: joi_1.default.string().required().allow('', null).default(''),
|
|
318
|
+
phone: joi_1.default.string().required().allow('', null).default(''),
|
|
319
|
+
comment: joi_1.default.string().required().allow('', null).default(''),
|
|
320
|
+
companyName: joi_1.default.string().required().allow('', null).default(''),
|
|
321
321
|
})),
|
|
322
322
|
underwriterIds: joi_1.default.array().items(joi_1.default.string()),
|
|
323
323
|
auditorIds: joi_1.default.array().items(joi_1.default.string()),
|
|
@@ -326,18 +326,28 @@ exports.CRMProspectValidationSchema = joi_1.default.object({
|
|
|
326
326
|
const contactSchema = new mongoose_1.default.Schema({
|
|
327
327
|
name: {
|
|
328
328
|
type: String,
|
|
329
|
+
required: false,
|
|
330
|
+
default: '',
|
|
329
331
|
},
|
|
330
332
|
email: {
|
|
331
333
|
type: String,
|
|
334
|
+
required: false,
|
|
335
|
+
default: '',
|
|
332
336
|
},
|
|
333
337
|
phone: {
|
|
334
338
|
type: String,
|
|
339
|
+
required: false,
|
|
340
|
+
default: '',
|
|
335
341
|
},
|
|
336
342
|
comment: {
|
|
337
343
|
type: String,
|
|
344
|
+
required: false,
|
|
345
|
+
default: '',
|
|
338
346
|
},
|
|
339
347
|
companyName: {
|
|
340
348
|
type: String,
|
|
349
|
+
required: false,
|
|
350
|
+
default: '',
|
|
341
351
|
},
|
|
342
352
|
}, { _id: false });
|
|
343
353
|
const CRMProspectInfoSchema = {
|
package/models/Prospect.model.ts
CHANGED
|
@@ -460,11 +460,11 @@ export const CRMProspectValidationSchema = Joi.object({
|
|
|
460
460
|
expectedLoanYield: Joi.number().required().allow(null, 0).default(0),
|
|
461
461
|
state: Joi.string().required(),
|
|
462
462
|
contacts: Joi.array().items(Joi.object({
|
|
463
|
-
name: Joi.string().required().
|
|
464
|
-
email: Joi.string().required().
|
|
465
|
-
phone: Joi.string().required().
|
|
466
|
-
comment: Joi.string().required().
|
|
467
|
-
companyName: Joi.string().required().
|
|
463
|
+
name: Joi.string().required().allow('', null).default(''),
|
|
464
|
+
email: Joi.string().required().allow('', null).default(''),
|
|
465
|
+
phone: Joi.string().required().allow('', null).default(''),
|
|
466
|
+
comment: Joi.string().required().allow('', null).default(''),
|
|
467
|
+
companyName: Joi.string().required().allow('', null).default(''),
|
|
468
468
|
})),
|
|
469
469
|
underwriterIds: Joi.array().items(Joi.string()),
|
|
470
470
|
auditorIds: Joi.array().items(Joi.string()),
|
|
@@ -476,18 +476,28 @@ export type CRMProspectModel = Model<ICRMProspect, object, object>;
|
|
|
476
476
|
const contactSchema = new mongoose.Schema({
|
|
477
477
|
name: {
|
|
478
478
|
type: String,
|
|
479
|
+
required: false,
|
|
480
|
+
default: '',
|
|
479
481
|
},
|
|
480
482
|
email: {
|
|
481
483
|
type: String,
|
|
484
|
+
required: false,
|
|
485
|
+
default: '',
|
|
482
486
|
},
|
|
483
487
|
phone: {
|
|
484
488
|
type: String,
|
|
489
|
+
required: false,
|
|
490
|
+
default: '',
|
|
485
491
|
},
|
|
486
492
|
comment: {
|
|
487
493
|
type: String,
|
|
494
|
+
required: false,
|
|
495
|
+
default: '',
|
|
488
496
|
},
|
|
489
497
|
companyName: {
|
|
490
498
|
type: String,
|
|
499
|
+
required: false,
|
|
500
|
+
default: '',
|
|
491
501
|
},
|
|
492
502
|
}, { _id: false });
|
|
493
503
|
|
package/models/_models.d.ts
CHANGED
package/models/_models.js
CHANGED
|
@@ -43,6 +43,7 @@ exports.MODEL_NAMES = {
|
|
|
43
43
|
CRMProspects: 'crm_prospects',
|
|
44
44
|
CRMProspectIndustries: 'crm_prospect_industries',
|
|
45
45
|
CRMProspectSources: 'crm_prospect_sources',
|
|
46
|
+
CRMProspectExternalUpdates: 'crm_prospect_external_updates',
|
|
46
47
|
customerAPGroups: 'customerAPGroups',
|
|
47
48
|
customerGroups: 'customerGroups',
|
|
48
49
|
deletedRecords: 'deleted_records',
|
package/models/_models.ts
CHANGED
|
@@ -40,6 +40,7 @@ export const MODEL_NAMES = {
|
|
|
40
40
|
CRMProspects: 'crm_prospects',
|
|
41
41
|
CRMProspectIndustries: 'crm_prospect_industries',
|
|
42
42
|
CRMProspectSources: 'crm_prospect_sources',
|
|
43
|
+
CRMProspectExternalUpdates: 'crm_prospect_external_updates',
|
|
43
44
|
customerAPGroups: 'customerAPGroups',
|
|
44
45
|
customerGroups: 'customerGroups',
|
|
45
46
|
deletedRecords: 'deleted_records',
|