@dynamatix/gb-schemas 2.0.53 → 2.0.55

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 (25) hide show
  1. package/dist/entities/applicants/credit-card-commitment.entity.d.ts +4 -5
  2. package/dist/entities/applicants/credit-card-commitment.entity.d.ts.map +1 -1
  3. package/dist/entities/applicants/mortgage-commitment.entity.d.ts +2 -6
  4. package/dist/entities/applicants/mortgage-commitment.entity.d.ts.map +1 -1
  5. package/dist/entities/applicants/secure-loan-commitment.entity.d.ts +14 -6
  6. package/dist/entities/applicants/secure-loan-commitment.entity.d.ts.map +1 -1
  7. package/dist/entities/applicants/secure-loan-commitment.entity.js +3 -0
  8. package/dist/entities/applicants/unsecured-loan-commitment.entity.d.ts +14 -5
  9. package/dist/entities/applicants/unsecured-loan-commitment.entity.d.ts.map +1 -1
  10. package/dist/entities/applicants/unsecured-loan-commitment.entity.js +3 -1
  11. package/entities/applicants/credit-card-commitment.entity.ts +5 -5
  12. package/entities/applicants/mortgage-commitment.entity.ts +3 -7
  13. package/entities/applicants/secure-loan-commitment.entity.ts +18 -7
  14. package/entities/applicants/unsecured-loan-commitment.entity.ts +18 -7
  15. package/package.json +1 -1
  16. package/prisma/applicants/credit-card-commitment.prisma +5 -6
  17. package/prisma/applicants/mortgage-commitment.prisma +4 -8
  18. package/prisma/applicants/secured-loan-commitment.prisma +22 -16
  19. package/prisma/applicants/unsecured-loan-commitment.prisma +22 -15
  20. package/prisma/migrations/20250515172824_update_security_schema/migration.sql +43 -43
  21. package/prisma/migrations/20250516053810_update_underwriter_schema/migration.sql +14 -14
  22. package/prisma/migrations/20250516075153_update_commitments_schemas/migration.sql +134 -0
  23. package/prisma/migrations/20250516094438_update_credit_card_commitment_schema/migration.sql +8 -0
  24. package/prisma/schema.prisma +58 -42
  25. package/prisma/shared/lookup.prisma +9 -1
