@kanda-libs/ks-component-ts 0.2.436 → 0.2.437

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.436",
3
+ "version": "0.2.437",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,8 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const BankAccountType = t.union([
4
+ t.literal("Business"),
5
+ t.literal("Personal"),
6
+ ]);
7
+
8
+ export type BankAccountType = "Business" | "Personal";
@@ -4,6 +4,7 @@ import { Analytics } from "./Analytics";
4
4
  import { BankAccount } from "./BankAccount";
5
5
  import { BusinessConfig } from "./BusinessConfig";
6
6
  import { CompanyInfo } from "./CompanyInfo";
7
+ import { CompanyType } from "./CompanyType";
7
8
  import { ContactInfo } from "./ContactInfo";
8
9
  import { Document } from "./Document";
9
10
  import { FinanceRate } from "./FinanceRate";
@@ -19,10 +20,7 @@ import { WelcomeSkipBanner } from "./WelcomeSkipBanner";
19
20
 
20
21
  export const Company = t.intersection([
21
22
  t.type({
22
- company_type: t.union([
23
- t.literal("limited_company"),
24
- t.literal("sole_trader"),
25
- ]),
23
+ company_type: CompanyType,
26
24
  }),
27
25
  t.partial({
28
26
  id: t.string,
@@ -93,7 +91,7 @@ export interface Company {
93
91
  users?: Array<UserType>;
94
92
  company_info?: CompanyInfo;
95
93
  solar_company_info?: SolarCompanyInfo;
96
- company_type: "limited_company" | "sole_trader";
94
+ company_type: CompanyType;
97
95
  limited_company_info?: LimitedCompanyInfo;
98
96
  sole_trader_info?: SoleTraderInfo;
99
97
  finance_rates?: Array<FinanceRate>;
@@ -0,0 +1,8 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const CompanyType = t.union([
4
+ t.literal("limited_company"),
5
+ t.literal("sole_trader"),
6
+ ]);
7
+
8
+ export type CompanyType = "limited_company" | "sole_trader";
@@ -6,6 +6,7 @@ import { FlowType } from "./FlowType";
6
6
  import { IntroductionState } from "./IntroductionState";
7
7
  import { JobDetails } from "./JobDetails";
8
8
  import { Metadata } from "./Metadata";
9
+ import { TraderDetails } from "./TraderDetails";
9
10
 
10
11
  export const Introduction = t.intersection([
11
12
  t.type({
@@ -22,6 +23,7 @@ export const Introduction = t.intersection([
22
23
  consumer_details: ApplicantDetails,
23
24
  budgets: Budgets,
24
25
  trader: ContactInfo,
26
+ trader_details: TraderDetails,
25
27
  job_details: JobDetails,
26
28
  current_state: IntroductionState,
27
29
  states: t.array(IntroductionState),
@@ -42,6 +44,7 @@ export interface Introduction {
42
44
  consumer_details?: ApplicantDetails;
43
45
  budgets?: Budgets;
44
46
  trader?: ContactInfo;
47
+ trader_details?: TraderDetails;
45
48
  job_details?: JobDetails;
46
49
  current_state?: IntroductionState;
47
50
  states?: Array<IntroductionState>;
@@ -10,6 +10,7 @@ export const IntroductionState = t.union([
10
10
  t.literal("trader_viewed"),
11
11
  t.literal("trader_agreed"),
12
12
  t.literal("trader_rejected"),
13
+ t.literal("trader_contact_provided"),
13
14
  t.literal("trader_details_provided"),
14
15
  t.literal("trader_is_reviewed"),
15
16
  t.literal("trader_is_verified"),
@@ -27,6 +28,7 @@ export type IntroductionState =
27
28
  | "trader_viewed"
28
29
  | "trader_agreed"
29
30
  | "trader_rejected"
31
+ | "trader_contact_provided"
30
32
  | "trader_details_provided"
31
33
  | "trader_is_reviewed"
32
34
  | "trader_is_verified"
@@ -0,0 +1,31 @@
1
+ import * as t from "io-ts";
2
+ import { BankAccount } from "./BankAccount";
3
+ import { BankAccountType } from "./BankAccountType";
4
+ import { CompanyType } from "./CompanyType";
5
+ import { LimitedCompanyInfo } from "./LimitedCompanyInfo";
6
+ import { SoleTraderInfo } from "./SoleTraderInfo";
7
+ import { VerificationStatus } from "./VerificationStatus";
8
+
9
+ export const TraderDetails = t.intersection([
10
+ t.type({
11
+ company_type: CompanyType,
12
+ bank_type: BankAccountType,
13
+ bank_account: BankAccount,
14
+ }),
15
+ t.partial({
16
+ limited_company_info: LimitedCompanyInfo,
17
+ sole_trader_info: SoleTraderInfo,
18
+ bank_report: t.string,
19
+ bank_verification: VerificationStatus,
20
+ }),
21
+ ]);
22
+
23
+ export interface TraderDetails {
24
+ company_type: CompanyType;
25
+ limited_company_info?: LimitedCompanyInfo;
26
+ sole_trader_info?: SoleTraderInfo;
27
+ bank_type: BankAccountType;
28
+ bank_account: BankAccount;
29
+ bank_report?: string;
30
+ bank_verification?: VerificationStatus;
31
+ }
@@ -0,0 +1,16 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const VerificationStatus = t.union([
4
+ t.literal("not_started"),
5
+ t.literal("verification_passed"),
6
+ t.literal("verification_failed"),
7
+ t.literal("verification_skipped"),
8
+ t.literal("verification_error"),
9
+ ]);
10
+
11
+ export type VerificationStatus =
12
+ | "not_started"
13
+ | "verification_passed"
14
+ | "verification_failed"
15
+ | "verification_skipped"
16
+ | "verification_error";
@@ -5,6 +5,7 @@ export * from "./ApplicantDetails";
5
5
  export * from "./Approval";
6
6
  export * from "./AuthUser";
7
7
  export * from "./BankAccount";
8
+ export * from "./BankAccountType";
8
9
  export * from "./Branding";
9
10
  export * from "./Budgets";
10
11
  export * from "./BusinessConfig";
@@ -18,6 +19,7 @@ export * from "./Company";
18
19
  export * from "./CompanyDirectorReport";
19
20
  export * from "./CompanyInfo";
20
21
  export * from "./CompanyReport";
22
+ export * from "./CompanyType";
21
23
  export * from "./ConsumerReport";
22
24
  export * from "./ContactInfo";
23
25
  export * from "./ContractAgreement";
@@ -121,6 +123,7 @@ export * from "./TierConfig";
121
123
  export * from "./TierEvent";
122
124
  export * from "./Title";
123
125
  export * from "./TradeFilter";
126
+ export * from "./TraderDetails";
124
127
  export * from "./TradeSummary";
125
128
  export * from "./TradeType";
126
129
  export * from "./Training";
@@ -128,5 +131,6 @@ export * from "./Transaction";
128
131
  export * from "./UserEvent";
129
132
  export * from "./UserType";
130
133
  export * from "./UTM";
134
+ export * from "./VerificationStatus";
131
135
  export * from "./WelcomeSkipBanner";
132
136
  export * from "./WorkType";
@@ -394,6 +394,10 @@ import {
394
394
  postIntroductionTraderOperation,
395
395
  PostIntroductionTraderRequestFunction,
396
396
  } from "./postIntroductionTrader";
397
+ import {
398
+ postIntroductionTraderDetailsOperation,
399
+ PostIntroductionTraderDetailsRequestFunction,
400
+ } from "./postIntroductionTraderDetails";
397
401
  import { postJobOperation, PostJobRequestFunction } from "./postJob";
398
402
  import { postLeadOperation, PostLeadRequestFunction } from "./postLead";
399
403
  import { postMeOperation, PostMeRequestFunction } from "./postMe";
@@ -583,6 +587,7 @@ export const operations: Operations = {
583
587
  postIntroductionConsumerDetails: postIntroductionConsumerDetailsOperation,
584
588
  postIntroductionJobDetails: postIntroductionJobDetailsOperation,
585
589
  postIntroductionTrader: postIntroductionTraderOperation,
590
+ postIntroductionTraderDetails: postIntroductionTraderDetailsOperation,
586
591
  postIntroductionConvertJob: postIntroductionConvertJobOperation,
587
592
  getCompanies: getCompaniesOperation,
588
593
  postCompany: postCompanyOperation,
@@ -759,6 +764,7 @@ export interface OperationRequestFunctionMap {
759
764
  postIntroductionConsumerDetails: PostIntroductionConsumerDetailsRequestFunction;
760
765
  postIntroductionJobDetails: PostIntroductionJobDetailsRequestFunction;
761
766
  postIntroductionTrader: PostIntroductionTraderRequestFunction;
767
+ postIntroductionTraderDetails: PostIntroductionTraderDetailsRequestFunction;
762
768
  postIntroductionConvertJob: PostIntroductionConvertJobRequestFunction;
763
769
  getCompanies: GetCompaniesRequestFunction;
764
770
  postCompany: PostCompanyRequestFunction;
@@ -1042,6 +1048,10 @@ export const requestFunctionsBuilder = (
1042
1048
  operations.postIntroductionTrader,
1043
1049
  requestAdapter
1044
1050
  ),
1051
+ postIntroductionTraderDetails: requestFunctionBuilder(
1052
+ operations.postIntroductionTraderDetails,
1053
+ requestAdapter
1054
+ ),
1045
1055
  postIntroductionConvertJob: requestFunctionBuilder(
1046
1056
  operations.postIntroductionConvertJob,
1047
1057
  requestAdapter
@@ -1536,6 +1546,7 @@ export const introductionServiceBuilder = (
1536
1546
  requestFunctions.postIntroductionConsumerDetails,
1537
1547
  postIntroductionJobDetails: requestFunctions.postIntroductionJobDetails,
1538
1548
  postIntroductionTrader: requestFunctions.postIntroductionTrader,
1549
+ postIntroductionTraderDetails: requestFunctions.postIntroductionTraderDetails,
1539
1550
  postIntroductionConvertJob: requestFunctions.postIntroductionConvertJob,
1540
1551
  });
1541
1552
 
@@ -1732,6 +1743,7 @@ export interface Operations {
1732
1743
  postIntroductionConsumerDetails: typeof postIntroductionConsumerDetailsOperation;
1733
1744
  postIntroductionJobDetails: typeof postIntroductionJobDetailsOperation;
1734
1745
  postIntroductionTrader: typeof postIntroductionTraderOperation;
1746
+ postIntroductionTraderDetails: typeof postIntroductionTraderDetailsOperation;
1735
1747
  postIntroductionConvertJob: typeof postIntroductionConvertJobOperation;
1736
1748
  getCompanies: typeof getCompaniesOperation;
1737
1749
  postCompany: typeof postCompanyOperation;
@@ -0,0 +1,38 @@
1
+ import type { RequestFunction } from "@openapi-io-ts/runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type PostIntroductionTraderDetailsRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const postIntroductionTraderDetailsOperation = {
9
+ path: "/api/introduction/{id}/trader-details",
10
+ method: "post",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Introduction },
13
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
14
+ },
15
+ parameters: [
16
+ {
17
+ _tag: "FormParameter",
18
+ explode: false,
19
+ in: "path",
20
+ name: "id",
21
+ },
22
+ ],
23
+ requestDefaultHeaders: {
24
+ "Content-Type": "application/json",
25
+ Accept: "application/json",
26
+ },
27
+ body: {
28
+ _tag: "JsonBody",
29
+ },
30
+ } as const;
31
+
32
+ export type PostIntroductionTraderDetailsRequestFunction = RequestFunction<
33
+ {
34
+ params: PostIntroductionTraderDetailsRequestParameters;
35
+ body: schemas.TraderDetails;
36
+ },
37
+ schemas.Introduction
38
+ >;