@dynamatix/gb-schemas 2.0.26 → 2.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/applicants/applicant-additional-income.model.d.ts +926 -20
  2. package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
  3. package/dist/applicants/applicant-additional-income.model.js +23 -3
  4. package/dist/applicants/applicant-commitment-creditCard.model.d.ts +0 -6
  5. package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
  6. package/dist/applicants/applicant-commitment-creditCard.model.js +0 -1
  7. package/dist/applicants/applicant-commitment-loan.model.d.ts +0 -6
  8. package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
  9. package/dist/applicants/applicant-commitment-loan.model.js +0 -1
  10. package/dist/applicants/applicant-commitment-mortgage.model.d.ts +0 -6
  11. package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
  12. package/dist/applicants/applicant-commitment-mortgage.model.js +0 -1
  13. package/dist/applicants/applicant-credit-data.model.js +11 -0
  14. package/dist/applicants/applicant-credit-profile.model.js +20 -0
  15. package/dist/applicants/applicant-direct-debit.model.js +17 -0
  16. package/dist/applicants/applicant-employment.model.js +50 -0
  17. package/dist/applicants/applicant-expenditure.model.js +54 -0
  18. package/dist/applicants/applicant-income-source.model.js +9 -0
  19. package/dist/applicants/applicant-income.model.d.ts +12 -0
  20. package/dist/applicants/applicant-income.model.d.ts.map +1 -1
  21. package/dist/applicants/applicant-income.model.js +81 -0
  22. package/dist/applicants/applicant-pension-income.model.d.ts +0 -288
  23. package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
  24. package/dist/applicants/applicant-pension-income.model.js +0 -13
  25. package/dist/applicants/applicant-risk-narrative.model.js +13 -0
  26. package/dist/applicants/applicant-uk-tax-credits.model.d.ts +0 -288
  27. package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
  28. package/dist/applicants/applicant-uk-tax-credits.model.js +0 -2
  29. package/dist/applicants/applicant.model.js +223 -0
  30. package/dist/applicants/index.js +13 -0
  31. package/dist/applications/application-audit.model.js +42 -0
  32. package/dist/applications/application-checklist-Item.model.js +45 -0
  33. package/dist/applications/application-company-model.js +120 -0
  34. package/dist/applications/application-credit-profile.model.js +12 -0
  35. package/dist/applications/application-direct-debit.model.js +92 -0
  36. package/dist/applications/application-document.model.js +35 -0
  37. package/dist/applications/application-fieldconfig.model.js +7 -0
  38. package/dist/applications/application-illustration-model.js +6 -0
  39. package/dist/applications/application-legal.model.js +7 -0
  40. package/dist/applications/application-mortgage.model.js +271 -0
  41. package/dist/applications/application-note.model.js +78 -0
  42. package/dist/applications/application-offer.model.js +6 -0
  43. package/dist/applications/application-onboarding.model.js +9 -0
  44. package/dist/applications/application-product.model.js +67 -0
  45. package/dist/applications/application-rationale.model.js +38 -0
  46. package/dist/applications/application-risk-narrative.model.js +12 -0
  47. package/dist/applications/application-valuation.model.js +15 -0
  48. package/dist/applications/application.model.js +153 -0
  49. package/dist/applications/broker.model.js +21 -0
  50. package/dist/applications/document.model.js +35 -0
  51. package/dist/applications/index.js +20 -0
  52. package/dist/applications/solicitor.model.js +114 -0
  53. package/dist/entities/applications/application-direct-debit.entity.d.ts +5 -3
  54. package/dist/entities/applications/application-direct-debit.entity.d.ts.map +1 -1
  55. package/dist/entities/applications/application-mortgage.entity.d.ts +2 -3
  56. package/dist/entities/applications/application-mortgage.entity.d.ts.map +1 -1
  57. package/dist/index.d.ts +1 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +9 -0
  60. package/dist/product-catalogues/index.js +3 -0
  61. package/dist/product-catalogues/product-catalogue.model.js +18 -0
  62. package/dist/product-catalogues/product-definitions.model.js +26 -0
  63. package/dist/product-catalogues/product-variant.model.js +12 -0
  64. package/dist/properties/index.js +2 -0
  65. package/dist/properties/property.model.js +144 -0
  66. package/dist/shared/alert.model.js +24 -0
  67. package/dist/shared/apprivo-sync-journey.model.js +17 -0
  68. package/dist/shared/checklist.model.js +30 -0
  69. package/dist/shared/document-type-model.js +10 -0
  70. package/dist/shared/index.js +12 -0
  71. package/dist/shared/job-run.model.js +14 -0
  72. package/dist/shared/job-setting.model.js +11 -0
  73. package/dist/shared/lookup-group.model.js +16 -0
  74. package/dist/shared/lookup.model.js +20 -0
  75. package/dist/shared/system-parameter.model.js +32 -0
  76. package/dist/shared/task-document.model.js +23 -0
  77. package/dist/shared/task.model.js +15 -0
  78. package/dist/underwriter/index.js +1 -0
  79. package/dist/underwriter/underwriter.model.js +17 -0
  80. package/dist/users/auth-log.model.js +21 -0
  81. package/dist/users/index.js +6 -0
  82. package/dist/users/permission.model.js +10 -0
  83. package/dist/users/role-group.model.js +14 -0
  84. package/dist/users/role.model.js +13 -0
  85. package/dist/users/tasks.model.js +15 -0
  86. package/dist/users/user.model.js +30 -0
  87. package/package.json +1 -1
