@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.
Files changed (31) hide show
  1. package/dist/applicants/applicant-direct-debit.model.d.ts +15 -23
  2. package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -1
  3. package/dist/applicants/applicant-direct-debit.model.js +1 -3
  4. package/dist/applicants/applicant.model.d.ts +36 -36
  5. package/dist/applicants/applicant.model.d.ts.map +1 -1
  6. package/dist/applicants/applicant.model.js +4 -1
  7. package/dist/applications/application-direct-debit.model.d.ts +520 -65
  8. package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
  9. package/dist/applications/application-direct-debit.model.js +92 -16
  10. package/dist/applications/application.model.d.ts +6 -0
  11. package/dist/applications/application.model.d.ts.map +1 -1
  12. package/dist/applications/application.model.js +3 -2
  13. package/dist/applications/index.js +0 -1
  14. package/dist/applications/solicitor.model.d.ts +46 -49
  15. package/dist/applications/solicitor.model.d.ts.map +1 -1
  16. package/dist/applications/solicitor.model.js +105 -26
  17. package/dist/properties/index.d.ts +1 -0
  18. package/dist/properties/index.d.ts.map +1 -1
  19. package/dist/properties/index.js +1 -0
  20. package/dist/properties/property-potfolio.model.d.ts +1113 -0
  21. package/dist/properties/property-potfolio.model.d.ts.map +1 -0
  22. package/dist/properties/property-potfolio.model.js +116 -0
  23. package/dist/properties/property.model.d.ts +6 -0
  24. package/dist/properties/property.model.d.ts.map +1 -1
  25. package/dist/properties/property.model.js +41 -31
  26. package/dist/shared/index.js +2 -1
  27. package/dist/users/user.model.d.ts +6 -6
  28. package/dist/value-objects/pound.d.ts +15 -0
  29. package/dist/value-objects/pound.d.ts.map +1 -0
  30. package/dist/value-objects/pound.js +40 -0
  31. package/package.json +1 -1
