@dynamatix/gb-schemas 1.2.134 → 1.2.136
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/applications/application-audit.model.d.ts +0 -6
- package/dist/applications/application-audit.model.d.ts.map +1 -1
- package/dist/applications/application-audit.model.js +0 -4
- package/dist/applications/application-mortgage.model.d.ts +6 -0
- package/dist/applications/application-mortgage.model.d.ts.map +1 -1
- package/dist/applications/application-mortgage.model.js +5 -0
- package/dist/value-objects/sort-code.d.ts.map +1 -1
- package/dist/value-objects/sort-code.js +13 -4
- package/package.json +1 -1
|
@@ -12,7 +12,6 @@ declare const ApplicationAuditModel: mongoose.Model<{
|
|
|
12
12
|
applicationId: mongoose.Types.ObjectId;
|
|
13
13
|
oldValue: string;
|
|
14
14
|
newValue: string;
|
|
15
|
-
formEntityDescription: string;
|
|
16
15
|
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
17
16
|
createdAt: NativeDate;
|
|
18
17
|
updatedAt: NativeDate;
|
|
@@ -26,7 +25,6 @@ declare const ApplicationAuditModel: mongoose.Model<{
|
|
|
26
25
|
applicationId: mongoose.Types.ObjectId;
|
|
27
26
|
oldValue: string;
|
|
28
27
|
newValue: string;
|
|
29
|
-
formEntityDescription: string;
|
|
30
28
|
}> & {
|
|
31
29
|
createdAt: NativeDate;
|
|
32
30
|
updatedAt: NativeDate;
|
|
@@ -40,7 +38,6 @@ declare const ApplicationAuditModel: mongoose.Model<{
|
|
|
40
38
|
applicationId: mongoose.Types.ObjectId;
|
|
41
39
|
oldValue: string;
|
|
42
40
|
newValue: string;
|
|
43
|
-
formEntityDescription: string;
|
|
44
41
|
} & {
|
|
45
42
|
_id: mongoose.Types.ObjectId;
|
|
46
43
|
} & {
|
|
@@ -60,7 +57,6 @@ declare const ApplicationAuditModel: mongoose.Model<{
|
|
|
60
57
|
applicationId: mongoose.Types.ObjectId;
|
|
61
58
|
oldValue: string;
|
|
62
59
|
newValue: string;
|
|
63
|
-
formEntityDescription: string;
|
|
64
60
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
65
61
|
createdAt: NativeDate;
|
|
66
62
|
updatedAt: NativeDate;
|
|
@@ -74,7 +70,6 @@ declare const ApplicationAuditModel: mongoose.Model<{
|
|
|
74
70
|
applicationId: mongoose.Types.ObjectId;
|
|
75
71
|
oldValue: string;
|
|
76
72
|
newValue: string;
|
|
77
|
-
formEntityDescription: string;
|
|
78
73
|
}>> & mongoose.FlatRecord<{
|
|
79
74
|
createdAt: NativeDate;
|
|
80
75
|
updatedAt: NativeDate;
|
|
@@ -88,7 +83,6 @@ declare const ApplicationAuditModel: mongoose.Model<{
|
|
|
88
83
|
applicationId: mongoose.Types.ObjectId;
|
|
89
84
|
oldValue: string;
|
|
90
85
|
newValue: string;
|
|
91
|
-
formEntityDescription: string;
|
|
92
86
|
}> & {
|
|
93
87
|
_id: mongoose.Types.ObjectId;
|
|
94
88
|
} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-audit.model.d.ts","sourceRoot":"","sources":["../../applications/application-audit.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application-audit.model.d.ts","sourceRoot":"","sources":["../../applications/application-audit.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA2ChC,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6D,CAAC;AACzF,eAAe,qBAAqB,CAAC"}
|
|
@@ -36,10 +36,6 @@ const applicationAuditSchema = new mongoose.Schema({
|
|
|
36
36
|
newValue: {
|
|
37
37
|
type: String,
|
|
38
38
|
required: true
|
|
39
|
-
},
|
|
40
|
-
formEntityDescription: {
|
|
41
|
-
type: String,
|
|
42
|
-
required: true
|
|
43
39
|
}
|
|
44
40
|
}, { timestamps: true });
|
|
45
41
|
const ApplicationAuditModel = mongoose.model('ApplicationAudit', applicationAuditSchema);
|
|
@@ -359,6 +359,7 @@ declare const MortgageModel: mongoose.Model<{
|
|
|
359
359
|
saleMadeLid?: unknown;
|
|
360
360
|
isTheIntentionToLet?: unknown;
|
|
361
361
|
leaseTypeLid?: mongoose.Types.ObjectId | null | undefined;
|
|
362
|
+
giftDetails?: unknown;
|
|
362
363
|
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
363
364
|
createdAt: NativeDate;
|
|
364
365
|
updatedAt: NativeDate;
|
|
@@ -718,6 +719,7 @@ declare const MortgageModel: mongoose.Model<{
|
|
|
718
719
|
saleMadeLid?: unknown;
|
|
719
720
|
isTheIntentionToLet?: unknown;
|
|
720
721
|
leaseTypeLid?: mongoose.Types.ObjectId | null | undefined;
|
|
722
|
+
giftDetails?: unknown;
|
|
721
723
|
}> & {
|
|
722
724
|
createdAt: NativeDate;
|
|
723
725
|
updatedAt: NativeDate;
|
|
@@ -1077,6 +1079,7 @@ declare const MortgageModel: mongoose.Model<{
|
|
|
1077
1079
|
saleMadeLid?: unknown;
|
|
1078
1080
|
isTheIntentionToLet?: unknown;
|
|
1079
1081
|
leaseTypeLid?: mongoose.Types.ObjectId | null | undefined;
|
|
1082
|
+
giftDetails?: unknown;
|
|
1080
1083
|
} & {
|
|
1081
1084
|
_id: mongoose.Types.ObjectId;
|
|
1082
1085
|
} & {
|
|
@@ -1124,6 +1127,7 @@ declare const MortgageModel: mongoose.Model<{
|
|
|
1124
1127
|
existingMortgageLender?: string | null | undefined;
|
|
1125
1128
|
vendorsName?: string | null | undefined;
|
|
1126
1129
|
saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
|
|
1130
|
+
giftDetails?: string | null | undefined;
|
|
1127
1131
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
1128
1132
|
createdAt: NativeDate;
|
|
1129
1133
|
updatedAt: NativeDate;
|
|
@@ -1159,6 +1163,7 @@ declare const MortgageModel: mongoose.Model<{
|
|
|
1159
1163
|
existingMortgageLender?: string | null | undefined;
|
|
1160
1164
|
vendorsName?: string | null | undefined;
|
|
1161
1165
|
saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
|
|
1166
|
+
giftDetails?: string | null | undefined;
|
|
1162
1167
|
}>> & mongoose.FlatRecord<{
|
|
1163
1168
|
createdAt: NativeDate;
|
|
1164
1169
|
updatedAt: NativeDate;
|
|
@@ -1194,6 +1199,7 @@ declare const MortgageModel: mongoose.Model<{
|
|
|
1194
1199
|
existingMortgageLender?: string | null | undefined;
|
|
1195
1200
|
vendorsName?: string | null | undefined;
|
|
1196
1201
|
saleMadeLid?: mongoose.Types.ObjectId | null | undefined;
|
|
1202
|
+
giftDetails?: string | null | undefined;
|
|
1197
1203
|
}> & {
|
|
1198
1204
|
_id: mongoose.Types.ObjectId;
|
|
1199
1205
|
} & {
|
|
@@ -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;
|
|
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;AA+S/C,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAe,aAAa,CAAC"}
|
|
@@ -177,6 +177,11 @@ const mortgageSchema = new mongoose.Schema({
|
|
|
177
177
|
default: null,
|
|
178
178
|
description: "Lease type for the property",
|
|
179
179
|
},
|
|
180
|
+
giftDetails: {
|
|
181
|
+
type: String,
|
|
182
|
+
maxlength: 50,
|
|
183
|
+
description: "Details of the gift for the mortgage",
|
|
184
|
+
},
|
|
180
185
|
}, {
|
|
181
186
|
timestamps: true,
|
|
182
187
|
toJSON: { virtuals: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-code.d.ts","sourceRoot":"","sources":["../../value-objects/sort-code.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,QAAQ,UAAU,CAAC;IACtB,UAAU,MAAM,CAAC;QACb,UAAU,KAAK,CAAC;YACZ,MAAM,QAAS,SAAQ,UAAU;aAAI;SACxC;KACJ;CACJ;AAED,cAAM,QAAS,SAAQ,QAAQ,CAAC,UAAU;gBAC1B,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS;IAIhE,IAAI,CAAC,GAAG,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"sort-code.d.ts","sourceRoot":"","sources":["../../value-objects/sort-code.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,QAAQ,UAAU,CAAC;IACtB,UAAU,MAAM,CAAC;QACb,UAAU,KAAK,CAAC;YACZ,MAAM,QAAS,SAAQ,UAAU;aAAI;SACxC;KACJ;CACJ;AAED,cAAM,QAAS,SAAQ,QAAQ,CAAC,UAAU;gBAC1B,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS;IAIhE,IAAI,CAAC,GAAG,EAAE,GAAG;CA0ChB;AAKD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -7,17 +7,26 @@ class SortCode extends mongoose.SchemaType {
|
|
|
7
7
|
if (val == null) {
|
|
8
8
|
return val; // Allow null or undefined
|
|
9
9
|
}
|
|
10
|
+
let input = val;
|
|
11
|
+
// Convert number to string if input is a number
|
|
10
12
|
if (typeof val === 'number') {
|
|
11
|
-
|
|
13
|
+
input = val.toString();
|
|
12
14
|
}
|
|
13
|
-
if (typeof
|
|
15
|
+
if (typeof input !== 'string') {
|
|
14
16
|
throw new mongoose.Error.CastError('SortCode', val, this.path, new Error('SortCode must be a string or number'));
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
// Remove non-digit characters (e.g., hyphens in "01-00-00")
|
|
19
|
+
const cleaned = input.replace(/\D/g, '');
|
|
20
|
+
// Validate that the cleaned input is exactly 6 digits
|
|
17
21
|
if (cleaned.length !== 6) {
|
|
18
22
|
throw new mongoose.Error.CastError('SortCode', val, this.path, new Error(`${val} is not a valid UK sort code. Must contain exactly 6 digits.`));
|
|
19
23
|
}
|
|
20
|
-
|
|
24
|
+
// If the original input was a string, try to preserve its exact format
|
|
25
|
+
const digitMatch = input.replace(/\D/g, '');
|
|
26
|
+
if (digitMatch === cleaned && input.match(/^\d{6}$/)) {
|
|
27
|
+
return input; // Preserve exact input
|
|
28
|
+
}
|
|
29
|
+
return cleaned;
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
32
|
// Register the custom type globally with Mongoose
|