gemcap-be-common 1.5.167 → 1.5.168

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.
@@ -1,6 +1,5 @@
1
1
  import mongoose, { Document, Model } from 'mongoose';
2
2
  import { MODEL_NAMES } from './_models';
3
- import { IOrganization } from './Organization.model';
4
3
 
5
4
  const mongooseLeanId = require('gemcap-be-common/plugins/id.plugin');
6
5
 
@@ -33,7 +33,9 @@ export interface IProductBroker {
33
33
  active: boolean;
34
34
  loanBrokerId: mongoose.Types.ObjectId;
35
35
  BSCode: string;
36
+ BSCodeId: mongoose.Types.ObjectId;
36
37
  PLCode: string;
38
+ PLCodeId: mongoose.Types.ObjectId;
37
39
  productId: mongoose.Types.ObjectId;
38
40
  baseInterestTotal: number;
39
41
  interestShare: number;
@@ -46,11 +48,13 @@ export interface IProductBrokerLean extends IProductBroker {
46
48
  createdAt: Date;
47
49
  updatedAt: Date;
48
50
  }
49
- export interface IProductBrokerPlain extends Omit<IProductBroker, 'borrowerId' | 'loanBrokerId' | 'productId'> {
51
+ export interface IProductBrokerPlain extends Omit<IProductBroker, 'borrowerId' | 'loanBrokerId' | 'productId' | 'BSCodeId' | 'PLCodeId'> {
50
52
  _id: string;
51
53
  borrowerId: string;
52
54
  loanBrokerId: string;
53
55
  productId: string;
56
+ BSCodeId: string;
57
+ PLCodeId: string;
54
58
  }
55
59
  export interface IProductBrokerDocWithLoanBroker extends TProductBrokerDoc {
56
60
  loanBroker: ILoanBrokerLean;
@@ -63,14 +67,16 @@ export declare const ProductBrokerSchema: mongoose.Schema<any, mongoose.Model<an
63
67
  createdAt: NativeDate;
64
68
  updatedAt: NativeDate;
65
69
  } & {
66
- borrowerId: mongoose.Types.ObjectId;
67
- productId: mongoose.Types.ObjectId;
70
+ uiId: string;
68
71
  order: number;
72
+ borrowerId: mongoose.Types.ObjectId;
69
73
  active: boolean;
70
- PLCode: string;
71
- uiId: string;
72
74
  loanBrokerId: mongoose.Types.ObjectId;
73
75
  BSCode: string;
76
+ BSCodeId: mongoose.Types.ObjectId;
77
+ PLCode: string;
78
+ PLCodeId: mongoose.Types.ObjectId;
79
+ productId: mongoose.Types.ObjectId;
74
80
  baseInterestTotal: number;
75
81
  interestShare: number;
76
82
  adminShare: number;
@@ -80,14 +86,16 @@ export declare const ProductBrokerSchema: mongoose.Schema<any, mongoose.Model<an
80
86
  createdAt: NativeDate;
81
87
  updatedAt: NativeDate;
82
88
  } & {
83
- borrowerId: mongoose.Types.ObjectId;
84
- productId: mongoose.Types.ObjectId;
89
+ uiId: string;
85
90
  order: number;
91
+ borrowerId: mongoose.Types.ObjectId;
86
92
  active: boolean;
87
- PLCode: string;
88
- uiId: string;
89
93
  loanBrokerId: mongoose.Types.ObjectId;
90
94
  BSCode: string;
95
+ BSCodeId: mongoose.Types.ObjectId;
96
+ PLCode: string;
97
+ PLCodeId: mongoose.Types.ObjectId;
98
+ productId: mongoose.Types.ObjectId;
91
99
  baseInterestTotal: number;
92
100
  interestShare: number;
93
101
  adminShare: number;
@@ -97,14 +105,16 @@ export declare const ProductBrokerSchema: mongoose.Schema<any, mongoose.Model<an
97
105
  createdAt: NativeDate;
98
106
  updatedAt: NativeDate;
99
107
  } & {
100
- borrowerId: mongoose.Types.ObjectId;
101
- productId: mongoose.Types.ObjectId;
108
+ uiId: string;
102
109
  order: number;
110
+ borrowerId: mongoose.Types.ObjectId;
103
111
  active: boolean;
104
- PLCode: string;
105
- uiId: string;
106
112
  loanBrokerId: mongoose.Types.ObjectId;
107
113
  BSCode: string;
114
+ BSCodeId: mongoose.Types.ObjectId;
115
+ PLCode: string;
116
+ PLCodeId: mongoose.Types.ObjectId;
117
+ productId: mongoose.Types.ObjectId;
108
118
  baseInterestTotal: number;
109
119
  interestShare: number;
110
120
  adminShare: number;
@@ -15,7 +15,9 @@ exports.ProductBrokerValidationSchema = joi_1.default.object({
15
15
  active: joi_1.default.boolean().required(),
16
16
  loanBrokerId: joi_1.default.string().required(),
17
17
  BSCode: joi_1.default.string().required(),
18
+ BSCodeId: joi_1.default.string().required(),
18
19
  PLCode: joi_1.default.string().required(),
20
+ PLCodeId: joi_1.default.string().required(),
19
21
  productId: joi_1.default.string().required(),
20
22
  baseInterestTotal: joi_1.default.number().required(),
21
23
  interestShare: joi_1.default.number().required(),
@@ -51,11 +53,21 @@ exports.ProductBrokerSchema = new mongoose_1.default.Schema({
51
53
  required: true,
52
54
  trim: true,
53
55
  },
56
+ BSCodeId: {
57
+ type: mongoose_1.default.Schema.Types.ObjectId,
58
+ ref: _models_1.MODEL_NAMES.quickbooksAccounts,
59
+ required: true,
60
+ },
54
61
  PLCode: {
55
62
  type: String,
56
63
  required: true,
57
64
  trim: true,
58
65
  },
66
+ PLCodeId: {
67
+ type: mongoose_1.default.Schema.Types.ObjectId,
68
+ ref: _models_1.MODEL_NAMES.quickbooksAccounts,
69
+ required: true,
70
+ },
59
71
  productId: {
60
72
  type: mongoose_1.default.Schema.Types.ObjectId,
61
73
  ref: _models_1.MODEL_NAMES.loanProducts,
@@ -12,7 +12,9 @@ export const ProductBrokerValidationSchema = Joi.object({
12
12
  active: Joi.boolean().required(),
13
13
  loanBrokerId: Joi.string().required(),
14
14
  BSCode: Joi.string().required(),
15
+ BSCodeId: Joi.string().required(),
15
16
  PLCode: Joi.string().required(),
17
+ PLCodeId: Joi.string().required(),
16
18
  productId: Joi.string().required(),
17
19
  baseInterestTotal: Joi.number().required(),
18
20
  interestShare: Joi.number().required(),
@@ -27,7 +29,9 @@ export interface IProductBroker {
27
29
  active: boolean;
28
30
  loanBrokerId: mongoose.Types.ObjectId;
29
31
  BSCode: string;
32
+ BSCodeId: mongoose.Types.ObjectId;
30
33
  PLCode: string;
34
+ PLCodeId: mongoose.Types.ObjectId;
31
35
  productId: mongoose.Types.ObjectId;
32
36
  baseInterestTotal: number;
33
37
  interestShare: number;
@@ -43,11 +47,13 @@ export interface IProductBrokerLean extends IProductBroker {
43
47
  updatedAt: Date;
44
48
  }
45
49
 
46
- export interface IProductBrokerPlain extends Omit<IProductBroker, 'borrowerId' | 'loanBrokerId' | 'productId'> {
50
+ export interface IProductBrokerPlain extends Omit<IProductBroker, 'borrowerId' | 'loanBrokerId' | 'productId' | 'BSCodeId' | 'PLCodeId'> {
47
51
  _id: string;
48
52
  borrowerId: string;
49
53
  loanBrokerId: string;
50
54
  productId: string;
55
+ BSCodeId: string;
56
+ PLCodeId: string;
51
57
  }
52
58
 
53
59
  export interface IProductBrokerDocWithLoanBroker extends TProductBrokerDoc {
@@ -88,11 +94,21 @@ export const ProductBrokerSchema = new mongoose.Schema(
88
94
  required: true,
89
95
  trim: true,
90
96
  },
97
+ BSCodeId: {
98
+ type: mongoose.Schema.Types.ObjectId,
99
+ ref: MODEL_NAMES.quickbooksAccounts,
100
+ required: true,
101
+ },
91
102
  PLCode: {
92
103
  type: String,
93
104
  required: true,
94
105
  trim: true,
95
106
  },
107
+ PLCodeId: {
108
+ type: mongoose.Schema.Types.ObjectId,
109
+ ref: MODEL_NAMES.quickbooksAccounts,
110
+ required: true,
111
+ },
96
112
  productId: {
97
113
  type: mongoose.Schema.Types.ObjectId,
98
114
  ref: MODEL_NAMES.loanProducts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.167",
3
+ "version": "1.5.168",
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
87
  ENTIRE_LOAN?: boolean;
89
- LAST_MONTH?: boolean;
88
+ SELECTED_PERIOD?: boolean;
90
89
  CURRENT_MONTH?: boolean;
90
+ LAST_MONTH?: boolean;
91
91
  TERM_LOAN?: boolean;
92
92
  };
93
93
  }>;
@@ -16,6 +16,8 @@ const defaultBrokerList = [
16
16
  active: true,
17
17
  BSCode: '',
18
18
  PLCode: '',
19
+ BSCodeId: null,
20
+ PLCodeId: null,
19
21
  productId: null,
20
22
  loanBrokerId: null,
21
23
  baseInterestTotal: 0,
@@ -24,6 +24,8 @@ const defaultBrokerList: BrokerView[] = [
24
24
  active: true,
25
25
  BSCode: '',
26
26
  PLCode: '',
27
+ BSCodeId: null,
28
+ PLCodeId: null,
27
29
  productId: null,
28
30
  loanBrokerId: null,
29
31
  baseInterestTotal: 0,
@@ -164,7 +164,7 @@ export declare class LoanTransactionsService {
164
164
  getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
165
165
  transactionIdsToMark: string[];
166
166
  transactions: {
167
- [x: string]: (string | number | Date | string[])[];
167
+ [x: string]: (string | number | string[] | Date)[];
168
168
  }[];
169
169
  }>;
170
170
  getBorrowerIdsForFile(transactionFileId: string): Promise<{