gemcap-be-common 1.3.64 → 1.3.65

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/db/new-summary.js CHANGED
@@ -1031,7 +1031,7 @@ class NewSummaryExcel {
1031
1031
  return options.addEmptyRow ? [...acc, row, emptyRow] : [...acc, row];
1032
1032
  }, []);
1033
1033
  };
1034
- const get = (base, i, key) => new decimal_js_1.default(i === 0 ? base[key]?.amount : base[key]?.[`minus_${i}`] ?? 0);
1034
+ const get = (base, i, key) => new decimal_js_1.default((i === 0 ? base[key]?.amount : base[key]?.[`minus_${i}`]) ?? 0);
1035
1035
  const financialRatioFormulas = [
1036
1036
  {
1037
1037
  label: 'Fixed Charge Coverage Ratio',
package/db/new-summary.ts CHANGED
@@ -1214,7 +1214,7 @@ export class NewSummaryExcel {
1214
1214
  formula: (data: Record<string, FinancialSpreadingDTO>, monthIndex: number) => number;
1215
1215
  };
1216
1216
 
1217
- const get = (base: Record<string, FinancialSpreadingDTO>, i: number, key: string) => new Decimal(i === 0 ? base[key]?.amount : base[key]?.[`minus_${i}`] ?? 0);
1217
+ const get = (base: Record<string, FinancialSpreadingDTO>, i: number, key: string) => new Decimal((i === 0 ? base[key]?.amount : base[key]?.[`minus_${i}`]) ?? 0);
1218
1218
 
1219
1219
  const financialRatioFormulas: FinancialRatioFormula[] = [
1220
1220
  {
@@ -10,6 +10,7 @@ const _models_1 = require("./_models");
10
10
  const ProspectInfoStageTwo_model_1 = require("./ProspectInfoStageTwo.model");
11
11
  const ProspectInfoStageOne_model_1 = require("./ProspectInfoStageOne.model");
12
12
  const main_helper_1 = require("../helpers/main.helper");
13
+ const textFieldMaxLength = 600;
13
14
  exports.prospectFieldsDictionary = {
14
15
  name: 'Name',
15
16
  industry: 'Industry',
@@ -302,13 +303,13 @@ exports.CRMProspectValidationSchema = joi_1.default.object({
302
303
  dropDate: joi_1.default.date().allow(null),
303
304
  }),
304
305
  priority: joi_1.default.string().valid(...Object.values(EProspectPriority)).required(),
305
- businessDescription: joi_1.default.string().max(400).allow(''),
306
- comments: joi_1.default.string().max(400).allow(''),
307
- collateralDescription: joi_1.default.string().max(400).allow(''),
306
+ businessDescription: joi_1.default.string().max(textFieldMaxLength).allow(''),
307
+ comments: joi_1.default.string().max(textFieldMaxLength).allow(''),
308
+ collateralDescription: joi_1.default.string().max(textFieldMaxLength).allow(''),
308
309
  declineReason: joi_1.default.string().valid(...Object.values(EProspectDeclineReason)),
309
- sourceId: joi_1.default.string(),
310
- closingPoints: joi_1.default.number().required(),
311
- expectedLoanYield: joi_1.default.number().required(),
310
+ sourceId: joi_1.default.string().required(),
311
+ closingPoints: joi_1.default.number().required().allow(null, 0).default(0),
312
+ expectedLoanYield: joi_1.default.number().required().allow(null, 0).default(0),
312
313
  state: joi_1.default.string().required(),
313
314
  contacts: joi_1.default.array().items(joi_1.default.object({
314
315
  name: joi_1.default.string().required().allow(''),
@@ -7,6 +7,8 @@ import { ExternalProspectStageTwoTables, ProspectInfoStageTwo } from './Prospect
7
7
  import { ExternalProspectStageOneTables, ProspectInfoStageOne } from './ProspectInfoStageOne.model';
8
8
  import { getUUID, TDictionary } from '../helpers/main.helper';
9
9
 
10
+ const textFieldMaxLength = 600;
11
+
10
12
  export const prospectFieldsDictionary: TDictionary = {
11
13
  name: 'Name',
12
14
  industry: 'Industry',
@@ -448,13 +450,13 @@ export const CRMProspectValidationSchema = Joi.object({
448
450
  dropDate: Joi.date().allow(null),
449
451
  }),
450
452
  priority: Joi.string().valid(...Object.values(EProspectPriority)).required(),
451
- businessDescription: Joi.string().max(400).allow(''),
452
- comments: Joi.string().max(400).allow(''),
453
- collateralDescription: Joi.string().max(400).allow(''),
453
+ businessDescription: Joi.string().max(textFieldMaxLength).allow(''),
454
+ comments: Joi.string().max(textFieldMaxLength).allow(''),
455
+ collateralDescription: Joi.string().max(textFieldMaxLength).allow(''),
454
456
  declineReason: Joi.string().valid(...Object.values(EProspectDeclineReason)),
455
- sourceId: Joi.string(),
456
- closingPoints: Joi.number().required(),
457
- expectedLoanYield: Joi.number().required(),
457
+ sourceId: Joi.string().required(),
458
+ closingPoints: Joi.number().required().allow(null, 0).default(0),
459
+ expectedLoanYield: Joi.number().required().allow(null, 0).default(0),
458
460
  state: Joi.string().required(),
459
461
  contacts: Joi.array().items(Joi.object({
460
462
  name: Joi.string().required().allow(''),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.3.64",
3
+ "version": "1.3.65",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {