@kanda-libs/ks-component-ts 0.2.405 → 0.2.407

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.405",
3
+ "version": "0.2.407",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,29 @@
1
+ import * as t from "io-ts";
2
+ import { BusinessSector } from "./BusinessSector";
3
+ import { FinanceProvider } from "./FinanceProvider";
4
+ import { LenderRateType } from "./LenderRateType";
5
+ import { TradeType } from "./TradeType";
6
+
7
+ export const BusinessConfig = t.intersection([
8
+ t.type({
9
+ show: t.union([t.literal("yes"), t.literal("no")]),
10
+ trade_type: TradeType,
11
+ trade_text: t.string,
12
+ business_sector: BusinessSector,
13
+ lender: FinanceProvider,
14
+ lender_rate_type: LenderRateType,
15
+ }),
16
+ t.partial({
17
+ extra: t.string,
18
+ }),
19
+ ]);
20
+
21
+ export interface BusinessConfig {
22
+ show: "yes" | "no";
23
+ trade_type: TradeType;
24
+ trade_text: string;
25
+ business_sector: BusinessSector;
26
+ extra?: string;
27
+ lender: FinanceProvider;
28
+ lender_rate_type: LenderRateType;
29
+ }
@@ -0,0 +1,22 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const BusinessSector = t.union([
4
+ t.literal("Home improvement"),
5
+ t.literal("Retail"),
6
+ t.literal("IT and technology Services"),
7
+ t.literal("Automotive services"),
8
+ t.literal("Training and education"),
9
+ t.literal("Events (including weddings)"),
10
+ t.literal("Healthcare"),
11
+ t.literal("Other"),
12
+ ]);
13
+
14
+ export type BusinessSector =
15
+ | "Home improvement"
16
+ | "Retail"
17
+ | "IT and technology Services"
18
+ | "Automotive services"
19
+ | "Training and education"
20
+ | "Events (including weddings)"
21
+ | "Healthcare"
22
+ | "Other";
@@ -1,6 +1,8 @@
1
1
  import * as t from "io-ts";
2
+ import { DateFromISOString } from "io-ts-types/DateFromISOString";
2
3
  import { Analytics } from "./Analytics";
3
4
  import { BankAccount } from "./BankAccount";
5
+ import { BusinessConfig } from "./BusinessConfig";
4
6
  import { CompanyInfo } from "./CompanyInfo";
5
7
  import { ContactInfo } from "./ContactInfo";
6
8
  import { Document } from "./Document";
@@ -64,6 +66,7 @@ export const Company = t.intersection([
64
66
  t.literal("cancelled"),
65
67
  ]),
66
68
  referral_code: t.string,
69
+ referral_activated_at: DateFromISOString,
67
70
  referred_by: t.string,
68
71
  company_logo: Document,
69
72
  bank_account: BankAccount,
@@ -73,6 +76,7 @@ export const Company = t.intersection([
73
76
  welcome_pack: WelcomeSkipBanner,
74
77
  lender_configs: t.array(LenderConfig),
75
78
  business_type: t.string,
79
+ business_config: BusinessConfig,
76
80
  metadata: Metadata,
77
81
  }),
78
82
  ]);
