@taxbit/react-sdk 1.0.0-beta.2 → 1.0.0-beta.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 CHANGED
@@ -1,6 +1,12 @@
1
1
  # Taxbit React SDK
2
2
 
3
- A React app, widget, and component for gathering Tax Documentation data for US and EU Tax forms.
3
+ A React component and hook for gathering Tax Documentation data for US and EU Tax forms.
4
+
5
+ ## Usage
6
+
7
+ The Taxbit React SDK provides a React component and hook for gathering tax documentation data from users. The component can be used to collect data for the Taxbit DPS (Digital Platform Sales) or W-Form (W-9, W-8BEN, W-8BEN-E) tax documentation forms. A hook provides more tools to understand the user's tax documentation status and download any pdf versions of the files that are created if eligible.
8
+
9
+ DPS (Digital Platform Sales) is a data standard and UI flow used by Taxbit to gather the information needed to report income as directed by the DAC7 for the European Union, and equivalent reporting requirements in Canada, New Zealand, and the United Kingdom.
4
10
 
5
11
  ## Installation
6
12
 
@@ -112,24 +118,43 @@ See the `Locale` type below.
112
118
  The `useTaxbit` hook will return a `status` object that can be used to determine the status of the user's tax documentation. The `status` object will have the following shape:
113
119
 
114
120
  ```typescript
115
- {
116
- submissionStatus: 'SUBMITTED' | 'NOT_SUBMITTED';
117
- dpsQuestionnaire: {
121
+ type ClientTaxDocumentationStatus = {
122
+ dpsQuestionnaire?: {
118
123
  dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
119
- expirationDate: 'PENDING' |
120
- 'VALID' |
121
- 'INVALID' |
122
- 'INSUFFICIENT_DATA' |
123
- 'NOT_REQUIRED';
124
- }
125
- }
124
+ vatStatus?:
125
+ | 'PENDING'
126
+ | 'VALID'
127
+ | 'INVALID'
128
+ | 'INSUFFICIENT_DATA'
129
+ | 'NOT_REQUIRED'
130
+ | 'NON_EU';
131
+ vatValidationDate?: string;
132
+ expirationDate?: string;
133
+ };
134
+ wFormQuestionnaire?: {
135
+ dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
136
+ type: 'W-9' | 'W-8BEN' | 'W-8BEN-E';
137
+ expirationDate?: string;
138
+ tinStatus?:
139
+ | 'PENDING'
140
+ | 'FOREIGN'
141
+ | 'INVALID_DATA'
142
+ | 'VALID_SSN_MATCH'
143
+ | 'VALID_EIN_MATCH'
144
+ | 'VALID_SSN_EIN_MATCH'
145
+ | 'MISMATCH'
146
+ | 'TIN_NOT_ISSUED'
147
+ | 'ERROR';
148
+ tinValidationDate?: string;
149
+ needsResubmission: boolean;
150
+ };
151
+ };
126
152
  ```
127
153
 
128
154
  an example is below.
129
155
 
130
156
  ```json
131
157
  {
132
- "submissionStatus": "SUBMITTED",
133
158
  "dpsQuestionnaire": {
134
159
  "dataCollectionStatus": "COMPLETE",
135
160
  "expirationDate": "2026-11-20T00:00:00.000Z"
@@ -137,6 +162,19 @@ an example is below.
137
162
  }
138
163
  ```
139
164
 
165
+ or for W-Form status
166
+
167
+ ```json
168
+ {
169
+ "wFormQuestionnaire": {
170
+ "dataCollectionStatus": "COMPLETE",
171
+ "type": "W-9",
172
+ "tinValidationDate": "2027-11-01T17:09:05.962Z",
173
+ "needsResubmission": false
174
+ }
175
+ }
176
+ ```
177
+
140
178
  ### CSS and Style Customization
141
179
 
142
180
  The Taxbit React SDK renders a form for collecting user data. The form is structured with fairly semantic HTML and CSS classes and can be easily customized to closely match your client's style.
@@ -221,8 +259,21 @@ type Progress = {
221
259
  };
