@dynamatix/gb-schemas 1.2.53 → 1.2.55

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.
@@ -129,6 +129,7 @@ declare const MortgageModel: mongoose.Model<{
129
129
  } | null | undefined;
130
130
  pageValidFlag?: unknown;
131
131
  existingMortgageLender?: unknown;
132
+ topSlicing?: unknown;
132
133
  purposeOfMortgage?: unknown;
133
134
  ifOtherDetails?: unknown;
134
135
  purchasePrice?: {
@@ -369,6 +370,53 @@ declare const MortgageModel: mongoose.Model<{
369
370
  validateAll?: {} | null | undefined;
370
371
  defaultOptions?: unknown;
371
372
  } | null | undefined;
373
+ outstandingBalance?: {
374
+ validators: mongoose.Types.DocumentArray<{
375
+ type?: unknown;
376
+ message?: unknown;
377
+ validator?: unknown;
378
+ reason?: unknown;
379
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
380
+ type?: unknown;
381
+ message?: unknown;
382
+ validator?: unknown;
383
+ reason?: unknown;
384
+ }> & {
385
+ type?: unknown;
386
+ message?: unknown;
387
+ validator?: unknown;
388
+ reason?: unknown;
389
+ }>;
390
+ get?: {} | null | undefined;
391
+ schema?: {
392
+ [x: string]: unknown;
393
+ } | null | undefined;
394
+ set?: {} | null | undefined;
395
+ validate?: {} | null | undefined;
396
+ default?: {} | null | undefined;
397
+ text?: {} | null | undefined;
398
+ unique?: {} | null | undefined;
399
+ index?: {} | null | undefined;
400
+ sparse?: {} | null | undefined;
401
+ required?: {} | null | undefined;
402
+ ref?: {} | null | undefined;
403
+ cast?: {} | null | undefined;
404
+ select?: {} | null | undefined;
405
+ immutable?: {} | null | undefined;
406
+ transform?: {} | null | undefined;
407
+ options?: {
408
+ [x: string]: unknown;
409
+ } | null | undefined;
410
+ OptionsConstructor?: {
411
+ [x: string]: unknown;
412
+ } | null | undefined;
413
+ getEmbeddedSchemaType?: {} | null | undefined;
414
+ instance?: unknown;
415
+ isRequired?: unknown;
416
+ path?: unknown;
417
+ validateAll?: {} | null | undefined;
418
+ defaultOptions?: unknown;
419
+ } | null | undefined;
372
420
  fundRaisedFor?: unknown;
373
421
  sourceOfFundsLid?: mongoose.Types.ObjectId | null | undefined;
374
422
  sourceOfFundDetails?: unknown;
@@ -486,6 +534,7 @@ declare const MortgageModel: mongoose.Model<{
486
534
  } | null | undefined;
487
535
  pageValidFlag?: unknown;
488
536
  existingMortgageLender?: unknown;
537
+ topSlicing?: unknown;
489
538
  purposeOfMortgage?: unknown;
490
539
  ifOtherDetails?: unknown;
491
540
  purchasePrice?: {
@@ -726,6 +775,53 @@ declare const MortgageModel: mongoose.Model<{
726
775
  validateAll?: {} | null | undefined;
727
776
  defaultOptions?: unknown;
728
777
  } | null | undefined;
778
+ outstandingBalance?: {
779
+ validators: mongoose.Types.DocumentArray<{
780
+ type?: unknown;
781
+ message?: unknown;
782
+ validator?: unknown;
783
+ reason?: unknown;
784
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
785
+ type?: unknown;
786
+ message?: unknown;
787
+ validator?: unknown;
788
+ reason?: unknown;
789
+ }> & {
790
+ type?: unknown;
791
+ message?: unknown;
792
+ validator?: unknown;
793
+ reason?: unknown;
794
+ }>;
795
+ get?: {} | null | undefined;
796
+ schema?: {
797
+ [x: string]: unknown;
798
+ } | null | undefined;
799
+ set?: {} | null | undefined;
800
+ validate?: {} | null | undefined;
801
+ default?: {} | null | undefined;
802
+ text?: {} | null | undefined;
803
+ unique?: {} | null | undefined;
804
+ index?: {} | null | undefined;
805
+ sparse?: {} | null | undefined;
806
+ required?: {} | null | undefined;
807
+ ref?: {} | null | undefined;
808
+ cast?: {} | null | undefined;
809
+ select?: {} | null | undefined;
810
+ immutable?: {} | null | undefined;
811
+ transform?: {} | null | undefined;
812
+ options?: {
813
+ [x: string]: unknown;
814
+ } | null | undefined;
815
+ OptionsConstructor?: {
816
+ [x: string]: unknown;
817
+ } | null | undefined;
818
+ getEmbeddedSchemaType?: {} | null | undefined;
819
+ instance?: unknown;
820
+ isRequired?: unknown;
821
+ path?: unknown;
822
+ validateAll?: {} | null | undefined;
823
+ defaultOptions?: unknown;
824
+ } | null | undefined;
729
825
  fundRaisedFor?: unknown;
730
826
  sourceOfFundsLid?: mongoose.Types.ObjectId | null | undefined;
731
827
  sourceOfFundDetails?: unknown;
@@ -843,6 +939,7 @@ declare const MortgageModel: mongoose.Model<{
843
939
  } | null | undefined;
844
940
  pageValidFlag?: unknown;
845
941
  existingMortgageLender?: unknown;
942
+ topSlicing?: unknown;
846
943
  purposeOfMortgage?: unknown;
847
944
  ifOtherDetails?: unknown;
848
945
  purchasePrice?: {
@@ -1083,6 +1180,53 @@ declare const MortgageModel: mongoose.Model<{
1083
1180
  validateAll?: {} | null | undefined;
1084
1181
  defaultOptions?: unknown;
1085
1182
  } | null | undefined;
1183
+ outstandingBalance?: {
1184
+ validators: mongoose.Types.DocumentArray<{
1185
+ type?: unknown;
1186
+ message?: unknown;
1187
+ validator?: unknown;
1188
+ reason?: unknown;
1189
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
1190
+ type?: unknown;
1191
+ message?: unknown;
1192
+ validator?: unknown;
1193
+ reason?: unknown;
1194
+ }> & {
1195
+ type?: unknown;
1196
+ message?: unknown;
1197
+ validator?: unknown;
1198
+ reason?: unknown;
1199
+ }>;
1200
+ get?: {} | null | undefined;
1201
+ schema?: {
1202
+ [x: string]: unknown;
1203
+ } | null | undefined;
1204
+ set?: {} | null | undefined;
1205
+ validate?: {} | null | undefined;
1206
+ default?: {} | null | undefined;
1207
+ text?: {} | null | undefined;
1208
+ unique?: {} | null | undefined;
1209
+ index?: {} | null | undefined;
1210
+ sparse?: {} | null | undefined;
1211
+ required?: {} | null | undefined;
1212
+ ref?: {} | null | undefined;
1213
+ cast?: {} | null | undefined;
1214
+ select?: {} | null | undefined;
1215
+ immutable?: {} | null | undefined;
1216
+ transform?: {} | null | undefined;
1217
+ options?: {
1218
+ [x: string]: unknown;
1219
+ } | null | undefined;
1220
+ OptionsConstructor?: {
1221
+ [x: string]: unknown;
1222
+ } | null | undefined;
1223
+ getEmbeddedSchemaType?: {} | null | undefined;
1224
+ instance?: unknown;
1225
+ isRequired?: unknown;
1226
+ path?: unknown;
1227
+ validateAll?: {} | null | undefined;
1228
+ defaultOptions?: unknown;
1229
+ } | null | undefined;
1086
1230
  fundRaisedFor?: unknown;
1087
1231
  sourceOfFundsLid?: mongoose.Types.ObjectId | null | undefined;
1088
1232
  sourceOfFundDetails?: unknown;
@@ -1114,16 +1258,20 @@ declare const MortgageModel: mongoose.Model<{
1114
1258
  updatedAt: NativeDate;
1115
1259
  } & {
1116
1260
  applicationId: mongoose.Types.ObjectId;
1261
+ pageValidFlag: boolean;
1262
+ topSlicing: boolean;
1117
1263
  purposeOfMortgage: string;
1118
1264
  depositComeFromLid: mongoose.Types.ObjectId[];
1119
1265
  ifOtherDetails: string;
1120
1266
  purchasePrice: Pound;
1121
1267
  repaymentTypeLid: mongoose.Types.ObjectId;
1122
1268
  exitStrategyLid: mongoose.Types.ObjectId;
1269
+ isCapitalRaise: boolean;
1123
1270
  purchaseDate: NativeDate;
1124
1271
  estimatedValue: Pound;
1125
1272
  loanRequired: Pound;
1126
1273
  monthlyRentalIncome: Pound;
1274
+ outstandingBalance: Pound;
1127
1275
  fundRaisedFor: string;
1128
1276
  sourceOfFundsLid: mongoose.Types.ObjectId;
1129
1277
  sourceOfFundDetails: string;
@@ -1132,31 +1280,33 @@ declare const MortgageModel: mongoose.Model<{
1132
1280
  isDistressedSale: boolean;
1133
1281
  isPurchasedBelowMarketValue: boolean;
1134
1282
  isPurchasedAsSale: boolean;
1283
+ isReadyToSell: boolean;
1284
+ isGovernmentInitiative: boolean;
1285
+ isTheIntentionToLet: boolean;
1135
1286
  proposedTenantsLid: mongoose.Types.ObjectId[];
1136
1287
  leaseTypeLid: mongoose.Types.ObjectId;
1137
- pageValidFlag?: boolean | null | undefined;
1138
1288
  existingMortgageLender?: string | null | undefined;
1139
- isCapitalRaise?: boolean | null | undefined;
1140
- isReadyToSell?: boolean | null | undefined;
1141
- isGovernmentInitiative?: boolean | null | undefined;
1142
1289
  vendorsName?: string | null | undefined;
1143
1290
  saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
1144
- isTheIntentionToLet?: boolean | null | undefined;
1145
1291
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
1146
1292
  createdAt: NativeDate;
1147
1293
  updatedAt: NativeDate;
1148
1294
  } & {
1149
1295
  applicationId: mongoose.Types.ObjectId;
1296
+ pageValidFlag: boolean;
1297
+ topSlicing: boolean;
1150
1298
  purposeOfMortgage: string;
1151
1299
  depositComeFromLid: mongoose.Types.ObjectId[];
1152
1300
  ifOtherDetails: string;
1153
1301
  purchasePrice: Pound;
1154
1302
  repaymentTypeLid: mongoose.Types.ObjectId;
1155
1303
  exitStrategyLid: mongoose.Types.ObjectId;
1304
+ isCapitalRaise: boolean;
1156
1305
  purchaseDate: NativeDate;
1157
1306
  estimatedValue: Pound;
1158
1307
  loanRequired: Pound;
1159
1308
  monthlyRentalIncome: Pound;
1309
+ outstandingBalance: Pound;
1160
1310
  fundRaisedFor: string;
1161
1311
  sourceOfFundsLid: mongoose.Types.ObjectId;
1162
1312
  sourceOfFundDetails: string;
@@ -1165,31 +1315,33 @@ declare const MortgageModel: mongoose.Model<{
1165
1315
  isDistressedSale: boolean;
1166
1316
  isPurchasedBelowMarketValue: boolean;
1167
1317
  isPurchasedAsSale: boolean;
1318
+ isReadyToSell: boolean;
1319
+ isGovernmentInitiative: boolean;
1320
+ isTheIntentionToLet: boolean;
1168
1321
  proposedTenantsLid: mongoose.Types.ObjectId[];
1169
1322
  leaseTypeLid: mongoose.Types.ObjectId;
1170
- pageValidFlag?: boolean | null | undefined;
1171
1323
  existingMortgageLender?: string | null | undefined;
1172
- isCapitalRaise?: boolean | null | undefined;
1173
- isReadyToSell?: boolean | null | undefined;
1174
- isGovernmentInitiative?: boolean | null | undefined;
1175
1324
  vendorsName?: string | null | undefined;
1176
1325
  saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
1177
- isTheIntentionToLet?: boolean | null | undefined;
1178
1326
  }>> & mongoose.FlatRecord<{
1179
1327
  createdAt: NativeDate;
1180
1328
  updatedAt: NativeDate;
1181
1329
  } & {
1182
1330
  applicationId: mongoose.Types.ObjectId;
1331
+ pageValidFlag: boolean;
1332
+ topSlicing: boolean;
1183
1333
  purposeOfMortgage: string;
1184
1334
  depositComeFromLid: mongoose.Types.ObjectId[];
1185
1335
  ifOtherDetails: string;
1186
1336
  purchasePrice: Pound;
1187
1337
  repaymentTypeLid: mongoose.Types.ObjectId;
1188
1338
  exitStrategyLid: mongoose.Types.ObjectId;
1339
+ isCapitalRaise: boolean;
1189
1340
  purchaseDate: NativeDate;
1190
1341
  estimatedValue: Pound;
1191
1342
  loanRequired: Pound;
1192
1343
  monthlyRentalIncome: Pound;
1344
+ outstandingBalance: Pound;
1193
1345
  fundRaisedFor: string;
1194
1346
  sourceOfFundsLid: mongoose.Types.ObjectId;
1195
1347
  sourceOfFundDetails: string;
@@ -1198,16 +1350,14 @@ declare const MortgageModel: mongoose.Model<{
1198
1350
  isDistressedSale: boolean;
1199
1351
  isPurchasedBelowMarketValue: boolean;
1200
1352
  isPurchasedAsSale: boolean;
1353
+ isReadyToSell: boolean;
1354
+ isGovernmentInitiative: boolean;
1355
+ isTheIntentionToLet: boolean;
1201
1356
  proposedTenantsLid: mongoose.Types.ObjectId[];
1202
1357
  leaseTypeLid: mongoose.Types.ObjectId;
1203
- pageValidFlag?: boolean | null | undefined;
1204
1358
  existingMortgageLender?: string | null | undefined;
1205
- isCapitalRaise?: boolean | null | undefined;
1206
- isReadyToSell?: boolean | null | undefined;
1207
- isGovernmentInitiative?: boolean | null | undefined;
1208
1359
  vendorsName?: string | null | undefined;
1209
1360
  saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
1210
- isTheIntentionToLet?: boolean | null | undefined;
1211
1361
  }> & {
1212
1362
  _id: mongoose.Types.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({
4
4
  applicationId: {
5
- type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true,
6
- description: "Unique identifier for the application"
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: "Application",
7
+ required: true,
8
+ description: "Unique identifier for the application",
7
9
  },
8
10
  pageValidFlag: {
9
11
  type: Boolean,
10
- get: (value) => (value ? "Yes" : "No"),
12
+ default: true,
11
13
  description: "True if all mandatory fields have been completed, otherwise false",
12
14
  },
13
15
  existingMortgageLender: {
@@ -15,6 +17,11 @@ const mortgageSchema = new mongoose.Schema({
15
17
  maxlength: 35,
16
18
  description: "Name of the existing mortgage lender",
17
19
  },
20
+ topSlicing: {
21
+ type: Boolean,
22
+ default: false,
23
+ description: "Indicates if the mortgage is being paid off using top slicing",
24
+ },
18
25
  purposeOfMortgage: {
19
26
  type: String,
20
27
  required: true,
@@ -52,7 +59,7 @@ const mortgageSchema = new mongoose.Schema({
52
59
  },
53
60
  isCapitalRaise: {
54
61
  type: Boolean,
55
- get: (value) => (value ? "Yes" : "No"),
62
+ default: false,
56
63
  description: "Indicates if capital raising is part of this finance",
57
64
  },
58
65
  purchaseDate: {
@@ -75,6 +82,11 @@ const mortgageSchema = new mongoose.Schema({
75
82
  required: true,
76
83
  description: "Monthly rental income from the property",
77
84
  },
85
+ outstandingBalance: {
86
+ type: Pound,
87
+ required: true,
88
+ description: "Outstanding balance on the existing mortgage",
89
+ },
78
90
  fundRaisedFor: {
79
91
  type: String,
80
92
  maxlength: 250,
@@ -107,30 +119,30 @@ const mortgageSchema = new mongoose.Schema({
107
119
  },
108
120
  isDistressedSale: {
109
121
  type: Boolean,
110
- get: (value) => (value ? "Yes" : "No"),
122
+ default: false,
111
123
  required: true,
112
124
  description: "Indicates if this is a distressed sale",
113
125
  },
114
126
  isPurchasedBelowMarketValue: {
115
127
  type: Boolean,
116
- get: (value) => (value ? "Yes" : "No"),
128
+ default: false,
117
129
  required: true,
118
130
  description: "Indicates if the property is purchased below market value",
119
131
  },
120
132
  isPurchasedAsSale: {
121
133
  type: Boolean,
122
- get: (value) => (value ? "Yes" : "No"),
134
+ default: false,
123
135
  required: true,
124
136
  description: "Indicates if the property is purchased as a sale and rent back",
125
137
  },
126
138
  isReadyToSell: {
127
139
  type: Boolean,
128
- get: (value) => (value ? "Yes" : "No"),
140
+ default: false,
129
141
  description: "Indicates if the property is ready to sell or let out",
130
142
  },
131
143
  isGovernmentInitiative: {
132
144
  type: Boolean,
133
- get: (value) => (value ? "Yes" : "No"),
145
+ default: false,
134
146
  description: "Indicates if this purchase is part of a government initiative",
135
147
  },
136
148
  vendorsName: {
@@ -145,7 +157,7 @@ const mortgageSchema = new mongoose.Schema({
145
157
  },
146
158
  isTheIntentionToLet: {
147
159
  type: Boolean,
148
- get: (value) => (value ? "Yes" : "No"),
160
+ default: false,
149
161
  description: "Indicates if the intention is to let out the property",
150
162
  },
151
163
  proposedTenantsLid: {
@@ -218,19 +230,21 @@ const mortgageSchema = new mongoose.Schema({
218
230
  // }) as VirtualWithDescription;
219
231
  // virtualLeaseType.description = "Populated lookup value for lease type";
220
232
  // virtual property 'applicationType'
221
- mortgageSchema.virtual('applicationType').get(function () {
222
- return this.applicationId?.applicationTypeLid instanceof mongoose.Types.ObjectId
233
+ mortgageSchema.virtual("applicationType").get(function () {
234
+ return this.applicationId?.applicationTypeLid instanceof
235
+ mongoose.Types.ObjectId
223
236
  ? null
224
237
  : this.applicationId?.applicationTypeLid?.text || null;
225
238
  });
226
239
  // virtual property 'lendingType'
227
- mortgageSchema.virtual('lendingType').get(function () {
228
- return this.applicationId?.lendingTypeLid instanceof mongoose.Types.ObjectId
240
+ mortgageSchema.virtual("lendingType").get(function () {
241
+ return this.applicationId?.lendingTypeLid instanceof
242
+ mongoose.Types.ObjectId
229
243
  ? null
230
244
  : this.applicationId?.lendingTypeLid?.text || null;
231
245
  });
232
246
  // virtual property 'lendingType'
233
- mortgageSchema.virtual('sourceOfWealth').get(function () {
247
+ mortgageSchema.virtual("sourceOfWealth").get(function () {
234
248
  const sourceOfWealthLids = this.applicationId?.sourceOfWealthLids;
235
249
  if (!Array.isArray(sourceOfWealthLids)) {
236
250
  return null;
@@ -179,7 +179,7 @@ declare const PropertyModel: mongoose.Model<{
179
179
  } | null | undefined;
180
180
  remainingTerm?: unknown;
181
181
  propertyId?: unknown;
182
- associatedLoanParties?: unknown;
182
+ associatedLoanPartiesIds?: unknown;
183
183
  countryLid?: mongoose.Types.ObjectId | null | undefined;
184
184
  lender?: unknown;
185
185
  marketValue?: {
@@ -526,7 +526,7 @@ declare const PropertyModel: mongoose.Model<{
526
526
  } | null | undefined;
527
527
  remainingTerm?: unknown;
528
528
  propertyId?: unknown;
529
- associatedLoanParties?: unknown;
529
+ associatedLoanPartiesIds?: unknown;
530
530
  countryLid?: mongoose.Types.ObjectId | null | undefined;
531
531
  lender?: unknown;
532
532
  marketValue?: {
@@ -873,7 +873,7 @@ declare const PropertyModel: mongoose.Model<{
873
873
  } | null | undefined;
874
874
  remainingTerm?: unknown;
875
875
  propertyId?: unknown;
876
- associatedLoanParties?: unknown;
876
+ associatedLoanPartiesIds?: unknown;
877
877
  countryLid?: mongoose.Types.ObjectId | null | undefined;
878
878
  lender?: unknown;
879
879
  marketValue?: {
@@ -1099,7 +1099,7 @@ declare const PropertyModel: mongoose.Model<{
1099
1099
  addressLine2?: string | null | undefined;
1100
1100
  addressLine3?: string | null | undefined;
1101
1101
  city?: string | null | undefined;
1102
- associatedLoanParties?: mongoose.Types.ObjectId[] | null | undefined;
1102
+ associatedLoanPartiesIds?: mongoose.Types.ObjectId[] | null | undefined;
1103
1103
  otherOwnershipParties?: string | null | undefined;
1104
1104
  portfolioFile?: string | null | undefined;
1105
1105
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
@@ -1122,7 +1122,7 @@ declare const PropertyModel: mongoose.Model<{
1122
1122
  addressLine2?: string | null | undefined;
1123
1123
  addressLine3?: string | null | undefined;
1124
1124
  city?: string | null | undefined;
1125
- associatedLoanParties?: mongoose.Types.ObjectId[] | null | undefined;
1125
+ associatedLoanPartiesIds?: mongoose.Types.ObjectId[] | null | undefined;
1126
1126
  otherOwnershipParties?: string | null | undefined;
1127
1127
  portfolioFile?: string | null | undefined;
1128
1128
  }>> & mongoose.FlatRecord<{
@@ -1145,7 +1145,7 @@ declare const PropertyModel: mongoose.Model<{
1145
1145
  addressLine2?: string | null | undefined;
1146
1146
  addressLine3?: string | null | undefined;
1147
1147
  city?: string | null | undefined;
1148
- associatedLoanParties?: mongoose.Types.ObjectId[] | null | undefined;
1148
+ associatedLoanPartiesIds?: mongoose.Types.ObjectId[] | null | undefined;
1149
1149
  otherOwnershipParties?: string | null | undefined;
1150
1150
  portfolioFile?: string | null | undefined;
1151
1151
  }> & {
@@ -34,7 +34,7 @@ const propertySchema = new mongoose.Schema({
34
34
  maxLength: 35,
35
35
  description: "Third line of the property address"
36
36
  },
37
- associatedLoanParties: {
37
+ associatedLoanPartiesIds: {
38
38
  type: [mongoose.Schema.Types.ObjectId],
39
39
  required: false,
40
40
  description: "List of associated loan parties (either applicant or company)"
@@ -18,7 +18,7 @@ class Pound extends mongoose.SchemaType {
18
18
  throw new mongoose.Error.CastError('Pound', val, this.path, new Error(`${val} is not a valid currency value`));
19
19
  }
20
20
  // Return without symbol prefixed
21
- return val.toFixed(2);
21
+ return parseFloat(val.toFixed(2));
22
22
  }
23
23
  }
24
24
  // Register custom type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.53",
3
+ "version": "1.2.55",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",