@@ -1,17 +1,93 @@
1
- import mongoose from "mongoose";
2
- const directDebitSchema = new mongoose.Schema({
3
- accountNumber: { type: String, default: "" },
4
- addressLine1: { type: String, default: "" },
5
- addressLine2: { type: String, default: "" },
6
- applicants: { type: String, default: "" },
7
- branch: { type: String, default: "" },
8
- city: { type: String, default: "" },
9
- contactPostcode: { type: String, default: "" },
10
- institution: { type: String, default: "" },
11
- isConfirmDeclaration: { type: String, default: false },
12
- nameOfAccountHolder: { type: String, default: "" },
13
- selectedPaymentDay: { type: String, default: null },
14
- sortCode: { type: String, default: "" },
1
+ import mongoose from 'mongoose';
2
+ import { SortCode } from '../value-objects/sort-code';
3
+ const applicationDirectDebitSchema = new mongoose.Schema({
4
+ applicationId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Application',
7
+ description: 'Reference to the application this direct debit belongs to',
8
+ },
9
+ accountNumber: {
10
+ type: Number,
11
+ isRequired: true,
12
+ maxLength: 8,
13
+ description: 'Bank account number of the applicant',
14
+ },
15
+ addressLine1: {
16
+ type: String,
17
+ description: 'First line of the applicant’s address'
18
+ },
19
+ addressLine2: {
20
+ type: String,
21
+ description: 'Second line of the applicant’s address'
22
+ },
23
+ applicantId: {
24
+ type: mongoose.Schema.Types.ObjectId,
25
+ ref: 'Applicant',
26
+ description: 'List of applicant IDs associated with this direct debit',
27
+ },
28
+ branch: {
29
+ type: String,
30
+ description: 'Branch name or code of the bank',
31
+ required: true
32
+ },
33
+ city: {
34
+ type: String,
35
+ description: 'City of the applicant’s address',
36
+ },
37
+ contactPostcode: {
38
+ type: String,
39
+ description: 'Postcode for correspondence',
40
+ requird: true
41
+ },
42
+ institution: {
43
+ type: String,
44
+ description: 'Name of the financial institution',
45
+ required: true,
46
+ },
47
+ isConfirmDeclaration: {
48
+ type: Boolean,
49
+ description: 'Whether the applicant has confirmed the declaration',
50
+ get: (value) => value ? 'Yes' : 'No',
51
+ },
52
+ nameOfAccountHolder: {
53
+ type: String,
54
+ description: 'Full name of the bank account holder',
55
+ required: true,
56
+ },
57
+ selectedPaymentDayLid: {
58
+ type: mongoose.Schema.Types.ObjectId,
59
+ ref: 'Lookup',
60
+ description: 'Lookup reference for selected payment day',
61
+ },
62
+ sortCode: {
63
+ type: SortCode,
64
+ description: 'UK bank sort code in XX-XX-XX format',
65
+ required: true,
66
+ },
67
+ }, {
68
+ timestamps: true,
69
+ toJSON: { virtuals: true, getters: true },
70
+ toObject: { virtuals: true, getters: true }
15
71
  });
16
- const DirectDebitModel = mongoose.model("DirectDebit", directDebitSchema);
17
- export default DirectDebitModel;
72
+ const virtualselectedPaymentDay = applicationDirectDebitSchema.virtual('selectedPaymentDay', {
73
+ ref: 'Lookup',
74
+ localField: 'selectedPaymentDayLid',
75
+ foreignField: '_id',
76
+ justOne: true,
77
+ options: {
78
+ select: 'label' // Only fetch the 'label' field from the Lookup collection
79
+ }
80
+ });
81
+ virtualselectedPaymentDay.description = 'Populated lookup value for the selected payment day';
82
+ const virtualApplicants = applicationDirectDebitSchema.virtual('applicants', {
83
+ ref: 'Applicant',
84
+ localField: 'applicantId',
85
+ foreignField: '_id',
86
+ justOne: true,
87
+ options: {
88
+ select: 'fullName'
89
+ }
90
+ });
91
+ virtualApplicants.description = 'Full Name of the applicant';
92
+ const ApplicationDirectDebitModel = mongoose.model("Application_DirectDebit", applicationDirectDebitSchema);
93
+ export default ApplicationDirectDebitModel;
@@ -44,6 +44,7 @@ declare const ApplicationModel: mongoose.Model<{
44
44
  isActive: string;
45
45
  isUkResident: string;
46
46
  newAuditRecordsCount: string;
47
+ propertyPortfolioIds: mongoose.Types.ObjectId[];
47
48
  selectedProduct?: string | null | undefined;
48
49
  riskRating?: string | null | undefined;
49
50
  productFeatures?: {
@@ -231,6 +232,7 @@ declare const ApplicationModel: mongoose.Model<{
231
232
  isActive: string;
232
233
  isUkResident: string;
233
234
  newAuditRecordsCount: string;
235
+ propertyPortfolioIds: mongoose.Types.ObjectId[];
234
236
  selectedProduct?: string | null | undefined;
235
237
  riskRating?: string | null | undefined;
236
238
  productFeatures?: {
@@ -418,6 +420,7 @@ declare const ApplicationModel: mongoose.Model<{
418
420
  isActive: string;
419
421
  isUkResident: string;
420
422
  newAuditRecordsCount: string;
423
+ propertyPortfolioIds: mongoose.Types.ObjectId[];
421
424
  selectedProduct?: string | null | undefined;
422
425
  riskRating?: string | null | undefined;
423
426
  productFeatures?: {
@@ -617,6 +620,7 @@ declare const ApplicationModel: mongoose.Model<{
617
620
  isActive: string;
618
621
  isUkResident: string;
619
622
  newAuditRecordsCount: string;
623
+ propertyPortfolioIds: mongoose.Types.ObjectId[];
620
624
  selectedProduct?: string | null | undefined;
621
625
  riskRating?: string | null | undefined;
622
626
  productFeatures?: {
@@ -804,6 +808,7 @@ declare const ApplicationModel: mongoose.Model<{
804
808
  isActive: string;
805
809
  isUkResident: string;
806
810
  newAuditRecordsCount: string;
811
+ propertyPortfolioIds: mongoose.Types.ObjectId[];
807
812
  selectedProduct?: string | null | undefined;
808
813
  riskRating?: string | null | undefined;
809
814
  productFeatures?: {
@@ -991,6 +996,7 @@ declare const ApplicationModel: mongoose.Model<{
991
996
  isActive: string;
992
997
  isUkResident: string;
993
998
  newAuditRecordsCount: string;
999
+ propertyPortfolioIds: mongoose.Types.ObjectId[];
994
1000
  selectedProduct?: string | null | undefined;
995
1001
  riskRating?: string | null | undefined;
996
1002
  productFeatures?: {
@@ -1 +1 @@
1
- {"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAsKhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AAC1E,eAAe,gBAAgB,CAAC"}
@@ -56,12 +56,13 @@ const applicationSchema = new mongoose.Schema({
56
56
  isUkResident: { type: String, default: true },
57
57
  riskRating: { type: String },
58
58
  productFeatures: productFeaturesSchema,
59
- directDebitId: { type: mongoose.Schema.Types.ObjectId, ref: "DirectDebit" },
59
+ directDebitId: { type: mongoose.Schema.Types.ObjectId, ref: "Application_DirectDebit" },
60
60
  creditProfile: creditProfileSchema,
61
61
  mortgageId: { type: mongoose.Schema.Types.ObjectId, ref: "Mortgage" },
62
62
  companyId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationCompany" },
63
63
  rationaleId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationRationale" },
64
- newAuditRecordsCount: { type: String, default: 0 } // Ensure it is a Number
64
+ newAuditRecordsCount: { type: String, default: 0 }, // Ensure it is a Number
65
+ propertyPortfolioIds: [{ type: mongoose.Schema.Types.ObjectId, ref: "Property_Portfolio" }]
65
66
  }, {
66
67
  timestamps: true,
67
68
  toJSON: { virtuals: true },
@@ -16,5 +16,4 @@ export { default as ApplicationDocumentModel } from './application-document.mode
16
16
  export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model';
17
17
  export { default as ApplicationFieldConfigModel } from './application-fieldconfig.model';
18
18
  export { default as DocumentModel } from './document.model';
19
- export { default as DirectDebitModel } from './application-direct-debit.model';
20
19
  export { default as MortgageModel } from './application-mortgage.model';
@@ -1,22 +1,21 @@
1
1
  import mongoose from "mongoose";
2
+ import { SortCode } from "../value-objects/sort-code";
2
3
  declare const SolicitorModel: mongoose.Model<{
3
- isActive: string;
4
- dualRep: string;
5
- isSraApprovedManagers: string;
6
- pageValidFlag: string;
7
- useExistingSolicitor: string;
4
+ createdAt: NativeDate;
5
+ updatedAt: NativeDate;
6
+ } & {
7
+ pageValidFlag: boolean;
8
8
  addressCity?: string | null | undefined;
9
9
  addressLine1?: string | null | undefined;
10
10
  addressLine2?: string | null | undefined;
11
11
  addressLine3?: string | null | undefined;
12
12
  addressPostCode?: string | null | undefined;
13
- accountNumber?: string | null | undefined;
13
+ accountNumber?: number | null | undefined;
14
14
  contactPostcode?: string | null | undefined;
15
15
  institution?: string | null | undefined;
16
16
  nameOfAccountHolder?: string | null | undefined;
17
- sortCode?: string | null | undefined;
17
+ sortCode?: SortCode | null | undefined;
18
18
  email?: string | null | undefined;
19
- solicitorsList?: string | null | undefined;
20
19
  addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
21
20
  bankAddressLine1?: string | null | undefined;
22
21
  bankAddressLine2?: string | null | undefined;
@@ -27,23 +26,21 @@ declare const SolicitorModel: mongoose.Model<{
27
26
  solicitorActing?: string | null | undefined;
28
27
  telephone?: string | null | undefined;
29
28
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
30
- isActive: string;
31
- dualRep: string;
32
- isSraApprovedManagers: string;
33
- pageValidFlag: string;
34
- useExistingSolicitor: string;
29
+ createdAt: NativeDate;
30
+ updatedAt: NativeDate;
31
+ } & {
32
+ pageValidFlag: boolean;
35
33
  addressCity?: string | null | undefined;
36
34
  addressLine1?: string | null | undefined;
37
35
  addressLine2?: string | null | undefined;
38
36
  addressLine3?: string | null | undefined;
39
37
  addressPostCode?: string | null | undefined;
40
- accountNumber?: string | null | undefined;
38
+ accountNumber?: number | null | undefined;
41
39
  contactPostcode?: string | null | undefined;
42
40
  institution?: string | null | undefined;
43
41
  nameOfAccountHolder?: string | null | undefined;
44
- sortCode?: string | null | undefined;
42
+ sortCode?: SortCode | null | undefined;
45
43
  email?: string | null | undefined;
46
- solicitorsList?: string | null | undefined;
47
44
  addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
48
45
  bankAddressLine1?: string | null | undefined;
49
46
  bankAddressLine2?: string | null | undefined;
@@ -54,23 +51,21 @@ declare const SolicitorModel: mongoose.Model<{
54
51
  solicitorActing?: string | null | undefined;
55
52
  telephone?: string | null | undefined;
56
53
  }> & {
57
- isActive: string;
58
- dualRep: string;
59
- isSraApprovedManagers: string;
60
- pageValidFlag: string;
61
- useExistingSolicitor: string;
54
+ createdAt: NativeDate;
55
+ updatedAt: NativeDate;
56
+ } & {
57
+ pageValidFlag: boolean;
62
58
  addressCity?: string | null | undefined;
63
59
  addressLine1?: string | null | undefined;
64
60
  addressLine2?: string | null | undefined;
65
61
  addressLine3?: string | null | undefined;
66
62
  addressPostCode?: string | null | undefined;
67
- accountNumber?: string | null | undefined;
63
+ accountNumber?: number | null | undefined;
68
64
  contactPostcode?: string | null | undefined;
69
65
  institution?: string | null | undefined;
70
66
  nameOfAccountHolder?: string | null | undefined;
71
- sortCode?: string | null | undefined;
67
+ sortCode?: SortCode | null | undefined;
72
68
  email?: string | null | undefined;
73
- solicitorsList?: string | null | undefined;
74
69
  addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
75
70
  bankAddressLine1?: string | null | undefined;
76
71
  bankAddressLine2?: string | null | undefined;
@@ -84,24 +79,30 @@ declare const SolicitorModel: mongoose.Model<{
84
79
  _id: mongoose.Types.ObjectId;
85
80
  } & {
86
81
  __v: number;
87
- }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
88
- isActive: string;
89
- dualRep: string;
90
- isSraApprovedManagers: string;
91
- pageValidFlag: string;
92
- useExistingSolicitor: string;
82
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
83
+ timestamps: true;
84
+ toJSON: {
85
+ virtuals: true;
86
+ };
87
+ toObject: {
88
+ virtuals: true;
89
+ };
90
+ }, {
91
+ createdAt: NativeDate;
92
+ updatedAt: NativeDate;
93
+ } & {
94
+ pageValidFlag: boolean;
93
95
  addressCity?: string | null | undefined;
94
96
  addressLine1?: string | null | undefined;
95
97
  addressLine2?: string | null | undefined;
96
98
  addressLine3?: string | null | undefined;
97
99
  addressPostCode?: string | null | undefined;
98
- accountNumber?: string | null | undefined;
100
+ accountNumber?: number | null | undefined;
99
101
  contactPostcode?: string | null | undefined;
100
102
  institution?: string | null | undefined;
101
103
  nameOfAccountHolder?: string | null | undefined;
102
- sortCode?: string | null | undefined;
104
+ sortCode?: SortCode | null | undefined;
103
105
  email?: string | null | undefined;
104
- solicitorsList?: string | null | undefined;
105
106
  addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
106
107
  bankAddressLine1?: string | null | undefined;
107
108
  bankAddressLine2?: string | null | undefined;
@@ -112,23 +113,21 @@ declare const SolicitorModel: mongoose.Model<{
112
113
  solicitorActing?: string | null | undefined;
113
114
  telephone?: string | null | undefined;
114
115
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
115
- isActive: string;
116
- dualRep: string;
117
- isSraApprovedManagers: string;
118
- pageValidFlag: string;
119
- useExistingSolicitor: string;
116
+ createdAt: NativeDate;
117
+ updatedAt: NativeDate;
118
+ } & {
119
+ pageValidFlag: boolean;
120
120
  addressCity?: string | null | undefined;
121
121
  addressLine1?: string | null | undefined;
122
122
  addressLine2?: string | null | undefined;
123
123
  addressLine3?: string | null | undefined;
124
124
  addressPostCode?: string | null | undefined;
125
- accountNumber?: string | null | undefined;
125
+ accountNumber?: number | null | undefined;
126
126
  contactPostcode?: string | null | undefined;
127
127
  institution?: string | null | undefined;
128
128
  nameOfAccountHolder?: string | null | undefined;
129
- sortCode?: string | null | undefined;
129
+ sortCode?: SortCode | null | undefined;
130
130
  email?: string | null | undefined;
131
- solicitorsList?: string | null | undefined;
132
131
  addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
133
132
  bankAddressLine1?: string | null | undefined;
134
133
  bankAddressLine2?: string | null | undefined;
@@ -139,23 +138,21 @@ declare const SolicitorModel: mongoose.Model<{
139
138
  solicitorActing?: string | null | undefined;
140
139
  telephone?: string | null | undefined;
141
140
  }>> & mongoose.FlatRecord<{
142
- isActive: string;
143
- dualRep: string;
144
- isSraApprovedManagers: string;
145
- pageValidFlag: string;
146
- useExistingSolicitor: string;
141
+ createdAt: NativeDate;
142
+ updatedAt: NativeDate;
143
+ } & {
144
+ pageValidFlag: boolean;
147
145
  addressCity?: string | null | undefined;
148
146
  addressLine1?: string | null | undefined;
149
147
  addressLine2?: string | null | undefined;
150
148
  addressLine3?: string | null | undefined;
151
149
  addressPostCode?: string | null | undefined;
152
- accountNumber?: string | null | undefined;
150
+ accountNumber?: number | null | undefined;
153
151
  contactPostcode?: string | null | undefined;
154
152
  institution?: string | null | undefined;
155
153
  nameOfAccountHolder?: string | null | undefined;
156
- sortCode?: string | null | undefined;
154
+ sortCode?: SortCode | null | undefined;
157
155
  email?: string | null | undefined;
158
- solicitorsList?: string | null | undefined;
159
156
  addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
160
157
  bankAddressLine1?: string | null | undefined;
161
158
  bankAddressLine2?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"solicitor.model.d.ts","sourceRoot":"","sources":["../../applications/solicitor.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAkChC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AACpE,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"solicitor.model.d.ts","sourceRoot":"","sources":["../../applications/solicitor.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAmHtD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AACpE,eAAe,cAAc,CAAC"}
@@ -1,32 +1,111 @@
1
1
  import mongoose from "mongoose";
2
+ import { SortCode } from "../value-objects/sort-code";
2
3
  const Schema = mongoose.Schema;
3
4
  const solicitorSchema = new Schema({
4
- dualRep: { type: String, default: false },
5
- isSraApprovedManagers: { type: String, default: true },
6
- pageValidFlag: { type: String, default: true },
7
- solicitorsList: { type: String },
8
- useExistingSolicitor: { type: String, default: true },
9
- accountNumber: { type: String },
10
- addressCity: { type: String },
11
- addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
12
- addressLine1: { type: String, },
13
- addressLine2: { type: String },
14
- addressLine3: { type: String },
15
- addressPostCode: { type: String, },
16
- bankAddressLine1: { type: String, },
17
- bankAddressLine2: { type: String },
18
- bankBranch: { type: String, },
19
- bankCity: { type: String, },
20
- contactPostcode: { type: String, },
21
- email: { type: String },
22
- institution: { type: String },
23
- isActive: { type: String, default: true },
24
- nameOfAccountHolder: { type: String },
25
- nameOfFirm: { type: String },
26
- signatory: { type: String },
27
- solicitorActing: { type: String },
28
- sortCode: { type: String, },
29
- telephone: { type: String, },
5
+ pageValidFlag: {
6
+ type: Boolean,
7
+ default: true,
8
+ description: "Flag indicating if the page is valid"
9
+ },
10
+ accountNumber: {
11
+ type: Number,
12
+ description: "Account number associated with the solicitor"
13
+ },
14
+ addressCity: {
15
+ type: String,
16
+ maxLength: 30,
17
+ description: "City where the solicitor is located"
18
+ },
19
+ addressCountryLid: {
20
+ type: mongoose.Schema.Types.ObjectId,
21
+ ref: "Lookup",
22
+ description: "Country ID from the lookup list"
23
+ },
24
+ addressLine1: {
25
+ type: String,
26
+ maxLength: 35,
27
+ description: "First line of the solicitor's address"
28
+ },
29
+ addressLine2: {
30
+ type: String,
31
+ maxLength: 35,
32
+ description: "Second line of the solicitor's address"
33
+ },
34
+ addressLine3: {
35
+ type: String,
36
+ maxLength: 35,
37
+ description: "Third line of the solicitor's address"
38
+ },
39
+ addressPostCode: {
40
+ type: String,
41
+ maxLength: 50,
42
+ description: "Postal code for the solicitor's address"
43
+ },
44
+ bankAddressLine1: {
45
+ type: String,
46
+ description: "First line of the solicitor's bank address"
47
+ },
48
+ bankAddressLine2: {
49
+ type: String,
50
+ description: "Second line of the solicitor's bank address"
51
+ },
52
+ bankBranch: {
53
+ type: String,
54
+ description: "Branch of the solicitor's bank"
55
+ },
56
+ bankCity: {
57
+ type: String,
58
+ description: "City where the solicitor's bank is located"
59
+ },
60
+ contactPostcode: {
61
+ type: String,
62
+ description: "Postal code for the solicitor's contact address"
63
+ },
64
+ email: {
65
+ type: String,
66
+ description: "Email address of the solicitor"
67
+ },
68
+ institution: {
69
+ type: String,
70
+ description: "Institution name where the solicitor works"
71
+ },
72
+ nameOfAccountHolder: {
73
+ type: String,
74
+ description: "Name of the account holder associated with the solicitor"
75
+ },
76
+ nameOfFirm: {
77
+ type: String,
78
+ description: "Name of the solicitor's firm"
79
+ },
80
+ signatory: {
81
+ type: String,
82
+ description: "Signatory name for the solicitor"
83
+ },
84
+ solicitorActing: {
85
+ type: String,
86
+ maxLength: 50,
87
+ description: "Indicates if the solicitor is acting in a particular capacity"
88
+ },
89
+ sortCode: {
90
+ type: SortCode,
91
+ description: "Sort code associated with the solicitor's account"
92
+ },
93
+ telephone: {
94
+ type: String,
95
+ maxLength: 15,
96
+ description: "Telephone number of the solicitor"
97
+ },
98
+ }, {
99
+ timestamps: true,
100
+ toJSON: { virtuals: true },
101
+ toObject: { virtuals: true }
30
102
  });
103
+ const virtualCountry = solicitorSchema.virtual('addressCountry', {
104
+ ref: 'Lookup',
105
+ localField: 'addressCountryLid',
106
+ foreignField: '_id',
107
+ justOne: true
108
+ });
109
+ virtualCountry.description = 'Populated lookup value for the solicitor\'s address country';
31
110
  const SolicitorModel = mongoose.model("Solicitor", solicitorSchema);
32
111
  export default SolicitorModel;
@@ -1,2 +1,3 @@
1
1
  export { default as PropertyModel } from './property.model';
2
+ export { default as PropertyPortfolioModel } from './property-potfolio.model';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../properties/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../properties/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +1,2 @@
1
1
  export { default as PropertyModel } from './property.model';
2
+ export { default as PropertyPortfolioModel } from './property-potfolio.model';