222
260
  ```
223
261
 
262
+ ```typescript
263
+ type QuestionnaireType = 'DPS' | 'W-FORM';
264
+ ```
265
+
224
266
  ## Changelog
225
267
 
268
+ ### Version 1.0.0-beta.3
269
+
270
+ 1. Transforming deprecated tax documentation data types for import to SDK
271
+ 2. More Readme documentation around Status and Questionnaire types
272
+
273
+ ### Version 1.0.0-beta.2
274
+
275
+ 1. The ClientTaxDocumentation type is exposed in the `useTaxbit` hook.
276
+
226
277
  ### Version 1.0.0-beta.1
227
278
 
228
279
  1. Showing "\*" when required for Addresses on Summary
@@ -271,7 +322,7 @@ type Progress = {
271
322
 
272
323
  ### Version 0.4.1
273
324
 
274
- 1. Bug fix for onProgress callback not being triggered from the TaxbitDPSQuestionnaire component.
325
+ 1. Bug fix for onProgress callback not being triggered from the TaxBitDAC7Form component.
275
326
 
276
327
  ### Version 0.4.0
277
328
 
@@ -304,5 +355,5 @@ type Progress = {
304
355
  1. Fix in package.json to expose UMD module as main.
305
356
  2. Added specific CSS class names for each question and each screen of the form.
306
357
  3. Added the new status structure into the useTaxbit hook.
307
- 4. TaxbitDPSQuestionnaire component will now preload the form with previously submitted data.
358
+ 4. TaxBitDAC7Form component will now preload the form with previously submitted data.
308
359
  5. Validation update to enforce that primary address country and tax residence country are the same.
@@ -0,0 +1,6 @@
1
+ import { SignedDatedComprehensiveTaxDocumentation } from '@taxbit/utilities';
2
+ export type Comprehensive = {
3
+ account_holder: SignedDatedComprehensiveTaxDocumentation['account_holder'];
4
+ regarded_owner?: SignedDatedComprehensiveTaxDocumentation['regarded_owner'];
5
+ document_type: 'COMPREHENSIVE';
6
+ };
@@ -0,0 +1,29 @@
1
+ import { Comprehensive } from './comprehensive';
2
+ import { W9 } from './w9';
3
+ export type W8 = {
4
+ name?: string;
5
+ country?: string;
6
+ tax_classification?: 'INDIVIDUAL' | 'CORPORATION' | 'PARTNERSHIP' | 'SIMPLE_TRUST' | 'COMPLEX_TRUST' | 'GRANTOR_TRUST' | 'ESTATE' | 'CENTRAL_BANK_OF_ISSUE' | 'FOREIGN_GOVERNMENT_CONTROLLED_ENTITY' | 'FOREIGN_GOVERNMENT_INTEGRAL_PART' | 'TAX_EXEMPT_ORGANIZATION' | 'PRIVATE_FOUNDATION' | 'INTERNATIONAL_ORGANIZATION';
7
+ permanent_address: {
8
+ first_line?: string;
9
+ city?: string;
10
+ state_or_province?: string;
11
+ postal_code?: string;
12
+ country?: string;
13
+ };
14
+ mailing_address?: {
15
+ first_line?: string;
16
+ city?: string;
17
+ state_or_province?: string;
18
+ postal_code?: string;
19
+ country?: string;
20
+ };
21
+ reference_numbers?: string;
22
+ tin?: string;
23
+ ftin?: string;
24
+ date_of_birth?: string;
25
+ ftin_not_legally_required?: true;
26
+ document_type: 'W-8BEN' | 'W-8BEN-E';
27
+ };
28
+ export declare const isW8TaxDocument: (taxDocument: Comprehensive | W9 | W8) => taxDocument is W8;
29
+ export declare const transformW8ToComprehensive: (taxDocument: W8) => Comprehensive;
@@ -0,0 +1,22 @@
1
+ import { Comprehensive } from './comprehensive';
2
+ import { W8 } from './w8';
3
+ export type W9 = {
4
+ name?: string;
5
+ tin?: string;
6
+ dba_name?: string;
7
+ tax_classification?: 'INDIVIDUAL' | 'LLC_S' | 'LLC_C' | 'LLC_P' | 'S_CORPORATION' | 'C_CORPORATION' | 'PARTNERSHIP' | 'TRUST_ESTATE' | 'OTHER';
8
+ address: {
9
+ first_line?: string;
10
+ second_line?: string;
11
+ city?: string;
12
+ state_or_province?: string;
13
+ postal_code?: string;
14
+ country?: string;
15
+ };
16
+ document_type: 'W-9';
17
+ other_tax_classification?: string;
18
+ exempt_payee_code?: string;
19
+ exempt_fatca_code?: string;
20
+ };
21
+ export declare const isW9TaxDocument: (taxDocument: Comprehensive | W9 | W8) => taxDocument is W9;
22
+ export declare const transformW9ToComprehensive: (taxDocument: W9) => Comprehensive;
@@ -1,9 +1,7 @@
1
1
  export type ClientTaxDocumentationStatus = {
2
- status: 'UNDOCUMENTED' | 'UNDETERMINED';
3
- submissionStatus: 'SUBMITTED' | 'NOT_SUBMITTED';
4
2
  dpsQuestionnaire?: {
5
3
  dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
6
- vatStatus?: 'PENDING' | 'VALID' | 'INVALID' | 'INSUFFICIENT_DATA' | 'NOT_REQUIRED';
4
+ vatStatus?: 'PENDING' | 'VALID' | 'INVALID' | 'INSUFFICIENT_DATA' | 'NOT_REQUIRED' | 'NON_EU';
7
5
  vatValidationDate?: string;
8
6
  expirationDate?: string;
9
7
  };
@@ -11,7 +9,7 @@ export type ClientTaxDocumentationStatus = {
11
9
  dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
12
10
  type: 'W-9' | 'W-8BEN' | 'W-8BEN-E';
13
11
  expirationDate?: string;
14
- tinStatus?: string;
12
+ tinStatus?: 'PENDING' | 'FOREIGN' | 'INVALID_DATA' | 'VALID_SSN_MATCH' | 'VALID_EIN_MATCH' | 'VALID_SSN_EIN_MATCH' | 'MISMATCH' | 'TIN_NOT_ISSUED' | 'ERROR';
15
13
  tinValidationDate?: string;
16
14
  needsResubmission: boolean;
17
15
  };
@@ -1,9 +1,7 @@
1
1
  export type TaxDocumentationStatus = {
2
- status: 'UNDOCUMENTED' | 'UNDETERMINED';
3
- submission_status: 'SUBMITTED' | 'NOT_SUBMITTED';
4
2
  dps_questionnaire?: {
5
3
  data_collection_status: 'COMPLETE' | 'INCOMPLETE';
6
- vat_status?: 'PENDING' | 'VALID' | 'INVALID' | 'INSUFFICIENT_DATA' | 'NOT_REQUIRED';
4
+ vat_status?: 'PENDING' | 'VALID' | 'INVALID' | 'INSUFFICIENT_DATA' | 'NOT_REQUIRED' | 'NON_EU';
7
5
  vat_validation_date?: string;
8
6
  expiration_date?: string;
9
7
  };
@@ -11,7 +9,7 @@ export type TaxDocumentationStatus = {
11
9
  data_collection_status: 'COMPLETE' | 'INCOMPLETE';
12
10
  type: 'W-9' | 'W-8BEN' | 'W-8BEN-E';
13
11
  expiration_date?: string;
14
- tin_status?: string;
12
+ tin_status?: 'PENDING' | 'FOREIGN' | 'INVALID_DATA' | 'VALID_SSN_MATCH' | 'VALID_EIN_MATCH' | 'VALID_SSN_EIN_MATCH' | 'MISMATCH' | 'TIN_NOT_ISSUED' | 'ERROR';
15
13
  tin_validation_date?: string;
16
14
  needs_resubmission: boolean;
17
15
  };