@dynamatix/gb-schemas 1.2.52 → 1.2.54

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.
@@ -1114,12 +1114,14 @@ declare const MortgageModel: mongoose.Model<{
1114
1114
  updatedAt: NativeDate;
1115
1115
  } & {
1116
1116
  applicationId: mongoose.Types.ObjectId;
1117
+ pageValidFlag: boolean;
1117
1118
  purposeOfMortgage: string;
1118
1119
  depositComeFromLid: mongoose.Types.ObjectId[];
1119
1120
  ifOtherDetails: string;
1120
1121
  purchasePrice: Pound;
1121
1122
  repaymentTypeLid: mongoose.Types.ObjectId;
1122
1123
  exitStrategyLid: mongoose.Types.ObjectId;
1124
+ isCapitalRaise: boolean;
1123
1125
  purchaseDate: NativeDate;
1124
1126
  estimatedValue: Pound;
1125
1127
  loanRequired: Pound;
@@ -1132,27 +1134,27 @@ declare const MortgageModel: mongoose.Model<{
1132
1134
  isDistressedSale: boolean;
1133
1135
  isPurchasedBelowMarketValue: boolean;
1134
1136
  isPurchasedAsSale: boolean;
1137
+ isReadyToSell: boolean;
1138
+ isGovernmentInitiative: boolean;
1139
+ isTheIntentionToLet: boolean;
1135
1140
  proposedTenantsLid: mongoose.Types.ObjectId[];
1136
1141
  leaseTypeLid: mongoose.Types.ObjectId;
1137
- pageValidFlag?: boolean | null | undefined;
1138
1142
  existingMortgageLender?: string | null | undefined;
1139
- isCapitalRaise?: boolean | null | undefined;
1140
- isReadyToSell?: boolean | null | undefined;
1141
- isGovernmentInitiative?: boolean | null | undefined;
1142
1143
  vendorsName?: string | null | undefined;
1143
1144
  saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
1144
- isTheIntentionToLet?: boolean | null | undefined;
1145
1145
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
1146
1146
  createdAt: NativeDate;
1147
1147
  updatedAt: NativeDate;
1148
1148
  } & {
1149
1149
  applicationId: mongoose.Types.ObjectId;
1150
+ pageValidFlag: boolean;
1150
1151
  purposeOfMortgage: string;
1151
1152
  depositComeFromLid: mongoose.Types.ObjectId[];
1152
1153
  ifOtherDetails: string;
1153
1154
  purchasePrice: Pound;
1154
1155
  repaymentTypeLid: mongoose.Types.ObjectId;
1155
1156
  exitStrategyLid: mongoose.Types.ObjectId;
1157
+ isCapitalRaise: boolean;
1156
1158
  purchaseDate: NativeDate;
1157
1159
  estimatedValue: Pound;
1158
1160
  loanRequired: Pound;
@@ -1165,27 +1167,27 @@ declare const MortgageModel: mongoose.Model<{
1165
1167
  isDistressedSale: boolean;
1166
1168
  isPurchasedBelowMarketValue: boolean;
1167
1169
  isPurchasedAsSale: boolean;
1170
+ isReadyToSell: boolean;
1171
+ isGovernmentInitiative: boolean;
1172
+ isTheIntentionToLet: boolean;
1168
1173
  proposedTenantsLid: mongoose.Types.ObjectId[];
1169
1174
  leaseTypeLid: mongoose.Types.ObjectId;
1170
- pageValidFlag?: boolean | null | undefined;
1171
1175
  existingMortgageLender?: string | null | undefined;
1172
- isCapitalRaise?: boolean | null | undefined;
1173
- isReadyToSell?: boolean | null | undefined;
1174
- isGovernmentInitiative?: boolean | null | undefined;
1175
1176
  vendorsName?: string | null | undefined;
1176
1177
  saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
1177
- isTheIntentionToLet?: boolean | null | undefined;
1178
1178
  }>> & mongoose.FlatRecord<{
1179
1179
  createdAt: NativeDate;
1180
1180
  updatedAt: NativeDate;
1181
1181
  } & {
1182
1182
  applicationId: mongoose.Types.ObjectId;
1183
+ pageValidFlag: boolean;
1183
1184
  purposeOfMortgage: string;
1184
1185
  depositComeFromLid: mongoose.Types.ObjectId[];
1185
1186
  ifOtherDetails: string;
1186
1187
  purchasePrice: Pound;
1187
1188
  repaymentTypeLid: mongoose.Types.ObjectId;
1188
1189
  exitStrategyLid: mongoose.Types.ObjectId;
1190
+ isCapitalRaise: boolean;
1189
1191
  purchaseDate: NativeDate;
1190
1192
  estimatedValue: Pound;
1191
1193
  loanRequired: Pound;
@@ -1198,16 +1200,14 @@ declare const MortgageModel: mongoose.Model<{
1198
1200
  isDistressedSale: boolean;
1199
1201
  isPurchasedBelowMarketValue: boolean;
1200
1202
  isPurchasedAsSale: boolean;
1203
+ isReadyToSell: boolean;
1204
+ isGovernmentInitiative: boolean;
1205
+ isTheIntentionToLet: boolean;
1201
1206
  proposedTenantsLid: mongoose.Types.ObjectId[];
1202
1207
  leaseTypeLid: mongoose.Types.ObjectId;
1203
- pageValidFlag?: boolean | null | undefined;
1204
1208
  existingMortgageLender?: string | null | undefined;
1205
- isCapitalRaise?: boolean | null | undefined;
1206
- isReadyToSell?: boolean | null | undefined;
1207
- isGovernmentInitiative?: boolean | null | undefined;
1208
1209
  vendorsName?: string | null | undefined;
1209
1210
  saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
1210
- isTheIntentionToLet?: boolean | null | undefined;
1211
1211
  }> & {
1212
1212
  _id: mongoose.Types.ObjectId;
1213
1213
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"application-mortgage.model.d.ts","sourceRoot":"","sources":["../../applications/application-mortgage.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAiR/C,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AAEjE,eAAe,aAAa,CAAC"}
@@ -2,12 +2,14 @@ import mongoose from "mongoose";
2
2
  import { Pound } from "../value-objects/pound";
3
3
  const mortgageSchema = new mongoose.Schema({
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: {
@@ -52,7 +54,7 @@ const mortgageSchema = new mongoose.Schema({
52
54
  },
53
55
  isCapitalRaise: {
54
56
  type: Boolean,
55
- get: (value) => (value ? "Yes" : "No"),
57
+ default: false,
56
58
  description: "Indicates if capital raising is part of this finance",
57
59
  },
58
60
  purchaseDate: {
@@ -107,30 +109,30 @@ const mortgageSchema = new mongoose.Schema({
107
109
  },
108
110
  isDistressedSale: {
109
111
  type: Boolean,
110
- get: (value) => (value ? "Yes" : "No"),
112
+ default: false,
111
113
  required: true,
112
114
  description: "Indicates if this is a distressed sale",
113
115
  },
114
116
  isPurchasedBelowMarketValue: {
115
117
  type: Boolean,
116
- get: (value) => (value ? "Yes" : "No"),
118
+ default: false,
117
119
  required: true,
118
120
  description: "Indicates if the property is purchased below market value",
119
121
  },
120
122
  isPurchasedAsSale: {
121
123
  type: Boolean,
122
- get: (value) => (value ? "Yes" : "No"),
124
+ default: false,
123
125
  required: true,
124
126
  description: "Indicates if the property is purchased as a sale and rent back",
125
127
  },
126
128
  isReadyToSell: {
127
129
  type: Boolean,
128
- get: (value) => (value ? "Yes" : "No"),
130
+ default: false,
129
131
  description: "Indicates if the property is ready to sell or let out",
130
132
  },
131
133
  isGovernmentInitiative: {
132
134
  type: Boolean,
133
- get: (value) => (value ? "Yes" : "No"),
135
+ default: false,
134
136
  description: "Indicates if this purchase is part of a government initiative",
135
137
  },
136
138
  vendorsName: {
@@ -145,7 +147,7 @@ const mortgageSchema = new mongoose.Schema({
145
147
  },
146
148
  isTheIntentionToLet: {
147
149
  type: Boolean,
148
- get: (value) => (value ? "Yes" : "No"),
150
+ default: false,
149
151
  description: "Indicates if the intention is to let out the property",
150
152
  },
151
153
  proposedTenantsLid: {
@@ -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.52",
3
+ "version": "1.2.54",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",