@dynamatix/gb-schemas 1.2.4 → 1.2.6
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/dist/applicants/applicant-direct-debit.model.d.ts +15 -23
- package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -1
- package/dist/applicants/applicant-direct-debit.model.js +1 -3
- package/dist/applicants/applicant.model.d.ts +36 -36
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applicants/applicant.model.js +4 -1
- package/dist/applications/application-direct-debit.model.d.ts +520 -65
- package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
- package/dist/applications/application-direct-debit.model.js +92 -16
- package/dist/applications/application.model.d.ts +6 -0
- package/dist/applications/application.model.d.ts.map +1 -1
- package/dist/applications/application.model.js +3 -2
- package/dist/applications/index.js +0 -1
- package/dist/applications/solicitor.model.d.ts +46 -49
- package/dist/applications/solicitor.model.d.ts.map +1 -1
- package/dist/applications/solicitor.model.js +105 -26
- package/dist/properties/index.d.ts +1 -0
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js +1 -0
- package/dist/properties/property-potfolio.model.d.ts +1113 -0
- package/dist/properties/property-potfolio.model.d.ts.map +1 -0
- package/dist/properties/property-potfolio.model.js +116 -0
- package/dist/properties/property.model.d.ts +6 -0
- package/dist/properties/property.model.d.ts.map +1 -1
- package/dist/properties/property.model.js +41 -31
- package/dist/shared/index.js +2 -1
- package/dist/users/user.model.d.ts +6 -6
- package/dist/value-objects/pound.d.ts +15 -0
- package/dist/value-objects/pound.d.ts.map +1 -0
- package/dist/value-objects/pound.js +40 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-potfolio.model.d.ts","sourceRoot":"","sources":["../../properties/property-potfolio.model.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAu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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAgE,CAAC;AAC7F,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import { Pound } from '../value-objects/pound';
|
|
3
|
+
const propertyPortfolioSchema = new mongoose.Schema({
|
|
4
|
+
propertyId: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
unique: true,
|
|
8
|
+
description: "Unique identifier for the property"
|
|
9
|
+
},
|
|
10
|
+
addressLine1: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
maxLength: 35,
|
|
14
|
+
description: "First line of the property address"
|
|
15
|
+
},
|
|
16
|
+
addressLine2: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false,
|
|
19
|
+
maxLength: 35,
|
|
20
|
+
description: "Second line of the property address"
|
|
21
|
+
},
|
|
22
|
+
addressLine3: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
maxLength: 35,
|
|
26
|
+
description: "Third line of the property address"
|
|
27
|
+
},
|
|
28
|
+
associatedLoanParties: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
description: "Checkbox to allow selection of the applicants on the application, including the company if applicable"
|
|
32
|
+
},
|
|
33
|
+
city: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false,
|
|
36
|
+
maxLength: 30,
|
|
37
|
+
description: "City where the property is located"
|
|
38
|
+
},
|
|
39
|
+
countryLid: {
|
|
40
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'Lookup',
|
|
42
|
+
required: true,
|
|
43
|
+
description: "Country where the property is located",
|
|
44
|
+
},
|
|
45
|
+
lender: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
maxLength: 35,
|
|
49
|
+
description: "Lender providing the loan for the property"
|
|
50
|
+
},
|
|
51
|
+
marketValue: {
|
|
52
|
+
type: Pound,
|
|
53
|
+
required: true,
|
|
54
|
+
default: '£0.00',
|
|
55
|
+
description: "The market value of the property",
|
|
56
|
+
},
|
|
57
|
+
monthlyRent: {
|
|
58
|
+
type: Pound,
|
|
59
|
+
required: true,
|
|
60
|
+
default: '£0.00',
|
|
61
|
+
description: "The monthly rent value of the property"
|
|
62
|
+
},
|
|
63
|
+
monthlyRepayment: {
|
|
64
|
+
type: Pound,
|
|
65
|
+
required: true,
|
|
66
|
+
default: '£0.00',
|
|
67
|
+
description: "The monthly repayment value for the property"
|
|
68
|
+
},
|
|
69
|
+
originalLoanBalance: {
|
|
70
|
+
type: Pound,
|
|
71
|
+
required: true,
|
|
72
|
+
default: '£0.00',
|
|
73
|
+
description: "The original loan balance for the property"
|
|
74
|
+
},
|
|
75
|
+
outstandingBalance: {
|
|
76
|
+
type: Pound,
|
|
77
|
+
required: true,
|
|
78
|
+
default: '£0.00',
|
|
79
|
+
description: "The remaining outstanding balance of the property loan"
|
|
80
|
+
},
|
|
81
|
+
otherOwnershipParties: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false,
|
|
84
|
+
maxLength: 500,
|
|
85
|
+
description: "Other parties that own the property"
|
|
86
|
+
},
|
|
87
|
+
postcode: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: true,
|
|
90
|
+
maxLength: 50,
|
|
91
|
+
description: "The postcode for the property"
|
|
92
|
+
},
|
|
93
|
+
remainingTerm: {
|
|
94
|
+
type: Number,
|
|
95
|
+
required: true,
|
|
96
|
+
max: 4,
|
|
97
|
+
description: "The remaining term of the loan in years"
|
|
98
|
+
},
|
|
99
|
+
}, {
|
|
100
|
+
timestamps: true,
|
|
101
|
+
toJSON: { virtuals: true },
|
|
102
|
+
toObject: { virtuals: true }
|
|
103
|
+
});
|
|
104
|
+
// Virtual property for countryLid (reference to Lookup collection)
|
|
105
|
+
const virtualCountry = propertyPortfolioSchema.virtual('country', {
|
|
106
|
+
ref: 'Lookup',
|
|
107
|
+
localField: 'countryLid',
|
|
108
|
+
foreignField: '_id',
|
|
109
|
+
justOne: true,
|
|
110
|
+
options: {
|
|
111
|
+
select: 'label' // This will select the 'label' field from the Lookup collection
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
virtualCountry.description = 'Populated lookup value for country';
|
|
115
|
+
const PropertyPortfolioModel = mongoose.model('Property_Portfolio', propertyPortfolioSchema);
|
|
116
|
+
export default PropertyPortfolioModel;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
declare const PropertyModel: mongoose.Model<{
|
|
3
|
+
pageValidFlag: any;
|
|
3
4
|
haveAnyBuyToLetProperties: any;
|
|
4
5
|
isPropertyInEnglandOrWales: any;
|
|
5
6
|
price: any;
|
|
@@ -43,6 +44,7 @@ declare const PropertyModel: mongoose.Model<{
|
|
|
43
44
|
energyEfficiencyRatingValue: any;
|
|
44
45
|
dataStreetSchema: any;
|
|
45
46
|
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
47
|
+
pageValidFlag: any;
|
|
46
48
|
haveAnyBuyToLetProperties: any;
|
|
47
49
|
isPropertyInEnglandOrWales: any;
|
|
48
50
|
price: any;
|
|
@@ -86,6 +88,7 @@ declare const PropertyModel: mongoose.Model<{
|
|
|
86
88
|
energyEfficiencyRatingValue: any;
|
|
87
89
|
dataStreetSchema: any;
|
|
88
90
|
}> & {
|
|
91
|
+
pageValidFlag: any;
|
|
89
92
|
haveAnyBuyToLetProperties: any;
|
|
90
93
|
isPropertyInEnglandOrWales: any;
|
|
91
94
|
price: any;
|
|
@@ -140,6 +143,7 @@ declare const PropertyModel: mongoose.Model<{
|
|
|
140
143
|
virtuals: true;
|
|
141
144
|
};
|
|
142
145
|
}, {
|
|
146
|
+
pageValidFlag: any;
|
|
143
147
|
haveAnyBuyToLetProperties: any;
|
|
144
148
|
isPropertyInEnglandOrWales: any;
|
|
145
149
|
price: any;
|
|
@@ -183,6 +187,7 @@ declare const PropertyModel: mongoose.Model<{
|
|
|
183
187
|
energyEfficiencyRatingValue: any;
|
|
184
188
|
dataStreetSchema: any;
|
|
185
189
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
190
|
+
pageValidFlag: any;
|
|
186
191
|
haveAnyBuyToLetProperties: any;
|
|
187
192
|
isPropertyInEnglandOrWales: any;
|
|
188
193
|
price: any;
|
|
@@ -226,6 +231,7 @@ declare const PropertyModel: mongoose.Model<{
|
|
|
226
231
|
energyEfficiencyRatingValue: any;
|
|
227
232
|
dataStreetSchema: any;
|
|
228
233
|
}>> & mongoose.FlatRecord<{
|
|
234
|
+
pageValidFlag: any;
|
|
229
235
|
haveAnyBuyToLetProperties: any;
|
|
230
236
|
isPropertyInEnglandOrWales: any;
|
|
231
237
|
price: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.model.d.ts","sourceRoot":"","sources":["../../properties/property.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"property.model.d.ts","sourceRoot":"","sources":["../../properties/property.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA8HhC,QAAA,MAAM,aAAa;mBAxEoC,GAAG;+BACS,GAAG;gCACF,GAAG;WAC3B,GAAG;4BACC,GAAG;8BACY,GAAG;2BACN,GAAG;6BACD,GAAG;6BACC,GAAG;6BACH,GAAG;yBACR,GAAG;qBACN,GAAG;gBACR,GAAG;0BACM,GAAG;gBAC5B,GAAG;kBAK/B,GAAG;qBAC8C,GAAG;yBACA,GAAG;2BACD,GAAG;8BACA,GAAG;4BACL,GAAG;4BACH,GAAG;gCACE,GAAG;cACrC,GAAG;gBACe,GAAG;yBACiB,GAAG;4BACZ,GAAG;0BACU,GAAG;0BACN,GAAG;0BACH,GAAG;6BACG,GAAG;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yBACR,GAAG;qBACN,GAAG;gBACR,GAAG;0BACM,GAAG;gBAC5B,GAAG;kBAK/B,GAAG;qBAC8C,GAAG;yBACA,GAAG;2BACD,GAAG;8BACA,GAAG;4BACL,GAAG;4BACH,GAAG;gCACE,GAAG;cACrC,GAAG;gBACe,GAAG;yBACiB,GAAG;4BACZ,GAAG;0BACU,GAAG;0BACN,GAAG;0BACH,GAAG;6BACG,GAAG;uBACe,GAAG;qBACrB,GAAG;uBACV,GAAG;0BACb,GAAG;8BAC6B,GAAG;sBACxC,GAAG;mBAKpD,GAAG;6BACmE,GAAG;sBAC3B,GAAG;4BACV,GAAG;iCACE,GAAG;sBACd,GAAG;;;;;GAsBmB,CAAC;AACjE,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
|
+
import { Pound } from "../value-objects/pound";
|
|
2
3
|
const dataStreetSchema = new mongoose.Schema({
|
|
3
4
|
floorArea: { type: String, default: '' },
|
|
4
5
|
propertyType: { type: String, default: '' },
|
|
@@ -49,6 +50,7 @@ const dataStreetSchema = new mongoose.Schema({
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
const propertySchema = new mongoose.Schema({
|
|
53
|
+
pageValidFlag: { type: Boolean, default: true }, //form
|
|
52
54
|
haveAnyBuyToLetProperties: { type: String, required: true },
|
|
53
55
|
isPropertyInEnglandOrWales: { type: String, required: true },
|
|
54
56
|
price: { type: String, default: '' },
|
|
@@ -56,37 +58,45 @@ const propertySchema = new mongoose.Schema({
|
|
|
56
58
|
totalMonthlyRentalIncome: { type: String, default: '' },
|
|
57
59
|
totalMonthlyRepayment: { type: String, default: '' },
|
|
58
60
|
totalOutstandingBalance: { type: String, default: '' },
|
|
59
|
-
areAllBedRoomsOver10sqm: { type:
|
|
60
|
-
isBrickTileConstruction: { type:
|
|
61
|
-
constructionDetails: { type: String,
|
|
62
|
-
isExLAExclusion: { type:
|
|
63
|
-
isFlatLift: { type:
|
|
64
|
-
flatNumberOfBedrooms: { type:
|
|
65
|
-
isGreenEPC: { type:
|
|
66
|
-
isGroundRent: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
61
|
+
areAllBedRoomsOver10sqm: { type: Boolean, required: true }, // form
|
|
62
|
+
isBrickTileConstruction: { type: Boolean, required: true }, // form
|
|
63
|
+
constructionDetails: { type: String, required: true }, // form
|
|
64
|
+
isExLAExclusion: { type: Boolean, required: true }, // form
|
|
65
|
+
isFlatLift: { type: Boolean, required: true }, // form
|
|
66
|
+
flatNumberOfBedrooms: { type: Number, required: true }, // form
|
|
67
|
+
isGreenEPC: { type: Boolean }, // form
|
|
68
|
+
isGroundRent: {
|
|
69
|
+
type: Pound,
|
|
70
|
+
required: true,
|
|
71
|
+
default: '£0.00' // Default value in correct format
|
|
72
|
+
}, // form - pounds
|
|
73
|
+
isHouseLicensed: { type: Boolean, required: true }, // form
|
|
74
|
+
houseNumberOfFloors: { type: Number, required: true }, // form
|
|
75
|
+
houseNumberOfKitchens: { type: Number, required: true }, // form
|
|
76
|
+
houseNumberOfLivingRooms: { type: Number, required: true }, // form
|
|
77
|
+
houseNumberOfBathrooms: { type: Number, required: true }, // form
|
|
78
|
+
houseNumberOfTenancies: { type: Number, required: true }, // form
|
|
79
|
+
hasHousePlanningPermission: { type: Boolean, required: true },
|
|
80
|
+
isGarage: { type: Boolean }, // form
|
|
81
|
+
isNewBuild: { type: Boolean, required: true }, // form
|
|
82
|
+
propertyAddressCity: { type: String, default: '', maxlength: 30 }, // form
|
|
83
|
+
propertyAddressCountry: { type: String, required: true }, // form
|
|
84
|
+
propertyAddressLine1: { type: String, required: true, maxlength: 35 }, // form
|
|
85
|
+
propertyAddressLine2: { type: String, default: '', maxlength: 35 }, // form
|
|
86
|
+
propertyAddressLine3: { type: String, default: '', maxlength: 35 }, // form
|
|
87
|
+
propertyAddressPostCode: { type: String, required: true, maxlength: 50 }, // form
|
|
88
|
+
propertyTenureLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }, // form
|
|
89
|
+
propertyTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }, // form
|
|
90
|
+
propertyYearBuilt: { type: Number, required: true, maxlength: 4 }, // form
|
|
91
|
+
receiptOfAnyDiscount: { type: Boolean, required: true }, // form
|
|
92
|
+
receiptOfDiscountDetails: { type: String, required: true, default: '', maxlength: 100 }, // form
|
|
93
|
+
sectorExperience: { type: String, required: true }, // form
|
|
94
|
+
serviceCharge: {
|
|
95
|
+
type: Pound,
|
|
96
|
+
required: true,
|
|
97
|
+
default: '£0.00' // Default value in correct format
|
|
98
|
+
}, // form - pounds
|
|
99
|
+
unexpiredRemainingLease: { type: Number, required: true, maxLength: 4 }, // form
|
|
90
100
|
yearLeaseExpires: { type: String, default: '' },
|
|
91
101
|
energyEfficiencyRating: { type: String },
|
|
92
102
|
energyEfficiencyRatingValue: { type: String },
|
package/dist/shared/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { default as TaskModel } from './task.model';
|
|
|
8
8
|
export { default as ApprivoSyncJourneyModel } from './apprivo-sync-journey.model';
|
|
9
9
|
export { default as JobRunModel } from './job-run.model';
|
|
10
10
|
export { default as TaskDocumentTypeModel } from './task-document.model';
|
|
11
|
-
export { default as DocumentTypeModel } from './document-type-model
|
|
11
|
+
export { default as DocumentTypeModel } from './document-type-model';
|
|
12
|
+
export { default as SchemaDocModel } from './schema-doc.model';
|
|
@@ -4,9 +4,9 @@ declare const UserModel: mongoose.Model<{
|
|
|
4
4
|
updatedAt: NativeDate;
|
|
5
5
|
} & {
|
|
6
6
|
accountId: string;
|
|
7
|
+
fullName: string;
|
|
7
8
|
status: string;
|
|
8
9
|
email: string;
|
|
9
|
-
fullName: string;
|
|
10
10
|
password: string;
|
|
11
11
|
groups: mongoose.Types.ObjectId[];
|
|
12
12
|
claims: mongoose.Types.DocumentArray<{
|
|
@@ -33,9 +33,9 @@ declare const UserModel: mongoose.Model<{
|
|
|
33
33
|
updatedAt: NativeDate;
|
|
34
34
|
} & {
|
|
35
35
|
accountId: string;
|
|
36
|
+
fullName: string;
|
|
36
37
|
status: string;
|
|
37
38
|
email: string;
|
|
38
|
-
fullName: string;
|
|
39
39
|
password: string;
|
|
40
40
|
groups: mongoose.Types.ObjectId[];
|
|
41
41
|
claims: mongoose.Types.DocumentArray<{
|
|
@@ -62,9 +62,9 @@ declare const UserModel: mongoose.Model<{
|
|
|
62
62
|
updatedAt: NativeDate;
|
|
63
63
|
} & {
|
|
64
64
|
accountId: string;
|
|
65
|
+
fullName: string;
|
|
65
66
|
status: string;
|
|
66
67
|
email: string;
|
|
67
|
-
fullName: string;
|
|
68
68
|
password: string;
|
|
69
69
|
groups: mongoose.Types.ObjectId[];
|
|
70
70
|
claims: mongoose.Types.DocumentArray<{
|
|
@@ -97,9 +97,9 @@ declare const UserModel: mongoose.Model<{
|
|
|
97
97
|
updatedAt: NativeDate;
|
|
98
98
|
} & {
|
|
99
99
|
accountId: string;
|
|
100
|
+
fullName: string;
|
|
100
101
|
status: string;
|
|
101
102
|
email: string;
|
|
102
|
-
fullName: string;
|
|
103
103
|
password: string;
|
|
104
104
|
groups: mongoose.Types.ObjectId[];
|
|
105
105
|
claims: mongoose.Types.DocumentArray<{
|
|
@@ -126,9 +126,9 @@ declare const UserModel: mongoose.Model<{
|
|
|
126
126
|
updatedAt: NativeDate;
|
|
127
127
|
} & {
|
|
128
128
|
accountId: string;
|
|
129
|
+
fullName: string;
|
|
129
130
|
status: string;
|
|
130
131
|
email: string;
|
|
131
|
-
fullName: string;
|
|
132
132
|
password: string;
|
|
133
133
|
groups: mongoose.Types.ObjectId[];
|
|
134
134
|
claims: mongoose.Types.DocumentArray<{
|
|
@@ -155,9 +155,9 @@ declare const UserModel: mongoose.Model<{
|
|
|
155
155
|
updatedAt: NativeDate;
|
|
156
156
|
} & {
|
|
157
157
|
accountId: string;
|
|
158
|
+
fullName: string;
|
|
158
159
|
status: string;
|
|
159
160
|
email: string;
|
|
160
|
-
fullName: string;
|
|
161
161
|
password: string;
|
|
162
162
|
groups: mongoose.Types.ObjectId[];
|
|
163
163
|
claims: mongoose.Types.DocumentArray<{
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
declare module 'mongoose' {
|
|
3
|
+
namespace Schema {
|
|
4
|
+
namespace Types {
|
|
5
|
+
class Pound extends SchemaType {
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare class Pound extends mongoose.SchemaType {
|
|
11
|
+
constructor(key: string, options: mongoose.AnyObject | undefined);
|
|
12
|
+
cast(val: any): any;
|
|
13
|
+
}
|
|
14
|
+
export { Pound };
|
|
15
|
+
//# sourceMappingURL=pound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pound.d.ts","sourceRoot":"","sources":["../../value-objects/pound.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,QAAQ,UAAU,CAAC;IACtB,UAAU,MAAM,CAAC;QACb,UAAU,KAAK,CAAC;YACZ,MAAM,KAAM,SAAQ,UAAU;aAAI;SACrC;KACJ;CACJ;AAED,cAAM,KAAM,SAAQ,QAAQ,CAAC,UAAU;gBACvB,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS;IAKhE,IAAI,CAAC,GAAG,EAAE,GAAG;CA8ChB;AAKD,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// pound.ts
|
|
2
|
+
import mongoose from 'mongoose';
|
|
3
|
+
class Pound extends mongoose.SchemaType {
|
|
4
|
+
constructor(key, options) {
|
|
5
|
+
super(key, options, 'Pound');
|
|
6
|
+
}
|
|
7
|
+
// Casting method that validates and formats the value
|
|
8
|
+
cast(val) {
|
|
9
|
+
if (val == null) {
|
|
10
|
+
return val; // Allow null or undefined values
|
|
11
|
+
}
|
|
12
|
+
// Convert numbers to string for processing
|
|
13
|
+
if (typeof val === 'number') {
|
|
14
|
+
val = val.toFixed(2); // Ensure 2 decimal places
|
|
15
|
+
}
|
|
16
|
+
// Ensure the value is a string
|
|
17
|
+
if (typeof val !== 'string') {
|
|
18
|
+
throw new mongoose.Error.CastError('Pound', val, this.path, new Error('Pound value must be a string or number'));
|
|
19
|
+
}
|
|
20
|
+
// Remove any existing £ symbol and commas for processing
|
|
21
|
+
let cleaned = val.replace(/£|,/g, '');
|
|
22
|
+
// Check if the cleaned value is a valid number
|
|
23
|
+
if (isNaN(Number(cleaned))) {
|
|
24
|
+
throw new mongoose.Error.CastError('Pound', val, this.path, new Error(`${val} is not a valid currency value`));
|
|
25
|
+
}
|
|
26
|
+
// Convert to number to handle decimal places correctly
|
|
27
|
+
const numValue = Number(cleaned);
|
|
28
|
+
// Format the number with commas and 2 decimal places
|
|
29
|
+
const formattedValue = numValue.toLocaleString('en-GB', {
|
|
30
|
+
style: 'decimal',
|
|
31
|
+
minimumFractionDigits: 2,
|
|
32
|
+
maximumFractionDigits: 2
|
|
33
|
+
});
|
|
34
|
+
// Add the £ symbol at the beginning
|
|
35
|
+
return `£${formattedValue}`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Register the custom type globally with Mongoose
|
|
39
|
+
mongoose.Schema.Types.Pound = Pound;
|
|
40
|
+
export { Pound };
|