@@ -0,0 +1,35 @@
1
+ import mongoose from "mongoose";
2
+ const documentSchema = new mongoose.Schema({
3
+ applicationId: {
4
+ type: mongoose.Schema.Types.ObjectId,
5
+ ref: "Application",
6
+ required: false,
7
+ },
8
+ documentId: { type: String, required: true },
9
+ owningEntityId: { type: String, required: false },
10
+ documentTypeLid: {
11
+ type: mongoose.Schema.Types.ObjectId,
12
+ ref: "Lookup",
13
+ required: false,
14
+ },
15
+ documentTypeId: { type: mongoose.Schema.Types.ObjectId, ref: "DocumentType", required: false },
16
+ fileName: { type: String, required: false },
17
+ contentType: { type: String, required: false },
18
+ created: { type: String, required: false },
19
+ createdBy: { type: String, required: false },
20
+ isGenerated: { type: String, required: false },
21
+ data: { type: String, required: false },
22
+ envelopeId: { type: String, required: false },
23
+ signers: { type: Array, default: [] },
24
+ documentType: {
25
+ documentTypeId: { type: String, required: false },
26
+ displayName: { type: String, required: false },
27
+ value: { type: String, required: false },
28
+ data: { type: Object, required: false },
29
+ },
30
+ documentUrl: { type: String, required: false },
31
+ }, {
32
+ timestamps: true
33
+ });
34
+ const DocumentModel = mongoose.model("Document", documentSchema);
35
+ export default DocumentModel;
@@ -0,0 +1,20 @@
1
+ export { default as ApplicationModel } from './application.model';
2
+ export { default as ApplicationAuditModel } from './application-audit.model';
3
+ export { default as ApplicationCheckListModel } from './application-checklist-Item.model';
4
+ export { default as ApplicationCompanyModel } from './application-company-model.js';
5
+ export { default as ApplicationNoteModel } from './application-note.model';
6
+ export { default as ApplicationCreditProfileModel } from './application-credit-profile.model';
7
+ export { default as ApplicationDirectDebitModel } from './application-direct-debit.model';
8
+ export { default as ApplicationMortgageModel } from './application-mortgage.model';
9
+ export { default as ApplicationOnboardingModel } from './application-onboarding.model';
10
+ export { default as ApplicationRationaleModel } from './application-rationale.model';
11
+ export { default as ApplicationValuationModel } from './application-valuation.model';
12
+ export { default as BrokerModel } from './broker.model';
13
+ export { default as ProductModel } from './application-product.model';
14
+ export { default as SolicitorModel } from './solicitor.model';
15
+ export { default as ApplicationDocumentModel } from './application-document.model';
16
+ export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model';
17
+ export { default as ApplicationFieldConfigModel } from './application-fieldconfig.model';
18
+ export { default as DocumentModel } from './document.model';
19
+ export { default as MortgageModel } from './application-mortgage.model';
20
+ export { default as ApplicationProductFeaturesModel } from './application-productfeatures.model';
@@ -0,0 +1,114 @@
1
+ import mongoose from "mongoose";
2
+ import { SortCode } from "../value-objects/sort-code";
3
+ const Schema = mongoose.Schema;
4
+ const solicitorSchema = new Schema({
5
+ applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application",
6
+ required: true,
7
+ description: "Unique identifier for the application",
8
+ },
9
+ pageValidFlag: {
10
+ type: Boolean,
11
+ default: true,
12
+ },
13
+ accountNumber: {
14
+ type: Number,
15
+ description: "Account number associated with the solicitor"
16
+ },
17
+ addressCity: {
18
+ type: String,
19
+ maxLength: 30,
20
+ description: "City where the solicitor is located"
21
+ },
22
+ addressCountryLid: {
23
+ type: mongoose.Schema.Types.ObjectId,
24
+ ref: "Lookup",
25
+ description: "Country ID from the lookup list"
26
+ },
27
+ addressLine1: {
28
+ type: String,
29
+ maxLength: 35,
30
+ description: "First line of the solicitor's address"
31
+ },
32
+ addressLine2: {
33
+ type: String,
34
+ maxLength: 35,
35
+ description: "Second line of the solicitor's address"
36
+ },
37
+ addressLine3: {
38
+ type: String,
39
+ maxLength: 35,
40
+ description: "Third line of the solicitor's address"
41
+ },
42
+ addressPostCode: {
43
+ type: String,
44
+ maxLength: 50,
45
+ description: "Postal code for the solicitor's address"
46
+ },
47
+ bankAddressLine1: {
48
+ type: String,
49
+ description: "First line of the solicitor's bank address"
50
+ },
51
+ bankAddressLine2: {
52
+ type: String,
53
+ description: "Second line of the solicitor's bank address"
54
+ },
55
+ bankBranch: {
56
+ type: String,
57
+ description: "Branch of the solicitor's bank"
58
+ },
59
+ bankCity: {
60
+ type: String,
61
+ description: "City where the solicitor's bank is located"
62
+ },
63
+ contactPostcode: {
64
+ type: String,
65
+ description: "Postal code for the solicitor's contact address"
66
+ },
67
+ email: {
68
+ type: String,
69
+ description: "Email address of the solicitor"
70
+ },
71
+ institution: {
72
+ type: String,
73
+ description: "Institution name where the solicitor works"
74
+ },
75
+ nameOfAccountHolder: {
76
+ type: String,
77
+ description: "Name of the account holder associated with the solicitor"
78
+ },
79
+ nameOfFirm: {
80
+ type: String,
81
+ description: "Name of the solicitor's firm"
82
+ },
83
+ signatory: {
84
+ type: String,
85
+ description: "Signatory name for the solicitor"
86
+ },
87
+ solicitorActing: {
88
+ type: String,
89
+ maxLength: 50,
90
+ description: "Indicates if the solicitor is acting in a particular capacity"
91
+ },
92
+ sortCode: {
93
+ type: SortCode,
94
+ description: "Sort code associated with the solicitor's account"
95
+ },
96
+ telephone: {
97
+ type: String,
98
+ maxLength: 15,
99
+ description: "Telephone number of the solicitor"
100
+ },
101
+ }, {
102
+ timestamps: true,
103
+ toJSON: { virtuals: true },
104
+ toObject: { virtuals: true }
105
+ });
106
+ const virtualCountry = solicitorSchema.virtual('addressCountry', {
107
+ ref: 'Lookup',
108
+ localField: 'addressCountryLid',
109
+ foreignField: '_id',
110
+ justOne: true
111
+ });
112
+ virtualCountry.description = 'Populated lookup value for the solicitor\'s address country';
113
+ const SolicitorModel = mongoose.model("Solicitor", solicitorSchema);
114
+ export default SolicitorModel;
@@ -1,4 +1,5 @@
1
1
  import { ApplicationEntity } from './application.entity';