@@ -115,6 +119,7 @@ export interface Company {
115
119
  | "suspended"
116
120
  | "cancelled";
117
121
  referral_code?: string;
122
+ referral_activated_at?: Date;
118
123
  referred_by?: string;
119
124
  company_logo?: Document;
120
125
  bank_account?: BankAccount;
@@ -124,5 +129,6 @@ export interface Company {
124
129
  welcome_pack?: WelcomeSkipBanner;
125
130
  lender_configs?: Array<LenderConfig>;
126
131
  business_type?: string;
132
+ business_config?: BusinessConfig;
127
133
  metadata?: Metadata;
128
134
  }
@@ -3,56 +3,12 @@ import { ContractAgreement } from "./ContractAgreement";
3
3
  import { Document } from "./Document";
4
4
  import { OnlinePresence } from "./OnlinePresence";
5
5
  import { Pence } from "./Pence";
6
+ import { TradeType } from "./TradeType";
6
7
  import { WorkType } from "./WorkType";
7
8
 
8
9
  export const CompanyInfo = t.intersection([
9
10
  t.type({
10
- trade_type: t.union([
11
- t.literal("air_conditioning"),
12
- t.literal("artificial_grass_specialists"),
13
- t.literal("bathrooms"),
14
- t.literal("battery_storage"),
15
- t.literal("blinds_and_shutters"),
16
- t.literal("carpentry"),
17
- t.literal("cctv_and_security_installations"),
18
- t.literal("cladding_sofits_and_guttering"),
19
- t.literal("conservatories"),
20
- t.literal("curtains"),
21
- t.literal("decking"),
22
- t.literal("driveways_and_patios"),
23
- t.literal("electrician"),
24
- t.literal("ev_charger_installer"),
25
- t.literal("fencing"),
26
- t.literal("fireplaces"),
27
- t.literal("fitted_bedroom_furniture"),
28
- t.literal("floor_layer"),
29
- t.literal("garage_doors"),
30
- t.literal("garden_rooms"),
31
- t.literal("gas_engineer"),
32
- t.literal("gates"),
33
- t.literal("heat_pumps"),
34
- t.literal("heating_systems"),
35
- t.literal("home_insulation_excl_spray_foam"),
36
- t.literal("hot_tub_specialist"),
37
- t.literal("kitchen_fitter"),
38
- t.literal("kitchen_supplier"),
39
- t.literal("landscaping"),
40
- t.literal("loft_boarding"),
41
- t.literal("painting_and_decorating"),
42
- t.literal("plasterer"),
43
- t.literal("plumbing"),
44
- t.literal("rendering"),
45
- t.literal("resin_drive_specialist"),
46
- t.literal("resin_driveways"),
47
- t.literal("roofing__excluding_flat_roofs"),
48
- t.literal("security_systems"),
49
- t.literal("stair_case_specialist"),
50
- t.literal("tiler"),
51
- t.literal("verandas"),
52
- t.literal("windows_and_doors"),
53
- t.literal("multi_trade"),
54
- t.literal("other_trade"),
55
- ]),
11
+ trade_type: TradeType,
56
12
  trade_type_name: t.string,
57
13
  trade_body: t.union([
58
14
  t.literal("none"),
@@ -86,51 +42,7 @@ export const CompanyInfo = t.intersection([
86
42
  ]);
87
43
 
88
44
  export interface CompanyInfo {
89
- trade_type:
90
- | "air_conditioning"
91
- | "artificial_grass_specialists"
92
- | "bathrooms"
93
- | "battery_storage"
94
- | "blinds_and_shutters"
95
- | "carpentry"
96
- | "cctv_and_security_installations"
97
- | "cladding_sofits_and_guttering"
98
- | "conservatories"
99
- | "curtains"
100
- | "decking"
101
- | "driveways_and_patios"
102
- | "electrician"
103
- | "ev_charger_installer"
104
- | "fencing"
105
- | "fireplaces"
106
- | "fitted_bedroom_furniture"
107
- | "floor_layer"
108
- | "garage_doors"
109
- | "garden_rooms"
110
- | "gas_engineer"
111
- | "gates"
112
- | "heat_pumps"
113
- | "heating_systems"
114
- | "home_insulation_excl_spray_foam"
115
- | "hot_tub_specialist"
116
- | "kitchen_fitter"
117
- | "kitchen_supplier"
118
- | "landscaping"
119
- | "loft_boarding"
120
- | "painting_and_decorating"
121
- | "plasterer"
122
- | "plumbing"
123
- | "rendering"
124
- | "resin_drive_specialist"
125
- | "resin_driveways"
126
- | "roofing__excluding_flat_roofs"
127
- | "security_systems"
128
- | "stair_case_specialist"
129
- | "tiler"
130
- | "verandas"
131
- | "windows_and_doors"
132
- | "multi_trade"
133
- | "other_trade";
45
+ trade_type: TradeType;
134
46
  trade_type_name: string;
135
47
  trade_body:
136
48
  | "none"
@@ -1,18 +1,20 @@
1
1
  import * as t from "io-ts";
2
2
 
3
3
  export const FinanceProvider = t.union([
4
- t.literal("omni"),
5
- t.literal("etika"),
6
- t.literal("propensio"),
7
4
  t.literal("allium"),
8
- t.literal("novuna"),
9
5
  t.literal("demo"),
6
+ t.literal("etika"),
7
+ t.literal("humm"),
8
+ t.literal("novuna"),
9
+ t.literal("omni"),
10
+ t.literal("propensio"),
10
11
  ]);
11
12
 
12
13
  export type FinanceProvider =
13
- | "omni"
14
- | "etika"
15
- | "propensio"
16
14
  | "allium"
15
+ | "demo"
16
+ | "etika"
17
+ | "humm"
17
18
  | "novuna"
18
- | "demo";
19
+ | "omni"
20
+ | "propensio";
@@ -0,0 +1,8 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const LenderRateType = t.union([
4
+ t.literal("regulated"),
5
+ t.literal("unregulated"),
6
+ ]);
7
+
8
+ export type LenderRateType = "regulated" | "unregulated";
@@ -0,0 +1,94 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const TradeType = t.union([
4
+ t.literal("air_conditioning"),
5
+ t.literal("artificial_grass_specialists"),
6
+ t.literal("bathrooms"),
7
+ t.literal("battery_storage"),
8
+ t.literal("blinds_and_shutters"),
9
+ t.literal("carpentry"),
10
+ t.literal("cctv_and_security_installations"),
11
+ t.literal("cladding_sofits_and_guttering"),
12
+ t.literal("conservatories"),
13
+ t.literal("curtains"),
14
+ t.literal("decking"),
15
+ t.literal("driveways_and_patios"),
16
+ t.literal("electrician"),
17
+ t.literal("ev_charger_installer"),
18
+ t.literal("fencing"),
19
+ t.literal("fireplaces"),
20
+ t.literal("fitted_bedroom_furniture"),
21
+ t.literal("floor_layer"),
22
+ t.literal("garage_doors"),
23
+ t.literal("garden_rooms"),
24
+ t.literal("gas_engineer"),
25
+ t.literal("gates"),
26
+ t.literal("heat_pumps"),
27
+ t.literal("heating_systems"),
28
+ t.literal("home_insulation_excl_spray_foam"),
29
+ t.literal("hot_tub_specialist"),
30
+ t.literal("kitchen_fitter"),
31
+ t.literal("kitchen_supplier"),
32
+ t.literal("landscaping"),
33
+ t.literal("loft_boarding"),
34
+ t.literal("painting_and_decorating"),
35
+ t.literal("plasterer"),
36
+ t.literal("plumbing"),
37
+ t.literal("rendering"),
38
+ t.literal("resin_drive_specialist"),
39
+ t.literal("resin_driveways"),
40
+ t.literal("roofing__excluding_flat_roofs"),
41
+ t.literal("security_systems"),
42
+ t.literal("stair_case_specialist"),
43
+ t.literal("tiler"),
44
+ t.literal("verandas"),
45
+ t.literal("windows_and_doors"),
46
+ t.literal("multi_trade"),
47
+ t.literal("other_trade"),
48
+ ]);
49
+
50
+ export type TradeType =
51
+ | "air_conditioning"
52
+ | "artificial_grass_specialists"
53
+ | "bathrooms"
54
+ | "battery_storage"
55
+ | "blinds_and_shutters"
56
+ | "carpentry"
57
+ | "cctv_and_security_installations"
58
+ | "cladding_sofits_and_guttering"
59
+ | "conservatories"
60
+ | "curtains"
61
+ | "decking"
62
+ | "driveways_and_patios"
63
+ | "electrician"
64
+ | "ev_charger_installer"
65
+ | "fencing"
66
+ | "fireplaces"
67
+ | "fitted_bedroom_furniture"
68
+ | "floor_layer"
69
+ | "garage_doors"
70
+ | "garden_rooms"
71
+ | "gas_engineer"
72
+ | "gates"
73
+ | "heat_pumps"
74
+ | "heating_systems"
75
+ | "home_insulation_excl_spray_foam"
76
+ | "hot_tub_specialist"
77
+ | "kitchen_fitter"
78
+ | "kitchen_supplier"
79
+ | "landscaping"
80
+ | "loft_boarding"
81
+ | "painting_and_decorating"
82
+ | "plasterer"
83
+ | "plumbing"
84
+ | "rendering"
85
+ | "resin_drive_specialist"
86
+ | "resin_driveways"
87
+ | "roofing__excluding_flat_roofs"
88
+ | "security_systems"
89
+ | "stair_case_specialist"
90
+ | "tiler"
91
+ | "verandas"
92
+ | "windows_and_doors"
93
+ | "multi_trade"
94
+ | "other_trade";
@@ -6,6 +6,8 @@ export * from "./Approval";
6
6
  export * from "./AuthUser";
7
7
  export * from "./BankAccount";
8
8
  export * from "./Branding";
9
+ export * from "./BusinessConfig";
10
+ export * from "./BusinessSector";
9
11
  export * from "./Cache";
10
12
  export * from "./Category";
11
13
  export * from "./CheckoutOption";
@@ -73,6 +75,7 @@ export * from "./LeadJobSummary";
73
75
  export * from "./LeadQuote";
74
76
  export * from "./LeadTrade";
75
77
  export * from "./LenderConfig";
78
+ export * from "./LenderRateType";
76
79
  export * from "./LimitedCompanyInfo";
77
80
  export * from "./Metadata";
78
81
  export * from "./Money";
@@ -108,6 +111,7 @@ export * from "./Tally";
108
111
  export * from "./Title";
109
112
  export * from "./TradeFilter";
110
113
  export * from "./TradeSummary";
114
+ export * from "./TradeType";
111
115
  export * from "./Training";
112
116
  export * from "./UserEvent";
113
117
  export * from "./UserType";
@@ -3,11 +3,12 @@ import * as schemas from "../components/schemas";
3
3
 
4
4
  export type ProviderCheckWebhookRequestParameters = {
5
5
  provider:
6
- | "gocardless"
7
- | "omni"
8
- | "etika"
9
6
  | "allium"
7
+ | "etika"
8
+ | "gocardless"
9
+ | "humm"
10
10
  | "novuna"
11
+ | "omni"
11
12
  | "stripe"
12
13
  | "veriff";
13
14
  };