gemcap-be-common 1.4.189 → 1.4.190

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.
@@ -22,44 +22,56 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import mongoose, { Document } from 'mongoose';
25
+ import mongoose from 'mongoose';
26
26
  import { EFinancialIndex } from '../services/financial-indexes.service';
27
27
  export interface IFinancialIndex {
28
28
  name: EFinancialIndex;
29
29
  date: Date;
30
30
  value: number;
31
31
  }
32
- export interface IFinancialIndexDoc extends IFinancialIndex, Document {
32
+ export interface IFinancialIndexDoc extends IFinancialIndex, mongoose.Document {
33
+ _id: mongoose.Types.ObjectId;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ }
37
+ export interface IFinancialIndexLean extends IFinancialIndex {
38
+ _id: mongoose.Types.ObjectId;
39
+ createdAt: Date;
40
+ updatedAt: Date;
33
41
  }
42
+ export interface IFinancialIndexPlain {
43
+ _id: string;
44
+ }
45
+ export type TFinancialIndexModel = mongoose.Model<IFinancialIndex>;
34
46
  export declare const FinancialIndexSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
35
47
  timestamps: true;
36
48
  }, {
37
49
  createdAt: NativeDate;
38
50
  updatedAt: NativeDate;
39
51
  } & {
40
- date: Date;
41
52
  name: string;
53
+ date: Date;
42
54
  value: number;
43
55
  __v?: number;
44
56
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
45
57
  createdAt: NativeDate;
46
58
  updatedAt: NativeDate;
47
59
  } & {
48
- date: Date;
49
60
  name: string;
61
+ date: Date;
50
62
  value: number;
51
63
  __v?: number;
52
64
  }>> & mongoose.FlatRecord<{
53
65
  createdAt: NativeDate;
54
66
  updatedAt: NativeDate;
55
67
  } & {
56
- date: Date;
57
68
  name: string;
69
+ date: Date;
58
70
  value: number;
59
71
  __v?: number;
60
72
  }> & {
61
73
  _id: mongoose.Types.ObjectId;
62
74
  }>;
63
- export declare const FinancialIndexesModel: mongoose.Model<IFinancialIndexDoc, {}, {}, {}, mongoose.Document<unknown, {}, IFinancialIndexDoc> & IFinancialIndexDoc & {
75
+ export declare const FinancialIndexesModel: mongoose.Model<IFinancialIndexDoc, {}, {}, {}, mongoose.Document<unknown, {}, IFinancialIndexDoc> & IFinancialIndexDoc & Required<{
64
76
  _id: mongoose.Types.ObjectId;
65
- }, any>;
77
+ }>, any>;
@@ -1,4 +1,4 @@
1
- import mongoose, { Document } from 'mongoose';
1
+ import mongoose from 'mongoose';
2
2
 
3
3
  import { MODEL_NAMES } from './_models';
4
4
  import { EFinancialIndex } from '../services/financial-indexes.service';
@@ -9,9 +9,24 @@ export interface IFinancialIndex {
9
9
  value: number;
10
10
  }
11
11
 
