@taxbit/react-sdk 0.4.1 → 0.4.3
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/README.md +18 -13
- package/dist/src/contexts/FormUI/useFormUI.d.ts +1 -0
- package/dist/src/contexts/FormUI/useFormUIContext.d.ts +2 -0
- package/dist/src/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +3 -2
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +6 -4
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +4 -2
- package/dist/src/entry/index.d.ts +1 -0
- package/dist/src/hooks/useTaxBit/useTaxBit.d.ts +0 -1
- package/dist/src/i18n/types/LocalizationKey.d.ts +1 -1
- package/dist/src/types/Progress.d.ts +8 -5
- package/dist/src/types/StepId.d.ts +1 -0
- package/dist/src/types/client/ClientTaxDocumentationStatus.d.ts +1 -0
- package/dist/src/types/client/ExternalValidations.d.ts +7 -0
- package/dist/src/types/client/index.d.ts +1 -0
- package/dist/src/types/server/TaxDocumentationStatus.d.ts +2 -1
- package/dist/src/validations/getInvalidFields.d.ts +2 -1
- package/dist/src/validations/invalidFieldRules.d.ts +2 -1
- package/dist/src/widgets/TaxBitForm/__tests__/TaxBitForm.complete.test.d.ts +0 -0
- package/dist/src/widgets/TaxBitForm/useTaxBitForm.d.ts +4 -3
- package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +3 -2
- package/dist/taxbit-react-sdk.js +1208 -1144
- package/dist/taxbit-react-sdk.umd.cjs +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,18 +176,7 @@ The TaxBit React SDK provides callbacks for the following events on the `TaxBitD
|
|
|
176
176
|
|
|
177
177
|
- `onSubmit` - called when the user clicks the submit button
|
|
178
178
|
- `onSuccess` - called after the server responds with a successful submission
|
|
179
|
-
- `onProgress` - called when the user navigates within the TaxBit UI. The function passed here will be passed a Progress object
|
|
180
|
-
|
|
181
|
-
```typescript
|
|
182
|
-
type Progress = {
|
|
183
|
-
stepNumber: number;
|
|
184
|
-
totalSteps: number;
|
|
185
|
-
percentComplete: number;
|
|
186
|
-
stepTitle: string;
|
|
187
|
-
stepId: string;
|
|
188
|
-
language: Locale;
|
|
189
|
-
};
|
|
190
|
-
```
|
|
179
|
+
- `onProgress` - called when the user navigates within the TaxBit UI. The function passed here will be passed a Progress object (see below for the type definition):
|
|
191
180
|
|
|
192
181
|
The DAC7 sequence, for example, can have a total of 3, 4, or 5 steps, each with a localized `stepTitle` and `stepId`. The `stepNumber` is the current step (1 based), and `percentComplete` is the percentage of the steps that have been completed.
|
|
193
182
|
|
|
@@ -231,13 +220,29 @@ type Locale =
|
|
|
231
220
|
| 'sv-se';
|
|
232
221
|
```
|
|
233
222
|
|
|
223
|
+
```typescript
|
|
224
|
+
type StepId =
|
|
225
|
+
| 'accountHolderContactInformation'
|
|
226
|
+
| 'accountHolderTaxInformation'
|
|
227
|
+
| 'accountHolderTaxClarification'
|
|
228
|
+
| 'accountHolderClassification'
|
|
229
|
+
| 'confirmation'
|
|
230
|
+
| 'exemptions'
|
|
231
|
+
| 'regardedOwnerClassification'
|
|
232
|
+
| 'regardedOwnerContactInformation'
|
|
233
|
+
| 'regardedOwnerTaxInformation'
|
|
234
|
+
| 'summary';
|
|
235
|
+
```
|
|
236
|
+
|
|
234
237
|
```typescript
|
|
235
238
|
type Progress = {
|
|
236
239
|
language: Locale;
|
|
237
240
|
percentComplete: number;
|
|
238
|
-
stepId:
|
|
241
|
+
stepId: StepId;
|
|
242
|
+
stepIndex: number;
|
|
239
243
|
stepNumber: number;
|
|
240
244
|
stepTitle: string;
|
|
245
|
+
steps: StepId[];
|
|
241
246
|
totalSteps: number;
|
|
242
247
|
};
|
|
243
248
|
```
|
|
@@ -32,6 +32,7 @@ export declare const useFormUI: () => {
|
|
|
32
32
|
setValue: (key: TaxDocumentationKey, value: string | undefined) => void;
|
|
33
33
|
isErrorFree: boolean;
|
|
34
34
|
showErrors: boolean;
|
|
35
|
+
showErrorsForField: (key: TaxDocumentationKey) => boolean | undefined;
|
|
35
36
|
exposeErrors: () => void;
|
|
36
37
|
hideErrors: () => void;
|
|
37
38
|
getRequiredLocalPrompt: (key: TaxDocumentationKey) => string;
|
|
@@ -23,6 +23,7 @@ export declare const useFormUIContext: () => {
|
|
|
23
23
|
setValue: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData, value: string | undefined) => void;
|
|
24
24
|
isErrorFree: boolean;
|
|
25
25
|
showErrors: boolean;
|
|
26
|
+
showErrorsForField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => boolean | undefined;
|
|
26
27
|
exposeErrors: () => void;
|
|
27
28
|
hideErrors: () => void;
|
|
28
29
|
getRequiredLocalPrompt: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => string;
|
|
@@ -55,6 +56,7 @@ export declare const useFormUIContext: () => {
|
|
|
55
56
|
setValue: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData, value: string | undefined) => void;
|
|
56
57
|
isErrorFree: boolean;
|
|
57
58
|
showErrors: boolean;
|
|
59
|
+
showErrorsForField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => boolean | undefined;
|
|
58
60
|
exposeErrors: () => void;
|
|
59
61
|
hideErrors: () => void;
|
|
60
62
|
getRequiredLocalPrompt: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InputStep, Locale, Progress, TaxForm } from '../../types';
|
|
3
|
-
import { ClientTaxDocumentation } from '../../types/client';
|
|
3
|
+
import { ClientTaxDocumentation, ExternalValidations } from '../../types/client';
|
|
4
4
|
type TaxDocumentationProviderProps = {
|
|
5
5
|
data?: ClientTaxDocumentation;
|
|
6
6
|
onSubmit: (data: ClientTaxDocumentation) => void;
|
|
@@ -9,6 +9,7 @@ type TaxDocumentationProviderProps = {
|
|
|
9
9
|
taxForms?: TaxForm[];
|
|
10
10
|
step?: InputStep;
|
|
11
11
|
onProgress?: (progress: Progress) => void;
|
|
12
|
+
externalValidations?: ExternalValidations;
|
|
12
13
|
};
|
|
13
|
-
export declare const TaxBitFormProvider: ({ data, onSubmit, onProgress, language, taxForms, step, children, }: TaxDocumentationProviderProps) => React.JSX.Element;
|
|
14
|
+
export declare const TaxBitFormProvider: ({ data, externalValidations, onSubmit, onProgress, language, taxForms, step, children, }: TaxDocumentationProviderProps) => React.JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { InputStep, Locale, Progress, TaxDocumentation, TaxForm } from 'types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { StepId } from 'types/StepId';
|
|
4
|
+
import { ClientTaxDocumentation, ExternalValidations } from 'types/client';
|
|
5
5
|
type UseTaxDocumentationProps = {
|
|
6
6
|
data: ClientTaxDocumentation;
|
|
7
7
|
language?: Locale;
|
|
8
|
+
externalValidations?: ExternalValidations;
|
|
8
9
|
onSubmit: (data: ClientTaxDocumentation) => void;
|
|
9
10
|
onProgress?: (progress: Progress) => void;
|
|
10
11
|
step?: InputStep;
|
|
11
12
|
taxForms?: TaxForm[];
|
|
12
13
|
};
|
|
13
|
-
export declare const useTaxDocumentation: ({ data:
|
|
14
|
+
export declare const useTaxDocumentation: ({ data: startingData, language: initialLanguage, externalValidations, onSubmit, onProgress, step: initialStep, taxForms: supportedForms, }: UseTaxDocumentationProps) => {
|
|
14
15
|
isW9: boolean;
|
|
15
16
|
isW8: boolean;
|
|
16
17
|
isW8Ben: boolean;
|
|
@@ -22,7 +23,7 @@ export declare const useTaxDocumentation: ({ data: initialData, language: initia
|
|
|
22
23
|
onResetTaxDocumentation: (data: ClientTaxDocumentation) => void;
|
|
23
24
|
editTo: (form: InputStep) => void;
|
|
24
25
|
onCancel: (() => void) | undefined;
|
|
25
|
-
|
|
26
|
+
getStepId: (key: InputStep) => StepId;
|
|
26
27
|
goTo: (form: InputStep) => void;
|
|
27
28
|
goBack: (() => void) | undefined;
|
|
28
29
|
goToNext: (data: TaxDocumentation) => void;
|
|
@@ -33,5 +34,6 @@ export declare const useTaxDocumentation: ({ data: initialData, language: initia
|
|
|
33
34
|
language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
|
|
34
35
|
supportedForms: TaxForm[];
|
|
35
36
|
setSupportedForms: import("react").Dispatch<import("react").SetStateAction<TaxForm[]>>;
|
|
37
|
+
externalValidations: ExternalValidations | undefined;
|
|
36
38
|
};
|
|
37
39
|
export {};
|
|
@@ -11,7 +11,7 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
11
11
|
onResetTaxDocumentation: (data: import("../../entry").ClientTaxDocumentation) => void;
|
|
12
12
|
editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
|
|
13
13
|
onCancel: (() => void) | undefined;
|
|
14
|
-
|
|
14
|
+
getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../entry").StepId;
|
|
15
15
|
goTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
|
|
16
16
|
goBack: (() => void) | undefined;
|
|
17
17
|
goToNext: (data: import("../../types").TaxDocumentation) => void;
|
|
@@ -22,6 +22,7 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
22
22
|
language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
|
|
23
23
|
supportedForms: import("../../types").TaxForm[];
|
|
24
24
|
setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
|
|
25
|
+
externalValidations: import("../../entry").ExternalValidations | undefined;
|
|
25
26
|
}, TaxDocumentationContextProvider: import("react").Provider<{
|
|
26
27
|
isW9: boolean;
|
|
27
28
|
isW8: boolean;
|
|
@@ -34,7 +35,7 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
34
35
|
onResetTaxDocumentation: (data: import("../../entry").ClientTaxDocumentation) => void;
|
|
35
36
|
editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
|
|
36
37
|
onCancel: (() => void) | undefined;
|
|
37
|
-
|
|
38
|
+
getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../entry").StepId;
|
|
38
39
|
goTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
|
|
39
40
|
goBack: (() => void) | undefined;
|
|
40
41
|
goToNext: (data: import("../../types").TaxDocumentation) => void;
|
|
@@ -45,4 +46,5 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
45
46
|
language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
|
|
46
47
|
supportedForms: import("../../types").TaxForm[];
|
|
47
48
|
setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
|
|
49
|
+
externalValidations: import("../../entry").ExternalValidations | undefined;
|
|
48
50
|
} | undefined>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ClientTaxDocumentation, ClientTaxDocumentationStatus } from '../../types/client';
|
|
2
2
|
export declare const useTaxBit: (bearerToken: string, staging?: true) => {
|
|
3
3
|
postData: (data: ClientTaxDocumentation) => Promise<void>;
|
|
4
|
-
formStatus: "NOT_SUBMITTED" | "COMPLETE" | "INCOMPLETE" | undefined;
|
|
5
4
|
status: ClientTaxDocumentationStatus | undefined;
|
|
6
5
|
formSubmitted: boolean;
|
|
7
6
|
serverData: ClientTaxDocumentation | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ButtonKey = 'edit' | 'back' | 'next' | 'reset' | 'submit' | 'cancel' | 'hide' | 'show';
|
|
2
|
-
export type ErrorKey = 'required' | 'invalid' | 'invalidDate' | 'mustBeSixCharacters' | 'mustBeNineDigits' | 'mustBeFiveOrNineDigits' | 'mustMatchName' | 'mustBeInDateFormat' | 'mustBeValidBirthDate' | 'mustNotMatchVatin' | 'residencesMustIncludeVatCountry' | 'residencesMustIncludeAddressCountry' | 'residencesMustIncludeAnEUCountry';
|
|
2
|
+
export type ErrorKey = 'required' | 'invalid' | 'invalidDate' | 'invalidVat' | 'mustBeSixCharacters' | 'mustBeNineDigits' | 'mustBeFiveOrNineDigits' | 'mustMatchName' | 'mustBeInDateFormat' | 'mustBeValidBirthDate' | 'mustNotMatchVatin' | 'residencesMustIncludeVatCountry' | 'residencesMustIncludeAddressCountry' | 'residencesMustIncludeAnEUCountry';
|
|
3
3
|
export type OptionKey = 'usPerson_yes' | 'usPerson_no' | 'regardedOwnerUsPerson_yes' | 'regardedOwnerUsPerson_no' | 'isIndividual_yes' | 'isIndividual_no' | 'cCorporation' | 'centralBankOfIssue' | 'complexTrust' | 'corporation' | 'disregardedEntity' | 'estate' | 'foreignGovernmentControlledEntity' | 'foreignGovernmentIntegralPart' | 'grantorTrust' | 'individual' | 'internationalOrganization' | 'llc' | 'no' | 'other' | 'partnership' | 'privateFoundation' | 'sCorporation' | 'simpleTrust' | 'smllc' | 'soleProprietor' | 'taxExemptOrganization' | 'trust' | 'trustEstate' | 'yes';
|
|
4
4
|
export type PromptKey = 'addAdditional' | 'address' | 'businessRegistrationNumber' | 'businessRegistrationCountry' | 'city' | 'cityOfBirth' | 'country' | 'countryOfBirth' | 'countryOfCitizenship' | 'dateOfBirth' | 'day' | 'dbaName' | 'exemptPayeeCode' | 'exemptFatcaCode' | 'financialAccountIdentifier' | 'financialAccountName' | 'foreignAccountType' | 'foreignOtherClassification' | 'foreignTin' | 'foreignTinIsNotRequired' | 'foreignTrustClassification' | 'isEuResident' | 'isIndividual' | 'iAcknowlegeESignIsOk' | 'iAmACitizenOfTheUs' | 'iAmExemptFromFatcaReporting' | 'iAmNotSubjectToBackupWithholding' | 'iAuthorizeWithholdingAgent' | 'iCertifyToAll' | 'iConfirmIncomeIsNonUs' | 'iConfirmTheBeneficialOwnerIsExempt' | 'iConfirmTheInformationIsCorrectComplete' | 'iConfirmTheEntityIsNotAUsPerson' | 'iConfirmTheEntityIsTheBeneficialOwner' | 'iConfirmTheTaxIdIsCorrect' | 'iHaveLegalCapacityToSign' | 'mailingAddress' | 'mailingAddressIsDifferent' | 'month' | 'name' | 'nameOfEntity' | 'nameOfCCorporation' | 'nameOfCorporation' | 'nameOfIndividual' | 'nameOfLlc' | 'nameOfOrganization' | 'nameOfPartnership' | 'nameOfSCorporation' | 'nameOfSoleProprietor' | 'nameOfTrustEstate' | 'nameOfTrust' | 'province' | 'regardedOwnerUsPerson' | 'removeAdditional' | 'signature' | 'smllcElection' | 'state' | 'stateProvince' | 'street' | 'street2' | 'taxIdNumber' | 'taxIdNumberIsNotRequired' | 'tin' | 'usAccountType' | 'usLlcClassification' | 'usOtherClassification' | 'usPerson' | 'usEin' | 'usSsn' | 'usTin' | 'usTrustEstateEin' | 'vatIdentificationNumber' | 'vatIsNotRequired' | 'vatCountry' | 'year' | 'zip';
|
|
5
5
|
export type SubPromptKey = 'smllcElection' | 'iConfirmIncomeIsNonUs' | 'isEuResident' | 'isIndividual' | 'financialAccountIdentifier' | 'financialAccountName' | 'vatIdentificationNumber' | 'placeOfBirth';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Locale } from './Locale
|
|
1
|
+
import { Locale } from './Locale';
|
|
2
|
+
import { StepId } from './StepId';
|
|
2
3
|
export type Progress = {
|
|
3
|
-
|
|
4
|
-
totalSteps: number;
|
|
4
|
+
language: Locale;
|
|
5
5
|
percentComplete: number;
|
|
6
|
+
stepId: StepId;
|
|
7
|
+
stepIndex: number;
|
|
8
|
+
stepNumber: number;
|
|
6
9
|
stepTitle: string;
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
steps: StepId[];
|
|
11
|
+
totalSteps: number;
|
|
9
12
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type StepId = 'accountHolderContactInformation' | 'accountHolderTaxInformation' | 'accountHolderTaxClarification' | 'accountHolderClassification' | 'confirmation' | 'exemptions' | 'regardedOwnerClassification' | 'regardedOwnerContactInformation' | 'regardedOwnerTaxInformation' | 'summary';
|
|
@@ -3,6 +3,7 @@ export type ClientTaxDocumentationStatus = {
|
|
|
3
3
|
submissionStatus: 'SUBMITTED' | 'NOT_SUBMITTED';
|
|
4
4
|
DAC7Interview?: {
|
|
5
5
|
dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
|
|
6
|
+
vatStatus: 'PENDING' | 'VALID' | 'INVALID' | 'INSUFFICIENT_DATA' | 'NOT_REQUIRED';
|
|
6
7
|
expirationDate: string;
|
|
7
8
|
};
|
|
8
9
|
};
|
|
@@ -2,7 +2,8 @@ export type TaxDocumentationStatus = {
|
|
|
2
2
|
status: 'UNDOCUMENTED' | 'UNDETERMINED';
|
|
3
3
|
submission_status: 'SUBMITTED' | 'NOT_SUBMITTED';
|
|
4
4
|
DAC7_interview?: {
|
|
5
|
-
|
|
5
|
+
data_collection_status: 'COMPLETE' | 'INCOMPLETE';
|
|
6
|
+
vat_status: 'PENDING' | 'VALID' | 'INVALID' | 'INSUFFICIENT_DATA' | 'NOT_REQUIRED';
|
|
6
7
|
expiration_date: string;
|
|
7
8
|
};
|
|
8
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { TaxDocumentationErrorFile } from '../contexts';
|
|
2
2
|
import { TaxDocumentation } from '../types';
|
|
3
|
-
|
|
3
|
+
import { ExternalValidations } from '../types/client';
|
|
4
|
+
export declare const getInvalidFields: (fields: TaxDocumentation, externalValidations?: ExternalValidations) => TaxDocumentationErrorFile;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ErrorKey } from 'i18n/types';
|
|
2
2
|
import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
|
|
3
|
-
|
|
3
|
+
import { ExternalValidations } from '../types/client';
|
|
4
|
+
export type FormUIValidation = (fields: TaxDocumentation, externalValidations?: ExternalValidations) => ErrorKey[] | undefined;
|
|
4
5
|
export type FormUIValidations = {
|
|
5
6
|
[key in TaxDocumentationKey]?: FormUIValidation;
|
|
6
7
|
};
|
|
File without changes
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ClientTaxDocumentation } from '
|
|
2
|
-
import { TaxBitFormProps } from './TaxBitForm
|
|
1
|
+
import { ClientTaxDocumentation, ExternalValidations } from 'types/client';
|
|
2
|
+
import { TaxBitFormProps } from './TaxBitForm';
|
|
3
3
|
type UseTaxBitFormProps = Exclude<TaxBitFormProps, 'language'>;
|
|
4
4
|
export declare const useTaxBitForm: ({ bearerToken, data, onSubmit, onSuccess, staging, }: UseTaxBitFormProps) => {
|
|
5
5
|
handleOnSubmit: (data: ClientTaxDocumentation) => Promise<void>;
|
|
6
|
-
|
|
6
|
+
externalValidations: ExternalValidations;
|
|
7
|
+
formData: ClientTaxDocumentation;
|
|
7
8
|
isComplete: boolean;
|
|
8
9
|
isLoading: boolean;
|
|
9
10
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Locale, Progress, TaxForm } from '../../types';
|
|
3
|
-
import { ClientTaxDocumentation } from '../../types/client';
|
|
3
|
+
import { ClientTaxDocumentation, ExternalValidations } from '../../types/client';
|
|
4
4
|
export type TaxBitFormUIProps = {
|
|
5
5
|
data?: ClientTaxDocumentation;
|
|
6
6
|
onSubmit: (data: ClientTaxDocumentation) => void;
|
|
7
|
+
externalValidations?: ExternalValidations;
|
|
7
8
|
language?: Locale;
|
|
8
9
|
taxForms?: TaxForm[];
|
|
9
10
|
complete?: boolean;
|
|
10
11
|
onProgress?: (progress: Progress) => void;
|
|
11
12
|
};
|
|
12
|
-
export declare const TaxBitFormUI: ({ data, onSubmit, language, taxForms, complete, onProgress, }: TaxBitFormUIProps) => React.JSX.Element;
|
|
13
|
+
export declare const TaxBitFormUI: ({ data, onSubmit, language, taxForms, complete, onProgress, externalValidations, }: TaxBitFormUIProps) => React.JSX.Element;
|