@kanda-libs/ks-component-ts 0.2.205 → 0.2.207

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanda-libs/ks-component-ts",
3
- "version": "0.2.205",
3
+ "version": "0.2.207",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,12 +1,11 @@
1
1
  import * as t from "io-ts";
2
- import { Document } from "./Document";
3
2
 
4
3
  export const Approval = t.intersection([
5
4
  t.type({
6
5
  outcome: t.union([
7
6
  t.literal("PASS"),
8
- t.literal("FAIL"),
9
7
  t.literal("REVIEW"),
8
+ t.literal("FAIL"),
10
9
  ]),
11
10
  reason: t.union([
12
11
  t.literal("approved"),
@@ -20,13 +19,11 @@ export const Approval = t.intersection([
20
19
  }),
21
20
  t.partial({
22
21
  reason_note: t.string,
23
- report_raw: t.string,
24
- report_pdf: Document,
25
22
  }),
26
23
  ]);
27
24
 
28
25
  export interface Approval {
29
- outcome: "PASS" | "FAIL" | "REVIEW";
26
+ outcome: "PASS" | "REVIEW" | "FAIL";
30
27
  reason:
31
28
  | "approved"
32
29
  | "insufficient_details"
@@ -36,6 +33,4 @@ export interface Approval {
36
33
  | "manual_review_required"
37
34
  | "not_approved";
38
35
  reason_note?: string;
39
- report_raw?: string;
40
- report_pdf?: Document;
41
36
  }
@@ -0,0 +1,21 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const CompanyDirectorReport = t.type({
4
+ number_of_current_appointments: t.number,
5
+ current_appointment_ccj: t.number,
6
+ number_of_inactive_appointments: t.number,
7
+ inactive_appointment_ccj: t.number,
8
+ number_of_previous_appointments: t.number,
9
+ previous_appointment_ccj: t.number,
10
+ disqualified: t.boolean,
11
+ });
12
+
13
+ export interface CompanyDirectorReport {
14
+ number_of_current_appointments: number;
15
+ current_appointment_ccj: number;
16
+ number_of_inactive_appointments: number;
17
+ inactive_appointment_ccj: number;
18
+ number_of_previous_appointments: number;
19
+ previous_appointment_ccj: number;
20
+ disqualified: boolean;
21
+ }
@@ -0,0 +1,26 @@
1
+ import * as t from "io-ts";
2
+ import { Document } from "./Document";
3
+
4
+ export const CompanyReport = t.type({
5
+ status: t.string,
6
+ incorporation_date: t.string,
7
+ number_of_writs: t.number,
8
+ active_ccj_exact: t.number,
9
+ active_ccj_possible: t.number,
10
+ satisfied_ccj: t.number,
11
+ risk_score: t.string,
12
+ credit_limit: t.string,
13
+ report_pdf: Document,
14
+ });
15
+
16
+ export interface CompanyReport {
17
+ status: string;
18
+ incorporation_date: string;
19
+ number_of_writs: number;
20
+ active_ccj_exact: number;
21
+ active_ccj_possible: number;
22
+ satisfied_ccj: number;
23
+ risk_score: string;
24
+ credit_limit: string;
25
+ report_pdf: Document;
26
+ }
@@ -0,0 +1,17 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const ConsumerReport = t.type({
4
+ active_ccj: t.number,
5
+ satisfied_ccj: t.number,
6
+ insolvencies: t.boolean,
7
+ credit_score_band: t.string,
8
+ credit_score: t.string,
9
+ });
10
+
11
+ export interface ConsumerReport {
12
+ active_ccj: number;
13
+ satisfied_ccj: number;
14
+ insolvencies: boolean;
15
+ credit_score_band: string;
16
+ credit_score: string;
17
+ }
@@ -1,5 +1,7 @@
1
1
  import * as t from "io-ts";
2
2
  import { Approval } from "./Approval";
3
+ import { CompanyDirectorReport } from "./CompanyDirectorReport";
4
+ import { CompanyReport } from "./CompanyReport";
3
5
  import { Metadata } from "./Metadata";
4
6
  import { OnboardingStage } from "./OnboardingStage";
5
7
 
@@ -10,15 +12,37 @@ export const Onboarding = t.partial({
10
12
  aid: t.string,
11
13
  current_stage: OnboardingStage,
12
14
  stages: t.array(OnboardingStage),
13
- company_report_approval: Approval,
14
- director_report_approvals: t.UnknownRecord,
15
- consumer_report_approval: Approval,
16
- owner_reports: t.UnknownRecord,
17
- owner_report_approvals: t.UnknownRecord,
18
- insurance_approval: Approval,
19
- trade_review_approval: Approval,
20
- online_review_approval: Approval,
21
- fca_approval: Approval,
15
+ company_review: t.partial({
16
+ report: CompanyReport,
17
+ approval: Approval,
18
+ }),
19
+ director_review: t.partial({
20
+ report: CompanyDirectorReport,
21
+ approval: Approval,
22
+ }),
23
+ consumer_review: t.partial({
24
+ reports: t.UnknownRecord,
25
+ approval: Approval,
26
+ }),
27
+ owner_review: t.partial({
28
+ reports: t.UnknownRecord,
29
+ approval: Approval,
30
+ }),
31
+ insurance_review: t.partial({
32
+ approval: Approval,
33
+ }),
34
+ trade_review: t.partial({
35
+ approval: Approval,
36
+ }),
37
+ online_review: t.partial({
38
+ approval: Approval,
39
+ }),
40
+ fca_upload: t.partial({
41
+ approval: Approval,
42
+ }),
43
+ fca_awaiting_approval: t.partial({
44
+ approval: Approval,
45
+ }),
22
46
  metadata: Metadata,
23
47
  });
24
48
 
@@ -29,14 +53,36 @@ export interface Onboarding {
29
53
  aid?: string;
30
54
  current_stage?: OnboardingStage;
31
55
  stages?: Array<OnboardingStage>;
32
- company_report_approval?: Approval;
33
- director_report_approvals?: Record<string, unknown>;
34
- consumer_report_approval?: Approval;
35
- owner_reports?: Record<string, unknown>;
36
- owner_report_approvals?: Record<string, unknown>;
37
- insurance_approval?: Approval;
38
- trade_review_approval?: Approval;
39
- online_review_approval?: Approval;
40
- fca_approval?: Approval;
56
+ company_review?: {
57
+ report?: CompanyReport;
58
+ approval?: Approval;
59
+ };
60
+ director_review?: {
61
+ report?: CompanyDirectorReport;
62
+ approval?: Approval;
63
+ };
64
+ consumer_review?: {
65
+ reports?: Record<string, unknown>;
66
+ approval?: Approval;
67
+ };
68
+ owner_review?: {
69
+ reports?: Record<string, unknown>;
70
+ approval?: Approval;
71
+ };
72
+ insurance_review?: {
73
+ approval?: Approval;
74
+ };
75
+ trade_review?: {
76
+ approval?: Approval;
77
+ };
78
+ online_review?: {
79
+ approval?: Approval;
80
+ };
81
+ fca_upload?: {
82
+ approval?: Approval;
83
+ };
84
+ fca_awaiting_approval?: {
85
+ approval?: Approval;
86
+ };
41
87
  metadata?: Metadata;
42
88
  }
@@ -1,6 +1,6 @@
1
1
  import * as t from "io-ts";
2
2
 
3
- export const DirectorReport = t.partial({
3
+ export const OwnerReport = t.partial({
4
4
  uk_credit_aml_warnings: t.string,
5
5
  international_sanctions_warnings: t.string,
6
6
  enhanced_international_saction_warnings: t.string,
@@ -11,7 +11,7 @@ export const DirectorReport = t.partial({
11
11
  adverse_media: t.string,
12
12
  });
13
13
 
14
- export interface DirectorReport {
14
+ export interface OwnerReport {
15
15
  uk_credit_aml_warnings?: string;
16
16
  international_sanctions_warnings?: string;
17
17
  enhanced_international_saction_warnings?: string;
@@ -10,7 +10,10 @@ export * from "./Cache";
10
10
  export * from "./CheckoutOption";
11
11
  export * from "./CommPreferences";
12
12
  export * from "./Company";
13
+ export * from "./CompanyDirectorReport";
13
14
  export * from "./CompanyInfo";
15
+ export * from "./CompanyReport";
16
+ export * from "./ConsumerReport";
14
17
  export * from "./ContactInfo";
15
18
  export * from "./ContractAgreement";
16
19
  export * from "./Credit";
@@ -18,7 +21,6 @@ export * from "./Customer";
18
21
  export * from "./CustomerDetails";
19
22
  export * from "./CustomerOptions";
20
23
  export * from "./DirectorInfo";
21
- export * from "./DirectorReport";
22
24
  export * from "./DirectorVerification";
23
25
  export * from "./Document";
24
26
  export * from "./EmployedDetails";
@@ -62,6 +64,7 @@ export * from "./NotEmployedDetails";
62
64
  export * from "./Onboarding";
63
65
  export * from "./OnboardingStage";
64
66
  export * from "./OnlinePresence";
67
+ export * from "./OwnerReport";
65
68
  export * from "./Partner";
66
69
  export * from "./Payment";
67
70
  export * from "./PaymentOption";
@@ -9,7 +9,7 @@ export const infoDirectorOperation = {
9
9
  path: "/api/info/director",
10
10
  method: "put",
11
11
  responses: {
12
- "200": { _tag: "JsonResponse", decoder: schemas.DirectorReport },
12
+ "200": { _tag: "JsonResponse", decoder: schemas.OwnerReport },
13
13
  default: { _tag: "JsonResponse", decoder: schemas.Error },
14
14
  },
15
15
  parameters: [
@@ -31,5 +31,5 @@ export const infoDirectorOperation = {
31
31
 
32
32
  export type InfoDirectorRequestFunction = RequestFunction<
33
33
  { params: InfoDirectorRequestParameters; body: schemas.UserType },
34
- schemas.DirectorReport
34
+ schemas.OwnerReport
35
35
  >;