12
- export interface IFinancialIndexDoc extends IFinancialIndex, Document {
12
+ export interface IFinancialIndexDoc extends IFinancialIndex, mongoose.Document {
13
+ _id: mongoose.Types.ObjectId;
14
+ createdAt: Date;
15
+ updatedAt: Date;
13
16
  }
14
17
 
18
+ export interface IFinancialIndexLean extends IFinancialIndex {
19
+ _id: mongoose.Types.ObjectId;
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ }
23
+
24
+ export interface IFinancialIndexPlain {
25
+ _id: string;
26
+ }
27
+
28
+ export type TFinancialIndexModel = mongoose.Model<IFinancialIndex>;
29
+
15
30
  export const FinancialIndexSchema = new mongoose.Schema(
16
31
  {
17
32
  name: {
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import mongoose, { Document, Model } from 'mongoose';
25
+ import mongoose from 'mongoose';
26
26
  import Joi from 'joi';
27
27
  import { EChargeCalculationBasis, EChargeFrequencies } from '../enums/loan-types.enum';
28
28
  import { ELoanChargeType } from '../enums/loan-charge-type.enum';
@@ -51,7 +51,7 @@ export interface ILoanChargeWithId extends ILoanCharge {
51
51
  _id: mongoose.Types.ObjectId;
52
52
  }
53
53
  export type ILoanChargeView = Omit<ILoanChargeWithId, 'borrowerId' | 'order'>;
54
- export interface ILoanChargeDoc extends ILoanCharge, Document {
54
+ export interface ILoanChargeDoc extends ILoanCharge, mongoose.Document {
55
55
  _id: mongoose.Types.ObjectId;
56
56
  createdAt: Date;
57
57
  updatedAt: Date;
@@ -66,7 +66,7 @@ export interface ILoanChargePlain extends Omit<ILoanCharge, 'borrowerId' | 'prod
66
66
  borrowerId: string;
67
67
  productId: string;
68
68
  }
69
- export type TLoanChargeModel = Model<ILoanCharge>;
69
+ export type TLoanChargeModel = mongoose.Model<ILoanCharge>;
70
70
  export declare const defaultChargeList: ILoanChargeView[];
71
71
  export declare const LoanChargeSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
72
72
  timestamps: true;
@@ -1,4 +1,4 @@
1
- import mongoose, { Document, Model } from 'mongoose';
1
+ import mongoose from 'mongoose';
2
2
  import Joi from 'joi';
3
3
 
4
4
  import { EChargeCalculationBasis, EChargeFrequencies } from '../enums/loan-types.enum';
@@ -48,7 +48,7 @@ export interface ILoanChargeWithId extends ILoanCharge {
48
48
 
49
49
  export type ILoanChargeView = Omit<ILoanChargeWithId, 'borrowerId' | 'order'>
50
50
 
51
- export interface ILoanChargeDoc extends ILoanCharge, Document {
51
+ export interface ILoanChargeDoc extends ILoanCharge, mongoose.Document {
52
52
  _id: mongoose.Types.ObjectId;
53
53
  createdAt: Date;
54
54
  updatedAt: Date;
@@ -66,7 +66,7 @@ export interface ILoanChargePlain extends Omit<ILoanCharge, 'borrowerId' | 'prod
66
66
  productId: string;
67
67
  }
68
68
 
69
- export type TLoanChargeModel = Model<ILoanCharge>;
69
+ export type TLoanChargeModel = mongoose.Model<ILoanCharge>;
70
70
 
71
71
  export const defaultChargeList: ILoanChargeView[] = [
72
72
  {
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import mongoose, { Document, Model } from 'mongoose';
25
+ import mongoose from 'mongoose';
26
26
  import { ELoanTypes } from '../enums/loan-types.enum';
27
27
  export interface ILoanProduct {
28
28
  borrowerId: mongoose.Types.ObjectId;
@@ -48,7 +48,7 @@ export interface ILoanProduct {
48
48
  calculationRequired: boolean;
49
49
  deactivationDate?: Date;
50
50
  }
51
- export interface ILoanProductDoc extends ILoanProduct, Document {
51
+ export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
52
52
  _id: mongoose.Types.ObjectId;
53
53
  createdAt: Date;
54
54
  updatedAt: Date;
@@ -70,9 +70,9 @@ export interface ILoanProductViewWithBalances extends ILoanProductView {
70
70
  balance: number;
71
71
  floatedBalance: number;
72
72
  }
73
- export interface ILoanProductDoc extends ILoanProduct, Document {
73
+ export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
74
74
  }
75
- export type TLoanProductModel = Model<ILoanProduct>;
75
+ export type TLoanProductModel = mongoose.Model<ILoanProduct>;
76
76
  export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
77
77
  timestamps: true;
78
78
  }, {
@@ -1,4 +1,4 @@
1
- import mongoose, { Document, Model } from 'mongoose';
1
+ import mongoose from 'mongoose';
2
2
 
3
3
  import { MODEL_NAMES } from './_models';
4
4
  import { ELoanTypes } from '../enums/loan-types.enum';
@@ -28,7 +28,7 @@ export interface ILoanProduct {
28
28
  deactivationDate?: Date;
29
29
  }
30
30
 
31
- export interface ILoanProductDoc extends ILoanProduct, Document {
31
+ export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
32
32
  _id: mongoose.Types.ObjectId;
33
33
  createdAt: Date;
34
34
  updatedAt: Date;
@@ -56,10 +56,10 @@ export interface ILoanProductViewWithBalances extends ILoanProductView {
56
56
  floatedBalance: number;
57
57
  }
58
58
 
59
- export interface ILoanProductDoc extends ILoanProduct, Document {
59
+ export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
60
60
  }
61
61
 
62
- export type TLoanProductModel = Model<ILoanProduct>;
62
+ export type TLoanProductModel = mongoose.Model<ILoanProduct>;
63
63
 
64
64
  export const LoanProductSchema = new mongoose.Schema(
65
65
  {
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import mongoose, { Document, Model } from 'mongoose';
25
+ import mongoose from 'mongoose';
26
26
  import { ITermLoanSettingsOnly } from './TermLoanSettings.model';
27
27
  export declare enum ETermLoanStatus {
28
28
  NEW = "NEW",
@@ -44,7 +44,7 @@ export interface ITermLoan {
44
44
  lastCalculated: Date;
45
45
  calculationStatus: ETermLoanStatus;
46
46
  }
47
- export interface ITermLoanDoc extends ITermLoan, Document {
47
+ export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
48
48
  _id: mongoose.Types.ObjectId;
49
49
  createdAt: Date;
50
50
  updatedAt: Date;
@@ -62,9 +62,9 @@ export interface ITermLoanView extends ITermLoan {
62
62
  _id: mongoose.Types.ObjectId;
63
63
  settings: ITermLoanSettingsOnly;
64
64
  }
65
- export interface ITermLoanDoc extends ITermLoan, Document {
65
+ export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
66
66
  }
67
- export type TTermLoanModel = Model<ITermLoan>;
67
+ export type TTermLoanModel = mongoose.Model<ITermLoan>;
68
68
  export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
69
69
  timestamps: true;
70
70
  }, {
@@ -72,14 +72,14 @@ export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, an
72
72
  updatedAt: NativeDate;
73
73
  } & {
74
74
  productId: mongoose.Types.ObjectId;
75
+ actual: boolean;
76
+ lastCalculated: Date;
75
77
  loanStartDate: Date;
76
78
  initialBalance: number;
77
79
  interestRate: number;
78
80
  adminRate: number;
79
81
  primeRate: number;
80
- actual: boolean;
81
82
  isMismatched: boolean;
82
- lastCalculated: Date;
83
83
  calculationStatus: string;
84
84
  __v?: number;
85
85
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
@@ -87,14 +87,14 @@ export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, an
87
87
  updatedAt: NativeDate;
88
88
  } & {
89
89
  productId: mongoose.Types.ObjectId;
90
+ actual: boolean;
91
+ lastCalculated: Date;
90
92
  loanStartDate: Date;
91
93
  initialBalance: number;
92
94
  interestRate: number;
93
95
  adminRate: number;
94
96
  primeRate: number;
95
- actual: boolean;
96
97
  isMismatched: boolean;
97
- lastCalculated: Date;
98
98
  calculationStatus: string;
99
99
  __v?: number;
100
100
  }>> & mongoose.FlatRecord<{
@@ -102,14 +102,14 @@ export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, an
102
102
  updatedAt: NativeDate;
103
103
  } & {
104
104
  productId: mongoose.Types.ObjectId;
105
+ actual: boolean;
106
+ lastCalculated: Date;
105
107
  loanStartDate: Date;
106
108
  initialBalance: number;
107
109
  interestRate: number;
108
110
  adminRate: number;
109
111
  primeRate: number;
110
- actual: boolean;
111
112
  isMismatched: boolean;
112
- lastCalculated: Date;
113
113
  calculationStatus: string;
114
114
  __v?: number;
115
115
  }> & {
@@ -1,4 +1,4 @@
1
- import mongoose, { Document, Model } from 'mongoose';
1
+ import mongoose from 'mongoose';
2
2
 
3
3
  import { MODEL_NAMES } from './_models';
4
4
  import { ITermLoanSettingsOnly } from './TermLoanSettings.model';
@@ -38,7 +38,7 @@ export interface ITermLoan {
38
38
  calculationStatus: ETermLoanStatus;
39
39
  }
40
40
 
41
- export interface ITermLoanDoc extends ITermLoan, Document {
41
+ export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
42
42
  _id: mongoose.Types.ObjectId;
43
43
  createdAt: Date;
44
44
  updatedAt: Date;
@@ -60,10 +60,10 @@ export interface ITermLoanView extends ITermLoan {
60
60
  settings: ITermLoanSettingsOnly;
61
61
  }
62
62
 
63
- export interface ITermLoanDoc extends ITermLoan, Document {
63
+ export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
64
64
  }
65
65
 
66
- export type TTermLoanModel = Model<ITermLoan>;
66
+ export type TTermLoanModel = mongoose.Model<ITermLoan>;
67
67
 
68
68
  export const TermLoanSchema = new mongoose.Schema(
69
69
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.189",
3
+ "version": "1.4.190",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -84,10 +84,10 @@ export declare class BorrowerService {
84
84
  getBorrowerCodesMap(): Promise<Map<string, string>>;
85
85
  getBorrowerStatementDetails(borrowers: IBorrowerDoc[]): Promise<{
86
86
  [x: string]: {
87
+ SELECTED_PERIOD?: boolean;
88
+ ENTIRE_LOAN?: boolean;
87
89
  LAST_MONTH?: boolean;
88
90
  CURRENT_MONTH?: boolean;
89
- ENTIRE_LOAN?: boolean;
90
- SELECTED_PERIOD?: boolean;
91
91
  TERM_LOAN?: boolean;
92
92
  };
93
93
  }>;
@@ -46,9 +46,9 @@ export declare class BrokersService {
46
46
  getAllProductBrokers(): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & {
47
47
  _id: import("mongoose").Types.ObjectId;
48
48
  })[]>;
49
- getBorrowerBrokers(borrowerId: string): Promise<BrokerView[] | (import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & {
49
+ getBorrowerBrokers(borrowerId: string): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & {
50
50
  _id: import("mongoose").Types.ObjectId;
51
- })[]>;
51
+ })[] | BrokerView[]>;
52
52
  getProductBrokers(productId: string): Promise<import("../models/ProductBroker.model").IProductBrokerDocWithBroker[]>;
53
53
  getTotalShares(borrowerId: string, brokers: IProductBrokerView[], replaceNames?: boolean): Promise<ProductTotal>;
54
54
  getTotals(borrowerId: string): Promise<BrokerTotalView[]>;