@@ -4,15 +4,14 @@ export declare class CreditCardCommitmentEntity {
4
4
  id: string;
5
5
  applicantId: string;
6
6
  commitmentId: string;
7
- lenderName?: string;
7
+ lenderName: string;
8
8
  creditLimit: number;
9
9
  outstandingBalance: number;
10
- creditCardRepaymentTypeLid: string;
10
+ creditCardRepaymentTypeLid?: string;
11
11
  monthlyPayment: number;
12
12
  jointNames?: boolean;
13
- source?: string;
14
- isSelected?: boolean;
15
- creditCardRationale?: string;
13
+ source: string;
14
+ isSelected: boolean;
16
15
  createdAt: Date;
17
16
  updatedAt: Date;
18
17
  applicant?: ApplicantEntity;
@@ -1 +1 @@
1
- {"version":3,"file":"credit-card-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/credit-card-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,qBAAa,0BAA0B;IACrC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,YAAY,EAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,0BAA0B,EAAG,MAAM,CAAC;IACpC,cAAc,EAAG,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;IAG7B,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;gBAEW,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC;CAGzD"}
1
+ {"version":3,"file":"credit-card-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/credit-card-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,0BAA0B;IACrC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,YAAY,EAAG,MAAM,CAAC;IACtB,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,cAAc,EAAG,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAG,MAAM,CAAC;IAChB,UAAU,EAAG,OAAO,CAAC;IACrB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;IAG7B,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;gBAEW,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC;CAGzD"}
@@ -21,18 +21,14 @@ export declare class MortgageCommitmentEntity {
21
21
  accountInArrearsDetails?: string;
22
22
  doHaveSharedResponsibility?: boolean;
23
23
  sharedMortgage?: string;
24
- source?: string;
25
- isSelected?: boolean;
26
- mortgageHPPRationale?: string;
24
+ source: string;
25
+ isSelected: boolean;
27
26
  financeTypeHppLid?: string;
28
27
  hppRepaymentTypeLid?: string;
29
28
  mortgageRate?: number;
30
29
  financeHomeTypeLid?: string;
31
30
  remainingTermMonth?: number;
32
31
  chargeTypeLid?: string;
33
- securityDetails?: string;
34
- purpose?: string;
35
- remainingTerm?: string;
36
32
  createdAt: Date;
37
33
  updatedAt: Date;
38
34
  applicant?: ApplicantEntity;
@@ -1 +1 @@
1
- {"version":3,"file":"mortgage-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/mortgage-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,wBAAwB;IACjC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,YAAY,EAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,UAAU,CAAC,EAAE,YAAY,CAAC;gBAEd,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC;IAKtD,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED,IAAI,iCAAiC,IAAI,MAAM,CAE9C;CACJ"}
1
+ {"version":3,"file":"mortgage-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/mortgage-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,wBAAwB;IACjC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,YAAY,EAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAG,MAAM,CAAC;IAChB,UAAU,EAAG,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,UAAU,CAAC,EAAE,YAAY,CAAC;gBAEd,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC;IAKtD,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED,IAAI,iCAAiC,IAAI,MAAM,CAE9C;CACJ"}
@@ -1,21 +1,29 @@
1
1
  import { ApplicantEntity } from './applicant.entity';
2
+ import { LookupEntity } from '../shared/lookup.entity';
2
3
  export declare class SecureLoanCommitmentEntity {
3
4
  id: string;
4
5
  applicantId: string;
5
6
  lenderName: string;
6
7
  commitmentId: string;
7
- securityDetails: string;
8
- purpose: string;
9
- doHaveSharedResponsibility: boolean;
10
- sharedMortgage: string;
11
- remainingTerm?: string;
12
- startDate: string;
8
+ securityDetails?: string;
9
+ purpose?: string;
10
+ doHaveSharedResponsibility?: boolean;
11
+ sharedMortgage?: string;
12
+ remainingTerm?: number;
13
+ startDate?: string;
13
14
  outstandingBalance: number;
14
15
  monthlyPayment: number;
16
+ source: string;
17
+ isSelected: boolean;
18
+ commitmentTypeLid?: string;
19
+ loanTypeLid?: string;
15
20
  createdAt: Date;
16
21
  updatedAt: Date;
17
22
  applicant?: ApplicantEntity;
23
+ commitmentType?: LookupEntity;
24
+ loanType?: LookupEntity;
18
25
  constructor(partial: Partial<SecureLoanCommitmentEntity>);
19
26
  get doHaveSharedResponsibilityDisplay(): string;
27
+ get lendingType(): string | undefined;
20
28
  }
21
29
  //# sourceMappingURL=secure-loan-commitment.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"secure-loan-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/secure-loan-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,0BAA0B;IACnC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,UAAU,EAAG,MAAM,CAAC;IACpB,YAAY,EAAG,MAAM,CAAC;IACtB,eAAe,EAAG,MAAM,CAAC;IACzB,OAAO,EAAG,MAAM,CAAC;IACjB,0BAA0B,EAAG,OAAO,CAAC;IACrC,cAAc,EAAG,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAG,MAAM,CAAC;IACnB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,cAAc,EAAG,MAAM,CAAC;IACxB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;gBAEhB,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC;IAKxD,IAAI,iCAAiC,IAAI,MAAM,CAE9C;CACJ"}
1
+ {"version":3,"file":"secure-loan-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/secure-loan-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,0BAA0B;IACnC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,UAAU,EAAG,MAAM,CAAC;IACpB,YAAY,EAAG,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,cAAc,EAAG,MAAM,CAAC;IACxB,MAAM,EAAG,MAAM,CAAC;IAChB,UAAU,EAAG,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,YAAY,CAAC;gBAEZ,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC;IAKxD,IAAI,iCAAiC,IAAI,MAAM,CAE9C;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;CACJ"}
@@ -6,4 +6,7 @@ export class SecureLoanCommitmentEntity {
6
6
  get doHaveSharedResponsibilityDisplay() {
7
7
  return this.doHaveSharedResponsibility ? "Yes" : "No";
8
8
  }
9
+ get lendingType() {
10
+ return this.applicant?.application?.lendingType?.name;
11
+ }
9
12
  }
@@ -1,20 +1,29 @@
1
1
  import { ApplicantEntity } from './applicant.entity';
2
+ import { LookupEntity } from '../shared/lookup.entity';
2
3
  export declare class UnsecuredLoanCommitmentEntity {
3
4
  id: string;
4
5
  applicantId: string;
5
6
  lenderName: string;
6
7
  commitmentId: string;
7
- purpose: string;
8
- doHaveSharedResponsibility: boolean;
9
- sharedMortgage: string;
10
- remainingTerm?: string;
11
- startDate: string;
8
+ purpose?: string;
9
+ doHaveSharedResponsibility?: boolean;
10
+ sharedMortgage?: string;
11
+ remainingTerm?: number;
12
+ startDate?: string;
12
13
  outstandingBalance: number;
13
14
  monthlyPayment: number;
15
+ source: string;
16
+ isSelected: boolean;
17
+ commitmentTypeLid?: string;
18
+ loanTypeLid?: string;
19
+ securityDetails?: string;
14
20
  createdAt: Date;
15
21
  updatedAt: Date;
16
22
  applicant?: ApplicantEntity;
23
+ commitmentType?: LookupEntity;
24
+ loanType?: LookupEntity;
17
25
  constructor(partial: Partial<UnsecuredLoanCommitmentEntity>);
18
26
  get doHaveSharedResponsibilityDisplay(): string;
27
+ get lendingType(): string | undefined;
19
28
  }
20
29
  //# sourceMappingURL=unsecured-loan-commitment.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unsecured-loan-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/unsecured-loan-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,6BAA6B;IACtC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,UAAU,EAAG,MAAM,CAAC;IACpB,YAAY,EAAG,MAAM,CAAC;IACtB,OAAO,EAAG,MAAM,CAAC;IACjB,0BAA0B,EAAG,OAAO,CAAC;IACrC,cAAc,EAAG,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAG,MAAM,CAAC;IACnB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,cAAc,EAAG,MAAM,CAAC;IACxB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;gBAEhB,OAAO,EAAE,OAAO,CAAC,6BAA6B,CAAC;IAM3D,IAAI,iCAAiC,IAAI,MAAM,CAE9C;CACJ"}
1
+ {"version":3,"file":"unsecured-loan-commitment.entity.d.ts","sourceRoot":"","sources":["../../../entities/applicants/unsecured-loan-commitment.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,6BAA6B;IACtC,EAAE,EAAG,MAAM,CAAC;IACZ,WAAW,EAAG,MAAM,CAAC;IACrB,UAAU,EAAG,MAAM,CAAC;IACpB,YAAY,EAAG,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,cAAc,EAAG,MAAM,CAAC;IACxB,MAAM,EAAG,MAAM,CAAC;IAChB,UAAU,EAAG,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,YAAY,CAAC;gBAEZ,OAAO,EAAE,OAAO,CAAC,6BAA6B,CAAC;IAK3D,IAAI,iCAAiC,IAAI,MAAM,CAE9C;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;CACJ"}
@@ -3,8 +3,10 @@ export class UnsecuredLoanCommitmentEntity {
3
3
  Object.assign(this, partial);
4
4
  }
5
5
  // Virtual fields from Mongoose model
6
- // These are computed properties that were previously virtual in Mongoose
7
6
  get doHaveSharedResponsibilityDisplay() {
8
7
  return this.doHaveSharedResponsibility ? "Yes" : "No";
9
8
  }
9
+ get lendingType() {
10
+ return this.applicant?.application?.lendingType?.name;
11
+ }
10
12
  }
@@ -1,18 +1,18 @@
1
1
  import { ApplicantEntity } from './applicant.entity';
2
2
  import { LookupEntity } from '../shared/lookup.entity';
3
+
3
4
  export class CreditCardCommitmentEntity {
4
5
  id!: string;
5
6
  applicantId!: string;
6
7
  commitmentId!: string;
7
- lenderName?: string;
8
+ lenderName!: string;
8
9
  creditLimit!: number;
9
10
  outstandingBalance!: number;
10
- creditCardRepaymentTypeLid!: string;
11
+ creditCardRepaymentTypeLid?: string;
11
12
  monthlyPayment!: number;
12
13
  jointNames?: boolean;
13
- source?: string;
14
- isSelected?: boolean;
15
- creditCardRationale?: string;
14
+ source!: string;
15
+ isSelected!: boolean;
16
16
  createdAt!: Date;
17
17
  updatedAt!: Date;
18
18
 
@@ -22,18 +22,14 @@ export class MortgageCommitmentEntity {
22
22
  accountInArrearsDetails?: string;
23
23
  doHaveSharedResponsibility?: boolean;
24
24
  sharedMortgage?: string;
25
- source?: string;
26
- isSelected?: boolean;
27
- mortgageHPPRationale?: string;
25
+ source!: string;
26
+ isSelected!: boolean;
28
27
  financeTypeHppLid?: string;
29
28
  hppRepaymentTypeLid?: string;
30
29
  mortgageRate?: number;
31
30
  financeHomeTypeLid?: string;
32
31
  remainingTermMonth?: number;
33
32
  chargeTypeLid?: string;
34
- securityDetails?: string;
35
- purpose?: string;
36
- remainingTerm?: string;
37
33
  createdAt!: Date;
38
34
  updatedAt!: Date;
39
35
 
@@ -78,4 +74,4 @@ export class MortgageCommitmentEntity {
78
74
  get doHaveSharedResponsibilityDisplay(): string {
79
75
  return this.doHaveSharedResponsibility ? "Yes" : "No";
80
76
  }
81
- }
77
+ }
@@ -1,23 +1,30 @@
1
1
  import { ApplicantEntity } from './applicant.entity';
2
+ import { LookupEntity } from '../shared/lookup.entity';
2
3
 
3
4
  export class SecureLoanCommitmentEntity {
4
5
  id!: string;
5
6
  applicantId!: string;
6
7
  lenderName!: string;
7
8
  commitmentId!: string;
8
- securityDetails!: string;
9
- purpose!: string;
10
- doHaveSharedResponsibility!: boolean;
11
- sharedMortgage!: string;
12
- remainingTerm?: string;
13
- startDate!: string;
9
+ securityDetails?: string;
10
+ purpose?: string;
11
+ doHaveSharedResponsibility?: boolean;
12
+ sharedMortgage?: string;
13
+ remainingTerm?: number;
14
+ startDate?: string;
14
15
  outstandingBalance!: number;
15
16
  monthlyPayment!: number;
17
+ source!: string;
18
+ isSelected!: boolean;
19
+ commitmentTypeLid?: string;
20
+ loanTypeLid?: string;
16
21
  createdAt!: Date;
17
22
  updatedAt!: Date;
18
23
 
19
24
  // Relations
20
25
  applicant?: ApplicantEntity;
26
+ commitmentType?: LookupEntity;
27
+ loanType?: LookupEntity;
21
28
 
22
29
  constructor(partial: Partial<SecureLoanCommitmentEntity>) {
23
30
  Object.assign(this, partial);
@@ -27,4 +34,8 @@ export class SecureLoanCommitmentEntity {
27
34
  get doHaveSharedResponsibilityDisplay(): string {
28
35
  return this.doHaveSharedResponsibility ? "Yes" : "No";
29
36
  }
30
- }
37
+
38
+ get lendingType(): string | undefined {
39
+ return this.applicant?.application?.lendingType?.name;
40
+ }
41
+ }
@@ -1,30 +1,41 @@
1
1
  import { ApplicantEntity } from './applicant.entity';
2
+ import { LookupEntity } from '../shared/lookup.entity';
2
3
 
3
4
  export class UnsecuredLoanCommitmentEntity {
4
5
  id!: string;
5
6
  applicantId!: string;
6
7
  lenderName!: string;
7
8
  commitmentId!: string;
8
- purpose!: string;
9
- doHaveSharedResponsibility!: boolean;
10
- sharedMortgage!: string;
11
- remainingTerm?: string;
12
- startDate!: string;
9
+ purpose?: string;
10
+ doHaveSharedResponsibility?: boolean;
11
+ sharedMortgage?: string;
12
+ remainingTerm?: number;
13
+ startDate?: string;
13
14
  outstandingBalance!: number;
14
15
  monthlyPayment!: number;
16
+ source!: string;
17
+ isSelected!: boolean;
18
+ commitmentTypeLid?: string;
19
+ loanTypeLid?: string;
20
+ securityDetails?: string;
15
21
  createdAt!: Date;
16
22
  updatedAt!: Date;
17
23
 
18
24
  // Relations
19
25
  applicant?: ApplicantEntity;
26
+ commitmentType?: LookupEntity;
27
+ loanType?: LookupEntity;
20
28
 
21
29
  constructor(partial: Partial<UnsecuredLoanCommitmentEntity>) {
22
30
  Object.assign(this, partial);
23
31
  }
24
32
 
25
33
  // Virtual fields from Mongoose model
26
- // These are computed properties that were previously virtual in Mongoose
27
34
  get doHaveSharedResponsibilityDisplay(): string {
28
35
  return this.doHaveSharedResponsibility ? "Yes" : "No";
29
36
  }
30
- }
37
+
38
+ get lendingType(): string | undefined {
39
+ return this.applicant?.application?.lendingType?.name;
40
+ }
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "2.0.53",
3
+ "version": "2.0.55",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,15 +2,14 @@ model CreditCardCommitment {
2
2
  id String @id @default(uuid())
3
3
  applicantId String @map("applicant_id")
4
4
  commitmentId String @unique @map("commitment_id")
5
- lenderName String? @map("lender_name")
5
+ lenderName String @map("lender_name")
6
6
  creditLimit Decimal @map("credit_limit") @db.Decimal(10, 2)
7
7
  outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
8
- creditCardRepaymentTypeLid String @map("credit_card_repayment_type_lid")
8
+ creditCardRepaymentTypeLid String? @map("credit_card_repayment_type_lid")
9
9
  monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
10
10
  jointNames Boolean? @map("joint_names")
11
- source String? @default("Broker") @map("source")
12
- isSelected Boolean? @default(true) @map("is_selected")
13
- creditCardRationale String? @default("") @map("credit_card_rationale")
11
+ source String @default("Broker") @map("source")
12
+ isSelected Boolean @default(true) @map("is_selected")
14
13
  createdAt DateTime @default(now()) @map("created_at")
15
14
  updatedAt DateTime @updatedAt @map("updated_at")
16
15
 
@@ -19,4 +18,4 @@ model CreditCardCommitment {
19
18
  repaymentType Lookup? @relation("CreditCardRepaymentType", fields: [creditCardRepaymentTypeLid], references: [id])
20
19
 
21
20
  @@map("applicant_creditcard_commitments")
22
- }
21
+ }
@@ -8,9 +8,9 @@ model MortgageCommitment {
8
8
  mortgageTypeLid String? @map("mortgage_type_lid")
9
9
  fixedTerm String? @map("fixed_term")
10
10
  originalLoanAmount Decimal? @map("original_loan_amount") @db.Decimal(10, 2)
11
- outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
11
+ outstandingBalance Decimal? @map("outstanding_balance") @db.Decimal(10, 2)
12
12
  startDate String? @map("start_date")
13
- monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
13
+ monthlyPayment Decimal? @map("monthly_payment") @db.Decimal(10, 2)
14
14
  furtherAdvances Boolean? @map("further_advances")
15
15
  furtherAdvanceDetails String? @map("further_advance_details")
16
16
  accountUptoDate Boolean? @map("account_upto_date")
@@ -19,18 +19,14 @@ model MortgageCommitment {
19
19
  accountInArrearsDetails String? @map("account_in_arrears_details")
20
20
  doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
21
21
  sharedMortgage String? @map("shared_mortgage")
22
- source String? @default("Broker") @map("source")
23
- isSelected Boolean? @default(true) @map("is_selected")
24
- mortgageHPPRationale String? @default("") @map("mortgage_hpp_rationale")
22
+ source String @default("Broker") @map("source")
23
+ isSelected Boolean @default(true) @map("is_selected")
25
24
  financeTypeHppLid String? @map("finance_type_hpp_lid")
26
25
  hppRepaymentTypeLid String? @map("hpp_repayment_type_lid")
27
26
  mortgageRate Float? @map("mortgage_rate")
28
27
  financeHomeTypeLid String? @map("finance_home_type_lid")
29
28
  remainingTermMonth Int? @map("remaining_term_month")
30
29
  chargeTypeLid String? @map("charge_type_lid")
31
- securityDetails String? @map("security_details")
32
- purpose String? @map("purpose")
33
- remainingTerm String? @map("remaining_term")
34
30
  createdAt DateTime @default(now()) @map("created_at")
35
31
  updatedAt DateTime @updatedAt @map("updated_at")
36
32
 
@@ -1,21 +1,27 @@
1
1
  model SecuredLoanCommitment {
2
- id String @id @default(uuid())
3
- applicantId String @map("applicant_id")
4
- lenderName String
5
- commitmentId String
6
- securityDetails String
7
- purpose String
8
- doHaveSharedResponsibility Boolean
9
- sharedMortgage String
10
- remainingTerm String?
11
- startDate String
12
- outstandingBalance Decimal
13
- monthlyPayment Decimal
14
- createdAt DateTime @default(now()) @map("created_at")
15
- updatedAt DateTime @updatedAt @map("updated_at")
2
+ id String @id @default(uuid())
3
+ applicantId String @map("applicant_id")
4
+ lenderName String @map("lender_name")
5
+ commitmentId String @unique @map("commitment_id")
6
+ securityDetails String? @map("security_details")
7
+ purpose String? @map("purpose")
8
+ doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
9
+ sharedMortgage String? @map("shared_mortgage")
10
+ remainingTerm Int? @map("remaining_term")
11
+ startDate String? @map("start_date")
12
+ outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
13
+ monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
14
+ source String @default("Broker") @map("source")
15
+ isSelected Boolean @default(true) @map("is_selected")
16
+ commitmentTypeLid String? @map("commitment_type_lid")
17
+ loanTypeLid String? @map("loan_type_lid")
18
+ createdAt DateTime @default(now()) @map("created_at")
19
+ updatedAt DateTime @updatedAt @map("updated_at")
16
20
 
17
21
  // Relations
18
- applicant Applicant @relation("ApplicantSecuredLoanCommitments", fields: [applicantId], references: [id])
22
+ applicant Applicant @relation("ApplicantSecuredLoanCommitments", fields: [applicantId], references: [id])
23
+ commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
24
+ loanType Lookup? @relation("LoanType", fields: [loanTypeLid], references: [id])
19
25
 
20
26
  @@map("applicant_secured_loan_commitments")
21
- }
27
+ }
@@ -1,20 +1,27 @@
1
1
  model UnsecuredLoanCommitment {
2
- id String @id @default(uuid())
3
- applicantId String @map("applicant_id")
4
- lenderName String
5
- commitmentId String
6
- purpose String
7
- doHaveSharedResponsibility Boolean
8
- sharedMortgage String
9
- remainingTerm String?
10
- startDate String
11
- outstandingBalance Decimal
12
- monthlyPayment Decimal
13
- createdAt DateTime @default(now()) @map("created_at")
14
- updatedAt DateTime @updatedAt @map("updated_at")
2
+ id String @id @default(uuid())
3
+ applicantId String @map("applicant_id")
4
+ lenderName String @map("lender_name")
5
+ commitmentId String @unique @map("commitment_id")
6
+ purpose String? @map("purpose")
7
+ doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
8
+ sharedMortgage String? @map("shared_mortgage")
9
+ remainingTerm Int? @map("remaining_term")
10
+ startDate String? @map("start_date")
11
+ outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
12
+ monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
13
+ source String @default("Broker") @map("source")
14
+ isSelected Boolean @default(true) @map("is_selected")
15
+ commitmentTypeLid String? @map("commitment_type_lid")
16
+ loanTypeLid String? @map("loan_type_lid")
17
+ securityDetails String? @map("security_details")
18
+ createdAt DateTime @default(now()) @map("created_at")
19
+ updatedAt DateTime @updatedAt @map("updated_at")
15
20
 
16
21
  // Relations
17
- applicant Applicant @relation("ApplicantUnsecuredLoanCommitments", fields: [applicantId], references: [id])
22
+ applicant Applicant @relation("ApplicantUnsecuredLoanCommitments", fields: [applicantId], references: [id])
23
+ commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
24
+ loanType Lookup? @relation("LoanType", fields: [loanTypeLid], references: [id])
18
25
 
19
26
  @@map("applicant_unsecured_loan_commitments")
20
- }
27
+ }
@@ -1,43 +1,43 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `sector_experience` on the `securities` table. All the data in the column will be lost.
5
- - Added the required column `sector_experience_lid` to the `securities` table without a default value. This is not possible if the table is not empty.
6
- - Made the column `property_type_lid` on table `securities` required. This step will fail if there are existing NULL values in that column.
7
-
8
- */
9
- -- DropForeignKey
10
- ALTER TABLE "securities" DROP CONSTRAINT "securities_property_tenure_lid_fkey";
11
-
12
- -- DropForeignKey
13
- ALTER TABLE "securities" DROP CONSTRAINT "securities_property_type_lid_fkey";
14
-
15
- -- AlterTable
16
- ALTER TABLE "securities" DROP COLUMN "sector_experience",
17
- ADD COLUMN "sector_experience_lid" TEXT NOT NULL,
18
- ALTER COLUMN "construction_details" DROP DEFAULT,
19
- ALTER COLUMN "flat_number_of_bedrooms" DROP DEFAULT,
20
- ALTER COLUMN "is_ground_rent" DROP DEFAULT,
21
- ALTER COLUMN "house_number_of_living_rooms" DROP DEFAULT,
22
- ALTER COLUMN "house_number_of_tenancies" DROP DEFAULT,
23
- ALTER COLUMN "property_address_city" DROP NOT NULL,
24
- ALTER COLUMN "property_address_city" DROP DEFAULT,
25
- ALTER COLUMN "property_address_line1" DROP DEFAULT,
26
- ALTER COLUMN "property_address_line2" DROP NOT NULL,
27
- ALTER COLUMN "property_address_line3" DROP NOT NULL,
28
- ALTER COLUMN "property_address_post_code" DROP DEFAULT,
29
- ALTER COLUMN "property_tenure_lid" DROP NOT NULL,
30
- ALTER COLUMN "property_type_lid" SET NOT NULL,
31
- ALTER COLUMN "property_year_built" DROP DEFAULT,
32
- ALTER COLUMN "receipt_of_discount_details" DROP DEFAULT,
33
- ALTER COLUMN "service_charge" DROP DEFAULT,
34
- ALTER COLUMN "unexpired_remaining_lease" DROP DEFAULT;
35
-
36
- -- AddForeignKey
37
- ALTER TABLE "securities" ADD CONSTRAINT "securities_property_tenure_lid_fkey" FOREIGN KEY ("property_tenure_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
38
-
39
- -- AddForeignKey
40
- ALTER TABLE "securities" ADD CONSTRAINT "securities_property_type_lid_fkey" FOREIGN KEY ("property_type_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
41
-
42
- -- AddForeignKey
43
- ALTER TABLE "securities" ADD CONSTRAINT "securities_sector_experience_lid_fkey" FOREIGN KEY ("sector_experience_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `sector_experience` on the `securities` table. All the data in the column will be lost.
5
+ - Added the required column `sector_experience_lid` to the `securities` table without a default value. This is not possible if the table is not empty.
6
+ - Made the column `property_type_lid` on table `securities` required. This step will fail if there are existing NULL values in that column.
7
+
8
+ */
9
+ -- DropForeignKey
10
+ ALTER TABLE "securities" DROP CONSTRAINT "securities_property_tenure_lid_fkey";
11
+
12
+ -- DropForeignKey
13
+ ALTER TABLE "securities" DROP CONSTRAINT "securities_property_type_lid_fkey";
14
+
15
+ -- AlterTable
16
+ ALTER TABLE "securities" DROP COLUMN "sector_experience",
17
+ ADD COLUMN "sector_experience_lid" TEXT NOT NULL,
18
+ ALTER COLUMN "construction_details" DROP DEFAULT,
19
+ ALTER COLUMN "flat_number_of_bedrooms" DROP DEFAULT,
20
+ ALTER COLUMN "is_ground_rent" DROP DEFAULT,
21
+ ALTER COLUMN "house_number_of_living_rooms" DROP DEFAULT,
22
+ ALTER COLUMN "house_number_of_tenancies" DROP DEFAULT,
23
+ ALTER COLUMN "property_address_city" DROP NOT NULL,
24
+ ALTER COLUMN "property_address_city" DROP DEFAULT,
25
+ ALTER COLUMN "property_address_line1" DROP DEFAULT,
26
+ ALTER COLUMN "property_address_line2" DROP NOT NULL,
27
+ ALTER COLUMN "property_address_line3" DROP NOT NULL,
28
+ ALTER COLUMN "property_address_post_code" DROP DEFAULT,
29
+ ALTER COLUMN "property_tenure_lid" DROP NOT NULL,
30
+ ALTER COLUMN "property_type_lid" SET NOT NULL,
31
+ ALTER COLUMN "property_year_built" DROP DEFAULT,
32
+ ALTER COLUMN "receipt_of_discount_details" DROP DEFAULT,
33
+ ALTER COLUMN "service_charge" DROP DEFAULT,
34
+ ALTER COLUMN "unexpired_remaining_lease" DROP DEFAULT;
35
+
36
+ -- AddForeignKey
37
+ ALTER TABLE "securities" ADD CONSTRAINT "securities_property_tenure_lid_fkey" FOREIGN KEY ("property_tenure_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
38
+
39
+ -- AddForeignKey
40
+ ALTER TABLE "securities" ADD CONSTRAINT "securities_property_type_lid_fkey" FOREIGN KEY ("property_type_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
41
+
42
+ -- AddForeignKey
43
+ ALTER TABLE "securities" ADD CONSTRAINT "securities_sector_experience_lid_fkey" FOREIGN KEY ("sector_experience_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -1,14 +1,14 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `user_id` on the `underwriters` table. All the data in the column will be lost.
5
-
6
- */
7
- -- DropForeignKey
8
- ALTER TABLE "underwriters" DROP CONSTRAINT "underwriters_user_id_fkey";
9
-
10
- -- AlterTable
11
- ALTER TABLE "underwriters" DROP COLUMN "user_id";
12
-
13
- -- AddForeignKey
14
- ALTER TABLE "underwriters" ADD CONSTRAINT "underwriters_underwriter_id_fkey" FOREIGN KEY ("underwriter_id") REFERENCES "users"("account_id") ON DELETE RESTRICT ON UPDATE CASCADE;
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `user_id` on the `underwriters` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- DropForeignKey
8
+ ALTER TABLE "underwriters" DROP CONSTRAINT "underwriters_user_id_fkey";
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "underwriters" DROP COLUMN "user_id";
12
+
13
+ -- AddForeignKey
14
+ ALTER TABLE "underwriters" ADD CONSTRAINT "underwriters_underwriter_id_fkey" FOREIGN KEY ("underwriter_id") REFERENCES "users"("account_id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,134 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `credit_card_rationale` on the `applicant_creditcard_commitments` table. All the data in the column will be lost.
5
+ - You are about to drop the column `mortgage_hpp_rationale` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
6
+ - You are about to drop the column `purpose` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
7
+ - You are about to drop the column `remaining_term` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
8
+ - You are about to drop the column `security_details` on the `applicant_mortgage_commitments` table. All the data in the column will be lost.
9
+ - You are about to drop the column `commitmentId` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
10
+ - You are about to drop the column `doHaveSharedResponsibility` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
11
+ - You are about to drop the column `lenderName` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
12
+ - You are about to drop the column `monthlyPayment` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
13
+ - You are about to drop the column `outstandingBalance` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
14
+ - You are about to drop the column `remainingTerm` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
15
+ - You are about to drop the column `securityDetails` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
16
+ - You are about to drop the column `sharedMortgage` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
17
+ - You are about to drop the column `startDate` on the `applicant_secured_loan_commitments` table. All the data in the column will be lost.
18
+ - You are about to drop the column `commitmentId` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
19
+ - You are about to drop the column `doHaveSharedResponsibility` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
20
+ - You are about to drop the column `lenderName` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
21
+ - You are about to drop the column `monthlyPayment` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
22
+ - You are about to drop the column `outstandingBalance` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
23
+ - You are about to drop the column `remainingTerm` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
24
+ - You are about to drop the column `sharedMortgage` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
25
+ - You are about to drop the column `startDate` on the `applicant_unsecured_loan_commitments` table. All the data in the column will be lost.
26
+ - A unique constraint covering the columns `[commitment_id]` on the table `applicant_secured_loan_commitments` will be added. If there are existing duplicate values, this will fail.
27
+ - A unique constraint covering the columns `[commitment_id]` on the table `applicant_unsecured_loan_commitments` will be added. If there are existing duplicate values, this will fail.
28
+ - Made the column `lender_name` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
29
+ - Made the column `is_selected` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
30
+ - Made the column `source` on table `applicant_creditcard_commitments` required. This step will fail if there are existing NULL values in that column.
31
+ - Made the column `is_selected` on table `applicant_mortgage_commitments` required. This step will fail if there are existing NULL values in that column.
32
+ - Made the column `source` on table `applicant_mortgage_commitments` required. This step will fail if there are existing NULL values in that column.
33
+ - Added the required column `commitment_id` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
34
+ - Added the required column `lender_name` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
35
+ - Added the required column `monthly_payment` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
36
+ - Added the required column `outstanding_balance` to the `applicant_secured_loan_commitments` table without a default value. This is not possible if the table is not empty.
37
+ - Added the required column `commitment_id` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
38
+ - Added the required column `lender_name` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
39
+ - Added the required column `monthly_payment` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
40
+ - Added the required column `outstanding_balance` to the `applicant_unsecured_loan_commitments` table without a default value. This is not possible if the table is not empty.
41
+
42
+ */
43
+ -- DropForeignKey
44
+ ALTER TABLE "applicant_creditcard_commitments" DROP CONSTRAINT "applicant_creditcard_commitments_credit_card_repayment_typ_fkey";
45
+
46
+ -- DropIndex
47
+ DROP INDEX "applicant_creditcard_commitments_commitment_id_key";
48
+
49
+ -- AlterTable
50
+ ALTER TABLE "applicant_creditcard_commitments" DROP COLUMN "credit_card_rationale",
51
+ ALTER COLUMN "lender_name" SET NOT NULL,
52
+ ALTER COLUMN "credit_card_repayment_type_lid" DROP NOT NULL,
53
+ ALTER COLUMN "is_selected" SET NOT NULL,
54
+ ALTER COLUMN "source" SET NOT NULL;
55
+
56
+ -- AlterTable
57
+ ALTER TABLE "applicant_mortgage_commitments" DROP COLUMN "mortgage_hpp_rationale",
58
+ DROP COLUMN "purpose",
59
+ DROP COLUMN "remaining_term",
60
+ DROP COLUMN "security_details",
61
+ ALTER COLUMN "outstanding_balance" DROP NOT NULL,
62
+ ALTER COLUMN "monthly_payment" DROP NOT NULL,
63
+ ALTER COLUMN "is_selected" SET NOT NULL,
64
+ ALTER COLUMN "source" SET NOT NULL;
65
+
66
+ -- AlterTable
67
+ ALTER TABLE "applicant_secured_loan_commitments" DROP COLUMN "commitmentId",
68
+ DROP COLUMN "doHaveSharedResponsibility",
69
+ DROP COLUMN "lenderName",
70
+ DROP COLUMN "monthlyPayment",
71
+ DROP COLUMN "outstandingBalance",
72
+ DROP COLUMN "remainingTerm",
73
+ DROP COLUMN "securityDetails",
74
+ DROP COLUMN "sharedMortgage",
75
+ DROP COLUMN "startDate",
76
+ ADD COLUMN "commitment_id" TEXT NOT NULL,
77
+ ADD COLUMN "commitment_type_lid" TEXT,
78
+ ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
79
+ ADD COLUMN "is_selected" BOOLEAN NOT NULL DEFAULT true,
80
+ ADD COLUMN "lender_name" TEXT NOT NULL,
81
+ ADD COLUMN "loan_type_lid" TEXT,
82
+ ADD COLUMN "monthly_payment" DECIMAL(10,2) NOT NULL,
83
+ ADD COLUMN "outstanding_balance" DECIMAL(10,2) NOT NULL,
84
+ ADD COLUMN "remaining_term" INTEGER,
85
+ ADD COLUMN "security_details" TEXT,
86
+ ADD COLUMN "shared_mortgage" TEXT,
87
+ ADD COLUMN "source" TEXT NOT NULL DEFAULT 'Broker',
88
+ ADD COLUMN "start_date" TEXT,
89
+ ALTER COLUMN "purpose" DROP NOT NULL;
90
+
91
+ -- AlterTable
92
+ ALTER TABLE "applicant_unsecured_loan_commitments" DROP COLUMN "commitmentId",
93
+ DROP COLUMN "doHaveSharedResponsibility",
94
+ DROP COLUMN "lenderName",
95
+ DROP COLUMN "monthlyPayment",
96
+ DROP COLUMN "outstandingBalance",
97
+ DROP COLUMN "remainingTerm",
98
+ DROP COLUMN "sharedMortgage",
99
+ DROP COLUMN "startDate",
100
+ ADD COLUMN "commitment_id" TEXT NOT NULL,
101
+ ADD COLUMN "commitment_type_lid" TEXT,
102
+ ADD COLUMN "do_have_shared_responsibility" BOOLEAN,
103
+ ADD COLUMN "is_selected" BOOLEAN NOT NULL DEFAULT true,
104
+ ADD COLUMN "lender_name" TEXT NOT NULL,
105
+ ADD COLUMN "loan_type_lid" TEXT,
106
+ ADD COLUMN "monthly_payment" DECIMAL(10,2) NOT NULL,
107
+ ADD COLUMN "outstanding_balance" DECIMAL(10,2) NOT NULL,
108
+ ADD COLUMN "remaining_term" INTEGER,
109
+ ADD COLUMN "security_details" TEXT,
110
+ ADD COLUMN "shared_mortgage" TEXT,
111
+ ADD COLUMN "source" TEXT NOT NULL DEFAULT 'Broker',
112
+ ADD COLUMN "start_date" TEXT,
113
+ ALTER COLUMN "purpose" DROP NOT NULL;
114
+
115
+ -- CreateIndex
116
+ CREATE UNIQUE INDEX "applicant_secured_loan_commitments_commitment_id_key" ON "applicant_secured_loan_commitments"("commitment_id");
117
+
118
+ -- CreateIndex
119
+ CREATE UNIQUE INDEX "applicant_unsecured_loan_commitments_commitment_id_key" ON "applicant_unsecured_loan_commitments"("commitment_id");
120
+
121
+ -- AddForeignKey
122
+ ALTER TABLE "applicant_creditcard_commitments" ADD CONSTRAINT "applicant_creditcard_commitments_credit_card_repayment_typ_fkey" FOREIGN KEY ("credit_card_repayment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
123
+
124
+ -- AddForeignKey
125
+ ALTER TABLE "applicant_secured_loan_commitments" ADD CONSTRAINT "applicant_secured_loan_commitments_commitment_type_lid_fkey" FOREIGN KEY ("commitment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
126
+
127
+ -- AddForeignKey
128
+ ALTER TABLE "applicant_secured_loan_commitments" ADD CONSTRAINT "applicant_secured_loan_commitments_loan_type_lid_fkey" FOREIGN KEY ("loan_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
129
+
130
+ -- AddForeignKey
131
+ ALTER TABLE "applicant_unsecured_loan_commitments" ADD CONSTRAINT "applicant_unsecured_loan_commitments_commitment_type_lid_fkey" FOREIGN KEY ("commitment_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
132
+
133
+ -- AddForeignKey
134
+ ALTER TABLE "applicant_unsecured_loan_commitments" ADD CONSTRAINT "applicant_unsecured_loan_commitments_loan_type_lid_fkey" FOREIGN KEY ("loan_type_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,8 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[commitment_id]` on the table `applicant_creditcard_commitments` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- CreateIndex
8
+ CREATE UNIQUE INDEX "applicant_creditcard_commitments_commitment_id_key" ON "applicant_creditcard_commitments"("commitment_id");
@@ -251,6 +251,14 @@ model Lookup {
251
251
  // commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
252
252
  repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
253
253
 
254
+ // SecuredLoanCommitment Relations
255
+ commitmentType_securedLoanCommitments SecuredLoanCommitment[] @relation("CommitmentType")
256
+ loanType_securedLoanCommitments SecuredLoanCommitment[] @relation("LoanType")
257
+
258
+ // UnsecuredLoanCommitment Relations
259
+ commitmentType_unsecuredLoanCommitments UnsecuredLoanCommitment[] @relation("CommitmentType")
260
+ loanType_unsecuredLoanCommitments UnsecuredLoanCommitment[] @relation("LoanType")
261
+
254
262
  creditDataStatus ApplicantCreditData[] @relation("CreditDataStatus")
255
263
  incomeSourceEmploymentStatus ApplicantIncomeSource[] @relation("IncomeSourceEmploymentStatus")
256
264
  applicantEmploymentIncome ApplicantEmploymentIncome[] @relation("ApplicantEmploymentIncomeType")
@@ -911,15 +919,14 @@ model CreditCardCommitment {
911
919
  id String @id @default(uuid())
912
920
  applicantId String @map("applicant_id")
913
921
  commitmentId String @unique @map("commitment_id")
914
- lenderName String? @map("lender_name")
922
+ lenderName String @map("lender_name")
915
923
  creditLimit Decimal @map("credit_limit") @db.Decimal(10, 2)
916
924
  outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
917
- creditCardRepaymentTypeLid String @map("credit_card_repayment_type_lid")
925
+ creditCardRepaymentTypeLid String? @map("credit_card_repayment_type_lid")
918
926
  monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
919
927
  jointNames Boolean? @map("joint_names")
920
- source String? @default("Broker") @map("source")
921
- isSelected Boolean? @default(true) @map("is_selected")
922
- creditCardRationale String? @default("") @map("credit_card_rationale")
928
+ source String @default("Broker") @map("source")
929
+ isSelected Boolean @default(true) @map("is_selected")
923
930
  createdAt DateTime @default(now()) @map("created_at")
924
931
  updatedAt DateTime @updatedAt @map("updated_at")
925
932
 
@@ -969,9 +976,9 @@ model MortgageCommitment {
969
976
  mortgageTypeLid String? @map("mortgage_type_lid")
970
977
  fixedTerm String? @map("fixed_term")
971
978
  originalLoanAmount Decimal? @map("original_loan_amount") @db.Decimal(10, 2)
972
- outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
979
+ outstandingBalance Decimal? @map("outstanding_balance") @db.Decimal(10, 2)
973
980
  startDate String? @map("start_date")
974
- monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
981
+ monthlyPayment Decimal? @map("monthly_payment") @db.Decimal(10, 2)
975
982
  furtherAdvances Boolean? @map("further_advances")
976
983
  furtherAdvanceDetails String? @map("further_advance_details")
977
984
  accountUptoDate Boolean? @map("account_upto_date")
@@ -980,18 +987,14 @@ model MortgageCommitment {
980
987
  accountInArrearsDetails String? @map("account_in_arrears_details")
981
988
  doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
982
989
  sharedMortgage String? @map("shared_mortgage")
983
- source String? @default("Broker") @map("source")
984
- isSelected Boolean? @default(true) @map("is_selected")
985
- mortgageHPPRationale String? @default("") @map("mortgage_hpp_rationale")
990
+ source String @default("Broker") @map("source")
991
+ isSelected Boolean @default(true) @map("is_selected")
986
992
  financeTypeHppLid String? @map("finance_type_hpp_lid")
987
993
  hppRepaymentTypeLid String? @map("hpp_repayment_type_lid")
988
994
  mortgageRate Float? @map("mortgage_rate")
989
995
  financeHomeTypeLid String? @map("finance_home_type_lid")
990
996
  remainingTermMonth Int? @map("remaining_term_month")
991
997
  chargeTypeLid String? @map("charge_type_lid")
992
- securityDetails String? @map("security_details")
993
- purpose String? @map("purpose")
994
- remainingTerm String? @map("remaining_term")
995
998
  createdAt DateTime @default(now()) @map("created_at")
996
999
  updatedAt DateTime @updatedAt @map("updated_at")
997
1000
 
@@ -1052,45 +1055,58 @@ model ResidenceCommitment {
1052
1055
 
1053
1056
  // From prisma/applicants/secured-loan-commitment.prisma
1054
1057
  model SecuredLoanCommitment {
1055
- id String @id @default(uuid())
1056
- applicantId String @map("applicant_id")
1057
- lenderName String
1058
- commitmentId String
1059
- securityDetails String
1060
- purpose String
1061
- doHaveSharedResponsibility Boolean
1062
- sharedMortgage String
1063
- remainingTerm String?
1064
- startDate String
1065
- outstandingBalance Decimal
1066
- monthlyPayment Decimal
1067
- createdAt DateTime @default(now()) @map("created_at")
1068
- updatedAt DateTime @updatedAt @map("updated_at")
1058
+ id String @id @default(uuid())
1059
+ applicantId String @map("applicant_id")
1060
+ lenderName String @map("lender_name")
1061
+ commitmentId String @unique @map("commitment_id")
1062
+ securityDetails String? @map("security_details")
1063
+ purpose String? @map("purpose")
1064
+ doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
1065
+ sharedMortgage String? @map("shared_mortgage")
1066
+ remainingTerm Int? @map("remaining_term")
1067
+ startDate String? @map("start_date")
1068
+ outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
1069
+ monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
1070
+ source String @default("Broker") @map("source")
1071
+ isSelected Boolean @default(true) @map("is_selected")
1072
+ commitmentTypeLid String? @map("commitment_type_lid")
1073
+ loanTypeLid String? @map("loan_type_lid")
1074
+ createdAt DateTime @default(now()) @map("created_at")
1075
+ updatedAt DateTime @updatedAt @map("updated_at")
1069
1076
 
1070
1077
  // Relations
1071
- applicant Applicant @relation("ApplicantSecuredLoanCommitments", fields: [applicantId], references: [id])
1078
+ applicant Applicant @relation("ApplicantSecuredLoanCommitments", fields: [applicantId], references: [id])
1079
+ commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
1080
+ loanType Lookup? @relation("LoanType", fields: [loanTypeLid], references: [id])
1072
1081
 
1073
1082
  @@map("applicant_secured_loan_commitments")
1074
1083
  }
1075
1084
 
1076
1085
  // From prisma/applicants/unsecured-loan-commitment.prisma
1077
1086
  model UnsecuredLoanCommitment {
1078
- id String @id @default(uuid())
1079
- applicantId String @map("applicant_id")
1080
- lenderName String
1081
- commitmentId String
1082
- purpose String
1083
- doHaveSharedResponsibility Boolean
1084
- sharedMortgage String
1085
- remainingTerm String?
1086
- startDate String
1087
- outstandingBalance Decimal
1088
- monthlyPayment Decimal
1089
- createdAt DateTime @default(now()) @map("created_at")
1090
- updatedAt DateTime @updatedAt @map("updated_at")
1087
+ id String @id @default(uuid())
1088
+ applicantId String @map("applicant_id")
1089
+ lenderName String @map("lender_name")
1090
+ commitmentId String @unique @map("commitment_id")
1091
+ purpose String? @map("purpose")
1092
+ doHaveSharedResponsibility Boolean? @map("do_have_shared_responsibility")
1093
+ sharedMortgage String? @map("shared_mortgage")
1094
+ remainingTerm Int? @map("remaining_term")
1095
+ startDate String? @map("start_date")
1096
+ outstandingBalance Decimal @map("outstanding_balance") @db.Decimal(10, 2)
1097
+ monthlyPayment Decimal @map("monthly_payment") @db.Decimal(10, 2)
1098
+ source String @default("Broker") @map("source")
1099
+ isSelected Boolean @default(true) @map("is_selected")
1100
+ commitmentTypeLid String? @map("commitment_type_lid")
1101
+ loanTypeLid String? @map("loan_type_lid")
1102
+ securityDetails String? @map("security_details")
1103
+ createdAt DateTime @default(now()) @map("created_at")
1104
+ updatedAt DateTime @updatedAt @map("updated_at")
1091
1105
 
1092
1106
  // Relations
1093
- applicant Applicant @relation("ApplicantUnsecuredLoanCommitments", fields: [applicantId], references: [id])
1107
+ applicant Applicant @relation("ApplicantUnsecuredLoanCommitments", fields: [applicantId], references: [id])
1108
+ commitmentType Lookup? @relation("CommitmentType", fields: [commitmentTypeLid], references: [id])
1109
+ loanType Lookup? @relation("LoanType", fields: [loanTypeLid], references: [id])
1094
1110
 
1095
1111
  @@map("applicant_unsecured_loan_commitments")
1096
1112
  }
@@ -130,6 +130,14 @@ model Lookup {
130
130
  // commitmentType_creditCardCommitments CreditCardCommitment[] @relation("CommitmentType")
131
131
  repaymentType_creditCardCommitments CreditCardCommitment[] @relation("CreditCardRepaymentType")
132
132
 
133
+ // SecuredLoanCommitment Relations
134
+ commitmentType_securedLoanCommitments SecuredLoanCommitment[] @relation("CommitmentType")
135
+ loanType_securedLoanCommitments SecuredLoanCommitment[] @relation("LoanType")
136
+
137
+ // UnsecuredLoanCommitment Relations
138
+ commitmentType_unsecuredLoanCommitments UnsecuredLoanCommitment[] @relation("CommitmentType")
139
+ loanType_unsecuredLoanCommitments UnsecuredLoanCommitment[] @relation("LoanType")
140
+
133
141
  creditDataStatus ApplicantCreditData[] @relation("CreditDataStatus")
134
142
  incomeSourceEmploymentStatus ApplicantIncomeSource[] @relation("IncomeSourceEmploymentStatus")
135
143
  applicantEmploymentIncome ApplicantEmploymentIncome[] @relation("ApplicantEmploymentIncomeType")
@@ -143,4 +151,4 @@ model Lookup {
143
151
 
144
152
  @@unique([groupId, value])
145
153
  @@map("lookups")
146
- }
154
+ }