@dynamatix/gb-schemas 2.3.373 โ†’ 2.3.374

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/README.md CHANGED
@@ -1,309 +1,309 @@
1
- # GB Schemas (@dynamatix/gb-schemas)
2
-
3
- A comprehensive TypeScript/Mongoose schema library for Gatehouse Bank backend systems, providing data models for mortgage applications, applicants, properties, and related financial services.
4
-
5
- ## ๐Ÿ—๏ธ Project Overview
6
-
7
- This package contains all the schemas and data models used in Gatehouse Bank's backend systems. It provides a robust foundation for managing mortgage applications, applicant data, property information, and various financial commitments through well-defined Mongoose schemas with TypeScript support.
8
-
9
- ## ๐Ÿ“ฆ Package Information
10
-
11
- - **Name**: `@dynamatix/gb-schemas`
12
- - **Version**: 1.3.305
13
- - **Description**: All the schemas for Gatehouse Bank back-end
14
- - **Type**: ES Module
15
- - **Main**: `dist/index.js`
16
- - **Types**: `dist/index.d.ts`
17
-
18
- ## ๐Ÿš€ Features
19
-
20
- - **TypeScript Support**: Full TypeScript definitions and type safety
21
- - **Mongoose Integration**: Built on Mongoose ODM for MongoDB
22
- - **Audit Middleware**: Built-in audit trail support via `@dynamatix/cat-shared`
23
- - **Workflow Middleware**: Automatic workflow triggering based on database events
24
- - **Custom Value Objects**: Specialized types for financial data (Pound, Account Number, Sort Code)
25
- - **Modular Architecture**: Organized into logical domains (applications, applicants, properties, etc.)
26
- - **Migration Scripts**: Comprehensive data migration and maintenance tools
27
-
28
- ## ๐Ÿ“ Project Structure
29
-
30
- ```
31
- gb-schemas-node/
32
- โ”œโ”€โ”€ applicants/ # Applicant-related schemas and models
33
- โ”œโ”€โ”€ applications/ # Application management schemas
34
- โ”œโ”€โ”€ properties/ # Property and security schemas
35
- โ”œโ”€โ”€ product-catalogues/ # Product definition schemas
36
- โ”œโ”€โ”€ shared/ # Common/shared schemas and utilities
37
- โ”œโ”€โ”€ users/ # User management schemas
38
- โ”œโ”€โ”€ underwriter/ # Underwriting-related schemas
39
- โ”œโ”€โ”€ value-objects/ # Custom Mongoose types
40
- โ”œโ”€โ”€ api-models/ # API-specific model definitions
41
- โ”œโ”€โ”€ entities/ # Entity layer schemas
42
- โ”œโ”€โ”€ examples/ # Usage examples
43
- โ”œโ”€โ”€ scripts/ # Migration and utility scripts
44
- โ””โ”€โ”€ schema-docs/ # Schema documentation generation
45
- ```
46
-
47
- ## ๐Ÿ”ง Installation
48
-
49
- ```bash
50
- npm install @dynamatix/gb-schemas
51
- ```
52
-
53
- ## ๐Ÿ“š Usage
54
-
55
- ### Basic Import
56
-
57
- ```typescript
58
- import {
59
- ApplicantModel,
60
- ApplicationModel,
61
- PropertyModel
62
- } from '@dynamatix/gb-schemas';
63
- ```
64
-
65
- ### Modular Imports
66
-
67
- ```typescript
68
- // Import specific modules
69
- import { ApplicantModel } from '@dynamatix/gb-schemas/applicants';
70
- import { ApplicationModel } from '@dynamatix/gb-schemas/applications';
71
- import { PropertyModel } from '@dynamatix/gb-schemas/properties';
72
- ```
73
-
74
- ### Example: Adding Applicant Income
75
-
76
- ```typescript
77
- import mongoose from 'mongoose';
78
- import ApplicantIncomeModel from '@dynamatix/gb-schemas/applicants/applicant-income.model';
79
-
80
- // Connect to MongoDB
81
- await mongoose.connect(MONGODB_URI);
82
-
83
- // Create new applicant income record
84
- const newIncome = new ApplicantIncomeModel({
85
- applicantId: 'your-applicant-id',
86
- selfEmployedIncomeRationale: 'Based on last 2 years of accounts'
87
- });
88
-
89
- const savedIncome = await newIncome.save();
90
- ```
91
-
92
- ### Workflow Middleware
93
-
94
- The library includes a powerful workflow middleware system that automatically triggers workflows based on database events.
95
-
96
- ```typescript
97
- import { initializeWorkflowMiddlewareWithCheck } from '@dynamatix/gb-schemas';
98
-
99
- // Initialize workflow middleware for ALL schemas with one call
100
- initializeWorkflowMiddlewareWithCheck();
101
- ```
102
-
103
- **Environment Variables:**
104
- - `WORKFLOW_API_KEY`: Required API key for workflow service authentication
105
- - `WORKFLOW_API_URL`: Optional workflow API URL (default: https://your-workflow-api.com/api/v1/workflows/execute)
106
- - `WORKFLOW_TIMEOUT`: Optional timeout in milliseconds (default: 30000)
107
- - `WORKFLOW_RETRY_ATTEMPTS`: Optional retry attempts (default: 3)
108
- - `WORKFLOW_RETRY_DELAY`: Optional retry delay in milliseconds (default: 1000)
109
-
110
- For detailed documentation, see [Workflow Middleware Guide](./docs/WORKFLOW_MIDDLEWARE.md).
111
-
112
- ## ๐Ÿ›๏ธ Core Schemas
113
-
114
- ### Applicants
115
- - **Applicant**: Core applicant information (personal details, addresses, employment status)
116
- - **Applicant Income**: Various income types (employment, self-employed, pension, property)
117
- - **Applicant Commitments**: Financial commitments (mortgages, loans, credit cards)
118
- - **Applicant Credit Data**: Credit profile and credit report information
119
- - **Applicant Expenditure**: Spending patterns and financial outgoings
120
-
121
- ### Applications
122
- - **Application**: Main application record with workflow and status tracking
123
- - **Application Mortgage**: Mortgage-specific application details
124
- - **Application Credit Profile**: Credit assessment information
125
- - **Application Legal**: Legal documentation and compliance data
126
- - **Application Notes**: Application-related notes and comments
127
-
128
- ### Properties
129
- - **Property**: Property details and characteristics
130
- - **Security**: Security and collateral information
131
-
132
- ### Product Catalogues
133
- - **Product Catalogue**: Product definitions and variants
134
- - **Product Definitions**: Detailed product specifications
135
- - **Product Variants**: Product customization options
136
-
137
- ### Shared Models
138
- - **Lookup**: Reference data and lookup values
139
- - **System Parameters**: Configuration and system settings
140
- - **Tasks**: Workflow task management
141
- - **Alerts**: System notification system
142
- - **Workflow Triggers**: Configuration for automatic workflow execution
143
-
144
- ## ๐Ÿ’ฐ Custom Value Objects
145
-
146
- ### Pound Type
147
- Custom Mongoose type for handling UK currency values with automatic formatting and validation.
148
-
149
- ```typescript
150
- import { Pound, formatPound } from '@dynamatix/gb-schemas/value-objects/pound';
151
-
152
- // Automatically handles currency formatting and validation
153
- const amount = new Pound('1,234.56'); // Returns 1234.56
154
- const formatted = formatPound(1234.56); // Returns "ยฃ1,234.56"
155
- ```
156
-
157
- ### Account Number & Sort Code
158
- Specialized types for UK banking information with validation.
159
-
160
- ## ๐Ÿ”„ Migration Scripts
161
-
162
- The project includes comprehensive migration and maintenance scripts:
163
-
164
- ### Available Scripts
165
-
166
- ```bash
167
- # Income migration
168
- npm run migrate:applicant-income
169
-
170
- # Self-employed ID migration
171
- npm run migrate:self-employed-id
172
-
173
- # Employment verification
174
- npm run check:applicants-employment
175
-
176
- # Application cleanup
177
- npm run delete:applications-by-type
178
-
179
- # API config updates
180
- npm run update:apiconfigs-paths
181
- ```
182
-
183
- ### Key Migration Scripts
184
-
185
- - **`migrate-applicant-income.js`**: Migrates from old income model to new separated models
186
- - **`migrate-self-employed-id.js`**: Updates self-employed applicant references
187
- - **`check-applicants-without-employment.js`**: Validates employment data integrity
188
- - **`update-apiconfigs-paths.js`**: Updates API configuration paths
189
-
190
- ## ๐Ÿ› ๏ธ Development
191
-
192
- ### Prerequisites
193
-
194
- - Node.js (v18+)
195
- - TypeScript 5.3+
196
- - MongoDB 6.14+
197
-
198
- ### Setup
199
-
200
- ```bash
201
- # Install dependencies
202
- npm install
203
-
204
- # Build the project
205
- npm run build
206
-
207
- # Generate documentation
208
- npm run generate-docs
209
-
210
- # Run examples
211
- npm run example:income
212
- ```
213
-
214
- ### Build Configuration
215
-
216
- The project uses TypeScript with ES2020 modules and generates declaration files:
217
-
218
- ```json
219
- {
220
- "target": "ES2020",
221
- "module": "ES2020",
222
- "outDir": "./dist",
223
- "declaration": true,
224
- "declarationMap": true
225
- }
226
- ```
227
-
228
- ## ๐Ÿ“– API Reference
229
-
230
- ### Main Exports
231
-
232
- ```typescript
233
- // Core models
234
- export * from './applications';
235
- export * from './applicants';
236
- export * from './properties';
237
- export * from './shared';
238
- export * from './users';
239
- export * from './product-catalogues';
240
- export * from './underwriter';
241
- ```
242
-
243
- ### Model Relationships
244
-
245
- - **Applications** โ†’ **Applicants** (one-to-many)
246
- - **Applications** โ†’ **Properties** (one-to-many)
247
- - **Applications** โ†’ **Product** (many-to-one)
248
- - **Applicants** โ†’ **Income Models** (one-to-many)
249
- - **Applicants** โ†’ **Commitment Models** (one-to-many)
250
-
251
- ## ๐Ÿ”’ Security & Compliance
252
-
253
- - **GDPR Support**: Built-in GDPR consent tracking
254
- - **Audit Trail**: Comprehensive audit logging via middleware
255
- - **Data Validation**: Strict schema validation and type checking
256
- - **Access Control**: User permission and role-based access models
257
-
258
- ## ๐Ÿงช Testing & Examples
259
-
260
- ### Example Scripts
261
-
262
- - **`add-applicant-income.ts`**: Demonstrates creating applicant income records
263
- - **Migration Scripts**: Show real-world data migration patterns
264
-
265
- ### Running Examples
266
-
267
- ```bash
268
- # Run income example
269
- npm run example:income
270
-
271
- # Generate documentation
272
- npm run generate-docs
273
- ```
274
-
275
- ## ๐Ÿ“ Documentation
276
-
277
- - **Schema Documentation**: Auto-generated via `npm run generate-docs`
278
- - **Migration Guides**: Detailed README files in the `scripts/` directory
279
- - **API Models**: Type-safe API model definitions
280
-
281
- ## ๐Ÿค Contributing
282
-
283
- 1. Fork the repository
284
- 2. Create a feature branch
285
- 3. Make your changes
286
- 4. Ensure TypeScript compilation passes
287
- 5. Submit a pull request
288
-
289
- ## ๐Ÿ“„ License
290
-
291
- ISC License - see package.json for details
292
-
293
- ## ๐Ÿ†˜ Support
294
-
295
- - **Issues**: [GitHub Issues](https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas/issues)
296
- - **Repository**: [GitHub Repository](https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas)
297
- - **Author**: Dynamatix
298
-
299
- ## ๐Ÿ”„ Version History
300
-
301
- - **Current**: 1.3.305
302
- - **Dependencies**:
303
- - `@dynamatix/cat-shared`: ^0.0.119
304
- - `mongoose`: ^8.9.5
305
- - `mongodb`: ^6.14.2
306
-
307
- ---
308
-
1
+ # GB Schemas (@dynamatix/gb-schemas)
2
+
3
+ A comprehensive TypeScript/Mongoose schema library for Gatehouse Bank backend systems, providing data models for mortgage applications, applicants, properties, and related financial services.
4
+
5
+ ## ๐Ÿ—๏ธ Project Overview
6
+
7
+ This package contains all the schemas and data models used in Gatehouse Bank's backend systems. It provides a robust foundation for managing mortgage applications, applicant data, property information, and various financial commitments through well-defined Mongoose schemas with TypeScript support.
8
+
9
+ ## ๐Ÿ“ฆ Package Information
10
+
11
+ - **Name**: `@dynamatix/gb-schemas`
12
+ - **Version**: 1.3.305
13
+ - **Description**: All the schemas for Gatehouse Bank back-end
14
+ - **Type**: ES Module
15
+ - **Main**: `dist/index.js`
16
+ - **Types**: `dist/index.d.ts`
17
+
18
+ ## ๐Ÿš€ Features
19
+
20
+ - **TypeScript Support**: Full TypeScript definitions and type safety
21
+ - **Mongoose Integration**: Built on Mongoose ODM for MongoDB
22
+ - **Audit Middleware**: Built-in audit trail support via `@dynamatix/cat-shared`
23
+ - **Workflow Middleware**: Automatic workflow triggering based on database events
24
+ - **Custom Value Objects**: Specialized types for financial data (Pound, Account Number, Sort Code)
25
+ - **Modular Architecture**: Organized into logical domains (applications, applicants, properties, etc.)
26
+ - **Migration Scripts**: Comprehensive data migration and maintenance tools
27
+
28
+ ## ๐Ÿ“ Project Structure
29
+
30
+ ```
31
+ gb-schemas-node/
32
+ โ”œโ”€โ”€ applicants/ # Applicant-related schemas and models
33
+ โ”œโ”€โ”€ applications/ # Application management schemas
34
+ โ”œโ”€โ”€ properties/ # Property and security schemas
35
+ โ”œโ”€โ”€ product-catalogues/ # Product definition schemas
36
+ โ”œโ”€โ”€ shared/ # Common/shared schemas and utilities
37
+ โ”œโ”€โ”€ users/ # User management schemas
38
+ โ”œโ”€โ”€ underwriter/ # Underwriting-related schemas
39
+ โ”œโ”€โ”€ value-objects/ # Custom Mongoose types
40
+ โ”œโ”€โ”€ api-models/ # API-specific model definitions
41
+ โ”œโ”€โ”€ entities/ # Entity layer schemas
42
+ โ”œโ”€โ”€ examples/ # Usage examples
43
+ โ”œโ”€โ”€ scripts/ # Migration and utility scripts
44
+ โ””โ”€โ”€ schema-docs/ # Schema documentation generation
45
+ ```
46
+
47
+ ## ๐Ÿ”ง Installation
48
+
49
+ ```bash
50
+ npm install @dynamatix/gb-schemas
51
+ ```
52
+
53
+ ## ๐Ÿ“š Usage
54
+
55
+ ### Basic Import
56
+
57
+ ```typescript
58
+ import {
59
+ ApplicantModel,
60
+ ApplicationModel,
61
+ PropertyModel
62
+ } from '@dynamatix/gb-schemas';
63
+ ```
64
+
65
+ ### Modular Imports
66
+
67
+ ```typescript
68
+ // Import specific modules
69
+ import { ApplicantModel } from '@dynamatix/gb-schemas/applicants';
70
+ import { ApplicationModel } from '@dynamatix/gb-schemas/applications';
71
+ import { PropertyModel } from '@dynamatix/gb-schemas/properties';
72
+ ```
73
+
74
+ ### Example: Adding Applicant Income
75
+
76
+ ```typescript
77
+ import mongoose from 'mongoose';
78
+ import ApplicantIncomeModel from '@dynamatix/gb-schemas/applicants/applicant-income.model';
79
+
80
+ // Connect to MongoDB
81
+ await mongoose.connect(MONGODB_URI);
82
+
83
+ // Create new applicant income record
84
+ const newIncome = new ApplicantIncomeModel({
85
+ applicantId: 'your-applicant-id',
86
+ selfEmployedIncomeRationale: 'Based on last 2 years of accounts'
87
+ });
88
+
89
+ const savedIncome = await newIncome.save();
90
+ ```
91
+
92
+ ### Workflow Middleware
93
+
94
+ The library includes a powerful workflow middleware system that automatically triggers workflows based on database events.
95
+
96
+ ```typescript
97
+ import { initializeWorkflowMiddlewareWithCheck } from '@dynamatix/gb-schemas';
98
+
99
+ // Initialize workflow middleware for ALL schemas with one call
100
+ initializeWorkflowMiddlewareWithCheck();
101
+ ```
102
+
103
+ **Environment Variables:**
104
+ - `WORKFLOW_API_KEY`: Required API key for workflow service authentication
105
+ - `WORKFLOW_API_URL`: Optional workflow API URL (default: https://your-workflow-api.com/api/v1/workflows/execute)
106
+ - `WORKFLOW_TIMEOUT`: Optional timeout in milliseconds (default: 30000)
107
+ - `WORKFLOW_RETRY_ATTEMPTS`: Optional retry attempts (default: 3)
108
+ - `WORKFLOW_RETRY_DELAY`: Optional retry delay in milliseconds (default: 1000)
109
+
110
+ For detailed documentation, see [Workflow Middleware Guide](./docs/WORKFLOW_MIDDLEWARE.md).
111
+
112
+ ## ๐Ÿ›๏ธ Core Schemas
113
+
114
+ ### Applicants
115
+ - **Applicant**: Core applicant information (personal details, addresses, employment status)
116
+ - **Applicant Income**: Various income types (employment, self-employed, pension, property)
117
+ - **Applicant Commitments**: Financial commitments (mortgages, loans, credit cards)
118
+ - **Applicant Credit Data**: Credit profile and credit report information
119
+ - **Applicant Expenditure**: Spending patterns and financial outgoings
120
+
121
+ ### Applications
122
+ - **Application**: Main application record with workflow and status tracking
123
+ - **Application Mortgage**: Mortgage-specific application details
124
+ - **Application Credit Profile**: Credit assessment information
125
+ - **Application Legal**: Legal documentation and compliance data
126
+ - **Application Notes**: Application-related notes and comments
127
+
128
+ ### Properties
129
+ - **Property**: Property details and characteristics
130
+ - **Security**: Security and collateral information
131
+
132
+ ### Product Catalogues
133
+ - **Product Catalogue**: Product definitions and variants
134
+ - **Product Definitions**: Detailed product specifications
135
+ - **Product Variants**: Product customization options
136
+
137
+ ### Shared Models
138
+ - **Lookup**: Reference data and lookup values
139
+ - **System Parameters**: Configuration and system settings
140
+ - **Tasks**: Workflow task management
141
+ - **Alerts**: System notification system
142
+ - **Workflow Triggers**: Configuration for automatic workflow execution
143
+
144
+ ## ๐Ÿ’ฐ Custom Value Objects
145
+
146
+ ### Pound Type
147
+ Custom Mongoose type for handling UK currency values with automatic formatting and validation.
148
+
149
+ ```typescript
150
+ import { Pound, formatPound } from '@dynamatix/gb-schemas/value-objects/pound';
151
+
152
+ // Automatically handles currency formatting and validation
153
+ const amount = new Pound('1,234.56'); // Returns 1234.56
154
+ const formatted = formatPound(1234.56); // Returns "ยฃ1,234.56"
155
+ ```
156
+
157
+ ### Account Number & Sort Code
158
+ Specialized types for UK banking information with validation.
159
+
160
+ ## ๐Ÿ”„ Migration Scripts
161
+
162
+ The project includes comprehensive migration and maintenance scripts:
163
+
164
+ ### Available Scripts
165
+
166
+ ```bash
167
+ # Income migration
168
+ npm run migrate:applicant-income
169
+
170
+ # Self-employed ID migration
171
+ npm run migrate:self-employed-id
172
+
173
+ # Employment verification
174
+ npm run check:applicants-employment
175
+
176
+ # Application cleanup
177
+ npm run delete:applications-by-type
178
+
179
+ # API config updates
180
+ npm run update:apiconfigs-paths
181
+ ```
182
+
183
+ ### Key Migration Scripts
184
+
185
+ - **`migrate-applicant-income.js`**: Migrates from old income model to new separated models
186
+ - **`migrate-self-employed-id.js`**: Updates self-employed applicant references
187
+ - **`check-applicants-without-employment.js`**: Validates employment data integrity
188
+ - **`update-apiconfigs-paths.js`**: Updates API configuration paths
189
+
190
+ ## ๐Ÿ› ๏ธ Development
191
+
192
+ ### Prerequisites
193
+
194
+ - Node.js (v18+)
195
+ - TypeScript 5.3+
196
+ - MongoDB 6.14+
197
+
198
+ ### Setup
199
+
200
+ ```bash
201
+ # Install dependencies
202
+ npm install
203
+
204
+ # Build the project
205
+ npm run build
206
+
207
+ # Generate documentation
208
+ npm run generate-docs
209
+
210
+ # Run examples
211
+ npm run example:income
212
+ ```
213
+
214
+ ### Build Configuration
215
+
216
+ The project uses TypeScript with ES2020 modules and generates declaration files:
217
+
218
+ ```json
219
+ {
220
+ "target": "ES2020",
221
+ "module": "ES2020",
222
+ "outDir": "./dist",
223
+ "declaration": true,
224
+ "declarationMap": true
225
+ }
226
+ ```
227
+
228
+ ## ๐Ÿ“– API Reference
229
+
230
+ ### Main Exports
231
+
232
+ ```typescript
233
+ // Core models
234
+ export * from './applications';
235
+ export * from './applicants';
236
+ export * from './properties';
237
+ export * from './shared';
238
+ export * from './users';
239
+ export * from './product-catalogues';
240
+ export * from './underwriter';
241
+ ```
242
+
243
+ ### Model Relationships
244
+
245
+ - **Applications** โ†’ **Applicants** (one-to-many)
246
+ - **Applications** โ†’ **Properties** (one-to-many)
247
+ - **Applications** โ†’ **Product** (many-to-one)
248
+ - **Applicants** โ†’ **Income Models** (one-to-many)
249
+ - **Applicants** โ†’ **Commitment Models** (one-to-many)
250
+
251
+ ## ๐Ÿ”’ Security & Compliance
252
+
253
+ - **GDPR Support**: Built-in GDPR consent tracking
254
+ - **Audit Trail**: Comprehensive audit logging via middleware
255
+ - **Data Validation**: Strict schema validation and type checking
256
+ - **Access Control**: User permission and role-based access models
257
+
258
+ ## ๐Ÿงช Testing & Examples
259
+
260
+ ### Example Scripts
261
+
262
+ - **`add-applicant-income.ts`**: Demonstrates creating applicant income records
263
+ - **Migration Scripts**: Show real-world data migration patterns
264
+
265
+ ### Running Examples
266
+
267
+ ```bash
268
+ # Run income example
269
+ npm run example:income
270
+
271
+ # Generate documentation
272
+ npm run generate-docs
273
+ ```
274
+
275
+ ## ๐Ÿ“ Documentation
276
+
277
+ - **Schema Documentation**: Auto-generated via `npm run generate-docs`
278
+ - **Migration Guides**: Detailed README files in the `scripts/` directory
279
+ - **API Models**: Type-safe API model definitions
280
+
281
+ ## ๐Ÿค Contributing
282
+
283
+ 1. Fork the repository
284
+ 2. Create a feature branch
285
+ 3. Make your changes
286
+ 4. Ensure TypeScript compilation passes
287
+ 5. Submit a pull request
288
+
289
+ ## ๐Ÿ“„ License
290
+
291
+ ISC License - see package.json for details
292
+
293
+ ## ๐Ÿ†˜ Support
294
+
295
+ - **Issues**: [GitHub Issues](https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas/issues)
296
+ - **Repository**: [GitHub Repository](https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas)
297
+ - **Author**: Dynamatix
298
+
299
+ ## ๐Ÿ”„ Version History
300
+
301
+ - **Current**: 1.3.305
302
+ - **Dependencies**:
303
+ - `@dynamatix/cat-shared`: ^0.0.119
304
+ - `mongoose`: ^8.9.5
305
+ - `mongodb`: ^6.14.2
306
+
307
+ ---
308
+
309
309
  *This package provides the foundational data layer for Gatehouse Bank's mortgage and financial services backend systems.*
@@ -398,10 +398,10 @@ welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
398
398
  const isLast = index === otherApplicants.length - 1;
399
399
  const comma = isLast ? '' : ',';
400
400
  // Format as an HTML line (with bold labels and inline values)
401
- return `
402
- <div class="applicant-line">
403
- <span class="readonly-data">${fullFirstName}, ${lastName}, ${formattedDOB}${comma}</span>
404
- </div>
401
+ return `
402
+ <div class="applicant-line">
403
+ <span class="readonly-data">${fullFirstName}, ${lastName}, ${formattedDOB}${comma}</span>
404
+ </div>
405
405
  `;
406
406
  }).filter((line) => line && line.trim() !== '');
407
407
  // Join all applicants as HTML (no \n needed)
@@ -681,14 +681,14 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
681
681
  application.lendingTypeLid.name === 'BTL';
682
682
  const monthlyRepaymentClass = isBTL ? 'mb-2' : '';
683
683
  // Create HTML content
684
- let summaryContent = `
685
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Product:</p> <span class="readonly-data ml-2">${product}</span></div>
686
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Finance Term:</p> <span class="readonly-data ml-2">${financeTerm}</span></div>
684
+ let summaryContent = `
685
+ <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Product:</p> <span class="readonly-data ml-2">${product}</span></div>
686
+ <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Finance Term:</p> <span class="readonly-data ml-2">${financeTerm}</span></div>
687
687
  <div class="flex align-items-center ${monthlyRepaymentClass}"><p class="text-bold m-0 readonly-data">Monthly Repayment:</p> <span class="readonly-data ml-2">${monthlyRepayment}</span></div>`;
688
688
  // Only show rental income and occupancy for BTL applications
689
689
  if (isBTL) {
690
- summaryContent += `
691
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Rental Income:</p> <span class="readonly-data ml-2">${rentalIncome}</span></div>
690
+ summaryContent += `
691
+ <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Rental Income:</p> <span class="readonly-data ml-2">${rentalIncome}</span></div>
692
692
  <div class="flex align-items-center"><p class="text-bold m-0 readonly-data">Occupancy:</p> <span class="readonly-data ml-2">${occupancy}</span></div>`;
693
693
  }
694
694
  return summaryContent;