@dynamatix/gb-schemas 2.17.12 → 2.17.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applicants/applicant-additional-income.model.d.ts +378 -0
- package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-additional-income.model.js +35 -0
- 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-additional-income.type.js +1 -0
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts +545 -0
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-creditCard.model.js +40 -0
- package/dist/applicants/applicant-commitment-loan.model.d.ts +434 -0
- package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-loan.model.js +51 -0
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts +506 -0
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-mortgage.model.js +69 -0
- 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 +426 -0
- package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-secureLoan.model.js +43 -0
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +426 -0
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -0
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.js +43 -0
- package/dist/applicants/applicant-credit-data.model.d.ts +60 -0
- package/dist/applicants/applicant-credit-data.model.d.ts.map +1 -0
- package/dist/applicants/applicant-credit-data.model.js +11 -0
- package/dist/applicants/applicant-credit-profile.model.d.ts +51 -0
- package/dist/applicants/applicant-credit-profile.model.d.ts.map +1 -0
- package/dist/applicants/applicant-credit-profile.model.js +20 -0
- package/dist/applicants/applicant-credit-report.model.d.ts +3816 -0
- package/dist/applicants/applicant-credit-report.model.d.ts.map +1 -0
- package/dist/applicants/applicant-credit-report.model.js +126 -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 +86 -0
- package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -0
- package/dist/applicants/applicant-direct-debit.model.js +16 -0
- package/dist/applicants/applicant-employment-income.model.d.ts +206 -0
- package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-employment-income.model.js +20 -0
- 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 +828 -0
- package/dist/applicants/applicant-employment.model.d.ts.map +1 -0
- package/dist/applicants/applicant-employment.model.js +46 -0
- package/dist/applicants/applicant-expenditure.model.d.ts +127 -0
- package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -0
- package/dist/applicants/applicant-expenditure.model.js +146 -0
- 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 +82 -0
- package/dist/applicants/applicant-income-settings.model.d.ts.map +1 -0
- package/dist/applicants/applicant-income-settings.model.js +22 -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-summary.model.d.ts +2964 -0
- package/dist/applicants/applicant-income-summary.model.d.ts.map +1 -0
- package/dist/applicants/applicant-income-summary.model.js +59 -0
- package/dist/applicants/applicant-income-summary.type.d.ts +72 -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-large-exposure.model.d.ts +667 -0
- package/dist/applicants/applicant-large-exposure.model.d.ts.map +1 -0
- package/dist/applicants/applicant-large-exposure.model.js +16 -0
- package/dist/applicants/applicant-large-exposure.type.d.ts +39 -0
- package/dist/applicants/applicant-large-exposure.type.d.ts.map +1 -0
- package/dist/applicants/applicant-large-exposure.type.js +1 -0
- package/dist/applicants/applicant-pension-income.model.d.ts +494 -0
- package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-pension-income.model.js +35 -0
- 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 +953 -0
- package/dist/applicants/applicant-property-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-property-income.model.js +34 -0
- package/dist/applicants/applicant-property-income.type.d.ts +44 -0
- package/dist/applicants/applicant-property-income.type.d.ts.map +1 -0
- package/dist/applicants/applicant-property-income.type.js +1 -0
- package/dist/applicants/applicant-risk-narrative.model.d.ts +66 -0
- package/dist/applicants/applicant-risk-narrative.model.d.ts.map +1 -0
- package/dist/applicants/applicant-risk-narrative.model.js +13 -0
- package/dist/applicants/applicant-self-employed-income.model.d.ts +213 -0
- package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-self-employed-income.model.js +23 -0
- 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 +213 -0
- package/dist/applicants/applicant-sole-trader-income.model.d.ts.map +1 -0
- package/dist/applicants/applicant-sole-trader-income.model.js +21 -0
- 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 +500 -0
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -0
- package/dist/applicants/applicant-uk-tax-credits.model.js +21 -0
- 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 +1569 -0
- package/dist/applicants/applicant.model.d.ts.map +1 -0
- package/dist/applicants/applicant.model.js +262 -0
- package/dist/applicants/applicant.type.d.ts +161 -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 +37 -0
- package/dist/applicants/index.d.ts.map +1 -0
- package/dist/applicants/index.js +22 -0
- package/dist/applications/application-audit.model.d.ts +120 -0
- package/dist/applications/application-audit.model.d.ts.map +1 -0
- package/dist/applications/application-audit.model.js +45 -0
- package/dist/applications/application-checklist-Item.model.d.ts +292 -0
- package/dist/applications/application-checklist-Item.model.d.ts.map +1 -0
- package/dist/applications/application-checklist-Item.model.js +49 -0
- package/dist/applications/application-company-model.d.ts +1548 -0
- package/dist/applications/application-company-model.d.ts.map +1 -0
- package/dist/applications/application-company-model.js +134 -0
- package/dist/applications/application-credit-profile.model.d.ts +63 -0
- package/dist/applications/application-credit-profile.model.d.ts.map +1 -0
- package/dist/applications/application-credit-profile.model.js +12 -0
- package/dist/applications/application-direct-debit.model.d.ts +697 -0
- package/dist/applications/application-direct-debit.model.d.ts.map +1 -0
- package/dist/applications/application-direct-debit.model.js +173 -0
- 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 +196 -0
- package/dist/applications/application-euc.model.d.ts.map +1 -0
- package/dist/applications/application-euc.model.js +39 -0
- package/dist/applications/application-euc.type.d.ts +58 -0
- package/dist/applications/application-euc.type.d.ts.map +1 -0
- package/dist/applications/application-euc.type.js +1 -0
- package/dist/applications/application-fieldconfig.model.d.ts +58 -0
- package/dist/applications/application-fieldconfig.model.d.ts.map +1 -0
- package/dist/applications/application-fieldconfig.model.js +10 -0
- package/dist/applications/application-illustration-model.d.ts +52 -0
- package/dist/applications/application-illustration-model.d.ts.map +1 -0
- package/dist/applications/application-illustration-model.js +6 -0
- package/dist/applications/application-legal.model.d.ts +58 -0
- package/dist/applications/application-legal.model.d.ts.map +1 -0
- package/dist/applications/application-legal.model.js +10 -0
- package/dist/applications/application-mortgage.model.d.ts +307 -0
- package/dist/applications/application-mortgage.model.d.ts.map +1 -0
- package/dist/applications/application-mortgage.model.js +274 -0
- 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 +184 -0
- package/dist/applications/application-note.model.d.ts.map +1 -0
- package/dist/applications/application-note.model.js +105 -0
- 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 +196 -0
- package/dist/applications/application-offer.model.d.ts.map +1 -0
- package/dist/applications/application-offer.model.js +56 -0
- 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 +70 -0
- package/dist/applications/application-onboarding.model.d.ts.map +1 -0
- package/dist/applications/application-onboarding.model.js +12 -0
- package/dist/applications/application-product.model.d.ts +290 -0
- package/dist/applications/application-product.model.d.ts.map +1 -0
- package/dist/applications/application-product.model.js +90 -0
- 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 +772 -0
- package/dist/applications/application-productfeatures.model.d.ts.map +1 -0
- package/dist/applications/application-productfeatures.model.js +100 -0
- 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 +126 -0
- package/dist/applications/application-rationale.model.d.ts.map +1 -0
- package/dist/applications/application-rationale.model.js +23 -0
- 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 +100 -0
- package/dist/applications/application-risk-narrative.model.d.ts.map +1 -0
- package/dist/applications/application-risk-narrative.model.js +17 -0
- 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 +1358 -0
- package/dist/applications/application-valuation.model.d.ts.map +1 -0
- package/dist/applications/application-valuation.model.js +72 -0
- package/dist/applications/application-valuation.type.d.ts +55 -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 +642 -0
- package/dist/applications/application.model.d.ts.map +1 -0
- package/dist/applications/application.model.js +254 -0
- package/dist/applications/applications-task.model.d.ts +312 -0
- package/dist/applications/applications-task.model.d.ts.map +1 -0
- package/dist/applications/applications-task.model.js +58 -0
- package/dist/applications/applications-task.type.d.ts +59 -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 +162 -0
- package/dist/applications/broker.model.d.ts.map +1 -0
- package/dist/applications/broker.model.js +24 -0
- 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 +36 -0
- package/dist/applications/index.d.ts.map +1 -0
- package/dist/applications/index.js +23 -0
- package/dist/applications/solicitor.model.d.ts +206 -0
- package/dist/applications/solicitor.model.d.ts.map +1 -0
- package/dist/applications/solicitor.model.js +121 -0
- 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 +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/product-catalogues/index.d.ts +7 -0
- package/dist/product-catalogues/index.d.ts.map +1 -0
- package/dist/product-catalogues/index.js +3 -0
- package/dist/product-catalogues/product-catalogue.model.d.ts +132 -0
- package/dist/product-catalogues/product-catalogue.model.d.ts.map +1 -0
- package/dist/product-catalogues/product-catalogue.model.js +22 -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 +318 -0
- package/dist/product-catalogues/product-definitions.model.d.ts.map +1 -0
- package/dist/product-catalogues/product-definitions.model.js +29 -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 +96 -0
- package/dist/product-catalogues/product-variant.model.d.ts.map +1 -0
- package/dist/product-catalogues/product-variant.model.js +16 -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/index.d.ts +3 -0
- package/dist/properties/index.d.ts.map +1 -0
- package/dist/properties/index.js +2 -0
- package/dist/properties/property.model.d.ts +1174 -0
- package/dist/properties/property.model.d.ts.map +1 -0
- package/dist/properties/property.model.js +152 -0
- package/dist/properties/security.model.d.ts +331 -0
- package/dist/properties/security.model.d.ts.map +1 -0
- package/dist/properties/security.model.js +159 -0
- package/dist/shared/alert.model.d.ts +102 -0
- package/dist/shared/alert.model.d.ts.map +1 -0
- package/dist/shared/alert.model.js +24 -0
- 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 +114 -0
- package/dist/shared/apprivo-sync-journey.model.d.ts.map +1 -0
- package/dist/shared/apprivo-sync-journey.model.js +19 -0
- package/dist/shared/checklist.model.d.ts +102 -0
- package/dist/shared/checklist.model.d.ts.map +1 -0
- package/dist/shared/checklist.model.js +35 -0
- package/dist/shared/index.d.ts +19 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +16 -0
- package/dist/shared/job-run.model.d.ts +76 -0
- package/dist/shared/job-run.model.d.ts.map +1 -0
- package/dist/shared/job-run.model.js +14 -0
- package/dist/shared/job-setting.model.d.ts +70 -0
- package/dist/shared/job-setting.model.d.ts.map +1 -0
- package/dist/shared/job-setting.model.js +11 -0
- package/dist/shared/lookup-group.model.d.ts +78 -0
- package/dist/shared/lookup-group.model.d.ts.map +1 -0
- package/dist/shared/lookup-group.model.js +22 -0
- package/dist/shared/lookup.model.d.ts +96 -0
- package/dist/shared/lookup.model.d.ts.map +1 -0
- package/dist/shared/lookup.model.js +32 -0
- package/dist/shared/schema-doc.model.d.ts +76 -0
- package/dist/shared/schema-doc.model.d.ts.map +1 -0
- package/dist/shared/schema-doc.model.js +11 -0
- package/dist/shared/system-parameter.model.d.ts +88 -0
- package/dist/shared/system-parameter.model.d.ts.map +1 -0
- package/dist/shared/system-parameter.model.js +32 -0
- package/dist/shared/task-document.model.d.ts +70 -0
- package/dist/shared/task-document.model.d.ts.map +1 -0
- package/dist/shared/task-document.model.js +23 -0
- package/dist/shared/task.model.d.ts +234 -0
- package/dist/shared/task.model.d.ts.map +1 -0
- package/dist/shared/task.model.js +15 -0
- 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/index.d.ts +2 -0
- package/dist/underwriter/index.d.ts.map +1 -0
- package/dist/underwriter/index.js +1 -0
- package/dist/underwriter/underwriter.model.d.ts +126 -0
- package/dist/underwriter/underwriter.model.d.ts.map +1 -0
- package/dist/underwriter/underwriter.model.js +17 -0
- package/dist/users/auth-log.model.d.ts +70 -0
- package/dist/users/auth-log.model.d.ts.map +1 -0
- package/dist/users/auth-log.model.js +24 -0
- package/dist/users/index.d.ts +7 -0
- package/dist/users/index.d.ts.map +1 -0
- package/dist/users/index.js +6 -0
- package/dist/users/permission.model.d.ts +84 -0
- package/dist/users/permission.model.d.ts.map +1 -0
- package/dist/users/permission.model.js +12 -0
- package/dist/users/role-group.model.d.ts +90 -0
- package/dist/users/role-group.model.d.ts.map +1 -0
- package/dist/users/role-group.model.js +17 -0
- package/dist/users/role.model.d.ts +90 -0
- package/dist/users/role.model.d.ts.map +1 -0
- package/dist/users/role.model.js +16 -0
- package/dist/users/tasks.model.d.ts +114 -0
- package/dist/users/tasks.model.d.ts.map +1 -0
- package/dist/users/tasks.model.js +18 -0
- package/dist/users/user.model.d.ts +222 -0
- package/dist/users/user.model.d.ts.map +1 -0
- package/dist/users/user.model.js +41 -0
- 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 +43 -0
- package/dist/value-objects/pound.d.ts.map +1 -0
- package/dist/value-objects/pound.js +50 -0
- package/dist/value-objects/sort-code.d.ts +42 -0
- package/dist/value-objects/sort-code.d.ts.map +1 -0
- package/dist/value-objects/sort-code.js +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
|
|
3
|
+
import creditProfileSchema from "./application-credit-profile.model";
|
|
4
|
+
import { applyWorkflowPlugin } from "../shared/workflow.plugin";
|
|
5
|
+
const applicationSchema = new mongoose.Schema({
|
|
6
|
+
queueId: [{
|
|
7
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
8
|
+
ref: "Queue",
|
|
9
|
+
default: null,
|
|
10
|
+
}],
|
|
11
|
+
underwriterReviewDate: { type: Date, default: null },
|
|
12
|
+
assignedToUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User", default: null },
|
|
13
|
+
assignedToUserDate: { type: Date, default: null },
|
|
14
|
+
firstAssignedToUserDate: { type: Date, default: null },
|
|
15
|
+
slaClockStart: { type: Date, default: null },
|
|
16
|
+
slaClockStop: { type: Date, default: null },
|
|
17
|
+
affordabilityCompletedAt: { type: Date, default: null },
|
|
18
|
+
applicationId: { type: String, required: true },
|
|
19
|
+
isApplicationFeePaid: { type: String, required: true },
|
|
20
|
+
applicationNumber: { type: String, required: true },
|
|
21
|
+
applicationTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
22
|
+
bankSolicitor: { type: String, default: "" },
|
|
23
|
+
brokerId: { type: mongoose.Schema.Types.ObjectId, ref: "Broker", default: null },
|
|
24
|
+
caseManager: { type: String, default: "" },
|
|
25
|
+
caseManagerAccepted: { type: String, default: false },
|
|
26
|
+
completedReason: { type: String, default: "" },
|
|
27
|
+
isIntendToOccupy: { type: String, required: true },
|
|
28
|
+
introducer: { type: String, default: "" },
|
|
29
|
+
isIntroducerSubmission: { type: String, required: true },
|
|
30
|
+
isBrokerAssigned: { type: String, default: false },
|
|
31
|
+
isFinanceRecommendedToApplicant: { type: String, required: true },
|
|
32
|
+
isWorkflowTaskCreated: { type: String, required: true },
|
|
33
|
+
lastUpdated: { type: String },
|
|
34
|
+
lendingTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
35
|
+
networkClubName: { type: String, default: "" },
|
|
36
|
+
isNetworkClubSubmission: { type: String, required: true },
|
|
37
|
+
newReason: { type: String, default: "" },
|
|
38
|
+
purchaseTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
39
|
+
rejectedReason: { type: String, default: "" },
|
|
40
|
+
repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
41
|
+
selectedProduct: { type: String, required: false },
|
|
42
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
43
|
+
submitReason: { type: String, default: "" },
|
|
44
|
+
submittedDate: { type: String },
|
|
45
|
+
underwriter: { type: String, default: "" },
|
|
46
|
+
isValuationFeePaid: { type: String, required: true },
|
|
47
|
+
withdrawalReasonLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
48
|
+
declineReasonLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
49
|
+
isPortfolioConfirmed: { type: Boolean, default: false },
|
|
50
|
+
productId: { type: mongoose.Schema.Types.ObjectId, ref: "Product", default: null },
|
|
51
|
+
product: { type: String },
|
|
52
|
+
securityId: { type: mongoose.Schema.Types.ObjectId, ref: "Security", default: null },
|
|
53
|
+
solicitorId: { type: mongoose.Schema.Types.ObjectId, ref: "Solicitor", default: null },
|
|
54
|
+
riskNarrativeId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationRiskNarrative", default: null },
|
|
55
|
+
riskNarrative: {
|
|
56
|
+
call1RequestedOn: { type: String, default: null },
|
|
57
|
+
call2RequestedOn: { type: String, default: null },
|
|
58
|
+
retryCount: { type: String, default: null },
|
|
59
|
+
riskRating: { type: String, default: null },
|
|
60
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
61
|
+
call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
62
|
+
},
|
|
63
|
+
// Flag for a requested RiskNarrative Call 2. Owned by Catura and never mapped from Apprivo.
|
|
64
|
+
// Deliberately top-level, not inside `riskNarrative`: the background sync replaces that whole
|
|
65
|
+
// sub-document, which would wipe anything stored within it.
|
|
66
|
+
// null = never requested, false = awaiting a final Call2Status, true = final status received.
|
|
67
|
+
// The default MUST stay null: the fetch-risk-narrative job queries for an explicit false, and
|
|
68
|
+
// defaulting to false would mark every existing application as awaiting and sync them all.
|
|
69
|
+
isRiskNarrativeSynced: { type: Boolean, default: null },
|
|
70
|
+
applicants: [
|
|
71
|
+
{ type: mongoose.Schema.Types.ObjectId, ref: "Applicant", default: null }
|
|
72
|
+
],
|
|
73
|
+
isActive: { type: String, default: false },
|
|
74
|
+
riskRating: { type: String },
|
|
75
|
+
directDebitId: { type: mongoose.Schema.Types.ObjectId, ref: "Application_DirectDebit", default: null },
|
|
76
|
+
creditProfile: creditProfileSchema,
|
|
77
|
+
mortgageId: { type: mongoose.Schema.Types.ObjectId, ref: "Mortgage", default: null },
|
|
78
|
+
companyId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationCompany", default: null },
|
|
79
|
+
offerId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationOffer", default: null },
|
|
80
|
+
newAuditRecordsCount: { type: Number, default: 0 }, // Ensure it is a Number
|
|
81
|
+
currentApprivoAuditId: Number,
|
|
82
|
+
propertyIds: [{ type: mongoose.Schema.Types.ObjectId, ref: "Property" }],
|
|
83
|
+
valuationId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationValuation" },
|
|
84
|
+
valuationReportId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationValuationReport" },
|
|
85
|
+
isMandateRequested: { type: Boolean, default: false },
|
|
86
|
+
isMandateApproved: { type: Boolean, default: null },
|
|
87
|
+
mandateReviewComments: { type: String, default: "" },
|
|
88
|
+
mandateRequestedByUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User", default: null },
|
|
89
|
+
mandateRequestedDate: { type: Date, default: null },
|
|
90
|
+
mandateReviewedByUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User", default: null },
|
|
91
|
+
mandateReviewedDate: { type: Date, default: null },
|
|
92
|
+
isReferred: { type: Boolean, default: false },
|
|
93
|
+
referredByUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User", default: null },
|
|
94
|
+
referredDate: { type: Date, default: null },
|
|
95
|
+
referralClearedByUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User", default: null },
|
|
96
|
+
referralClearedDate: { type: Date, default: null },
|
|
97
|
+
brokerTaskCount: {
|
|
98
|
+
type: Number,
|
|
99
|
+
default: 0
|
|
100
|
+
},
|
|
101
|
+
lenderTaskCount: {
|
|
102
|
+
type: Number,
|
|
103
|
+
default: 0
|
|
104
|
+
},
|
|
105
|
+
pendingTaskCountForUser: {
|
|
106
|
+
type: Number,
|
|
107
|
+
default: 0
|
|
108
|
+
},
|
|
109
|
+
applicationFormSignedDate: {
|
|
110
|
+
type: Date, // Stores as ISODate in MongoDB (e.g., "2023-11-15T12:30:45.123Z")
|
|
111
|
+
default: null
|
|
112
|
+
},
|
|
113
|
+
isUkResident: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false
|
|
116
|
+
},
|
|
117
|
+
creditReportId: { type: String, default: null },
|
|
118
|
+
isAlgbraEligible: { type: Boolean, default: false },
|
|
119
|
+
}, {
|
|
120
|
+
timestamps: true,
|
|
121
|
+
toJSON: { virtuals: true },
|
|
122
|
+
toObject: { virtuals: true }
|
|
123
|
+
});
|
|
124
|
+
applyAuditMiddleware(applicationSchema, "Application");
|
|
125
|
+
// Apply workflow plugin to the schema
|
|
126
|
+
applyWorkflowPlugin(applicationSchema, 'application');
|
|
127
|
+
// Virtual property 'noOfApplicants'
|
|
128
|
+
applicationSchema.virtual('noOfApplicants').get(function () {
|
|
129
|
+
return this.applicants ? this.applicants.length : 0;
|
|
130
|
+
});
|
|
131
|
+
// Virtual property 'applicationTypeName'
|
|
132
|
+
applicationSchema.virtual('applicationTypeName').get(function () {
|
|
133
|
+
return this.applicationTypeLid instanceof mongoose.Types.ObjectId
|
|
134
|
+
? null
|
|
135
|
+
: this.applicationTypeLid?.name ?? null;
|
|
136
|
+
});
|
|
137
|
+
// Virtual property 'lendingType'
|
|
138
|
+
applicationSchema.virtual('lendingType').get(function () {
|
|
139
|
+
return this.lendingTypeLid instanceof mongoose.Types.ObjectId
|
|
140
|
+
? null
|
|
141
|
+
: this.lendingTypeLid?.name ?? null;
|
|
142
|
+
});
|
|
143
|
+
// Virtual property 'purchaseType'
|
|
144
|
+
applicationSchema.virtual('purchaseType').get(function () {
|
|
145
|
+
return this.purchaseTypeLid instanceof mongoose.Types.ObjectId
|
|
146
|
+
? null
|
|
147
|
+
: this.purchaseTypeLid?.text ?? null;
|
|
148
|
+
});
|
|
149
|
+
// Virtual property 'status'
|
|
150
|
+
applicationSchema.virtual('status').get(function () {
|
|
151
|
+
return this.statusLid instanceof mongoose.Types.ObjectId ? null : this.statusLid?.name ?? null;
|
|
152
|
+
});
|
|
153
|
+
// Ensure the fields are populated when querying
|
|
154
|
+
applicationSchema.pre('find', function () {
|
|
155
|
+
this.populate('applicationTypeLid').populate('lendingTypeLid').populate('statusLid');
|
|
156
|
+
});
|
|
157
|
+
applicationSchema.pre('findOne', function () {
|
|
158
|
+
this.populate('applicationTypeLid').populate('lendingTypeLid').populate('statusLid');
|
|
159
|
+
});
|
|
160
|
+
// Virtual property 'LTV %'
|
|
161
|
+
applicationSchema.virtual('ltv').get(function () {
|
|
162
|
+
const purchasePrice = this.mortgageId?.purchasePrice;
|
|
163
|
+
const loanRequired = this.mortgageId?.loanRequired;
|
|
164
|
+
if (purchasePrice && loanRequired) {
|
|
165
|
+
const parseCurrency = (value) => {
|
|
166
|
+
if (typeof value === 'string') {
|
|
167
|
+
return parseFloat(value.replace(/[^0-9.-]+/g, ""));
|
|
168
|
+
}
|
|
169
|
+
return value;
|
|
170
|
+
};
|
|
171
|
+
const parsedPurchasePrice = parseCurrency(purchasePrice);
|
|
172
|
+
const parsedLoanRequired = parseCurrency(loanRequired);
|
|
173
|
+
const ltv = (parsedLoanRequired / parsedPurchasePrice) * 100;
|
|
174
|
+
return ltv.toFixed(2) + "%";
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
});
|
|
178
|
+
applicationSchema.virtual('submittedDateFormatted').get(function () {
|
|
179
|
+
if (!this.submittedDate)
|
|
180
|
+
return null;
|
|
181
|
+
const date = new Date(this.submittedDate);
|
|
182
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
183
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
184
|
+
const year = date.getFullYear();
|
|
185
|
+
return `${day}-${month}-${year}`;
|
|
186
|
+
});
|
|
187
|
+
// Virtual property for broker name
|
|
188
|
+
applicationSchema.virtual('brokerName').get(function () {
|
|
189
|
+
if (this.brokerId && typeof this.brokerId === 'object' && this.brokerId.firstName && this.brokerId.lastName) {
|
|
190
|
+
return this.brokerId.firstName + " " + this.brokerId.lastName;
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
193
|
+
});
|
|
194
|
+
applicationSchema.virtual('brokerEmail').get(function () {
|
|
195
|
+
return this.brokerId && typeof this.brokerId === 'object' ? this.brokerId.email : null;
|
|
196
|
+
});
|
|
197
|
+
applicationSchema.virtual('solicitorName').get(function () {
|
|
198
|
+
return this.solicitorId && typeof this.solicitorId === 'object' ? this.solicitorId.nameOfAccountHolder : null;
|
|
199
|
+
});
|
|
200
|
+
applicationSchema.virtual('solicitorEmail').get(function () {
|
|
201
|
+
return this.solicitorId && typeof this.solicitorId === 'object' ? this.solicitorId.email : null;
|
|
202
|
+
});
|
|
203
|
+
applicationSchema.virtual('brokerPhone').get(function () {
|
|
204
|
+
return this.brokerId && typeof this.brokerId === 'object' ? this.brokerId.mobileTelephone : null;
|
|
205
|
+
});
|
|
206
|
+
applicationSchema.virtual('solicitorPhone').get(function () {
|
|
207
|
+
return this.solicitorId && typeof this.solicitorId === 'object' ? this.solicitorId.telephone : null;
|
|
208
|
+
});
|
|
209
|
+
// Virtual property 'pendingDays'
|
|
210
|
+
applicationSchema.virtual('pendingDays').get(function () {
|
|
211
|
+
if (!this.applicationFormSignedDate)
|
|
212
|
+
return null;
|
|
213
|
+
// Get current date at midnight (ignoring time)
|
|
214
|
+
const now = new Date();
|
|
215
|
+
const todayMidnight = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
216
|
+
// Get signed date at midnight (ignoring time)
|
|
217
|
+
const signedDate = new Date(this.applicationFormSignedDate);
|
|
218
|
+
const signedMidnight = new Date(signedDate.getFullYear(), signedDate.getMonth(), signedDate.getDate());
|
|
219
|
+
// Calculate difference in just date
|
|
220
|
+
const diffTime = todayMidnight.getTime() - signedMidnight.getTime();
|
|
221
|
+
// Convert to days
|
|
222
|
+
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
|
223
|
+
return diffDays;
|
|
224
|
+
});
|
|
225
|
+
// Virtual property 'taskCompletionPercent'
|
|
226
|
+
applicationSchema.virtual('taskCompletionPercent').get(function () {
|
|
227
|
+
const broker = typeof this.brokerTaskCount === 'number' ? this.brokerTaskCount : 0;
|
|
228
|
+
const lender = typeof this.lenderTaskCount === 'number' ? this.lenderTaskCount : 0;
|
|
229
|
+
const total = broker + lender;
|
|
230
|
+
// If both broker and lender are 0, return 100.00
|
|
231
|
+
if (broker === 0 && lender === 0)
|
|
232
|
+
return 100.00;
|
|
233
|
+
// If broker is 0 and lender is not, return 100.00
|
|
234
|
+
if (broker === 0 && lender > 0)
|
|
235
|
+
return 100.00;
|
|
236
|
+
// If lender is 0 and broker is not, return 0.00
|
|
237
|
+
if (lender === 0 && broker > 0)
|
|
238
|
+
return 0.00;
|
|
239
|
+
// Calculate (lender/total)*100
|
|
240
|
+
return Number(((lender / total) * 100).toFixed(2));
|
|
241
|
+
});
|
|
242
|
+
// Database indexes for performance optimization
|
|
243
|
+
// Single field indexes
|
|
244
|
+
applicationSchema.index({ applicationId: 1 });
|
|
245
|
+
applicationSchema.index({ assignedToUserId: 1 });
|
|
246
|
+
applicationSchema.index({ brokerId: 1 });
|
|
247
|
+
applicationSchema.index({ applicants: 1 }); // For array membership queries
|
|
248
|
+
// Compound indexes for common query combinations
|
|
249
|
+
applicationSchema.index({ applicants: 1, _id: 1 }); // For finding application by applicant
|
|
250
|
+
applicationSchema.index({ assignedToUserId: 1, statusLid: 1 }); // For filtering by assignee and status
|
|
251
|
+
// Text index for search functionality
|
|
252
|
+
applicationSchema.index({ applicationNumber: "text" });
|
|
253
|
+
const ApplicationModel = mongoose.model("Application", applicationSchema);
|
|
254
|
+
export default ApplicationModel;
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/// <reference path="../value-objects/pound.d.ts" />
|
|
2
|
+
/// <reference path="../value-objects/account-number.d.ts" />
|
|
3
|
+
/// <reference path="../value-objects/sort-code.d.ts" />
|
|
4
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
5
|
+
/// <reference types="mongoose/types/callback" />
|
|
6
|
+
/// <reference types="mongoose/types/collection" />
|
|
7
|
+
/// <reference types="mongoose/types/connection" />
|
|
8
|
+
/// <reference types="mongoose/types/cursor" />
|
|
9
|
+
/// <reference types="mongoose/types/document" />
|
|
10
|
+
/// <reference types="mongoose/types/error" />
|
|
11
|
+
/// <reference types="mongoose/types/expressions" />
|
|
12
|
+
/// <reference types="mongoose/types/helpers" />
|
|
13
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
14
|
+
/// <reference types="mongoose/types/indexes" />
|
|
15
|
+
/// <reference types="mongoose/types/models" />
|
|
16
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
17
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
18
|
+
/// <reference types="mongoose/types/populate" />
|
|
19
|
+
/// <reference types="mongoose/types/query" />
|
|
20
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
21
|
+
/// <reference types="mongoose/types/session" />
|
|
22
|
+
/// <reference types="mongoose/types/types" />
|
|
23
|
+
/// <reference types="mongoose/types/utility" />
|
|
24
|
+
/// <reference types="mongoose/types/validation" />
|
|
25
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
26
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
27
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
28
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
29
|
+
import mongoose from "mongoose";
|
|
30
|
+
declare const ApplicationsTaskModel: mongoose.Model<{
|
|
31
|
+
createdAt: NativeDate;
|
|
32
|
+
updatedAt: NativeDate;
|
|
33
|
+
} & {
|
|
34
|
+
applicationId: mongoose.Types.ObjectId;
|
|
35
|
+
createdOn: string;
|
|
36
|
+
additionalData: {
|
|
37
|
+
concernTypeLid: mongoose.Types.ObjectId;
|
|
38
|
+
concernComments: string;
|
|
39
|
+
resolvedComments: string;
|
|
40
|
+
rejectionReason: string;
|
|
41
|
+
rejectionDate: string;
|
|
42
|
+
responderRemarks: string;
|
|
43
|
+
requesterAttachmentId: string;
|
|
44
|
+
responderAttachmentId: string;
|
|
45
|
+
requesterFileName: string;
|
|
46
|
+
responderFileName: string;
|
|
47
|
+
respondedDate: string;
|
|
48
|
+
description?: string | null | undefined;
|
|
49
|
+
statusLid?: mongoose.Types.ObjectId | null | undefined;
|
|
50
|
+
requesterId?: mongoose.Types.ObjectId | null | undefined;
|
|
51
|
+
responderId?: mongoose.Types.ObjectId | null | undefined;
|
|
52
|
+
taskType?: "internal" | "broker" | null | undefined;
|
|
53
|
+
acceptedDate?: string | null | undefined;
|
|
54
|
+
acceptedById?: mongoose.Types.ObjectId | null | undefined;
|
|
55
|
+
rejectedById?: mongoose.Types.ObjectId | null | undefined;
|
|
56
|
+
};
|
|
57
|
+
statusDate: string;
|
|
58
|
+
statusReason: string;
|
|
59
|
+
comments: mongoose.Types.DocumentArray<{
|
|
60
|
+
createdAt: NativeDate;
|
|
61
|
+
message: string;
|
|
62
|
+
createdBy: mongoose.Types.ObjectId;
|
|
63
|
+
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
|
|
64
|
+
createdAt: NativeDate;
|
|
65
|
+
message: string;
|
|
66
|
+
createdBy: mongoose.Types.ObjectId;
|
|
67
|
+
}> & {
|
|
68
|
+
createdAt: NativeDate;
|
|
69
|
+
message: string;
|
|
70
|
+
createdBy: mongoose.Types.ObjectId;
|
|
71
|
+
}>;
|
|
72
|
+
status?: number | null | undefined;
|
|
73
|
+
checkflowId?: string | null | undefined;
|
|
74
|
+
instanceId?: string | null | undefined;
|
|
75
|
+
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
76
|
+
createdAt: NativeDate;
|
|
77
|
+
updatedAt: NativeDate;
|
|
78
|
+
} & {
|
|
79
|
+
applicationId: mongoose.Types.ObjectId;
|
|
80
|
+
createdOn: string;
|
|
81
|
+
additionalData: {
|
|
82
|
+
concernTypeLid: mongoose.Types.ObjectId;
|
|
83
|
+
concernComments: string;
|
|
84
|
+
resolvedComments: string;
|
|
85
|
+
rejectionReason: string;
|
|
86
|
+
rejectionDate: string;
|
|
87
|
+
responderRemarks: string;
|
|
88
|
+
requesterAttachmentId: string;
|
|
89
|
+
responderAttachmentId: string;
|
|
90
|
+
requesterFileName: string;
|
|
91
|
+
responderFileName: string;
|
|
92
|
+
respondedDate: string;
|
|
93
|
+
description?: string | null | undefined;
|
|
94
|
+
statusLid?: mongoose.Types.ObjectId | null | undefined;
|
|
95
|
+
requesterId?: mongoose.Types.ObjectId | null | undefined;
|
|
96
|
+
responderId?: mongoose.Types.ObjectId | null | undefined;
|
|
97
|
+
taskType?: "internal" | "broker" | null | undefined;
|
|
98
|
+
acceptedDate?: string | null | undefined;
|
|
99
|
+
acceptedById?: mongoose.Types.ObjectId | null | undefined;
|
|
100
|
+
rejectedById?: mongoose.Types.ObjectId | null | undefined;
|
|
101
|
+
};
|
|
102
|
+
statusDate: string;
|
|
103
|
+
statusReason: string;
|
|
104
|
+
comments: mongoose.Types.DocumentArray<{
|
|
105
|
+
createdAt: NativeDate;
|
|
106
|
+
message: string;
|
|
107
|
+
createdBy: mongoose.Types.ObjectId;
|
|
108
|
+
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
|
|
109
|
+
createdAt: NativeDate;
|
|
110
|
+
message: string;
|
|
111
|
+
createdBy: mongoose.Types.ObjectId;
|
|
112
|
+
}> & {
|
|
113
|
+
createdAt: NativeDate;
|
|
114
|
+
message: string;
|
|
115
|
+
createdBy: mongoose.Types.ObjectId;
|
|
116
|
+
}>;
|
|
117
|
+
status?: number | null | undefined;
|
|
118
|
+
checkflowId?: string | null | undefined;
|
|
119
|
+
instanceId?: string | null | undefined;
|
|
120
|
+
}, {}> & {
|
|
121
|
+
createdAt: NativeDate;
|
|
122
|
+
updatedAt: NativeDate;
|
|
123
|
+
} & {
|
|
124
|
+
applicationId: mongoose.Types.ObjectId;
|
|
125
|
+
createdOn: string;
|
|
126
|
+
additionalData: {
|
|
127
|
+
concernTypeLid: mongoose.Types.ObjectId;
|
|
128
|
+
concernComments: string;
|
|
129
|
+
resolvedComments: string;
|
|
130
|
+
rejectionReason: string;
|
|
131
|
+
rejectionDate: string;
|
|
132
|
+
responderRemarks: string;
|
|
133
|
+
requesterAttachmentId: string;
|
|
134
|
+
responderAttachmentId: string;
|
|
135
|
+
requesterFileName: string;
|
|
136
|
+
responderFileName: string;
|
|
137
|
+
respondedDate: string;
|
|
138
|
+
description?: string | null | undefined;
|
|
139
|
+
statusLid?: mongoose.Types.ObjectId | null | undefined;
|
|
140
|
+
requesterId?: mongoose.Types.ObjectId | null | undefined;
|
|
141
|
+
responderId?: mongoose.Types.ObjectId | null | undefined;
|
|
142
|
+
taskType?: "internal" | "broker" | null | undefined;
|
|
143
|
+
acceptedDate?: string | null | undefined;
|
|
144
|
+
acceptedById?: mongoose.Types.ObjectId | null | undefined;
|
|
145
|
+
rejectedById?: mongoose.Types.ObjectId | null | undefined;
|
|
146
|
+
};
|
|
147
|
+
statusDate: string;
|
|
148
|
+
statusReason: string;
|
|
149
|
+
comments: mongoose.Types.DocumentArray<{
|
|
150
|
+
createdAt: NativeDate;
|
|
151
|
+
message: string;
|
|
152
|
+
createdBy: mongoose.Types.ObjectId;
|
|
153
|
+
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
|
|
154
|
+
createdAt: NativeDate;
|
|
155
|
+
message: string;
|
|
156
|
+
createdBy: mongoose.Types.ObjectId;
|
|
157
|
+
}> & {
|
|
158
|
+
createdAt: NativeDate;
|
|
159
|
+
message: string;
|
|
160
|
+
createdBy: mongoose.Types.ObjectId;
|
|
161
|
+
}>;
|
|
162
|
+
status?: number | null | undefined;
|
|
163
|
+
checkflowId?: string | null | undefined;
|
|
164
|
+
instanceId?: string | null | undefined;
|
|
165
|
+
} & {
|
|
166
|
+
_id: mongoose.Types.ObjectId;
|
|
167
|
+
} & {
|
|
168
|
+
__v: number;
|
|
169
|
+
}, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
170
|
+
timestamps: true;
|
|
171
|
+
}, {
|
|
172
|
+
createdAt: NativeDate;
|
|
173
|
+
updatedAt: NativeDate;
|
|
174
|
+
} & {
|
|
175
|
+
applicationId: mongoose.Types.ObjectId;
|
|
176
|
+
createdOn: string;
|
|
177
|
+
additionalData: {
|
|
178
|
+
concernTypeLid: mongoose.Types.ObjectId;
|
|
179
|
+
concernComments: string;
|
|
180
|
+
resolvedComments: string;
|
|
181
|
+
rejectionReason: string;
|
|
182
|
+
rejectionDate: string;
|
|
183
|
+
responderRemarks: string;
|
|
184
|
+
requesterAttachmentId: string;
|
|
185
|
+
responderAttachmentId: string;
|
|
186
|
+
requesterFileName: string;
|
|
187
|
+
responderFileName: string;
|
|
188
|
+
respondedDate: string;
|
|
189
|
+
description?: string | null | undefined;
|
|
190
|
+
statusLid?: mongoose.Types.ObjectId | null | undefined;
|
|
191
|
+
requesterId?: mongoose.Types.ObjectId | null | undefined;
|
|
192
|
+
responderId?: mongoose.Types.ObjectId | null | undefined;
|
|
193
|
+
taskType?: "internal" | "broker" | null | undefined;
|
|
194
|
+
acceptedDate?: string | null | undefined;
|
|
195
|
+
acceptedById?: mongoose.Types.ObjectId | null | undefined;
|
|
196
|
+
rejectedById?: mongoose.Types.ObjectId | null | undefined;
|
|
197
|
+
};
|
|
198
|
+
statusDate: string;
|
|
199
|
+
statusReason: string;
|
|
200
|
+
comments: mongoose.Types.DocumentArray<{
|
|
201
|
+
createdAt: NativeDate;
|
|
202
|
+
message: string;
|
|
203
|
+
createdBy: mongoose.Types.ObjectId;
|
|
204
|
+
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
|
|
205
|
+
createdAt: NativeDate;
|
|
206
|
+
message: string;
|
|
207
|
+
createdBy: mongoose.Types.ObjectId;
|
|
208
|
+
}> & {
|
|
209
|
+
createdAt: NativeDate;
|
|
210
|
+
message: string;
|
|
211
|
+
createdBy: mongoose.Types.ObjectId;
|
|
212
|
+
}>;
|
|
213
|
+
status?: number | null | undefined;
|
|
214
|
+
checkflowId?: string | null | undefined;
|
|
215
|
+
instanceId?: string | null | undefined;
|
|
216
|
+
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
217
|
+
createdAt: NativeDate;
|
|
218
|
+
updatedAt: NativeDate;
|
|
219
|
+
} & {
|
|
220
|
+
applicationId: mongoose.Types.ObjectId;
|
|
221
|
+
createdOn: string;
|
|
222
|
+
additionalData: {
|
|
223
|
+
concernTypeLid: mongoose.Types.ObjectId;
|
|
224
|
+
concernComments: string;
|
|
225
|
+
resolvedComments: string;
|
|
226
|
+
rejectionReason: string;
|
|
227
|
+
rejectionDate: string;
|
|
228
|
+
responderRemarks: string;
|
|
229
|
+
requesterAttachmentId: string;
|
|
230
|
+
responderAttachmentId: string;
|
|
231
|
+
requesterFileName: string;
|
|
232
|
+
responderFileName: string;
|
|
233
|
+
respondedDate: string;
|
|
234
|
+
description?: string | null | undefined;
|
|
235
|
+
statusLid?: mongoose.Types.ObjectId | null | undefined;
|
|
236
|
+
requesterId?: mongoose.Types.ObjectId | null | undefined;
|
|
237
|
+
responderId?: mongoose.Types.ObjectId | null | undefined;
|
|
238
|
+
taskType?: "internal" | "broker" | null | undefined;
|
|
239
|
+
acceptedDate?: string | null | undefined;
|
|
240
|
+
acceptedById?: mongoose.Types.ObjectId | null | undefined;
|
|
241
|
+
rejectedById?: mongoose.Types.ObjectId | null | undefined;
|
|
242
|
+
};
|
|
243
|
+
statusDate: string;
|
|
244
|
+
statusReason: string;
|
|
245
|
+
comments: mongoose.Types.DocumentArray<{
|
|
246
|
+
createdAt: NativeDate;
|
|
247
|
+
message: string;
|
|
248
|
+
createdBy: mongoose.Types.ObjectId;
|
|
249
|
+
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
|
|
250
|
+
createdAt: NativeDate;
|
|
251
|
+
message: string;
|
|
252
|
+
createdBy: mongoose.Types.ObjectId;
|
|
253
|
+
}> & {
|
|
254
|
+
createdAt: NativeDate;
|
|
255
|
+
message: string;
|
|
256
|
+
createdBy: mongoose.Types.ObjectId;
|
|
257
|
+
}>;
|
|
258
|
+
status?: number | null | undefined;
|
|
259
|
+
checkflowId?: string | null | undefined;
|
|
260
|
+
instanceId?: string | null | undefined;
|
|
261
|
+
}>, {}> & mongoose.FlatRecord<{
|
|
262
|
+
createdAt: NativeDate;
|
|
263
|
+
updatedAt: NativeDate;
|
|
264
|
+
} & {
|
|
265
|
+
applicationId: mongoose.Types.ObjectId;
|
|
266
|
+
createdOn: string;
|
|
267
|
+
additionalData: {
|
|
268
|
+
concernTypeLid: mongoose.Types.ObjectId;
|
|
269
|
+
concernComments: string;
|
|
270
|
+
resolvedComments: string;
|
|
271
|
+
rejectionReason: string;
|
|
272
|
+
rejectionDate: string;
|
|
273
|
+
responderRemarks: string;
|
|
274
|
+
requesterAttachmentId: string;
|
|
275
|
+
responderAttachmentId: string;
|
|
276
|
+
requesterFileName: string;
|
|
277
|
+
responderFileName: string;
|
|
278
|
+
respondedDate: string;
|
|
279
|
+
description?: string | null | undefined;
|
|
280
|
+
statusLid?: mongoose.Types.ObjectId | null | undefined;
|
|
281
|
+
requesterId?: mongoose.Types.ObjectId | null | undefined;
|
|
282
|
+
responderId?: mongoose.Types.ObjectId | null | undefined;
|
|
283
|
+
taskType?: "internal" | "broker" | null | undefined;
|
|
284
|
+
acceptedDate?: string | null | undefined;
|
|
285
|
+
acceptedById?: mongoose.Types.ObjectId | null | undefined;
|
|
286
|
+
rejectedById?: mongoose.Types.ObjectId | null | undefined;
|
|
287
|
+
};
|
|
288
|
+
statusDate: string;
|
|
289
|
+
statusReason: string;
|
|
290
|
+
comments: mongoose.Types.DocumentArray<{
|
|
291
|
+
createdAt: NativeDate;
|
|
292
|
+
message: string;
|
|
293
|
+
createdBy: mongoose.Types.ObjectId;
|
|
294
|
+
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
|
|
295
|
+
createdAt: NativeDate;
|
|
296
|
+
message: string;
|
|
297
|
+
createdBy: mongoose.Types.ObjectId;
|
|
298
|
+
}> & {
|
|
299
|
+
createdAt: NativeDate;
|
|
300
|
+
message: string;
|
|
301
|
+
createdBy: mongoose.Types.ObjectId;
|
|
302
|
+
}>;
|
|
303
|
+
status?: number | null | undefined;
|
|
304
|
+
checkflowId?: string | null | undefined;
|
|
305
|
+
instanceId?: string | null | undefined;
|
|
306
|
+
}> & {
|
|
307
|
+
_id: mongoose.Types.ObjectId;
|
|
308
|
+
} & {
|
|
309
|
+
__v: number;
|
|
310
|
+
}>>;
|
|
311
|
+
export default ApplicationsTaskModel;
|
|
312
|
+
//# sourceMappingURL=applications-task.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applications-task.model.d.ts","sourceRoot":"","sources":["../../applications/applications-task.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAiEhC,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6D,CAAC;AACzF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
|
|
2
|
+
import { applyWorkflowPlugin } from "../shared/workflow.plugin";
|
|
3
|
+
import mongoose from "mongoose";
|
|
4
|
+
// Additional Data schema for the nested object
|
|
5
|
+
const additionalDataSchema = new mongoose.Schema({
|
|
6
|
+
requesterId: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: false },
|
|
7
|
+
responderId: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: false },
|
|
8
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: false },
|
|
9
|
+
concernTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
10
|
+
description: { type: String },
|
|
11
|
+
concernComments: { type: String, required: true },
|
|
12
|
+
resolvedComments: { type: String, default: "" },
|
|
13
|
+
taskType: {
|
|
14
|
+
type: String,
|
|
15
|
+
enum: ["internal", "broker"], // allowed values
|
|
16
|
+
required: false
|
|
17
|
+
},
|
|
18
|
+
acceptedDate: { type: String },
|
|
19
|
+
acceptedById: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: false },
|
|
20
|
+
rejectedById: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: false },
|
|
21
|
+
rejectionReason: { type: String, default: null },
|
|
22
|
+
rejectionDate: { type: String, default: null },
|
|
23
|
+
responderRemarks: { type: String, default: "" },
|
|
24
|
+
requesterAttachmentId: { type: String, default: null },
|
|
25
|
+
responderAttachmentId: { type: String, default: null },
|
|
26
|
+
requesterFileName: { type: String, default: null },
|
|
27
|
+
responderFileName: { type: String, default: null },
|
|
28
|
+
respondedDate: { type: String, default: null }
|
|
29
|
+
}, { _id: false });
|
|
30
|
+
const applicationsTaskSchema = new mongoose.Schema({
|
|
31
|
+
checkflowId: { type: String, required: false },
|
|
32
|
+
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
|
|
33
|
+
instanceId: { type: String, required: false },
|
|
34
|
+
status: { type: Number, required: false, default: 2 }, // 2 = pending
|
|
35
|
+
statusReason: { type: String, default: "" },
|
|
36
|
+
statusDate: { type: String, default: null },
|
|
37
|
+
additionalData: { type: additionalDataSchema, required: true },
|
|
38
|
+
comments: [{
|
|
39
|
+
createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: true },
|
|
40
|
+
createdAt: { type: Date, default: Date.now },
|
|
41
|
+
message: { type: String, default: "", maxlength: 2000 }
|
|
42
|
+
}],
|
|
43
|
+
createdOn: { type: String, required: true, default: () => new Date().toISOString() }
|
|
44
|
+
}, { timestamps: true });
|
|
45
|
+
applyAuditMiddleware(applicationsTaskSchema, "ApplicationsTask");
|
|
46
|
+
// Apply workflow plugin to the schema
|
|
47
|
+
applyWorkflowPlugin(applicationsTaskSchema, 'applicationstask');
|
|
48
|
+
// Indexes for query optimization
|
|
49
|
+
applicationsTaskSchema.index({ applicationId: 1, instanceId: 1 }); // Compound index for findByApplicationIdAndInstanceId queries
|
|
50
|
+
applicationsTaskSchema.index({ applicationId: 1, createdOn: -1 }); // Compound index for findAll with sort by createdOn descending
|
|
51
|
+
// Unique index to prevent duplicate tasks created by concurrent syncs (background job + frontend-triggered sync).
|
|
52
|
+
// partialFilterExpression excludes internal system tasks (instanceId = "") so they are not affected by this constraint.
|
|
53
|
+
applicationsTaskSchema.index({ instanceId: 1, checkflowId: 1 }, {
|
|
54
|
+
unique: true,
|
|
55
|
+
partialFilterExpression: { instanceId: { $exists: true, $ne: "" } }
|
|
56
|
+
});
|
|
57
|
+
const ApplicationsTaskModel = mongoose.model("ApplicationsTask", applicationsTaskSchema);
|
|
58
|
+
export default ApplicationsTaskModel;
|