@dynamatix/gb-schemas 2.0.67 → 2.3.4
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 +309 -0
- package/dist/applicants/applicant-additional-income.model.d.ts +192 -8
- package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-additional-income.model.js +24 -3
- package/dist/applicants/applicant-additional-income.type.d.ts +40 -0
- package/dist/applicants/applicant-additional-income.type.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts +90 -47
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-creditCard.model.js +12 -6
- package/dist/applicants/applicant-commitment-loan.model.d.ts +81 -41
- package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-loan.model.js +13 -8
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts +78 -38
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-mortgage.model.js +19 -19
- package/dist/applicants/applicant-commitment-residence.model.d.ts +768 -0
- package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-residence.model.js +57 -0
- package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +81 -47
- package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-secureLoan.model.js +14 -8
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +81 -47
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.js +14 -8
- package/dist/applicants/applicant-credit-data.model.d.ts +32 -4
- package/dist/applicants/applicant-credit-data.model.d.ts.map +1 -1
- package/dist/applicants/applicant-credit-profile.model.d.ts +29 -1
- package/dist/applicants/applicant-credit-profile.model.d.ts.map +1 -1
- package/dist/applicants/applicant-credit-report.model.d.ts +3784 -0
- package/dist/applicants/applicant-credit-report.model.d.ts.map +1 -0
- package/dist/applicants/applicant-credit-report.model.js +122 -0
- package/dist/applicants/applicant-credit-report.type.d.ts +145 -0
- package/dist/applicants/applicant-credit-report.type.d.ts.map +1 -0
- package/dist/applicants/applicant-credit-report.type.js +1 -0
- package/dist/applicants/applicant-direct-debit.model.d.ts +29 -4
- package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -1
- package/dist/applicants/applicant-direct-debit.model.js +0 -1
- package/dist/applicants/applicant-employment-income.model.d.ts +39 -8
- package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-employment-income.model.js +13 -2
- package/dist/applicants/applicant-employment-income.type.d.ts +37 -0
- package/dist/applicants/applicant-employment-income.type.d.ts.map +1 -0
- package/dist/applicants/applicant-employment-income.type.js +1 -0
- package/dist/applicants/applicant-employment.model.d.ts +167 -703
- package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
- package/dist/applicants/applicant-employment.model.js +25 -27
- package/dist/applicants/applicant-expenditure.model.d.ts +42 -8
- package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
- package/dist/applicants/applicant-expenditure.model.js +86 -2
- package/dist/applicants/applicant-expenditure.type.d.ts +42 -0
- package/dist/applicants/applicant-expenditure.type.d.ts.map +1 -0
- package/dist/applicants/applicant-expenditure.type.js +1 -0
- package/dist/applicants/applicant-income-settings.model.d.ts +30 -2
- package/dist/applicants/applicant-income-settings.model.d.ts.map +1 -1
- package/dist/applicants/applicant-income-settings.model.js +11 -0
- package/dist/applicants/applicant-income-settings.type.d.ts +40 -0
- package/dist/applicants/applicant-income-settings.type.d.ts.map +1 -0
- package/dist/applicants/applicant-income-settings.type.js +1 -0
- package/dist/applicants/applicant-income-source.model.d.ts +26 -0
- package/dist/applicants/applicant-income-source.model.d.ts.map +1 -0
- package/dist/applicants/applicant-income-summary.model.d.ts +2202 -0
- package/dist/applicants/applicant-income-summary.model.d.ts.map +1 -0
- package/dist/applicants/applicant-income-summary.model.js +45 -0
- package/dist/applicants/applicant-income-summary.type.d.ts +60 -0
- package/dist/applicants/applicant-income-summary.type.d.ts.map +1 -0
- package/dist/applicants/applicant-income-summary.type.js +1 -0
- package/dist/applicants/applicant-income.model.d.ts +30 -2068
- package/dist/applicants/applicant-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-other-income.model.d.ts +85 -0
- package/dist/applicants/applicant-other-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-pension-income.model.d.ts +51 -302
- package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-pension-income.model.js +14 -6
- package/dist/applicants/applicant-pension-income.type.d.ts +40 -0
- package/dist/applicants/applicant-pension-income.type.d.ts.map +1 -0
- package/dist/applicants/applicant-pension-income.type.js +1 -0
- package/dist/applicants/applicant-property-income.model.d.ts +102 -56
- package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-property-income.model.js +18 -7
- package/dist/applicants/applicant-risk-narrative.model.d.ts +32 -4
- package/dist/applicants/applicant-risk-narrative.model.d.ts.map +1 -1
- package/dist/applicants/applicant-self-employed-income.model.d.ts +39 -8
- package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-self-employed-income.model.js +13 -2
- package/dist/applicants/applicant-self-employed-income.type.d.ts +37 -0
- package/dist/applicants/applicant-self-employed-income.type.d.ts.map +1 -0
- package/dist/applicants/applicant-self-employed-income.type.js +1 -0
- package/dist/applicants/applicant-self-employment.model.d.ts +269 -0
- package/dist/applicants/applicant-self-employment.model.d.ts.map +1 -0
- package/dist/applicants/applicant-self-employment.model.js +55 -0
- package/dist/applicants/applicant-sole-trader-income.model.d.ts +39 -8
- package/dist/applicants/applicant-sole-trader-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-sole-trader-income.model.js +11 -2
- package/dist/applicants/applicant-sole-trader-income.type.d.ts +37 -0
- package/dist/applicants/applicant-sole-trader-income.type.d.ts.map +1 -0
- package/dist/applicants/applicant-sole-trader-income.type.js +1 -0
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts +66 -317
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
- package/dist/applicants/applicant-uk-tax-credits.model.js +15 -7
- package/dist/applicants/applicant-uk-tax-credits.type.d.ts +39 -0
- package/dist/applicants/applicant-uk-tax-credits.type.d.ts.map +1 -0
- package/dist/applicants/applicant-uk-tax-credits.type.js +1 -0
- package/dist/applicants/applicant-welcome-call.model.d.ts +384 -0
- package/dist/applicants/applicant-welcome-call.model.d.ts.map +1 -0
- package/dist/applicants/applicant-welcome-call.model.js +709 -0
- package/dist/applicants/applicant-welcome-call.type.d.ts +66 -0
- package/dist/applicants/applicant-welcome-call.type.d.ts.map +1 -0
- package/dist/applicants/applicant-welcome-call.type.js +1 -0
- package/dist/applicants/applicant.model.d.ts +1522 -89
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applicants/applicant.model.js +40 -9
- package/dist/applicants/applicant.type.d.ts +158 -0
- package/dist/applicants/applicant.type.d.ts.map +1 -0
- package/dist/applicants/applicant.type.js +1 -0
- package/dist/applicants/index.d.ts +24 -8
- package/dist/applicants/index.d.ts.map +1 -1
- package/dist/applicants/index.js +12 -8
- package/dist/applications/application-audit.model.d.ts +36 -8
- package/dist/applications/application-audit.model.d.ts.map +1 -1
- package/dist/applications/application-audit.model.js +3 -0
- package/dist/applications/application-checklist-Item.model.d.ts +36 -2
- package/dist/applications/application-checklist-Item.model.d.ts.map +1 -1
- package/dist/applications/application-checklist-Item.model.js +4 -0
- package/dist/applications/application-company-model.d.ts +123 -59
- package/dist/applications/application-company-model.d.ts.map +1 -1
- package/dist/applications/application-company-model.js +24 -10
- package/dist/applications/application-credit-profile.model.d.ts +29 -1
- package/dist/applications/application-credit-profile.model.d.ts.map +1 -1
- package/dist/applications/application-direct-debit.model.d.ts +178 -32
- package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
- package/dist/applications/application-direct-debit.model.js +64 -1
- package/dist/applications/application-direct-debit.type.d.ts +63 -0
- package/dist/applications/application-direct-debit.type.d.ts.map +1 -0
- package/dist/applications/application-direct-debit.type.js +1 -0
- package/dist/applications/application-euc.model.d.ts +154 -0
- package/dist/applications/application-euc.model.d.ts.map +1 -0
- package/dist/applications/application-euc.model.js +28 -0
- package/dist/applications/application-fieldconfig.model.d.ts +30 -2
- package/dist/applications/application-fieldconfig.model.d.ts.map +1 -1
- package/dist/applications/application-fieldconfig.model.js +3 -0
- package/dist/applications/application-illustration-model.d.ts +30 -2
- package/dist/applications/application-illustration-model.d.ts.map +1 -1
- package/dist/applications/application-legal.model.d.ts +30 -2
- package/dist/applications/application-legal.model.d.ts.map +1 -1
- package/dist/applications/application-legal.model.js +3 -0
- package/dist/applications/application-mortgage.model.d.ts +201 -1097
- package/dist/applications/application-mortgage.model.d.ts.map +1 -1
- package/dist/applications/application-mortgage.model.js +24 -21
- package/dist/applications/application-mortgage.type.d.ts +76 -0
- package/dist/applications/application-mortgage.type.d.ts.map +1 -0
- package/dist/applications/application-mortgage.type.js +1 -0
- package/dist/applications/application-note.model.d.ts +66 -26
- package/dist/applications/application-note.model.d.ts.map +1 -1
- package/dist/applications/application-note.model.js +30 -3
- package/dist/applications/application-note.type.d.ts +55 -0
- package/dist/applications/application-note.type.d.ts.map +1 -0
- package/dist/applications/application-note.type.js +1 -0
- package/dist/applications/application-offer.model.d.ts +158 -10
- package/dist/applications/application-offer.model.d.ts.map +1 -1
- package/dist/applications/application-offer.model.js +49 -3
- package/dist/applications/application-offer.type.d.ts +54 -0
- package/dist/applications/application-offer.type.d.ts.map +1 -0
- package/dist/applications/application-offer.type.js +1 -0
- package/dist/applications/application-onboarding.model.d.ts +30 -2
- package/dist/applications/application-onboarding.model.d.ts.map +1 -1
- package/dist/applications/application-onboarding.model.js +3 -0
- package/dist/applications/application-product.model.d.ts +185 -15
- package/dist/applications/application-product.model.d.ts.map +1 -1
- package/dist/applications/application-product.model.js +34 -11
- package/dist/applications/application-product.type.d.ts +58 -0
- package/dist/applications/application-product.type.d.ts.map +1 -0
- package/dist/applications/application-product.type.js +1 -0
- package/dist/applications/application-productfeatures.model.d.ts +42 -8
- package/dist/applications/application-productfeatures.model.d.ts.map +1 -1
- package/dist/applications/application-productfeatures.model.js +5 -1
- package/dist/applications/application-productfeatures.type.d.ts +125 -0
- package/dist/applications/application-productfeatures.type.d.ts.map +1 -0
- package/dist/applications/application-productfeatures.type.js +1 -0
- package/dist/applications/application-rationale.model.d.ts +105 -195
- package/dist/applications/application-rationale.model.d.ts.map +1 -1
- package/dist/applications/application-rationale.model.js +17 -32
- package/dist/applications/application-rationale.type.d.ts +44 -0
- package/dist/applications/application-rationale.type.d.ts.map +1 -0
- package/dist/applications/application-rationale.type.js +1 -0
- package/dist/applications/application-risk-narrative.model.d.ts +72 -32
- package/dist/applications/application-risk-narrative.model.d.ts.map +1 -1
- package/dist/applications/application-risk-narrative.model.js +10 -5
- package/dist/applications/application-valuation-report.model.d.ts +1438 -0
- package/dist/applications/application-valuation-report.model.d.ts.map +1 -0
- package/dist/applications/application-valuation-report.model.js +799 -0
- package/dist/applications/application-valuation-report.type.d.ts +256 -0
- package/dist/applications/application-valuation-report.type.d.ts.map +1 -0
- package/dist/applications/application-valuation-report.type.js +1 -0
- package/dist/applications/application-valuation.model.d.ts +730 -19
- package/dist/applications/application-valuation.model.d.ts.map +1 -1
- package/dist/applications/application-valuation.model.js +34 -7
- package/dist/applications/application-valuation.type.d.ts +54 -0
- package/dist/applications/application-valuation.type.d.ts.map +1 -0
- package/dist/applications/application-valuation.type.js +1 -0
- package/dist/applications/application.model.d.ts +318 -116
- package/dist/applications/application.model.d.ts.map +1 -1
- package/dist/applications/application.model.js +120 -27
- package/dist/applications/applications-task.model.d.ts +300 -0
- package/dist/applications/applications-task.model.d.ts.map +1 -0
- package/dist/applications/applications-task.model.js +50 -0
- package/dist/applications/applications-task.type.d.ts +57 -0
- package/dist/applications/applications-task.type.d.ts.map +1 -0
- package/dist/applications/applications-task.type.js +1 -0
- package/dist/applications/broker.model.d.ts +54 -26
- package/dist/applications/broker.model.d.ts.map +1 -1
- package/dist/applications/broker.model.js +5 -2
- package/dist/applications/broker.type.d.ts +51 -0
- package/dist/applications/broker.type.d.ts.map +1 -0
- package/dist/applications/broker.type.js +1 -0
- package/dist/applications/index.d.ts +16 -2
- package/dist/applications/index.d.ts.map +1 -1
- package/dist/applications/index.js +5 -2
- package/dist/applications/productfeatures.model.d.ts +368 -0
- package/dist/applications/productfeatures.model.d.ts.map +1 -0
- package/dist/applications/solicitor.model.d.ts +43 -14
- package/dist/applications/solicitor.model.d.ts.map +1 -1
- package/dist/applications/solicitor.model.js +8 -1
- package/dist/applications/solicitor.type.d.ts +56 -0
- package/dist/applications/solicitor.type.d.ts.map +1 -0
- package/dist/applications/solicitor.type.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/product-catalogues/index.d.ts +3 -0
- package/dist/product-catalogues/index.d.ts.map +1 -1
- package/dist/product-catalogues/product-catalogue.model.d.ts +30 -2
- package/dist/product-catalogues/product-catalogue.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-catalogue.model.js +4 -0
- package/dist/product-catalogues/product-catalogue.type.d.ts +15 -0
- package/dist/product-catalogues/product-catalogue.type.d.ts.map +1 -0
- package/dist/product-catalogues/product-catalogue.type.js +1 -0
- package/dist/product-catalogues/product-definitions.model.d.ts +30 -2
- package/dist/product-catalogues/product-definitions.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-definitions.model.js +3 -0
- package/dist/product-catalogues/product-definitions.type.d.ts +53 -0
- package/dist/product-catalogues/product-definitions.type.d.ts.map +1 -0
- package/dist/product-catalogues/product-definitions.type.js +1 -0
- package/dist/product-catalogues/product-variant.model.d.ts +30 -2
- package/dist/product-catalogues/product-variant.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-variant.model.js +4 -0
- package/dist/product-catalogues/product-variant.type.d.ts +38 -0
- package/dist/product-catalogues/product-variant.type.d.ts.map +1 -0
- package/dist/product-catalogues/product-variant.type.js +1 -0
- package/dist/properties/property.model.d.ts +102 -59
- package/dist/properties/property.model.d.ts.map +1 -1
- package/dist/properties/property.model.js +16 -8
- package/dist/properties/security.model.d.ts +48 -2
- package/dist/properties/security.model.d.ts.map +1 -1
- package/dist/properties/security.model.js +15 -3
- package/dist/shared/alert.model.d.ts +42 -14
- package/dist/shared/alert.model.d.ts.map +1 -1
- package/dist/shared/api-log.model.d.ts +124 -0
- package/dist/shared/api-log.model.d.ts.map +1 -0
- package/dist/shared/api-log.model.js +25 -0
- package/dist/shared/api-performance.model.d.ts +37 -0
- package/dist/shared/api-performance.model.d.ts.map +1 -0
- package/dist/shared/api-performance.model.js +22 -0
- package/dist/shared/api-performance.type.d.ts +178 -0
- package/dist/shared/api-performance.type.d.ts.map +1 -0
- package/dist/shared/api-performance.type.js +1 -0
- package/dist/shared/apprivo-sync-journey.model.d.ts +36 -8
- package/dist/shared/apprivo-sync-journey.model.d.ts.map +1 -1
- package/dist/shared/apprivo-sync-journey.model.js +2 -0
- package/dist/shared/checklist.model.d.ts +36 -8
- package/dist/shared/checklist.model.d.ts.map +1 -1
- package/dist/shared/checklist.model.js +5 -0
- package/dist/shared/index.d.ts +7 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +5 -1
- package/dist/shared/job-run.model.d.ts +30 -2
- package/dist/shared/job-run.model.d.ts.map +1 -1
- package/dist/shared/job-setting.model.d.ts +36 -8
- package/dist/shared/job-setting.model.d.ts.map +1 -1
- package/dist/shared/lookup-group.model.d.ts +30 -2
- package/dist/shared/lookup-group.model.d.ts.map +1 -1
- package/dist/shared/lookup-group.model.js +6 -0
- package/dist/shared/lookup.model.d.ts +30 -2
- package/dist/shared/lookup.model.d.ts.map +1 -1
- package/dist/shared/lookup.model.js +7 -0
- package/dist/shared/schema-doc.model.d.ts +36 -8
- package/dist/shared/schema-doc.model.d.ts.map +1 -1
- package/dist/shared/system-parameter.model.d.ts +36 -8
- package/dist/shared/system-parameter.model.d.ts.map +1 -1
- package/dist/shared/task-document.model.d.ts +36 -8
- package/dist/shared/task-document.model.d.ts.map +1 -1
- package/dist/shared/task.model.d.ts +36 -8
- package/dist/shared/task.model.d.ts.map +1 -1
- package/dist/shared/webhook-event.model.d.ts +37 -0
- package/dist/shared/webhook-event.model.d.ts.map +1 -0
- package/dist/shared/webhook-event.model.js +57 -0
- package/dist/shared/webhook-event.type.d.ts +15 -0
- package/dist/shared/webhook-event.type.d.ts.map +1 -0
- package/dist/shared/webhook-event.type.js +1 -0
- package/dist/shared/workflow-trigger.model.d.ts +32 -0
- package/dist/shared/workflow-trigger.model.d.ts.map +1 -0
- package/dist/shared/workflow-trigger.model.js +49 -0
- package/dist/shared/workflow-trigger.type.d.ts +60 -0
- package/dist/shared/workflow-trigger.type.d.ts.map +1 -0
- package/dist/shared/workflow-trigger.type.js +1 -0
- package/dist/shared/workflow.init.d.ts +21 -0
- package/dist/shared/workflow.init.d.ts.map +1 -0
- package/dist/shared/workflow.init.js +42 -0
- package/dist/shared/workflow.logger.d.ts +18 -0
- package/dist/shared/workflow.logger.d.ts.map +1 -0
- package/dist/shared/workflow.logger.js +41 -0
- package/dist/shared/workflow.middleware.d.ts +108 -0
- package/dist/shared/workflow.middleware.d.ts.map +1 -0
- package/dist/shared/workflow.middleware.js +246 -0
- package/dist/shared/workflow.plugin.d.ts +46 -0
- package/dist/shared/workflow.plugin.d.ts.map +1 -0
- package/dist/shared/workflow.plugin.js +151 -0
- package/dist/shared/workflow.service.d.ts +42 -0
- package/dist/shared/workflow.service.d.ts.map +1 -0
- package/dist/shared/workflow.service.js +134 -0
- package/dist/types/base.types.d.ts +35 -0
- package/dist/types/base.types.d.ts.map +1 -0
- package/dist/types/base.types.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/underwriter/underwriter.model.d.ts +30 -2
- package/dist/underwriter/underwriter.model.d.ts.map +1 -1
- package/dist/users/auth-log.model.d.ts +30 -2
- package/dist/users/auth-log.model.d.ts.map +1 -1
- package/dist/users/auth-log.model.js +3 -0
- package/dist/users/permission.model.d.ts +30 -2
- package/dist/users/permission.model.d.ts.map +1 -1
- package/dist/users/permission.model.js +2 -0
- package/dist/users/role-group.model.d.ts +30 -2
- package/dist/users/role-group.model.d.ts.map +1 -1
- package/dist/users/role-group.model.js +3 -0
- package/dist/users/role.model.d.ts +30 -2
- package/dist/users/role.model.d.ts.map +1 -1
- package/dist/users/role.model.js +3 -0
- package/dist/users/tasks.model.d.ts +30 -2
- package/dist/users/tasks.model.d.ts.map +1 -1
- package/dist/users/tasks.model.js +4 -1
- package/dist/users/user.model.d.ts +48 -14
- package/dist/users/user.model.d.ts.map +1 -1
- package/dist/users/user.model.js +13 -2
- package/dist/users/user.type.d.ts +55 -0
- package/dist/users/user.type.d.ts.map +1 -0
- package/dist/users/user.type.js +1 -0
- package/dist/value-objects/account-number.d.ts +42 -0
- package/dist/value-objects/account-number.d.ts.map +1 -0
- package/dist/value-objects/account-number.js +24 -0
- package/dist/value-objects/pound.d.ts +28 -0
- package/dist/value-objects/pound.d.ts.map +1 -1
- package/dist/value-objects/pound.js +33 -9
- package/dist/value-objects/sort-code.d.ts +27 -0
- package/dist/value-objects/sort-code.d.ts.map +1 -1
- package/dist/value-objects/sort-code.js +13 -4
- package/package.json +33 -29
- package/dist/applicants/applicant-income.model.js +0 -78
- package/dist/applications/application-document.model.js +0 -35
- package/dist/applications/document.model.js +0 -35
- package/dist/entities/applicants/applicant-credit-data.entity.d.ts +0 -19
- package/dist/entities/applicants/applicant-credit-data.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-credit-data.entity.js +0 -5
- package/dist/entities/applicants/applicant-credit-profile.entity.d.ts +0 -14
- package/dist/entities/applicants/applicant-credit-profile.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-credit-profile.entity.js +0 -5
- package/dist/entities/applicants/applicant-employment-income.entity.d.ts +0 -14
- package/dist/entities/applicants/applicant-employment-income.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-employment-income.entity.js +0 -5
- package/dist/entities/applicants/applicant-employment.entity.d.ts +0 -54
- package/dist/entities/applicants/applicant-employment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-employment.entity.js +0 -5
- package/dist/entities/applicants/applicant-expenditure.entity.d.ts +0 -14
- package/dist/entities/applicants/applicant-expenditure.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-expenditure.entity.js +0 -5
- package/dist/entities/applicants/applicant-income-settings.entity.d.ts +0 -17
- package/dist/entities/applicants/applicant-income-settings.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-income-settings.entity.js +0 -5
- package/dist/entities/applicants/applicant-income.entity.d.ts +0 -77
- package/dist/entities/applicants/applicant-income.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-income.entity.js +0 -2
- package/dist/entities/applicants/applicant-share-holding.entity.d.ts +0 -18
- package/dist/entities/applicants/applicant-share-holding.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant-share-holding.entity.js +0 -5
- package/dist/entities/applicants/applicant.entity.d.ts +0 -144
- package/dist/entities/applicants/applicant.entity.d.ts.map +0 -1
- package/dist/entities/applicants/applicant.entity.js +0 -48
- package/dist/entities/applicants/credit-card-commitment.entity.d.ts +0 -22
- package/dist/entities/applicants/credit-card-commitment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/credit-card-commitment.entity.js +0 -9
- package/dist/entities/applicants/index.d.ts +0 -20
- package/dist/entities/applicants/index.d.ts.map +0 -1
- package/dist/entities/applicants/index.js +0 -18
- package/dist/entities/applicants/loan-commitment.entity.d.ts +0 -29
- package/dist/entities/applicants/loan-commitment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/loan-commitment.entity.js +0 -15
- package/dist/entities/applicants/mortgage-commitment.entity.d.ts +0 -50
- package/dist/entities/applicants/mortgage-commitment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/mortgage-commitment.entity.js +0 -27
- package/dist/entities/applicants/other-income.entity.d.ts +0 -41
- package/dist/entities/applicants/other-income.entity.d.ts.map +0 -1
- package/dist/entities/applicants/other-income.entity.js +0 -19
- package/dist/entities/applicants/property-income.entity.d.ts +0 -17
- package/dist/entities/applicants/property-income.entity.d.ts.map +0 -1
- package/dist/entities/applicants/property-income.entity.js +0 -5
- package/dist/entities/applicants/residence-commitment.entity.d.ts +0 -44
- package/dist/entities/applicants/residence-commitment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/residence-commitment.entity.js +0 -19
- package/dist/entities/applicants/secure-loan-commitment.entity.d.ts +0 -29
- package/dist/entities/applicants/secure-loan-commitment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/secure-loan-commitment.entity.js +0 -12
- package/dist/entities/applicants/unsecured-loan-commitment.entity.d.ts +0 -29
- package/dist/entities/applicants/unsecured-loan-commitment.entity.d.ts.map +0 -1
- package/dist/entities/applicants/unsecured-loan-commitment.entity.js +0 -12
- package/dist/entities/applications/application-audit.entity.d.ts +0 -18
- package/dist/entities/applications/application-audit.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-audit.entity.js +0 -5
- package/dist/entities/applications/application-company.entity.d.ts +0 -60
- package/dist/entities/applications/application-company.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-company.entity.js +0 -15
- package/dist/entities/applications/application-credit-profile.entity.d.ts +0 -11
- package/dist/entities/applications/application-credit-profile.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-credit-profile.entity.js +0 -5
- package/dist/entities/applications/application-direct-debit.entity.d.ts +0 -24
- package/dist/entities/applications/application-direct-debit.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-direct-debit.entity.js +0 -5
- package/dist/entities/applications/application-document.entity.d.ts +0 -28
- package/dist/entities/applications/application-document.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-document.entity.js +0 -5
- package/dist/entities/applications/application-fieldconfig.entity.d.ts +0 -9
- package/dist/entities/applications/application-fieldconfig.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-fieldconfig.entity.js +0 -5
- package/dist/entities/applications/application-illustration.entity.d.ts +0 -8
- package/dist/entities/applications/application-illustration.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-illustration.entity.js +0 -5
- package/dist/entities/applications/application-legal.entity.d.ts +0 -9
- package/dist/entities/applications/application-legal.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-legal.entity.js +0 -5
- package/dist/entities/applications/application-mortgage.entity.d.ts +0 -55
- package/dist/entities/applications/application-mortgage.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-mortgage.entity.js +0 -27
- package/dist/entities/applications/application-note.entity.d.ts +0 -37
- package/dist/entities/applications/application-note.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-note.entity.js +0 -5
- package/dist/entities/applications/application-offer.entity.d.ts +0 -8
- package/dist/entities/applications/application-offer.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-offer.entity.js +0 -5
- package/dist/entities/applications/application-onboarding.entity.d.ts +0 -11
- package/dist/entities/applications/application-onboarding.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-onboarding.entity.js +0 -5
- package/dist/entities/applications/application-product.entity.d.ts +0 -33
- package/dist/entities/applications/application-product.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-product.entity.js +0 -5
- package/dist/entities/applications/application-rationale.entity.d.ts +0 -51
- package/dist/entities/applications/application-rationale.entity.d.ts.map +0 -1
- package/dist/entities/applications/application-rationale.entity.js +0 -5
- package/dist/entities/applications/application.entity.d.ts +0 -102
- package/dist/entities/applications/application.entity.d.ts.map +0 -1
- package/dist/entities/applications/application.entity.js +0 -66
- package/dist/entities/applications/broker.entity.d.ts +0 -23
- package/dist/entities/applications/broker.entity.d.ts.map +0 -1
- package/dist/entities/applications/broker.entity.js +0 -5
- package/dist/entities/applications/checklist-item.entity.d.ts +0 -47
- package/dist/entities/applications/checklist-item.entity.d.ts.map +0 -1
- package/dist/entities/applications/checklist-item.entity.js +0 -5
- package/dist/entities/applications/index.d.ts +0 -22
- package/dist/entities/applications/index.d.ts.map +0 -1
- package/dist/entities/applications/index.js +0 -20
- package/dist/entities/applications/product-features.entity.d.ts +0 -104
- package/dist/entities/applications/product-features.entity.d.ts.map +0 -1
- package/dist/entities/applications/product-features.entity.js +0 -20
- package/dist/entities/applications/solicitor.entity.d.ts +0 -33
- package/dist/entities/applications/solicitor.entity.d.ts.map +0 -1
- package/dist/entities/applications/solicitor.entity.js +0 -5
- package/dist/entities/index.d.ts +0 -10
- package/dist/entities/index.d.ts.map +0 -1
- package/dist/entities/index.js +0 -10
- package/dist/entities/prisma.d.ts +0 -3
- package/dist/entities/prisma.d.ts.map +0 -1
- package/dist/entities/prisma.js +0 -10
- package/dist/entities/product-catalogues/index.d.ts +0 -8
- package/dist/entities/product-catalogues/index.d.ts.map +0 -1
- package/dist/entities/product-catalogues/index.js +0 -6
- package/dist/entities/product-catalogues/product-catalogue.entity.d.ts +0 -22
- package/dist/entities/product-catalogues/product-catalogue.entity.d.ts.map +0 -1
- package/dist/entities/product-catalogues/product-catalogue.entity.js +0 -5
- package/dist/entities/product-catalogues/product-definition.entity.d.ts +0 -16
- package/dist/entities/product-catalogues/product-definition.entity.d.ts.map +0 -1
- package/dist/entities/product-catalogues/product-definition.entity.js +0 -5
- package/dist/entities/product-catalogues/product-variant.entity.d.ts +0 -14
- package/dist/entities/product-catalogues/product-variant.entity.d.ts.map +0 -1
- package/dist/entities/product-catalogues/product-variant.entity.js +0 -5
- package/dist/entities/product-catalogues/product.entity.d.ts +0 -11
- package/dist/entities/product-catalogues/product.entity.d.ts.map +0 -1
- package/dist/entities/product-catalogues/product.entity.js +0 -5
- package/dist/entities/product-catalogues/rule.entity.d.ts +0 -21
- package/dist/entities/product-catalogues/rule.entity.d.ts.map +0 -1
- package/dist/entities/product-catalogues/rule.entity.js +0 -5
- package/dist/entities/properties/data-street.entity.d.ts +0 -22
- package/dist/entities/properties/data-street.entity.d.ts.map +0 -1
- package/dist/entities/properties/data-street.entity.js +0 -5
- package/dist/entities/properties/index.d.ts +0 -6
- package/dist/entities/properties/index.d.ts.map +0 -1
- package/dist/entities/properties/index.js +0 -4
- package/dist/entities/properties/property.entity.d.ts +0 -30
- package/dist/entities/properties/property.entity.d.ts.map +0 -1
- package/dist/entities/properties/property.entity.js +0 -5
- package/dist/entities/properties/security.entity.d.ts +0 -58
- package/dist/entities/properties/security.entity.d.ts.map +0 -1
- package/dist/entities/properties/security.entity.js +0 -5
- package/dist/entities/shared/alert.entity.d.ts +0 -14
- package/dist/entities/shared/alert.entity.d.ts.map +0 -1
- package/dist/entities/shared/alert.entity.js +0 -5
- package/dist/entities/shared/apprivo-sync-journey.entity.d.ts +0 -19
- package/dist/entities/shared/apprivo-sync-journey.entity.d.ts.map +0 -1
- package/dist/entities/shared/apprivo-sync-journey.entity.js +0 -5
- package/dist/entities/shared/checklist.entity.d.ts +0 -15
- package/dist/entities/shared/checklist.entity.d.ts.map +0 -1
- package/dist/entities/shared/checklist.entity.js +0 -5
- package/dist/entities/shared/document-type.entity.d.ts +0 -9
- package/dist/entities/shared/document-type.entity.d.ts.map +0 -1
- package/dist/entities/shared/document-type.entity.js +0 -5
- package/dist/entities/shared/index.d.ts +0 -12
- package/dist/entities/shared/index.d.ts.map +0 -1
- package/dist/entities/shared/index.js +0 -10
- package/dist/entities/shared/job-run.entity.d.ts +0 -15
- package/dist/entities/shared/job-run.entity.d.ts.map +0 -1
- package/dist/entities/shared/job-run.entity.js +0 -5
- package/dist/entities/shared/job-run.model.d.ts +0 -11
- package/dist/entities/shared/job-run.model.d.ts.map +0 -1
- package/dist/entities/shared/job-setting.entity.d.ts +0 -11
- package/dist/entities/shared/job-setting.entity.d.ts.map +0 -1
- package/dist/entities/shared/job-setting.entity.js +0 -5
- package/dist/entities/shared/lookup-group.entity.d.ts +0 -11
- package/dist/entities/shared/lookup-group.entity.d.ts.map +0 -1
- package/dist/entities/shared/lookup-group.entity.js +0 -5
- package/dist/entities/shared/lookup.entity.d.ts +0 -14
- package/dist/entities/shared/lookup.entity.d.ts.map +0 -1
- package/dist/entities/shared/lookup.entity.js +0 -5
- package/dist/entities/shared/system-parameter.entity.d.ts +0 -10
- package/dist/entities/shared/system-parameter.entity.d.ts.map +0 -1
- package/dist/entities/shared/system-parameter.entity.js +0 -5
- package/dist/entities/underwriter/index.d.ts +0 -4
- package/dist/entities/underwriter/index.d.ts.map +0 -1
- package/dist/entities/underwriter/index.js +0 -2
- package/dist/entities/underwriter/underwriter.entity.d.ts +0 -19
- package/dist/entities/underwriter/underwriter.entity.d.ts.map +0 -1
- package/dist/entities/underwriter/underwriter.entity.js +0 -5
- package/dist/entities/users/auth-log.entity.d.ts +0 -11
- package/dist/entities/users/auth-log.entity.d.ts.map +0 -1
- package/dist/entities/users/auth-log.entity.js +0 -5
- package/dist/entities/users/index.d.ts +0 -8
- package/dist/entities/users/index.d.ts.map +0 -1
- package/dist/entities/users/index.js +0 -6
- package/dist/entities/users/permission.entity.d.ts +0 -12
- package/dist/entities/users/permission.entity.d.ts.map +0 -1
- package/dist/entities/users/permission.entity.js +0 -5
- package/dist/entities/users/role-group.entity.d.ts +0 -13
- package/dist/entities/users/role-group.entity.d.ts.map +0 -1
- package/dist/entities/users/role-group.entity.js +0 -5
- package/dist/entities/users/role.entity.d.ts +0 -16
- package/dist/entities/users/role.entity.d.ts.map +0 -1
- package/dist/entities/users/role.entity.js +0 -5
- package/dist/entities/users/user.entity.d.ts +0 -33
- package/dist/entities/users/user.entity.d.ts.map +0 -1
- package/dist/entities/users/user.entity.js +0 -5
- package/dist/shared/document-type-model.js +0 -10
- package/entities/applicants/applicant-credit-data.entity.ts +0 -24
- package/entities/applicants/applicant-credit-profile.entity.ts +0 -19
- package/entities/applicants/applicant-employment-income.entity.ts +0 -18
- package/entities/applicants/applicant-employment.entity.ts +0 -60
- package/entities/applicants/applicant-expenditure.entity.ts +0 -19
- package/entities/applicants/applicant-income-settings.entity.ts +0 -22
- package/entities/applicants/applicant-income.entity.ts +0 -79
- package/entities/applicants/applicant-share-holding.entity.ts +0 -23
- package/entities/applicants/applicant.entity.ts +0 -194
- package/entities/applicants/credit-card-commitment.entity.ts +0 -31
- package/entities/applicants/index.ts +0 -59
- package/entities/applicants/loan-commitment.entity.ts +0 -44
- package/entities/applicants/mortgage-commitment.entity.ts +0 -77
- package/entities/applicants/other-income.entity.ts +0 -68
- package/entities/applicants/property-income.entity.ts +0 -19
- package/entities/applicants/residence-commitment.entity.ts +0 -63
- package/entities/applicants/secure-loan-commitment.entity.ts +0 -41
- package/entities/applicants/unsecured-loan-commitment.entity.ts +0 -41
- package/entities/applications/application-audit.entity.ts +0 -23
- package/entities/applications/application-company.entity.ts +0 -76
- package/entities/applications/application-credit-profile.entity.ts +0 -13
- package/entities/applications/application-direct-debit.entity.ts +0 -29
- package/entities/applications/application-document.entity.ts +0 -33
- package/entities/applications/application-fieldconfig.entity.ts +0 -11
- package/entities/applications/application-illustration.entity.ts +0 -10
- package/entities/applications/application-legal.entity.ts +0 -11
- package/entities/applications/application-mortgage.entity.ts +0 -82
- package/entities/applications/application-note.entity.ts +0 -42
- package/entities/applications/application-offer.entity.ts +0 -10
- package/entities/applications/application-onboarding.entity.ts +0 -13
- package/entities/applications/application-product.entity.ts +0 -38
- package/entities/applications/application-rationale.entity.ts +0 -56
- package/entities/applications/application.entity.ts +0 -168
- package/entities/applications/broker.entity.ts +0 -25
- package/entities/applications/checklist-item.entity.ts +0 -49
- package/entities/applications/index.ts +0 -63
- package/entities/applications/product-features.entity.ts +0 -118
- package/entities/applications/solicitor.entity.ts +0 -38
- package/entities/index.ts +0 -14
- package/entities/prisma.ts +0 -13
- package/entities/product-catalogues/index.ts +0 -23
- package/entities/product-catalogues/product-catalogue.entity.ts +0 -27
- package/entities/product-catalogues/product-definition.entity.ts +0 -21
- package/entities/product-catalogues/product-variant.entity.ts +0 -19
- package/entities/product-catalogues/product.entity.ts +0 -16
- package/entities/product-catalogues/rule.entity.ts +0 -26
- package/entities/properties/data-street.entity.ts +0 -27
- package/entities/properties/index.ts +0 -17
- package/entities/properties/property.entity.ts +0 -35
- package/entities/properties/security.entity.ts +0 -63
- package/entities/shared/alert.entity.ts +0 -19
- package/entities/shared/apprivo-sync-journey.entity.ts +0 -25
- package/entities/shared/apprivo-sync-journey.model.ts +0 -13
- package/entities/shared/checklist.entity.ts +0 -20
- package/entities/shared/document-type.entity.ts +0 -11
- package/entities/shared/index.ts +0 -35
- package/entities/shared/job-run.entity.ts +0 -20
- package/entities/shared/job-run.model.ts +0 -10
- package/entities/shared/job-setting.entity.ts +0 -13
- package/entities/shared/lookup-group.entity.ts +0 -16
- package/entities/shared/lookup.entity.ts +0 -19
- package/entities/shared/system-parameter.entity.ts +0 -13
- package/entities/underwriter/index.ts +0 -7
- package/entities/underwriter/underwriter.entity.ts +0 -24
- package/entities/users/auth-log.entity.ts +0 -13
- package/entities/users/index.ts +0 -23
- package/entities/users/permission.entity.ts +0 -17
- package/entities/users/role-group.entity.ts +0 -18
- package/entities/users/role.entity.ts +0 -21
- package/entities/users/user.entity.ts +0 -38
- package/prisma/applicants/applicant-credit-data.prisma +0 -19
- package/prisma/applicants/applicant-credit-profile.prisma +0 -15
- package/prisma/applicants/applicant-employment-income.prisma +0 -15
- package/prisma/applicants/applicant-employment.prisma +0 -54
- package/prisma/applicants/applicant-expenditure.prisma +0 -14
- package/prisma/applicants/applicant-income-settings.prisma +0 -17
- package/prisma/applicants/applicant-income.prisma +0 -78
- package/prisma/applicants/applicant-other-income.prisma +0 -45
- package/prisma/applicants/applicant-property-income.prisma +0 -21
- package/prisma/applicants/applicant-share-holding.prisma +0 -17
- package/prisma/applicants/applicant.prisma +0 -130
- package/prisma/applicants/credit-card-commitment.prisma +0 -21
- package/prisma/applicants/loan-commitment.prisma +0 -26
- package/prisma/applicants/mortgage-commitment.prisma +0 -43
- package/prisma/applicants/residence-commitment.prisma +0 -41
- package/prisma/applicants/secured-loan-commitment.prisma +0 -27
- package/prisma/applicants/unsecured-loan-commitment.prisma +0 -27
- package/prisma/applications/application-audit.prisma +0 -19
- package/prisma/applications/application-company.prisma +0 -56
- package/prisma/applications/application-credit-profile.prisma +0 -15
- package/prisma/applications/application-direct-debit.prisma +0 -27
- package/prisma/applications/application-document.prisma +0 -28
- package/prisma/applications/application-fieldconfig.prisma +0 -9
- package/prisma/applications/application-illustration.prisma +0 -8
- package/prisma/applications/application-legal.prisma +0 -9
- package/prisma/applications/application-mortgage.prisma +0 -48
- package/prisma/applications/application-note.prisma +0 -36
- package/prisma/applications/application-offer.prisma +0 -8
- package/prisma/applications/application-onboarding.prisma +0 -11
- package/prisma/applications/application-product.prisma +0 -33
- package/prisma/applications/application-rationale.prisma +0 -51
- package/prisma/applications/application.prisma +0 -92
- package/prisma/applications/broker.prisma +0 -26
- package/prisma/applications/checklist-item.prisma +0 -47
- package/prisma/applications/checklist.prisma +0 -19
- package/prisma/applications/product-features.prisma +0 -122
- package/prisma/applications/solicitor.prisma +0 -33
- package/prisma/broker.entity.ts +0 -8
- package/prisma/migrations/20250501070203_initial_migration/migration.sql +0 -2044
- package/prisma/migrations/20250501102630_job_setting_name_change/migration.sql +0 -10
- package/prisma/migrations/20250501104920_milstone_update/migration.sql +0 -30
- package/prisma/migrations/20250501105546_apprivo_sync_journey_update/migration.sql +0 -9
- package/prisma/migrations/20250501105850_job_run_update/migration.sql +0 -13
- package/prisma/migrations/20250505115236_update_application_schema/migration.sql +0 -115
- package/prisma/migrations/20250505145328_update_broker_schema/migration.sql +0 -8
- package/prisma/migrations/20250505185034_update_direct_debit_schema/migration.sql +0 -27
- package/prisma/migrations/20250505190613_update_solicitor_schema/migration.sql +0 -29
- package/prisma/migrations/20250506054831_update_note_schema/migration.sql +0 -12
- package/prisma/migrations/20250506142218_update_broker_schema/migration.sql +0 -17
- package/prisma/migrations/20250506190258_update_application_note_schema/migration.sql +0 -32
- package/prisma/migrations/20250506204635_update_mortgage_schema/migration.sql +0 -26
- package/prisma/migrations/20250507122847_applicant_retirement_age/migration.sql +0 -9
- package/prisma/migrations/20250507184905_update_mortgage_schema/migration.sql +0 -8
- package/prisma/migrations/20250507194746_update_direct_debit_schema/migration.sql +0 -5
- package/prisma/migrations/20250508092417_update_application_schema/migration.sql +0 -3
- package/prisma/migrations/20250508094735_update_direct_debit_schema/migration.sql +0 -2
- package/prisma/migrations/20250509073536_update_applicant_schema/migration.sql +0 -4
- package/prisma/migrations/20250509111029_update_solicitor_schema/migration.sql +0 -2
- package/prisma/migrations/20250509125107_update_mortgage_schema/migration.sql +0 -19
- package/prisma/migrations/20250512071728_update_mortgage_schema/migration.sql +0 -15
- package/prisma/migrations/20250512094011_update_property_schema/migration.sql +0 -34
- package/prisma/migrations/20250512102019_update_mortgage_schema/migration.sql +0 -2
- package/prisma/migrations/20250513132704_update_credit_card_commitment_schema/migration.sql +0 -22
- package/prisma/migrations/20250513143530_update_credit_card_commitment_schema/migration.sql +0 -8
- package/prisma/migrations/20250513170654_update_mortgage_commitment_schema/migration.sql +0 -89
- package/prisma/migrations/20250513183558_update_loan_commitment_schema/migration.sql +0 -33
- package/prisma/migrations/20250513184341_update_loan_commitment_schema/migration.sql +0 -4
- package/prisma/migrations/20250513202307_update_role_schema/migration.sql +0 -12
- package/prisma/migrations/20250514062536_update_role_group_schema/migration.sql +0 -12
- package/prisma/migrations/20250514064054_update_user_schema/migration.sql +0 -12
- package/prisma/migrations/20250514071524_update_user_schema/migration.sql +0 -15
- package/prisma/migrations/20250514072729_update_user_schema/migration.sql +0 -18
- package/prisma/migrations/20250514102042_update_user_rolegroup_role_schemas/migration.sql +0 -9
- package/prisma/migrations/20250514183537_update_application_company_schema/migration.sql +0 -100
- package/prisma/migrations/20250514194139_update_applicant_share_holding_schema/migration.sql +0 -11
- package/prisma/migrations/20250515132015_update_underwriter_schema/migration.sql +0 -56
- package/prisma/migrations/20250515133236_update_underwriter_schema/migration.sql +0 -12
- package/prisma/migrations/20250515172824_update_security_schema/migration.sql +0 -43
- package/prisma/migrations/20250516053810_update_underwriter_schema/migration.sql +0 -14
- package/prisma/migrations/20250516075153_update_commitments_schemas/migration.sql +0 -134
- package/prisma/migrations/20250516094438_update_credit_card_commitment_schema/migration.sql +0 -8
- package/prisma/migrations/20250519075211_update_product_features_schema/migration.sql +0 -15
- package/prisma/migrations/20250519094725_update_product_feature_schema/migration.sql +0 -163
- package/prisma/migrations/20250519133154_update_employemnt_income_schema/migration.sql +0 -11
- package/prisma/migrations/20250519181411_update_applicant_income_schema/migration.sql +0 -65
- package/prisma/migrations/20250520030945_update_income_settings_schema/migration.sql +0 -44
- package/prisma/migrations/20250520061455_update_income_settings_schema/migration.sql +0 -11
- package/prisma/migrations/20250521173204_update_product_catalogue_schema/migration.sql +0 -28
- package/prisma/migrations/20250521180300_update_product_variant_schema/migration.sql +0 -8
- package/prisma/migrations/20250521191050_update_product_definition_schema/migration.sql +0 -23
- package/prisma/migrations/20250521192012_update_product_definition_schema/migration.sql +0 -9
- package/prisma/migrations/migration_lock.toml +0 -3
- package/prisma/product-catalogues/product-catalogue.prisma +0 -22
- package/prisma/product-catalogues/product-definition.prisma +0 -16
- package/prisma/product-catalogues/product-variant.prisma +0 -15
- package/prisma/product-catalogues/product.prisma +0 -10
- package/prisma/product-catalogues/rule.prisma +0 -22
- package/prisma/properties/property.prisma +0 -30
- package/prisma/properties/security.prisma +0 -81
- package/prisma/schema.prisma +0 -1979
- package/prisma/shared/alert.prisma +0 -15
- package/prisma/shared/apprivo-sync-journey.prisma +0 -19
- package/prisma/shared/checklist.prisma +0 -10
- package/prisma/shared/document-type.prisma +0 -9
- package/prisma/shared/job-run.prisma +0 -15
- package/prisma/shared/job-setting.prisma +0 -11
- package/prisma/shared/lookup-group.prisma +0 -12
- package/prisma/shared/lookup.prisma +0 -154
- package/prisma/shared/system-parameter.prisma +0 -16
- package/prisma/underwriter/underwriter.prisma +0 -20
- package/prisma/users/auth-log.prisma +0 -11
- package/prisma/users/permission.prisma +0 -13
- package/prisma/users/role-group.prisma +0 -15
- package/prisma/users/role.prisma +0 -15
- package/prisma/users/user.prisma +0 -30
- /package/dist/{entities/shared/job-run.model.js → applicants/applicant-additional-income.type.js} +0 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { applyWorkflowPlugin } from "../shared/workflow.plugin";
|
|
3
|
+
import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
|
|
4
|
+
// Welcome Call Schema
|
|
5
|
+
const welcomeCallSchema = new mongoose.Schema({
|
|
6
|
+
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
7
|
+
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: false },
|
|
8
|
+
bepReference: {
|
|
9
|
+
type: String,
|
|
10
|
+
description: "BEP reference",
|
|
11
|
+
default: null
|
|
12
|
+
},
|
|
13
|
+
applicantName: {
|
|
14
|
+
type: String,
|
|
15
|
+
description: "Applicant Name",
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
firstCallAttemptDate: {
|
|
19
|
+
type: String,
|
|
20
|
+
description: "Call Started Date",
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
scheduledCallTime: {
|
|
24
|
+
type: String,
|
|
25
|
+
description: "Scheduled Call Time",
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
callCompletedDate: {
|
|
29
|
+
type: String,
|
|
30
|
+
description: "Call Completed Date / Welcome call end date",
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
failedCallReason: {
|
|
34
|
+
type: String,
|
|
35
|
+
description: "Failed Call Reason",
|
|
36
|
+
default: null,
|
|
37
|
+
},
|
|
38
|
+
idvStatus: {
|
|
39
|
+
type: String,
|
|
40
|
+
description: "IDV Status",
|
|
41
|
+
default: null
|
|
42
|
+
},
|
|
43
|
+
customerFullNameStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
44
|
+
customerDOBStatusLid: {
|
|
45
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
46
|
+
},
|
|
47
|
+
residentialAddressStatusLid: {
|
|
48
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
49
|
+
},
|
|
50
|
+
contactNumberStatusLid: {
|
|
51
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
52
|
+
},
|
|
53
|
+
emailAddressStatusLid: {
|
|
54
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
55
|
+
},
|
|
56
|
+
financePaymentTypeStatusLid: {
|
|
57
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
58
|
+
},
|
|
59
|
+
amountOfFinanceStatusLid: {
|
|
60
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
61
|
+
},
|
|
62
|
+
otherApplicantDetailsStatusLid: {
|
|
63
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
64
|
+
},
|
|
65
|
+
employerNameStatusLid: {
|
|
66
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
67
|
+
},
|
|
68
|
+
securityPropertyPurchasePriceLid: {
|
|
69
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
70
|
+
description: "security property purchase price/estimated value"
|
|
71
|
+
},
|
|
72
|
+
idvPassedStatusLid: {
|
|
73
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
74
|
+
},
|
|
75
|
+
highRiskCountryStatusLid: {
|
|
76
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
77
|
+
description: "applicant you are speaking is residing in high risk country"
|
|
78
|
+
},
|
|
79
|
+
securityPropertyAddressStatusLid: {
|
|
80
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
81
|
+
description: "applicant to confirm the security property address"
|
|
82
|
+
},
|
|
83
|
+
monthlyFinancePaymentStatusLid: {
|
|
84
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
85
|
+
},
|
|
86
|
+
propertyResidents: {
|
|
87
|
+
type: String,
|
|
88
|
+
description: "Who will reside in the property? N.B. This should align with the finance type and other application details",
|
|
89
|
+
default: null
|
|
90
|
+
},
|
|
91
|
+
propertyTypeStatusLid: {
|
|
92
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
93
|
+
description: "applicant to confirm type of property"
|
|
94
|
+
},
|
|
95
|
+
productFixedPeriodStatusLid: {
|
|
96
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
97
|
+
description: "customer to confirm the length of product fixed period"
|
|
98
|
+
},
|
|
99
|
+
fullFinanceTermStatusLid: {
|
|
100
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
101
|
+
description: "customer to confirm the length of finance term"
|
|
102
|
+
},
|
|
103
|
+
productRentalRateStatusLid: {
|
|
104
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
105
|
+
},
|
|
106
|
+
underwritingQuestions: {
|
|
107
|
+
type: String,
|
|
108
|
+
description: "Underwriting questions",
|
|
109
|
+
default: null
|
|
110
|
+
},
|
|
111
|
+
vulnerabilityImpact: {
|
|
112
|
+
type: String,
|
|
113
|
+
description: "Is there anything you feel the Bank should be aware of that could impact your finances or your ability to deal with your account either now or in the future?",
|
|
114
|
+
default: null
|
|
115
|
+
},
|
|
116
|
+
vulnerabilityIndicatorsStatusLid: {
|
|
117
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null
|
|
118
|
+
},
|
|
119
|
+
vulnerabilityResponseStatusLid: {
|
|
120
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
121
|
+
description: "vulnerability response to previous question"
|
|
122
|
+
},
|
|
123
|
+
isVulnerableCustomer: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false,
|
|
126
|
+
description: "vulnerable customer SOP/TEXAS model"
|
|
127
|
+
},
|
|
128
|
+
isInformCustomerStatus: {
|
|
129
|
+
type: Boolean, default: false,
|
|
130
|
+
description: "inform customer if changes at any point in the future"
|
|
131
|
+
},
|
|
132
|
+
financeSummaryStatusLid: {
|
|
133
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
134
|
+
desription: "customer to explain summary of finance details"
|
|
135
|
+
},
|
|
136
|
+
ShahriahFinanceSummaryStatusLid: {
|
|
137
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
138
|
+
description: "customer to summarize the understanding of shahriah finance details and how differ from mortgage"
|
|
139
|
+
},
|
|
140
|
+
isNextStepsStatus: {
|
|
141
|
+
type: Boolean, default: false,
|
|
142
|
+
description: "explain next step in application journey"
|
|
143
|
+
},
|
|
144
|
+
purchaseTypeLid: {
|
|
145
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
146
|
+
ref: "Lookup",
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
lendingTypeLid: {
|
|
150
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
151
|
+
ref: "Lookup",
|
|
152
|
+
required: false
|
|
153
|
+
},
|
|
154
|
+
customerEnglishabilityStatusLid: {
|
|
155
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
156
|
+
ref: "Lookup",
|
|
157
|
+
required: false,
|
|
158
|
+
description: "Customer's levele of English speaking ability"
|
|
159
|
+
},
|
|
160
|
+
brokerNameStatusLid: {
|
|
161
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
162
|
+
ref: "Lookup",
|
|
163
|
+
required: false,
|
|
164
|
+
description: "ask applicant to confirm the broker name"
|
|
165
|
+
},
|
|
166
|
+
accountHolderNameStatusLid: {
|
|
167
|
+
type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null,
|
|
168
|
+
description: "Ask the applicant to confirm the account holder and name of bank"
|
|
169
|
+
},
|
|
170
|
+
repaymentAmountStatusLid: {
|
|
171
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
172
|
+
ref: "Lookup",
|
|
173
|
+
default: null,
|
|
174
|
+
description: "Ask the applicant to confirm the monthly repayment amount",
|
|
175
|
+
},
|
|
176
|
+
propertyReside: {
|
|
177
|
+
type: String,
|
|
178
|
+
description: "Customer to confirm who will reside in the property",
|
|
179
|
+
default: null
|
|
180
|
+
},
|
|
181
|
+
FinanceTypeStatusLid: {
|
|
182
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
183
|
+
ref: "Lookup",
|
|
184
|
+
default: null,
|
|
185
|
+
description: "applicant response matched with application detail and finance type",
|
|
186
|
+
},
|
|
187
|
+
customerSufficientStatusLid: {
|
|
188
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
189
|
+
ref: "Lookup",
|
|
190
|
+
required: false,
|
|
191
|
+
description: "customer sufficiently aware of application details",
|
|
192
|
+
},
|
|
193
|
+
knowledgeOfApplicationStatusLid: {
|
|
194
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
195
|
+
ref: "Lookup",
|
|
196
|
+
required: false,
|
|
197
|
+
description: "applicant knowledge of application details",
|
|
198
|
+
},
|
|
199
|
+
customerQuestions: {
|
|
200
|
+
type: String,
|
|
201
|
+
description: "Ask the customer if they have any questions",
|
|
202
|
+
default: null
|
|
203
|
+
},
|
|
204
|
+
underwriterName: {
|
|
205
|
+
type: String,
|
|
206
|
+
description: "Name of underwriter",
|
|
207
|
+
default: null
|
|
208
|
+
},
|
|
209
|
+
failedCallDate: {
|
|
210
|
+
type: String,
|
|
211
|
+
description: "Failed Call Date",
|
|
212
|
+
default: null
|
|
213
|
+
},
|
|
214
|
+
isAlgbraAccountRequested: {
|
|
215
|
+
type: Boolean,
|
|
216
|
+
default: false,
|
|
217
|
+
description: "if Algbra bank account has been requested"
|
|
218
|
+
},
|
|
219
|
+
isActive: {
|
|
220
|
+
type: Boolean,
|
|
221
|
+
default: true,
|
|
222
|
+
description: "Welcome call active"
|
|
223
|
+
}
|
|
224
|
+
}, {
|
|
225
|
+
timestamps: true,
|
|
226
|
+
toJSON: { virtuals: true },
|
|
227
|
+
toObject: { virtuals: true }
|
|
228
|
+
});
|
|
229
|
+
// virtual property for full name
|
|
230
|
+
welcomeCallSchema.virtual('fullName').get(function () {
|
|
231
|
+
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
232
|
+
const applicant = this.applicantId;
|
|
233
|
+
const firstName = applicant.firstName || '';
|
|
234
|
+
const lastName = applicant.lastName || '';
|
|
235
|
+
return `${firstName} ${lastName}`.trim();
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
});
|
|
239
|
+
// Virtual property for current address
|
|
240
|
+
welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
|
|
241
|
+
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
242
|
+
const applicant = this.applicantId;
|
|
243
|
+
// Use only regular address fields (addressLine1, addressLine2, addressLine3)
|
|
244
|
+
if (applicant.addressLine1) {
|
|
245
|
+
// Get country name from populated addressCountryLid
|
|
246
|
+
let countryName = '';
|
|
247
|
+
if (applicant.addressCountryLid && typeof applicant.addressCountryLid === 'object') {
|
|
248
|
+
countryName = applicant.addressCountryLid.name || '';
|
|
249
|
+
}
|
|
250
|
+
const addressParts = [
|
|
251
|
+
applicant.addressLine1,
|
|
252
|
+
applicant.addressLine2,
|
|
253
|
+
applicant.addressLine3,
|
|
254
|
+
applicant.addressCity,
|
|
255
|
+
applicant.addressPostCode,
|
|
256
|
+
countryName
|
|
257
|
+
].filter(part => part && part.trim() !== '');
|
|
258
|
+
return addressParts.join(', ');
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return null;
|
|
262
|
+
});
|
|
263
|
+
// Virtual property for applicant employer/business name based on income settings
|
|
264
|
+
welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
265
|
+
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
266
|
+
const applicant = this.applicantId;
|
|
267
|
+
// Check if applicant has income settings
|
|
268
|
+
if (applicant.incomeSourceId && typeof applicant.incomeSourceId === 'object') {
|
|
269
|
+
const incomeSettings = applicant.incomeSourceId;
|
|
270
|
+
// If incomeFromEmployment is false, return N/A
|
|
271
|
+
if (!incomeSettings.incomeFromEmployment)
|
|
272
|
+
return 'N/A';
|
|
273
|
+
// Check employment status to determine if employed or self-employed
|
|
274
|
+
if (incomeSettings.employmentStatusLid && typeof incomeSettings.employmentStatusLid === 'object') {
|
|
275
|
+
const employmentStatus = incomeSettings.employmentStatusLid;
|
|
276
|
+
const statusName = employmentStatus.name;
|
|
277
|
+
// Check if it's employed status - compare by name for stability
|
|
278
|
+
if (statusName === 'Employee with no shareholding' ||
|
|
279
|
+
statusName === 'A non-equity partner in a partnership' ||
|
|
280
|
+
statusName === 'A shareholder with less than 25% shares') {
|
|
281
|
+
// Check employment information
|
|
282
|
+
if (applicant.employmentInformationId && typeof applicant.employmentInformationId === 'object') {
|
|
283
|
+
const employment = applicant.employmentInformationId;
|
|
284
|
+
// If field exists, return the value (or empty string if null/empty)
|
|
285
|
+
if (employment.employerName && employment.employerName.trim() !== '') {
|
|
286
|
+
return employment.employerName;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return '';
|
|
290
|
+
}
|
|
291
|
+
// Field exists but no data - return empty string
|
|
292
|
+
return '';
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// Check if it's self-employed or solo trader status - compare by name for stability
|
|
296
|
+
else if (statusName === 'A shareholder with 25% or more shares' ||
|
|
297
|
+
statusName === 'An equity partner in a partnership' ||
|
|
298
|
+
statusName === 'Sole Trader') {
|
|
299
|
+
// Check self-employment information
|
|
300
|
+
if (applicant.selfEmployedInformationId && typeof applicant.selfEmployedInformationId === 'object') {
|
|
301
|
+
const selfEmployment = applicant.selfEmployedInformationId;
|
|
302
|
+
// If field exists, return the value (or empty string if null/empty)
|
|
303
|
+
if (selfEmployment.nameOfBusiness && selfEmployment.nameOfBusiness.trim() !== '') {
|
|
304
|
+
return selfEmployment.nameOfBusiness;
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
return '';
|
|
308
|
+
}
|
|
309
|
+
// Field exists but no data - return empty string
|
|
310
|
+
return '';
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
console.log('No employment status found');
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return 'N/A';
|
|
320
|
+
});
|
|
321
|
+
// Virtual property for Customer's Contact Numbers (Phone and Mobile)
|
|
322
|
+
welcomeCallSchema.virtual('customerContactNumbers').get(function () {
|
|
323
|
+
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
324
|
+
const phoneNumber = this.applicantId.phoneNumber;
|
|
325
|
+
const mobileNumber = this.applicantId.mobileNumber;
|
|
326
|
+
if (phoneNumber && mobileNumber) {
|
|
327
|
+
return `${phoneNumber}/${mobileNumber}`;
|
|
328
|
+
}
|
|
329
|
+
else if (phoneNumber) {
|
|
330
|
+
return phoneNumber;
|
|
331
|
+
}
|
|
332
|
+
else if (mobileNumber) {
|
|
333
|
+
return mobileNumber;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return null;
|
|
337
|
+
});
|
|
338
|
+
// Virtual property for other applicants name and DOB in the requested format
|
|
339
|
+
welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
|
|
340
|
+
let application = null;
|
|
341
|
+
if (this.applicantId && typeof this.applicantId === 'object' && !(typeof this.applicantId.toHexString === 'function') && this.applicantId.applicationId) {
|
|
342
|
+
application = this.applicantId.applicationId;
|
|
343
|
+
}
|
|
344
|
+
else if (this.applicationId && typeof this.applicationId === 'object') {
|
|
345
|
+
application = this.applicationId;
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
return 'N/A';
|
|
349
|
+
}
|
|
350
|
+
if (application) {
|
|
351
|
+
// Get all applicants from the application (field name is 'applicants')
|
|
352
|
+
if (application.applicants && Array.isArray(application.applicants) && application.applicants.length > 0) {
|
|
353
|
+
// Get current applicant ID for comparison
|
|
354
|
+
const currentApplicantId = this.applicantId?._id || this.applicantId;
|
|
355
|
+
// Filter out the current applicant to get only OTHER applicants
|
|
356
|
+
const otherApplicants = application.applicants.filter((applicant) => {
|
|
357
|
+
const applicantId = applicant._id || applicant;
|
|
358
|
+
return applicantId.toString() !== currentApplicantId.toString();
|
|
359
|
+
});
|
|
360
|
+
// If no other applicants, return "N/A" (single applicant case)
|
|
361
|
+
if (otherApplicants.length === 0) {
|
|
362
|
+
return 'N/A';
|
|
363
|
+
}
|
|
364
|
+
// Format each other applicant as: "First and middle names, last name, Date of birth"
|
|
365
|
+
const formattedApplicants = otherApplicants.map((applicant, index) => {
|
|
366
|
+
// Check if applicant is an ObjectId (not populated)
|
|
367
|
+
if (typeof applicant === 'string' || (applicant.constructor && applicant.constructor.name === 'ObjectId')) {
|
|
368
|
+
return null; // Skip unpopulated references
|
|
369
|
+
}
|
|
370
|
+
const firstName = applicant.firstName || '';
|
|
371
|
+
const middleName = applicant.middleName || '';
|
|
372
|
+
const lastName = applicant.lastName || '';
|
|
373
|
+
// Combine first and middle names with space
|
|
374
|
+
const fullFirstName = middleName ? `${firstName} ${middleName}` : firstName;
|
|
375
|
+
// Format date of birth to dd/mm/yyyy
|
|
376
|
+
let formattedDOB = '';
|
|
377
|
+
if (applicant.dateOfBirth) {
|
|
378
|
+
// Check if dateOfBirth is already a formatted string (DD/MM/YYYY)
|
|
379
|
+
if (typeof applicant.dateOfBirth === 'string' && /^\d{2}\/\d{2}\/\d{4}$/.test(applicant.dateOfBirth)) {
|
|
380
|
+
// Already in DD/MM/YYYY format
|
|
381
|
+
formattedDOB = applicant.dateOfBirth;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
// Try to parse as Date object or ISO string
|
|
385
|
+
try {
|
|
386
|
+
const date = new Date(applicant.dateOfBirth);
|
|
387
|
+
// Check if date is valid
|
|
388
|
+
if (!isNaN(date.getTime())) {
|
|
389
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
390
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
391
|
+
const year = date.getFullYear();
|
|
392
|
+
formattedDOB = `${day}/${month}/${year}`;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
catch (e) {
|
|
396
|
+
// Date parsing failed, try to use as-is if it's a string
|
|
397
|
+
if (typeof applicant.dateOfBirth === 'string') {
|
|
398
|
+
formattedDOB = applicant.dateOfBirth;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
const isLast = index === otherApplicants.length - 1;
|
|
404
|
+
const comma = isLast ? '' : ',';
|
|
405
|
+
// Format as an HTML line (with bold labels and inline values)
|
|
406
|
+
return `
|
|
407
|
+
<div class="applicant-line">
|
|
408
|
+
<span class="readonly-data">${fullFirstName}, ${lastName}, ${formattedDOB}${comma}</span>
|
|
409
|
+
</div>
|
|
410
|
+
`;
|
|
411
|
+
}).filter((line) => line && line.trim() !== '');
|
|
412
|
+
// Join all applicants as HTML (no \n needed)
|
|
413
|
+
return formattedApplicants.join('');
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
// If application not populated or no applicants, return "N/A"
|
|
417
|
+
return 'N/A';
|
|
418
|
+
});
|
|
419
|
+
// Virtual property for broker name and firm
|
|
420
|
+
welcomeCallSchema.virtual('brokerNameAndFirm').get(function () {
|
|
421
|
+
// Access application from welcome call directly
|
|
422
|
+
if (this.applicationId && typeof this.applicationId === 'object') {
|
|
423
|
+
const application = this.applicationId;
|
|
424
|
+
let brokerName = '';
|
|
425
|
+
let tradingName = '';
|
|
426
|
+
// Get broker information
|
|
427
|
+
if (application.brokerId && typeof application.brokerId === 'object') {
|
|
428
|
+
const broker = application.brokerId;
|
|
429
|
+
// Get broker name
|
|
430
|
+
if (broker.firstName && broker.lastName) {
|
|
431
|
+
brokerName = `${broker.firstName} ${broker.lastName}`;
|
|
432
|
+
}
|
|
433
|
+
// Get trading name (try both lowercase and uppercase)
|
|
434
|
+
if (broker.tradingName) {
|
|
435
|
+
tradingName = broker.tradingName;
|
|
436
|
+
}
|
|
437
|
+
else if (broker.TradingName) {
|
|
438
|
+
tradingName = broker.TradingName;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
// Combine in format "Broker name / Trading Name"
|
|
442
|
+
if (brokerName && tradingName) {
|
|
443
|
+
return `${brokerName} / ${tradingName}`;
|
|
444
|
+
}
|
|
445
|
+
else if (brokerName) {
|
|
446
|
+
return brokerName;
|
|
447
|
+
}
|
|
448
|
+
else if (tradingName) {
|
|
449
|
+
return tradingName;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return null;
|
|
453
|
+
});
|
|
454
|
+
// Virtual property for account holder and Bank
|
|
455
|
+
welcomeCallSchema.virtual('accountHolderAndBank').get(function () {
|
|
456
|
+
if (this.applicantId && typeof this.applicantId === 'object' && this.applicantId.applicationId) {
|
|
457
|
+
const application = this.applicantId.applicationId;
|
|
458
|
+
let accountHolderName = '';
|
|
459
|
+
let institutionName = '';
|
|
460
|
+
// Get direct debit information
|
|
461
|
+
if (application && application.directDebitId && typeof application.directDebitId === 'object') {
|
|
462
|
+
const directDebit = application.directDebitId;
|
|
463
|
+
if (directDebit.nameOfAccountHolder) {
|
|
464
|
+
accountHolderName = directDebit.nameOfAccountHolder;
|
|
465
|
+
}
|
|
466
|
+
if (directDebit.institution) {
|
|
467
|
+
institutionName = directDebit.institution;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
// Combine in format "account holder / institution"
|
|
471
|
+
if (accountHolderName && institutionName) {
|
|
472
|
+
return `${accountHolderName} / ${institutionName}`;
|
|
473
|
+
}
|
|
474
|
+
else if (accountHolderName) {
|
|
475
|
+
return accountHolderName;
|
|
476
|
+
}
|
|
477
|
+
else if (institutionName) {
|
|
478
|
+
return institutionName;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return null;
|
|
482
|
+
});
|
|
483
|
+
// virtual property for property address
|
|
484
|
+
welcomeCallSchema.virtual('customerPropertyAddress').get(function () {
|
|
485
|
+
// Get property address from application's security reference
|
|
486
|
+
if (this.applicationId && typeof this.applicationId === 'object') {
|
|
487
|
+
const application = this.applicationId;
|
|
488
|
+
// Access security details through securityId
|
|
489
|
+
if (application.securityId && typeof application.securityId === 'object') {
|
|
490
|
+
const security = application.securityId;
|
|
491
|
+
// Use property address fields from security model
|
|
492
|
+
if (security.propertyAddressLine1) {
|
|
493
|
+
const addressParts = [
|
|
494
|
+
security.propertyAddressLine1,
|
|
495
|
+
security.propertyAddressLine2,
|
|
496
|
+
security.propertyAddressLine3,
|
|
497
|
+
security.propertyAddressCity,
|
|
498
|
+
security.propertyAddressPostCode
|
|
499
|
+
].filter(part => part && part.trim() !== '')
|
|
500
|
+
.map(part => `${part},`);
|
|
501
|
+
return addressParts.join('\n');
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return null;
|
|
506
|
+
});
|
|
507
|
+
// Virtual property for applicant employer information
|
|
508
|
+
welcomeCallSchema.virtual('applicantEmployer').get(function () {
|
|
509
|
+
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
510
|
+
const applicant = this.applicantId;
|
|
511
|
+
// Check if applicant has employment information
|
|
512
|
+
if (applicant.employmentId && typeof applicant.employmentId === 'object') {
|
|
513
|
+
const employment = applicant.employmentId;
|
|
514
|
+
// Priority: employerName first, then natureOfBusiness
|
|
515
|
+
if (employment.employerName && employment.employerName.trim() !== '') {
|
|
516
|
+
return employment.employerName;
|
|
517
|
+
}
|
|
518
|
+
else if (employment.natureOfBusiness && employment.natureOfBusiness.trim() !== '') {
|
|
519
|
+
return employment.natureOfBusiness;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return null;
|
|
524
|
+
});
|
|
525
|
+
// Virtual property for product name
|
|
526
|
+
welcomeCallSchema.virtual('productName').get(function () {
|
|
527
|
+
// Get product from application
|
|
528
|
+
if (this.applicationId && typeof this.applicationId === 'object') {
|
|
529
|
+
const application = this.applicationId;
|
|
530
|
+
// First check if selectedProduct is on the application directly
|
|
531
|
+
let selectedProduct = application.selectedProduct;
|
|
532
|
+
// If not found on application, check productId
|
|
533
|
+
if (!selectedProduct || selectedProduct.trim() === '') {
|
|
534
|
+
if (application.productId && typeof application.productId === 'object') {
|
|
535
|
+
selectedProduct = application.productId.selectedProduct;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
// Extract text before parentheses if selectedProduct has a value
|
|
539
|
+
if (selectedProduct && typeof selectedProduct === 'string' && selectedProduct.trim() !== '') {
|
|
540
|
+
// Extract text before opening parenthesis and trim whitespace
|
|
541
|
+
const match = selectedProduct.match(/^([^(]+)/);
|
|
542
|
+
if (match && match[1]) {
|
|
543
|
+
let productName = match[1].trim();
|
|
544
|
+
// Remove product type words like "Fixed", "Variable", "Tracker", etc.
|
|
545
|
+
// Split by common product type keywords and return only the first part
|
|
546
|
+
const productTypeKeywords = ['Fixed', 'Variable', 'Tracker', 'Discount', 'Capped'];
|
|
547
|
+
for (const keyword of productTypeKeywords) {
|
|
548
|
+
if (productName.includes(keyword)) {
|
|
549
|
+
productName = productName.split(keyword)[0].trim();
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
return productName;
|
|
554
|
+
}
|
|
555
|
+
// If no parentheses found, return the whole string trimmed
|
|
556
|
+
return selectedProduct.trim();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return null;
|
|
560
|
+
});
|
|
561
|
+
// Virtual property for initial rate percentage
|
|
562
|
+
welcomeCallSchema.virtual('initialRatePercentage').get(function () {
|
|
563
|
+
// Get product features from application
|
|
564
|
+
if (this.applicationId && typeof this.applicationId === 'object') {
|
|
565
|
+
const application = this.applicationId;
|
|
566
|
+
// Check if product features are available
|
|
567
|
+
if (application.productFeatures && typeof application.productFeatures === 'object') {
|
|
568
|
+
const productFeatures = application.productFeatures;
|
|
569
|
+
// Get initialRate value
|
|
570
|
+
if (productFeatures.initialRate !== undefined && productFeatures.initialRate !== null) {
|
|
571
|
+
const initialRate = productFeatures.initialRate;
|
|
572
|
+
// Convert to number
|
|
573
|
+
const rateValue = typeof initialRate === 'string' ? parseFloat(initialRate) : initialRate;
|
|
574
|
+
// Check if valid number
|
|
575
|
+
if (!isNaN(rateValue)) {
|
|
576
|
+
// If value is less than 1, it's likely stored as decimal (e.g., 0.0599)
|
|
577
|
+
// Multiply by 100 to get percentage
|
|
578
|
+
// If value is greater than or equal to 1, it's likely already in percentage form (e.g., 5.99)
|
|
579
|
+
// Divide by 100 as requested by user
|
|
580
|
+
const percentageValue = rateValue >= 1 ? rateValue / 100 : rateValue * 100;
|
|
581
|
+
// Format to 2 decimal places and add % sign
|
|
582
|
+
return `${percentageValue.toFixed(2)}%`;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return null;
|
|
588
|
+
});
|
|
589
|
+
// Virtual property for finance summary HTML
|
|
590
|
+
welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
|
|
591
|
+
let application = null;
|
|
592
|
+
if (this.applicantId && typeof this.applicantId === 'object' && !(typeof this.applicantId.toHexString === 'function') && this.applicantId.applicationId) {
|
|
593
|
+
application = this.applicantId.applicationId;
|
|
594
|
+
}
|
|
595
|
+
else if (this.applicationId && typeof this.applicationId === 'object') {
|
|
596
|
+
application = this.applicationId;
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
return '-';
|
|
600
|
+
}
|
|
601
|
+
if (application) {
|
|
602
|
+
// Initialize summary data
|
|
603
|
+
let product = '';
|
|
604
|
+
let financeTerm = '';
|
|
605
|
+
let monthlyRepayment = '';
|
|
606
|
+
let rentalIncome = '';
|
|
607
|
+
let occupancy = '';
|
|
608
|
+
// Get product information (first 3 characters)
|
|
609
|
+
if (application.selectedProduct && typeof application.selectedProduct === 'string') {
|
|
610
|
+
const extracted = application.selectedProduct.split('(')[0].trim();
|
|
611
|
+
product = `${extracted} product`;
|
|
612
|
+
}
|
|
613
|
+
else if (application.productId && typeof application.productId === 'object' && application.productId.selectedProduct) {
|
|
614
|
+
const extracted = application.productId.selectedProduct.split('(')[0].trim();
|
|
615
|
+
product = `${extracted} product`;
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
product = '-';
|
|
619
|
+
}
|
|
620
|
+
// Get finance term from productId if available
|
|
621
|
+
if (application.productId && typeof application.productId === 'object') {
|
|
622
|
+
if (application.productId.numberOfYearsToRepay !== undefined && application.productId.numberOfYearsToRepay !== null) {
|
|
623
|
+
financeTerm = `${application.productId.numberOfYearsToRepay} year finance term`;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
financeTerm = '-';
|
|
628
|
+
}
|
|
629
|
+
// Get rental income from mortgage - mortgageId is at application level
|
|
630
|
+
let mortgage = null;
|
|
631
|
+
if (application.mortgageId && typeof application.mortgageId === 'object') {
|
|
632
|
+
mortgage = application.mortgageId;
|
|
633
|
+
}
|
|
634
|
+
if (mortgage) {
|
|
635
|
+
// Helper function to format currency with commas
|
|
636
|
+
const formatCurrency = (value) => {
|
|
637
|
+
if (isNaN(value) || value === null || value === undefined) {
|
|
638
|
+
return '0.00';
|
|
639
|
+
}
|
|
640
|
+
return value.toLocaleString('en-GB', {
|
|
641
|
+
minimumFractionDigits: 2,
|
|
642
|
+
maximumFractionDigits: 2
|
|
643
|
+
});
|
|
644
|
+
};
|
|
645
|
+
// Get rental income - check if it exists (even if 0)
|
|
646
|
+
if (mortgage.monthlyRentalIncome !== undefined && mortgage.monthlyRentalIncome !== null) {
|
|
647
|
+
// Convert to number first, then format
|
|
648
|
+
const numericValue = Number(mortgage.monthlyRentalIncome);
|
|
649
|
+
const rentalValue = isNaN(numericValue) ? '0.00' : formatCurrency(numericValue);
|
|
650
|
+
rentalIncome = `£${rentalValue}`;
|
|
651
|
+
}
|
|
652
|
+
// Get monthly repayment amount from productFeatures collection
|
|
653
|
+
try {
|
|
654
|
+
const ApplicationProductFeatures = mongoose.model('ApplicationProductFeatures');
|
|
655
|
+
const productFeatures = await ApplicationProductFeatures.findOne({
|
|
656
|
+
applicationId: application
|
|
657
|
+
});
|
|
658
|
+
if (productFeatures && productFeatures.repayment !== undefined && productFeatures.repayment !== null) {
|
|
659
|
+
const numericValue = Number(productFeatures.repayment);
|
|
660
|
+
const repaymentValue = isNaN(numericValue) ? '0.00' : formatCurrency(numericValue);
|
|
661
|
+
monthlyRepayment = `£${repaymentValue}`;
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
monthlyRepayment = '-';
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
catch (error) {
|
|
668
|
+
console.log('Error fetching product features:', error);
|
|
669
|
+
monthlyRepayment = '-';
|
|
670
|
+
}
|
|
671
|
+
// Get occupancy information from mortgage
|
|
672
|
+
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids) && mortgage.proposedTenantsLids.length > 0) {
|
|
673
|
+
// Get the first proposed tenant type
|
|
674
|
+
const firstTenant = mortgage.proposedTenantsLids[0];
|
|
675
|
+
if (firstTenant && typeof firstTenant === 'object' && firstTenant.name) {
|
|
676
|
+
occupancy = firstTenant.name;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
else {
|
|
680
|
+
occupancy = '-';
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
// Check if lending type is BTL to show rental income and occupancy
|
|
684
|
+
const isBTL = application.lendingTypeLid &&
|
|
685
|
+
typeof application.lendingTypeLid === 'object' &&
|
|
686
|
+
application.lendingTypeLid.name === 'BTL';
|
|
687
|
+
const monthlyRepaymentClass = isBTL ? 'mb-2' : '';
|
|
688
|
+
// Create HTML content
|
|
689
|
+
let summaryContent = `
|
|
690
|
+
<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>
|
|
691
|
+
<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>
|
|
692
|
+
<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>`;
|
|
693
|
+
// Only show rental income and occupancy for BTL applications
|
|
694
|
+
if (isBTL) {
|
|
695
|
+
summaryContent += `
|
|
696
|
+
<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>
|
|
697
|
+
<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>`;
|
|
698
|
+
}
|
|
699
|
+
return summaryContent;
|
|
700
|
+
}
|
|
701
|
+
return '-';
|
|
702
|
+
});
|
|
703
|
+
applyAuditMiddleware(welcomeCallSchema, "ApplicantWelcomeCall");
|
|
704
|
+
// Apply workflow plugin to the schema
|
|
705
|
+
applyWorkflowPlugin(welcomeCallSchema, 'applicantwelcomecall');
|
|
706
|
+
// Index for query optimization
|
|
707
|
+
welcomeCallSchema.index({ applicantId: 1, isActive: 1 }); // Compound index for getWelcomeCallByApplicantId and softDeleteByApplicantId queries
|
|
708
|
+
const WelcomeCallModel = mongoose.model('ApplicantWelcomeCall', welcomeCallSchema);
|
|
709
|
+
export default WelcomeCallModel;
|