@dynamatix/gb-schemas 2.0.48 → 2.0.49
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/entities/applications/application.entity.d.ts +0 -1
- package/dist/entities/applications/application.entity.d.ts.map +1 -1
- package/dist/entities/underwriter/underwriter.entity.d.ts +10 -8
- package/dist/entities/underwriter/underwriter.entity.d.ts.map +1 -1
- package/entities/applications/application.entity.ts +0 -1
- package/entities/underwriter/underwriter.entity.ts +11 -10
- package/package.json +1 -1
- package/prisma/applicants/applicant-share-holding.prisma +2 -2
- package/prisma/applications/application.prisma +0 -1
- package/prisma/migrations/20250514183537_update_application_company_schema/migration.sql +100 -100
- package/prisma/migrations/20250514194139_update_applicant_share_holding_schema/migration.sql +11 -0
- package/prisma/migrations/20250515132015_update_underwriter_schema/migration.sql +56 -0
- package/prisma/schema.prisma +17 -20
- package/prisma/underwriter/underwriter.prisma +16 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/application.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EA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AG,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"application.entity.d.ts","sourceRoot":"","sources":["../../../entities/applications/application.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,qBAAa,iBAAiB;IAC1B,EAAE,EAAG,MAAM,CAAC;IACZ,OAAO,EAAG,MAAM,EAAE,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAG,MAAM,CAAC;IACvB,oBAAoB,EAAG,OAAO,CAAC;IAC/B,iBAAiB,EAAG,MAAM,CAAC;IAC3B,kBAAkB,EAAG,MAAM,CAAC;IAC5B,aAAa,EAAG,MAAM,CAAC;IACvB,QAAQ,EAAG,MAAM,CAAC;IAClB,WAAW,EAAG,MAAM,CAAC;IACrB,mBAAmB,EAAG,OAAO,CAAC;IAC9B,eAAe,EAAG,MAAM,CAAC;IACzB,gBAAgB,EAAG,OAAO,CAAC;IAC3B,UAAU,E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,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAK9B;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,IAAI,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,IAAI,CAEjC;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,IAAI,CAE/B;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;CACJ"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
export declare class UnderwriterEntity {
|
|
2
2
|
id: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
decisionDate?: Date;
|
|
6
|
-
decisionNotes?: string;
|
|
7
|
-
riskRating?: string;
|
|
8
|
-
riskNotes?: string;
|
|
3
|
+
fullName: string;
|
|
4
|
+
mandateLevel: number;
|
|
9
5
|
underwriterId: string;
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
totalBTLCaseCount: number;
|
|
7
|
+
btlPreOfferCaseCount: number;
|
|
8
|
+
btlPostOfferCaseCount: number;
|
|
9
|
+
totalBridgingCaseCount: number;
|
|
10
|
+
bridgingPreOfferCaseCount: number;
|
|
11
|
+
bridgingPostOfferCaseCount: number;
|
|
12
|
+
bridgingMandateLevel: number;
|
|
12
13
|
createdAt: Date;
|
|
13
14
|
updatedAt: Date;
|
|
15
|
+
userId?: string;
|
|
14
16
|
constructor(partial: Partial<UnderwriterEntity>);
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=underwriter.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"underwriter.entity.d.ts","sourceRoot":"","sources":["../../../entities/underwriter/underwriter.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAiB;IAC1B,EAAE,EAAG,MAAM,CAAC;IACZ,
|
|
1
|
+
{"version":3,"file":"underwriter.entity.d.ts","sourceRoot":"","sources":["../../../entities/underwriter/underwriter.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAiB;IAC1B,EAAE,EAAG,MAAM,CAAC;IACZ,QAAQ,EAAG,MAAM,CAAC;IAClB,YAAY,EAAG,MAAM,CAAC;IACtB,aAAa,EAAG,MAAM,CAAC;IACvB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,oBAAoB,EAAG,MAAM,CAAC;IAC9B,qBAAqB,EAAG,MAAM,CAAC;IAC/B,sBAAsB,EAAG,MAAM,CAAC;IAChC,yBAAyB,EAAG,MAAM,CAAC;IACnC,0BAA0B,EAAG,MAAM,CAAC;IACpC,oBAAoB,EAAG,MAAM,CAAC;IAC9B,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEJ,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC;CAGlD"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
export class UnderwriterEntity {
|
|
2
2
|
id!: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
decisionDate?: Date;
|
|
6
|
-
decisionNotes?: string;
|
|
7
|
-
riskRating?: string;
|
|
8
|
-
riskNotes?: string;
|
|
3
|
+
fullName!: string;
|
|
4
|
+
mandateLevel!: number;
|
|
9
5
|
underwriterId!: string;
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
totalBTLCaseCount!: number;
|
|
7
|
+
btlPreOfferCaseCount!: number;
|
|
8
|
+
btlPostOfferCaseCount!: number;
|
|
9
|
+
totalBridgingCaseCount!: number;
|
|
10
|
+
bridgingPreOfferCaseCount!: number;
|
|
11
|
+
bridgingPostOfferCaseCount!: number;
|
|
12
|
+
bridgingMandateLevel!: number;
|
|
12
13
|
createdAt!: Date;
|
|
13
14
|
updatedAt!: Date;
|
|
14
|
-
|
|
15
|
+
userId?: string;
|
|
15
16
|
|
|
16
17
|
constructor(partial: Partial<UnderwriterEntity>) {
|
|
17
18
|
Object.assign(this, partial);
|
|
18
19
|
}
|
|
19
|
-
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
model ApplicantShareholding {
|
|
2
2
|
id String @id @default(uuid())
|
|
3
|
-
companyId String @
|
|
4
|
-
applicantId String @map("applicant_id")
|
|
3
|
+
companyId String @map("company_id")
|
|
4
|
+
applicantId String @unique @map("applicant_id")
|
|
5
5
|
applicantName String @default("") @map("applicant_name")
|
|
6
6
|
directorShareholderLid String? @map("director_shareholder_lid")
|
|
7
7
|
shareholding Int? @map("shareholding")
|
|
@@ -71,7 +71,6 @@ model Application {
|
|
|
71
71
|
documents ApplicationDocument[]
|
|
72
72
|
notes ApplicationNote[]
|
|
73
73
|
audits ApplicationAudit[]
|
|
74
|
-
underwriters Underwriter[] @relation("ApplicationUnderwriters")
|
|
75
74
|
products ApplicationProduct[] @relation("ApplicationProducts")
|
|
76
75
|
|
|
77
76
|
// Lookup relations
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Warnings:
|
|
3
|
-
|
|
4
|
-
- You are about to drop the column `name` on the `application_companies` table. All the data in the column will be lost.
|
|
5
|
-
- You are about to drop the column `registration_number` on the `application_companies` table. All the data in the column will be lost.
|
|
6
|
-
- You are about to drop the `companies` table. If the table is not empty, all the data it contains will be lost.
|
|
7
|
-
- A unique constraint covering the columns `[company_id]` on the table `applicant_shareholdings` will be added. If there are existing duplicate values, this will fail.
|
|
8
|
-
- Added the required column `address_country_lid` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
9
|
-
- Added the required column `address_line1` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
10
|
-
- Added the required column `business_type_lid` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
11
|
-
- Added the required column `registered_name` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
12
|
-
- Added the required column `registered_number` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
13
|
-
- Added the required column `tax_jurisdiction_lid` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
14
|
-
- Added the required column `trading_since` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
15
|
-
- Added the required column `year_end` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
16
|
-
- Added the required column `year_end1` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
17
|
-
- Added the required column `year_end2` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
18
|
-
- Added the required column `year_end3` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
-- DropForeignKey
|
|
22
|
-
ALTER TABLE "applicant_shareholdings" DROP CONSTRAINT "applicant_shareholdings_company_id_fkey";
|
|
23
|
-
|
|
24
|
-
-- DropForeignKey
|
|
25
|
-
ALTER TABLE "companies" DROP CONSTRAINT "companies_address_country_lid_fkey";
|
|
26
|
-
|
|
27
|
-
-- DropForeignKey
|
|
28
|
-
ALTER TABLE "companies" DROP CONSTRAINT "companies_application_id_fkey";
|
|
29
|
-
|
|
30
|
-
-- DropForeignKey
|
|
31
|
-
ALTER TABLE "companies" DROP CONSTRAINT "companies_application_type_lid_fkey";
|
|
32
|
-
|
|
33
|
-
-- DropForeignKey
|
|
34
|
-
ALTER TABLE "companies" DROP CONSTRAINT "companies_business_type_lid_fkey";
|
|
35
|
-
|
|
36
|
-
-- DropForeignKey
|
|
37
|
-
ALTER TABLE "companies" DROP CONSTRAINT "companies_tax_jurisdiction_lid_fkey";
|
|
38
|
-
|
|
39
|
-
-- AlterTable
|
|
40
|
-
ALTER TABLE "application_companies" DROP COLUMN "name",
|
|
41
|
-
DROP COLUMN "registration_number",
|
|
42
|
-
ADD COLUMN "address_city" TEXT,
|
|
43
|
-
ADD COLUMN "address_country_lid" TEXT NOT NULL,
|
|
44
|
-
ADD COLUMN "address_line1" TEXT NOT NULL,
|
|
45
|
-
ADD COLUMN "address_line2" TEXT,
|
|
46
|
-
ADD COLUMN "address_line3" TEXT,
|
|
47
|
-
ADD COLUMN "address_post_code" TEXT NOT NULL DEFAULT '',
|
|
48
|
-
ADD COLUMN "business_type_lid" TEXT NOT NULL,
|
|
49
|
-
ADD COLUMN "company_any_voluntary_enforced_possession_no" BOOLEAN NOT NULL DEFAULT true,
|
|
50
|
-
ADD COLUMN "company_any_voluntary_enforced_possession_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
51
|
-
ADD COLUMN "company_bankruptcy" TEXT NOT NULL DEFAULT '',
|
|
52
|
-
ADD COLUMN "company_bankruptcy_no" BOOLEAN NOT NULL DEFAULT true,
|
|
53
|
-
ADD COLUMN "company_bankruptcy_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
54
|
-
ADD COLUMN "company_ccj_in_last_three_year_no" BOOLEAN NOT NULL DEFAULT true,
|
|
55
|
-
ADD COLUMN "company_ccj_in_last_three_year_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
56
|
-
ADD COLUMN "company_county_court_judgment" TEXT NOT NULL DEFAULT '',
|
|
57
|
-
ADD COLUMN "company_credit_defaults" TEXT NOT NULL DEFAULT '',
|
|
58
|
-
ADD COLUMN "company_defaults_in_last_year_no" BOOLEAN NOT NULL DEFAULT true,
|
|
59
|
-
ADD COLUMN "company_defaults_in_last_year_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
60
|
-
ADD COLUMN "company_secured_arrears" TEXT NOT NULL DEFAULT '',
|
|
61
|
-
ADD COLUMN "company_unsecured_arrears" TEXT NOT NULL DEFAULT '',
|
|
62
|
-
ADD COLUMN "date_of_incorporation" TEXT,
|
|
63
|
-
ADD COLUMN "do_you_know_registered_number" BOOLEAN NOT NULL DEFAULT true,
|
|
64
|
-
ADD COLUMN "epc" TEXT NOT NULL DEFAULT '',
|
|
65
|
-
ADD COLUMN "nature_of_business" TEXT NOT NULL DEFAULT '',
|
|
66
|
-
ADD COLUMN "net_profit_year1" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
67
|
-
ADD COLUMN "net_profit_year2" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
68
|
-
ADD COLUMN "net_profit_year3" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
69
|
-
ADD COLUMN "page_valid_flag" BOOLEAN DEFAULT true,
|
|
70
|
-
ADD COLUMN "registered_name" TEXT NOT NULL,
|
|
71
|
-
ADD COLUMN "registered_number" INTEGER NOT NULL,
|
|
72
|
-
ADD COLUMN "remaining_lease" TEXT NOT NULL DEFAULT '',
|
|
73
|
-
ADD COLUMN "sic_codes" TEXT[],
|
|
74
|
-
ADD COLUMN "tax_jurisdiction_lid" TEXT NOT NULL,
|
|
75
|
-
ADD COLUMN "trading_since" TEXT NOT NULL,
|
|
76
|
-
ADD COLUMN "turnover_year1" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
77
|
-
ADD COLUMN "turnover_year2" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
78
|
-
ADD COLUMN "turnover_year3" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
79
|
-
ADD COLUMN "year_end" TEXT NOT NULL,
|
|
80
|
-
ADD COLUMN "year_end1" INTEGER NOT NULL,
|
|
81
|
-
ADD COLUMN "year_end2" INTEGER NOT NULL,
|
|
82
|
-
ADD COLUMN "year_end3" INTEGER NOT NULL;
|
|
83
|
-
|
|
84
|
-
-- DropTable
|
|
85
|
-
DROP TABLE "companies";
|
|
86
|
-
|
|
87
|
-
-- CreateIndex
|
|
88
|
-
CREATE UNIQUE INDEX "applicant_shareholdings_company_id_key" ON "applicant_shareholdings"("company_id");
|
|
89
|
-
|
|
90
|
-
-- AddForeignKey
|
|
91
|
-
ALTER TABLE "applicant_shareholdings" ADD CONSTRAINT "applicant_shareholdings_company_id_fkey" FOREIGN KEY ("company_id") REFERENCES "application_companies"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
92
|
-
|
|
93
|
-
-- AddForeignKey
|
|
94
|
-
ALTER TABLE "application_companies" ADD CONSTRAINT "application_companies_business_type_lid_fkey" FOREIGN KEY ("business_type_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
95
|
-
|
|
96
|
-
-- AddForeignKey
|
|
97
|
-
ALTER TABLE "application_companies" ADD CONSTRAINT "application_companies_tax_jurisdiction_lid_fkey" FOREIGN KEY ("tax_jurisdiction_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
98
|
-
|
|
99
|
-
-- AddForeignKey
|
|
100
|
-
ALTER TABLE "application_companies" ADD CONSTRAINT "application_companies_address_country_lid_fkey" FOREIGN KEY ("address_country_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `name` on the `application_companies` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `registration_number` on the `application_companies` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the `companies` table. If the table is not empty, all the data it contains will be lost.
|
|
7
|
+
- A unique constraint covering the columns `[company_id]` on the table `applicant_shareholdings` will be added. If there are existing duplicate values, this will fail.
|
|
8
|
+
- Added the required column `address_country_lid` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
9
|
+
- Added the required column `address_line1` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
10
|
+
- Added the required column `business_type_lid` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
11
|
+
- Added the required column `registered_name` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
12
|
+
- Added the required column `registered_number` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
13
|
+
- Added the required column `tax_jurisdiction_lid` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
14
|
+
- Added the required column `trading_since` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
15
|
+
- Added the required column `year_end` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
16
|
+
- Added the required column `year_end1` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
17
|
+
- Added the required column `year_end2` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
18
|
+
- Added the required column `year_end3` to the `application_companies` table without a default value. This is not possible if the table is not empty.
|
|
19
|
+
|
|
20
|
+
*/
|
|
21
|
+
-- DropForeignKey
|
|
22
|
+
ALTER TABLE "applicant_shareholdings" DROP CONSTRAINT "applicant_shareholdings_company_id_fkey";
|
|
23
|
+
|
|
24
|
+
-- DropForeignKey
|
|
25
|
+
ALTER TABLE "companies" DROP CONSTRAINT "companies_address_country_lid_fkey";
|
|
26
|
+
|
|
27
|
+
-- DropForeignKey
|
|
28
|
+
ALTER TABLE "companies" DROP CONSTRAINT "companies_application_id_fkey";
|
|
29
|
+
|
|
30
|
+
-- DropForeignKey
|
|
31
|
+
ALTER TABLE "companies" DROP CONSTRAINT "companies_application_type_lid_fkey";
|
|
32
|
+
|
|
33
|
+
-- DropForeignKey
|
|
34
|
+
ALTER TABLE "companies" DROP CONSTRAINT "companies_business_type_lid_fkey";
|
|
35
|
+
|
|
36
|
+
-- DropForeignKey
|
|
37
|
+
ALTER TABLE "companies" DROP CONSTRAINT "companies_tax_jurisdiction_lid_fkey";
|
|
38
|
+
|
|
39
|
+
-- AlterTable
|
|
40
|
+
ALTER TABLE "application_companies" DROP COLUMN "name",
|
|
41
|
+
DROP COLUMN "registration_number",
|
|
42
|
+
ADD COLUMN "address_city" TEXT,
|
|
43
|
+
ADD COLUMN "address_country_lid" TEXT NOT NULL,
|
|
44
|
+
ADD COLUMN "address_line1" TEXT NOT NULL,
|
|
45
|
+
ADD COLUMN "address_line2" TEXT,
|
|
46
|
+
ADD COLUMN "address_line3" TEXT,
|
|
47
|
+
ADD COLUMN "address_post_code" TEXT NOT NULL DEFAULT '',
|
|
48
|
+
ADD COLUMN "business_type_lid" TEXT NOT NULL,
|
|
49
|
+
ADD COLUMN "company_any_voluntary_enforced_possession_no" BOOLEAN NOT NULL DEFAULT true,
|
|
50
|
+
ADD COLUMN "company_any_voluntary_enforced_possession_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
51
|
+
ADD COLUMN "company_bankruptcy" TEXT NOT NULL DEFAULT '',
|
|
52
|
+
ADD COLUMN "company_bankruptcy_no" BOOLEAN NOT NULL DEFAULT true,
|
|
53
|
+
ADD COLUMN "company_bankruptcy_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
54
|
+
ADD COLUMN "company_ccj_in_last_three_year_no" BOOLEAN NOT NULL DEFAULT true,
|
|
55
|
+
ADD COLUMN "company_ccj_in_last_three_year_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
56
|
+
ADD COLUMN "company_county_court_judgment" TEXT NOT NULL DEFAULT '',
|
|
57
|
+
ADD COLUMN "company_credit_defaults" TEXT NOT NULL DEFAULT '',
|
|
58
|
+
ADD COLUMN "company_defaults_in_last_year_no" BOOLEAN NOT NULL DEFAULT true,
|
|
59
|
+
ADD COLUMN "company_defaults_in_last_year_yes" BOOLEAN NOT NULL DEFAULT false,
|
|
60
|
+
ADD COLUMN "company_secured_arrears" TEXT NOT NULL DEFAULT '',
|
|
61
|
+
ADD COLUMN "company_unsecured_arrears" TEXT NOT NULL DEFAULT '',
|
|
62
|
+
ADD COLUMN "date_of_incorporation" TEXT,
|
|
63
|
+
ADD COLUMN "do_you_know_registered_number" BOOLEAN NOT NULL DEFAULT true,
|
|
64
|
+
ADD COLUMN "epc" TEXT NOT NULL DEFAULT '',
|
|
65
|
+
ADD COLUMN "nature_of_business" TEXT NOT NULL DEFAULT '',
|
|
66
|
+
ADD COLUMN "net_profit_year1" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
67
|
+
ADD COLUMN "net_profit_year2" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
68
|
+
ADD COLUMN "net_profit_year3" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
69
|
+
ADD COLUMN "page_valid_flag" BOOLEAN DEFAULT true,
|
|
70
|
+
ADD COLUMN "registered_name" TEXT NOT NULL,
|
|
71
|
+
ADD COLUMN "registered_number" INTEGER NOT NULL,
|
|
72
|
+
ADD COLUMN "remaining_lease" TEXT NOT NULL DEFAULT '',
|
|
73
|
+
ADD COLUMN "sic_codes" TEXT[],
|
|
74
|
+
ADD COLUMN "tax_jurisdiction_lid" TEXT NOT NULL,
|
|
75
|
+
ADD COLUMN "trading_since" TEXT NOT NULL,
|
|
76
|
+
ADD COLUMN "turnover_year1" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
77
|
+
ADD COLUMN "turnover_year2" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
78
|
+
ADD COLUMN "turnover_year3" DECIMAL(65,30) NOT NULL DEFAULT 0.00,
|
|
79
|
+
ADD COLUMN "year_end" TEXT NOT NULL,
|
|
80
|
+
ADD COLUMN "year_end1" INTEGER NOT NULL,
|
|
81
|
+
ADD COLUMN "year_end2" INTEGER NOT NULL,
|
|
82
|
+
ADD COLUMN "year_end3" INTEGER NOT NULL;
|
|
83
|
+
|
|
84
|
+
-- DropTable
|
|
85
|
+
DROP TABLE "companies";
|
|
86
|
+
|
|
87
|
+
-- CreateIndex
|
|
88
|
+
CREATE UNIQUE INDEX "applicant_shareholdings_company_id_key" ON "applicant_shareholdings"("company_id");
|
|
89
|
+
|
|
90
|
+
-- AddForeignKey
|
|
91
|
+
ALTER TABLE "applicant_shareholdings" ADD CONSTRAINT "applicant_shareholdings_company_id_fkey" FOREIGN KEY ("company_id") REFERENCES "application_companies"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
92
|
+
|
|
93
|
+
-- AddForeignKey
|
|
94
|
+
ALTER TABLE "application_companies" ADD CONSTRAINT "application_companies_business_type_lid_fkey" FOREIGN KEY ("business_type_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
95
|
+
|
|
96
|
+
-- AddForeignKey
|
|
97
|
+
ALTER TABLE "application_companies" ADD CONSTRAINT "application_companies_tax_jurisdiction_lid_fkey" FOREIGN KEY ("tax_jurisdiction_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
98
|
+
|
|
99
|
+
-- AddForeignKey
|
|
100
|
+
ALTER TABLE "application_companies" ADD CONSTRAINT "application_companies_address_country_lid_fkey" FOREIGN KEY ("address_country_lid") REFERENCES "lookups"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- A unique constraint covering the columns `[applicant_id]` on the table `applicant_shareholdings` will be added. If there are existing duplicate values, this will fail.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
-- DropIndex
|
|
8
|
+
DROP INDEX "applicant_shareholdings_company_id_key";
|
|
9
|
+
|
|
10
|
+
-- CreateIndex
|
|
11
|
+
CREATE UNIQUE INDEX "applicant_shareholdings_applicant_id_key" ON "applicant_shareholdings"("applicant_id");
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `application_id` on the `underwriters` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `assigned_date` on the `underwriters` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `completed_date` on the `underwriters` table. All the data in the column will be lost.
|
|
7
|
+
- You are about to drop the column `decision` on the `underwriters` table. All the data in the column will be lost.
|
|
8
|
+
- You are about to drop the column `decision_date` on the `underwriters` table. All the data in the column will be lost.
|
|
9
|
+
- You are about to drop the column `decision_notes` on the `underwriters` table. All the data in the column will be lost.
|
|
10
|
+
- You are about to drop the column `risk_notes` on the `underwriters` table. All the data in the column will be lost.
|
|
11
|
+
- You are about to drop the column `risk_rating` on the `underwriters` table. All the data in the column will be lost.
|
|
12
|
+
- You are about to drop the column `status` on the `underwriters` table. All the data in the column will be lost.
|
|
13
|
+
- A unique constraint covering the columns `[underwriter_id]` on the table `underwriters` will be added. If there are existing duplicate values, this will fail.
|
|
14
|
+
- Added the required column `bridging_mandate_level` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
15
|
+
- Added the required column `bridging_post_offer_case_count` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
16
|
+
- Added the required column `bridging_pre_offer_case_count` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
17
|
+
- Added the required column `btl_post_offer_case_count` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
18
|
+
- Added the required column `btl_pre_offer_case_count` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
19
|
+
- Added the required column `full_name` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
20
|
+
- Added the required column `mandate_level` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
21
|
+
- Added the required column `total_bridging_case_count` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
22
|
+
- Added the required column `total_btl_case_count` to the `underwriters` table without a default value. This is not possible if the table is not empty.
|
|
23
|
+
|
|
24
|
+
*/
|
|
25
|
+
-- DropForeignKey
|
|
26
|
+
ALTER TABLE "underwriters" DROP CONSTRAINT "underwriters_application_id_fkey";
|
|
27
|
+
|
|
28
|
+
-- DropForeignKey
|
|
29
|
+
ALTER TABLE "underwriters" DROP CONSTRAINT "underwriters_underwriter_id_fkey";
|
|
30
|
+
|
|
31
|
+
-- AlterTable
|
|
32
|
+
ALTER TABLE "underwriters" DROP COLUMN "application_id",
|
|
33
|
+
DROP COLUMN "assigned_date",
|
|
34
|
+
DROP COLUMN "completed_date",
|
|
35
|
+
DROP COLUMN "decision",
|
|
36
|
+
DROP COLUMN "decision_date",
|
|
37
|
+
DROP COLUMN "decision_notes",
|
|
38
|
+
DROP COLUMN "risk_notes",
|
|
39
|
+
DROP COLUMN "risk_rating",
|
|
40
|
+
DROP COLUMN "status",
|
|
41
|
+
ADD COLUMN "bridging_mandate_level" INTEGER NOT NULL,
|
|
42
|
+
ADD COLUMN "bridging_post_offer_case_count" INTEGER NOT NULL,
|
|
43
|
+
ADD COLUMN "bridging_pre_offer_case_count" INTEGER NOT NULL,
|
|
44
|
+
ADD COLUMN "btl_post_offer_case_count" INTEGER NOT NULL,
|
|
45
|
+
ADD COLUMN "btl_pre_offer_case_count" INTEGER NOT NULL,
|
|
46
|
+
ADD COLUMN "full_name" TEXT NOT NULL,
|
|
47
|
+
ADD COLUMN "mandate_level" INTEGER NOT NULL,
|
|
48
|
+
ADD COLUMN "total_bridging_case_count" INTEGER NOT NULL,
|
|
49
|
+
ADD COLUMN "total_btl_case_count" INTEGER NOT NULL,
|
|
50
|
+
ADD COLUMN "user_id" TEXT;
|
|
51
|
+
|
|
52
|
+
-- CreateIndex
|
|
53
|
+
CREATE UNIQUE INDEX "underwriters_underwriter_id_key" ON "underwriters"("underwriter_id");
|
|
54
|
+
|
|
55
|
+
-- AddForeignKey
|
|
56
|
+
ALTER TABLE "underwriters" ADD CONSTRAINT "underwriters_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -758,8 +758,8 @@ model ApplicantPropertyIncome {
|
|
|
758
758
|
// From prisma/applicants/applicant-share-holding.prisma
|
|
759
759
|
model ApplicantShareholding {
|
|
760
760
|
id String @id @default(uuid())
|
|
761
|
-
companyId String @
|
|
762
|
-
applicantId String @map("applicant_id")
|
|
761
|
+
companyId String @map("company_id")
|
|
762
|
+
applicantId String @unique @map("applicant_id")
|
|
763
763
|
applicantName String @default("") @map("applicant_name")
|
|
764
764
|
directorShareholderLid String? @map("director_shareholder_lid")
|
|
765
765
|
shareholding Int? @map("shareholding")
|
|
@@ -1554,7 +1554,6 @@ model Application {
|
|
|
1554
1554
|
documents ApplicationDocument[]
|
|
1555
1555
|
notes ApplicationNote[]
|
|
1556
1556
|
audits ApplicationAudit[]
|
|
1557
|
-
underwriters Underwriter[] @relation("ApplicationUnderwriters")
|
|
1558
1557
|
products ApplicationProduct[] @relation("ApplicationProducts")
|
|
1559
1558
|
|
|
1560
1559
|
// Lookup relations
|
|
@@ -1858,23 +1857,21 @@ model DataStreet {
|
|
|
1858
1857
|
|
|
1859
1858
|
// From prisma/underwriter/underwriter.prisma
|
|
1860
1859
|
model Underwriter {
|
|
1861
|
-
id
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
createdAt
|
|
1873
|
-
updatedAt
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
application Application @relation("ApplicationUnderwriters", fields: [applicationId], references: [id])
|
|
1877
|
-
underwriter User @relation("UserUnderwriters", fields: [underwriterId], references: [id])
|
|
1860
|
+
id String @id @default(uuid())
|
|
1861
|
+
fullName String @map("full_name")
|
|
1862
|
+
mandateLevel Int @map("mandate_level")
|
|
1863
|
+
underwriterId String @unique @map("underwriter_id")
|
|
1864
|
+
totalBTLCaseCount Int @map("total_btl_case_count")
|
|
1865
|
+
btlPreOfferCaseCount Int @map("btl_pre_offer_case_count")
|
|
1866
|
+
btlPostOfferCaseCount Int @map("btl_post_offer_case_count")
|
|
1867
|
+
totalBridgingCaseCount Int @map("total_bridging_case_count")
|
|
1868
|
+
bridgingPreOfferCaseCount Int @map("bridging_pre_offer_case_count")
|
|
1869
|
+
bridgingPostOfferCaseCount Int @map("bridging_post_offer_case_count")
|
|
1870
|
+
bridgingMandateLevel Int @map("bridging_mandate_level")
|
|
1871
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
1872
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
1873
|
+
userId String? @map("user_id")
|
|
1874
|
+
user User? @relation("UserUnderwriters", fields: [userId], references: [id])
|
|
1878
1875
|
|
|
1879
1876
|
@@map("underwriters")
|
|
1880
1877
|
}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
model Underwriter {
|
|
2
|
-
id
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
createdAt
|
|
14
|
-
updatedAt
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
application Application @relation("ApplicationUnderwriters", fields: [applicationId], references: [id])
|
|
18
|
-
underwriter User @relation("UserUnderwriters", fields: [underwriterId], references: [id])
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
fullName String @map("full_name")
|
|
4
|
+
mandateLevel Int @map("mandate_level")
|
|
5
|
+
underwriterId String @unique @map("underwriter_id")
|
|
6
|
+
totalBTLCaseCount Int @map("total_btl_case_count")
|
|
7
|
+
btlPreOfferCaseCount Int @map("btl_pre_offer_case_count")
|
|
8
|
+
btlPostOfferCaseCount Int @map("btl_post_offer_case_count")
|
|
9
|
+
totalBridgingCaseCount Int @map("total_bridging_case_count")
|
|
10
|
+
bridgingPreOfferCaseCount Int @map("bridging_pre_offer_case_count")
|
|
11
|
+
bridgingPostOfferCaseCount Int @map("bridging_post_offer_case_count")
|
|
12
|
+
bridgingMandateLevel Int @map("bridging_mandate_level")
|
|
13
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
14
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
15
|
+
userId String? @map("user_id")
|
|
16
|
+
user User? @relation("UserUnderwriters", fields: [userId], references: [id])
|
|
19
17
|
|
|
20
18
|
@@map("underwriters")
|
|
21
|
-
}
|
|
19
|
+
}
|