2
+ import { LookupEntity } from '../shared/lookup.entity';
2
3
  export declare class ApplicationDirectDebitEntity {
3
4
  id: string;
4
5
  applicationId: string;
@@ -10,13 +11,14 @@ export declare class ApplicationDirectDebitEntity {
10
11
  city?: string;
11
12
  contactPostcode: string;
12
13
  institution?: string;
13
- isConfirmDeclaration?: boolean;
14
+ isConfirmDeclaration: boolean;
14
15
  nameOfAccountHolder: string;
15
- selectedPaymentDayLid?: string;
16
- sortCode: number;
16
+ selectedPaymentDayLid: string;
17
+ sortCode: string;
17
18
  createdAt: Date;
18
19
  updatedAt: Date;
19
20
  application: ApplicationEntity;
21
+ selectedPaymentDay?: LookupEntity;
20
22
  constructor(partial: Partial<ApplicationDirectDebitEntity>);
21
23
  }
22
24
  //# sourceMappingURL=application-direct-debit.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"application-direct-debit.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/application-direct-debit.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,qBAAa,4BAA4B;IACvC,EAAE,EAAG,MAAM,CAAC;IACZ,aAAa,EAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,EAAG,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,EAAG,MAAM,CAAC;IAClB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,WAAW,EAAG,iBAAiB,CAAC;gBAEpB,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC;CAG3D"}
1
+ {"version":3,"file":"application-direct-debit.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/application-direct-debit.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,4BAA4B;IACvC,EAAE,EAAG,MAAM,CAAC;IACZ,aAAa,EAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAG,OAAO,CAAC;IAC/B,mBAAmB,EAAG,MAAM,CAAC;IAC7B,qBAAqB,EAAG,MAAM,CAAC;IAC/B,QAAQ,EAAG,MAAM,CAAC;IAClB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,WAAW,EAAG,iBAAiB,CAAC;IAChC,kBAAkB,CAAC,EAAE,YAAY,CAAC;gBAEtB,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC;CAG3D"}
@@ -5,7 +5,6 @@ export declare class ApplicationMortgageEntity {
5
5
  applicationId: string;
6
6
  pageValidFlag: boolean;
7
7
  existingMortgageLender?: string;
8
- topSlicing: boolean;
9
8
  purposeOfMortgage: string;
10
9
  depositComeFromLids: string[];
11
10
  ifOtherDetails: string;
@@ -19,8 +18,8 @@ export declare class ApplicationMortgageEntity {
19
18
  monthlyRentalIncome: number;
20
19
  outstandingBalance: number;
21
20
  fundRaisedFor: string;
22
- sourceOfFundsLid: string;
23
- sourceOfFundDetails: string;
21
+ sourceofFundsLid: string;
22
+ sourceofFundDetails: string;
24
23
  propertyValuationDetails: string;
25
24
  telephoneNumber: string;
26
25
  isDistressedSale: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"application-mortgage.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/application-mortgage.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,yBAAyB;IAClC,EAAE,EAAG,MAAM,CAAC;IACZ,aAAa,EAAG,MAAM,CAAC;IACvB,aAAa,EAAG,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,UAAU,EAAG,OAAO,CAAC;IACrB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,mBAAmB,EAAG,MAAM,EAAE,CAAC;IAC/B,cAAc,EAAG,MAAM,CAAC;IACxB,aAAa,EAAG,MAAM,CAAC;IACvB,gBAAgB,EAAG,MAAM,CAAC;IAC1B,eAAe,EAAG,MAAM,CAAC;IACzB,cAAc,EAAG,OAAO,CAAC;IACzB,YAAY,EAAG,MAAM,CAAC;IACtB,cAAc,EAAG,MAAM,CAAC;IACxB,YAAY,EAAG,MAAM,CAAC;IACtB,mBAAmB,EAAG,MAAM,CAAC;IAC7B,kBAAkB,EAAG,MAAM,CAAC;IAC5B,aAAa,EAAG,MAAM,CAAC;IACvB,gBAAgB,EAAG,MAAM,CAAC;IAC1B,mBAAmB,EAAG,MAAM,CAAC;IAC7B,wBA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;IAGjB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;IACjC,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;gBAErB,OAAO,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAKvD,IAAI,oBAAoB,IAAI,MAAM,EAAE,GAAG,IAAI,CAE1C;IAED,IAAI,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAErC;IAED,IAAI,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEpC;IAED,IAAI,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAErC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,IAAI,oBAAoB,IAAI,MAAM,EAAE,GAAG,IAAI,CAE1C;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,IAAI,CAEjC;CACJ"}
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export * from './applicants/index.js';
5
5
  export * from './users/index.js';
6
6
  export * from './product-catalogues/index.js';
7
7
  export * from './underwriter/index.js';
8
+ export * from './entities/index.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AAGvC,cAAc,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export * from './applications/index.js';
2
+ export * from './shared/index.js';
3
+ export * from './properties/index.js';
4
+ export * from './applicants/index.js';
5
+ export * from './users/index.js';
6
+ export * from './product-catalogues/index.js';
7
+ export * from './underwriter/index.js';
8
+ // Export Prisma/Postgres schemas
9
+ export * from './entities/index.js';
@@ -0,0 +1,3 @@
1
+ export { default as ProductCatalogueModel } from './product-catalogue.model';
2
+ export { default as ProductDefinitionsModel } from './product-definitions.model';
3
+ export { default as ProductVariantModel } from './product-variant.model';
@@ -0,0 +1,18 @@
1
+ import mongoose from "mongoose";
2
+ const productCatalogueSchema = new mongoose.Schema({
3
+ productCatalogueId: { type: String, required: true },
4
+ name: { type: String, required: true },
5
+ description: { type: String },
6
+ applyFrom: { type: String, required: true },
7
+ applyUntil: { type: String, required: true },
8
+ submitUntil: { type: String, required: true },
9
+ status: { type: String, required: true },
10
+ lockedForEdit: { type: String, required: true },
11
+ baseRateName: { type: String },
12
+ baseRate: { type: String },
13
+ mapperName: { type: String }
14
+ }, {
15
+ timestamps: true
16
+ });
17
+ const ProductCatalogueModel = mongoose.model('ProductCatalogue', productCatalogueSchema);
18
+ export default ProductCatalogueModel;
@@ -0,0 +1,26 @@
1
+ import mongoose from "mongoose";
2
+ const ruleSchema = new mongoose.Schema({
3
+ ruleId: { type: String, required: true },
4
+ rule: { type: String, required: true }, // Storing as a string (JSON stringified)
5
+ name: { type: String, required: true },
6
+ description: { type: String },
7
+ scope: { type: String },
8
+ mandatory: { type: String, required: true },
9
+ overrideRuleType: { type: String },
10
+ overrideRuleMessage: { type: String },
11
+ inheritedFrom: { type: String },
12
+ anyPass: { type: String, required: true },
13
+ preCashflow: { type: String, required: true }
14
+ });
15
+ const productDefinitionsSchema = new mongoose.Schema({
16
+ productDefinitionId: { type: String, required: true },
17
+ productCatalogueId: { ref: "ProductCatalogue", type: mongoose.Schema.Types.ObjectId, required: true },
18
+ name: { type: String, required: true },
19
+ atLeastOnePass: { type: String, required: true },
20
+ elements: { type: [mongoose.Schema.Types.Mixed], default: [] },
21
+ rules: { type: [ruleSchema], default: [] } // Embedded array of RuleSchema
22
+ }, {
23
+ timestamps: true
24
+ });
25
+ const ProductDefinitionsModel = mongoose.model('ProductDefinitions', productDefinitionsSchema);
26
+ export default ProductDefinitionsModel;
@@ -0,0 +1,12 @@
1
+ import mongoose from "mongoose";
2
+ const productVariantSchema = new mongoose.Schema({
3
+ productCatalogueId: { ref: "ProductCatalogue", type: mongoose.Schema.Types.ObjectId, required: true },
4
+ variantid: { type: String, required: true },
5
+ name: { type: String, required: true },
6
+ variantCode: { type: String, required: true },
7
+ label: { type: String },
8
+ }, {
9
+ timestamps: true
10
+ });
11
+ const ProductVariantModel = mongoose.model('ProductVariant', productVariantSchema);
12
+ export default ProductVariantModel;
@@ -0,0 +1,2 @@
1
+ export { default as SecurityModel } from './security.model';
2
+ export { default as PropertyModel } from './property.model';
@@ -0,0 +1,144 @@
1
+ import mongoose from 'mongoose';
2
+ import { Pound } from '../value-objects/pound';
3
+ const propertySchema = new mongoose.Schema({
4
+ applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application",
5
+ description: "Unique identifier for the application",
6
+ required: true
7
+ },
8
+ pageValidFlag: {
9
+ type: Boolean,
10
+ default: true,
11
+ description: "Flag indicating if the page is valid",
12
+ },
13
+ propertyId: {
14
+ type: String,
15
+ required: true,
16
+ unique: true,
17
+ description: "Unique identifier for the property"
18
+ },
19
+ addressLine1: {
20
+ type: String,
21
+ required: true,
22
+ maxLength: 35,
23
+ description: "First line of the property address"
24
+ },
25
+ addressLine2: {
26
+ type: String,
27
+ required: false,
28
+ maxLength: 35,
29
+ description: "Second line of the property address"
30
+ },
31
+ addressLine3: {
32
+ type: String,
33
+ required: false,
34
+ maxLength: 35,
35
+ description: "Third line of the property address"
36
+ },
37
+ associatedLoanPartiesIds: {
38
+ type: [mongoose.Schema.Types.ObjectId],
39
+ required: false,
40
+ description: "List of associated loan parties (either applicant or company)"
41
+ },
42
+ city: {
43
+ type: String,
44
+ required: false,
45
+ maxLength: 30,
46
+ description: "City where the property is located"
47
+ },
48
+ countryLid: {
49
+ type: mongoose.Schema.Types.ObjectId,
50
+ ref: 'Lookup',
51
+ required: true,
52
+ description: "Country where the property is located",
53
+ },
54
+ lender: {
55
+ type: String,
56
+ required: true,
57
+ maxLength: 35,
58
+ description: "Lender providing the loan for the property"
59
+ },
60
+ marketValue: {
61
+ type: Pound,
62
+ required: true,
63
+ default: 0.00,
64
+ description: "The market value of the property",
65
+ },
66
+ monthlyRent: {
67
+ type: Pound,
68
+ required: true,
69
+ default: 0.00,
70
+ description: "The monthly rent value of the property"
71
+ },
72
+ monthlyRepayment: {
73
+ type: Pound,
74
+ required: true,
75
+ default: 0.00,
76
+ description: "The monthly repayment value for the property"
77
+ },
78
+ originalLoanBalance: {
79
+ type: Pound,
80
+ required: true,
81
+ default: 0.00,
82
+ description: "The original loan balance for the property"
83
+ },
84
+ outstandingBalance: {
85
+ type: Pound,
86
+ required: true,
87
+ default: 0.00,
88
+ description: "The remaining outstanding balance of the property loan"
89
+ },
90
+ otherOwnershipParties: {
91
+ type: String,
92
+ required: false,
93
+ maxLength: 500,
94
+ description: "Other parties that own the property"
95
+ },
96
+ postCode: {
97
+ type: String,
98
+ required: true,
99
+ maxLength: 50,
100
+ description: "The postCode for the property"
101
+ },
102
+ remainingTerm: {
103
+ type: Number,
104
+ required: true,
105
+ max: 4,
106
+ description: "The remaining term of the loan in years"
107
+ },
108
+ portfolioFile: {
109
+ type: String,
110
+ required: false,
111
+ description: "File containing the portfolio details"
112
+ }
113
+ }, {
114
+ timestamps: true,
115
+ toJSON: { virtuals: true },
116
+ toObject: { virtuals: true }
117
+ });
118
+ propertySchema.virtual('country').get(function () {
119
+ return this.countryLid instanceof mongoose.Types.ObjectId ? null : this.countryLid?.name || null;
120
+ });
121
+ propertySchema.virtual('stressedRCR').get(function () {
122
+ const monthlyRentValue = this.monthlyRent ? parseFloat(this.monthlyRent.toString()) : 0.00;
123
+ const monthlyRepaymentValue = this.monthlyRepayment ? parseFloat(this.monthlyRepayment.toString()) : 0.00;
124
+ // Avoid division by zero
125
+ if (monthlyRepaymentValue === 0) {
126
+ return '0.00'; // Return 0.00 if monthlyRepayment is zero
127
+ }
128
+ const stressedRCR = (monthlyRentValue / monthlyRepaymentValue) * 100;
129
+ return stressedRCR.toFixed(2);
130
+ });
131
+ // virtual property 'applicationType'
132
+ propertySchema.virtual('applicationType').get(function () {
133
+ return this.applicationId?.applicationTypeLid instanceof mongoose.Types.ObjectId
134
+ ? null
135
+ : this.applicationId?.applicationTypeLid?.name || null;
136
+ });
137
+ // virtual property 'lendingType'
138
+ propertySchema.virtual('lendingType').get(function () {
139
+ return this.applicationId?.lendingTypeLid instanceof mongoose.Types.ObjectId
140
+ ? null
141
+ : this.applicationId?.lendingTypeLid?.name || null;
142
+ });
143
+ const PropertyModel = mongoose.model('Property', propertySchema);
144
+ export default PropertyModel;
@@ -0,0 +1,24 @@
1
+ import mongoose from "mongoose";
2
+ const alertSchema = new mongoose.Schema({
3
+ alertTypeLid: {
4
+ type: mongoose.Schema.Types.ObjectId,
5
+ ref: "Lookup"
6
+ },
7
+ applicationId: {
8
+ type: mongoose.Schema.Types.ObjectId,
9
+ ref: "Application",
10
+ required: true
11
+ },
12
+ alertMessage: { type: String },
13
+ documentId: {
14
+ type: mongoose.Schema.Types.ObjectId,
15
+ ref: "Document",
16
+ },
17
+ statusLid: {
18
+ type: mongoose.Schema.Types.ObjectId,
19
+ ref: "Lookup"
20
+ },
21
+ isActive: { type: String, default: true },
22
+ }, { timestamps: true });
23
+ const AlertModel = mongoose.model("Alert", alertSchema);
24
+ export default AlertModel;
@@ -0,0 +1,17 @@
1
+ import mongoose from "mongoose";
2
+ const ApprivoSyncJourneySchema = new mongoose.Schema({
3
+ applicationId: { type: String, required: true },
4
+ milestoneLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
5
+ mileStoneStatus: {
6
+ type: String,
7
+ enum: ['Completed', 'Errored', 'Not Applicable'],
8
+ required: true
9
+ },
10
+ error: { type: String, default: null },
11
+ isFirstPull: { type: String, required: true },
12
+ jobRunId: { type: mongoose.Schema.Types.ObjectId, ref: "Job_Run" },
13
+ startTime: { type: Date, default: null },
14
+ endTime: { type: Date, default: null },
15
+ }, { timestamps: true });
16
+ const ApprivoSyncJourneyModel = mongoose.model('ApprivoSyncJourney', ApprivoSyncJourneySchema);
17
+ export default ApprivoSyncJourneyModel;
@@ -0,0 +1,30 @@
1
+ import mongoose from "mongoose";
2
+ const checklistSchema = new mongoose.Schema({
3
+ checkTypeLid: {
4
+ type: mongoose.Schema.Types.ObjectId,
5
+ ref: "Lookup",
6
+ required: true
7
+ },
8
+ source: {
9
+ type: String,
10
+ required: true
11
+ },
12
+ sourceId: {
13
+ type: mongoose.Schema.Types.ObjectId,
14
+ required: false
15
+ },
16
+ applicationId: {
17
+ type: mongoose.Schema.Types.ObjectId,
18
+ ref: "Application",
19
+ required: true
20
+ },
21
+ checkDescription: { type: String },
22
+ checkStatusLid: {
23
+ type: mongoose.Schema.Types.ObjectId,
24
+ ref: "Lookup",
25
+ required: true
26
+ }
27
+ }, { timestamps: true });
28
+ checklistSchema.index({ checkDescription: 'text', source: 'text' });
29
+ const CheckListModel = mongoose.model("CheckList", checklistSchema);
30
+ export default CheckListModel;
@@ -0,0 +1,10 @@
1
+ import mongoose from "mongoose";
2
+ const DocumentTypeSchema = new mongoose.Schema({
3
+ name: { type: String, required: true },
4
+ label: { type: String },
5
+ source: { type: String, default: null },
6
+ parentDocumentTypeId: { type: mongoose.Schema.Types.ObjectId, ref: 'DocumentType', default: null },
7
+ matchRules: { type: mongoose.Schema.Types.Mixed }
8
+ });
9
+ const DocumentTypeModel = mongoose.model('DocumentType', DocumentTypeSchema);
10
+ export default DocumentTypeModel;
@@ -0,0 +1,12 @@
1
+ export { default as LookupGroupModel } from './lookup-group.model';
2
+ export { default as LookupModel } from './lookup.model';
3
+ export { default as SystemParameterModel } from './system-parameter.model';
4
+ export { default as AlertModel } from './alert.model';
5
+ export { default as CheckListModel } from './checklist.model';
6
+ export { default as JobSettingModel } from './job-setting.model';
7
+ export { default as TaskModel } from './task.model';
8
+ export { default as ApprivoSyncJourneyModel } from './apprivo-sync-journey.model';
9
+ export { default as JobRunModel } from './job-run.model';
10
+ export { default as TaskDocumentTypeModel } from './task-document.model';
11
+ export { default as DocumentTypeModel } from './document-type-model';
12
+ export { default as SchemaDocModel } from './schema-doc.model';
@@ -0,0 +1,14 @@
1
+ import mongoose, { Schema } from "mongoose";
2
+ const jobRunSchema = new Schema({
3
+ jobName: { type: String, required: true },
4
+ status: {
5
+ type: String,
6
+ enum: ['Running', 'Completed', 'Errored'],
7
+ required: true
8
+ },
9
+ error: { type: String, default: null },
10
+ startTime: { type: Date, default: null },
11
+ endTime: { type: Date, default: null }
12
+ });
13
+ const JobRunModel = mongoose.model('Job_Run', jobRunSchema);
14
+ export default JobRunModel;
@@ -0,0 +1,11 @@
1
+ import mongoose from "mongoose";
2
+ const jobSettingSchema = new mongoose.Schema({
3
+ name: { type: String, required: true },
4
+ isActive: { type: String, default: true },
5
+ frequency: {
6
+ type: String, default: '2 hours'
7
+ },
8
+ jobParams: { type: [mongoose.Schema.Types.Mixed] }
9
+ });
10
+ const JobSettingModel = mongoose.model("Job_Setting", jobSettingSchema);
11
+ export default JobSettingModel;
@@ -0,0 +1,16 @@
1
+ import mongoose from "mongoose";
2
+ const lookupGroupSchema = new mongoose.Schema({
3
+ name: {
4
+ type: String,
5
+ required: true,
6
+ unique: true,
7
+ },
8
+ lookups: [
9
+ {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: "Lookup", // References the Lookup collection
12
+ },
13
+ ],
14
+ });
15
+ const LookupGroupModel = mongoose.model('LookupGroup', lookupGroupSchema);
16
+ export default LookupGroupModel;
@@ -0,0 +1,20 @@
1
+ import mongoose from "mongoose";
2
+ const lookupSchema = new mongoose.Schema({
3
+ name: {
4
+ type: String,
5
+ required: true
6
+ },
7
+ text: {
8
+ type: String,
9
+ required: true
10
+ },
11
+ lookupGroupId: {
12
+ type: mongoose.Schema.Types.ObjectId,
13
+ ref: "LookupGroup", // References the LookupGroup collection
14
+ },
15
+ value: {
16
+ type: String
17
+ }
18
+ });
19
+ const LookupModel = mongoose.model('Lookup', lookupSchema);
20
+ export default LookupModel;