You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin implements a company validation RecordHook for Flatfile. It validates company information including name, website, address, and EIN (Employer Identification Number). The plugin uses external APIs for address validation and EIN verification, providing detailed error messages for unverified information.
4
+
5
+
## Features
6
+
7
+
- Validates company name
8
+
- Validates company website format
9
+
- Validates company address using Google Maps API (optional)
10
+
- Validates EIN using EIN Verification API (optional)
The plugin accepts a configuration object with the following properties:
44
+
45
+
-`sheetSlug` (string): The slug of the sheet to apply the validation to
46
+
-`googleMapsApiKey` (string): Your Google Maps API key for address validation
47
+
-`einVerificationApiKey` (string): Your EIN Verification API key
48
+
-`validateAddress` (boolean): Whether to validate company addresses
49
+
-`validateEIN` (boolean): Whether to validate EINs
50
+
51
+
## Behavior
52
+
53
+
The plugin performs the following validations:
54
+
55
+
1. Company Name: Checks if the name is longer than 1 character
56
+
2. Company Website: Validates the website format using a regex pattern
57
+
3. Company Address (optional): Uses Google Maps API to verify the address
58
+
4. EIN (optional): Verifies the EIN using the EIN Verification API
59
+
60
+
For each invalid field, the plugin adds an error message to the record. The record is then returned, allowing Flatfile to display the errors to the user.
61
+
62
+
Note: Address and EIN validations are performed only if the respective configuration options are set to true.
"task": "Develop a company/business validation Flatfile Listener plugin:\n - Create a RecordHook to validate company information\n - Implement company name and address validation using external APIs (e.g., Google Places API)\n - Verify business registration numbers or tax IDs\n - Check for company existence in business databases\n - Add error messages or warnings for unverified business information\n - Give the user reasonable config options to specify the Sheet Slug, the Field(s) that are the company information(s), whether the validation should be done automatically",
4
+
"summary": "This solution implements a company validation RecordHook plugin for Flatfile. It validates company information including name, website, address, EIN, and business registration. The plugin uses external APIs for address validation and business verification. It includes configuration options and provides detailed error messages and warnings for unverified information.",
5
+
"steps": [
6
+
[
7
+
"Retrieve information about Flatfile Listeners and RecordHook plugin.\n",
8
+
"#E1",
9
+
"PineconeAssistant",
10
+
"Provide information on Flatfile Listeners and RecordHook plugin, including their structure and usage",
11
+
"Plan: Retrieve information about Flatfile Listeners and RecordHook plugin.\n#E1 = PineconeAssistant[Provide information on Flatfile Listeners and RecordHook plugin, including their structure and usage]"
12
+
],
13
+
[
14
+
"Create a basic structure for the company validation RecordHook.\n",
15
+
"#E2",
16
+
"LLM",
17
+
"Create a basic structure for a Flatfile RecordHook plugin for company validation, using the information from #E1",
18
+
"Plan: Create a basic structure for the company validation RecordHook.\n#E2 = LLM[Create a basic structure for a Flatfile RecordHook plugin for company validation, using the information from #E1]"
19
+
],
20
+
[
21
+
"Implement company name and address validation using Google Places API.\n",
22
+
"#E3",
23
+
"Google",
24
+
"How to use Google Places API for company name and address validation",
25
+
"Plan: Implement company name and address validation using Google Places API.\n#E3 = Google[How to use Google Places API for company name and address validation]"
26
+
],
27
+
[
28
+
"Integrate Google Places API validation into the RecordHook.\n",
29
+
"#E4",
30
+
"LLM",
31
+
"Integrate Google Places API validation into the RecordHook structure from #E2, using the information from #E3",
32
+
"Plan: Integrate Google Places API validation into the RecordHook.\n#E4 = LLM[Integrate Google Places API validation into the RecordHook structure from #E2, using the information from #E3]"
33
+
],
34
+
[
35
+
"Implement business registration number and tax ID verification.\n",
36
+
"#E5",
37
+
"Google",
38
+
"API for verifying business registration numbers and tax IDs",
39
+
"Plan: Implement business registration number and tax ID verification.\n#E5 = Google[API for verifying business registration numbers and tax IDs]"
40
+
],
41
+
[
42
+
"Add business registration and tax ID verification to the RecordHook.\n",
43
+
"#E6",
44
+
"LLM",
45
+
"Add business registration and tax ID verification to the RecordHook using the information from #E5 and #E4",
46
+
"Plan: Add business registration and tax ID verification to the RecordHook.\n#E6 = LLM[Add business registration and tax ID verification to the RecordHook using the information from #E5 and #E4]"
47
+
],
48
+
[
49
+
"Implement company existence check in business databases.\n",
50
+
"#E7",
51
+
"Google",
52
+
"API for checking company existence in business databases",
53
+
"Plan: Implement company existence check in business databases.\n#E7 = Google[API for checking company existence in business databases]"
54
+
],
55
+
[
56
+
"Integrate company existence check into the RecordHook.\n",
57
+
"#E8",
58
+
"LLM",
59
+
"Integrate company existence check into the RecordHook using the information from #E7 and #E6",
60
+
"Plan: Integrate company existence check into the RecordHook.\n#E8 = LLM[Integrate company existence check into the RecordHook using the information from #E7 and #E6]"
61
+
],
62
+
[
63
+
"Add error messages and warnings for unverified business information.\n",
64
+
"#E9",
65
+
"LLM",
66
+
"Add error messages and warnings for unverified business information to the RecordHook from #E8",
67
+
"Plan: Add error messages and warnings for unverified business information.\n#E9 = LLM[Add error messages and warnings for unverified business information to the RecordHook from #E8]"
68
+
],
69
+
[
70
+
"Implement configuration options for the RecordHook.\n",
71
+
"#E10",
72
+
"LLM",
73
+
"Add configuration options to the RecordHook for specifying Sheet Slug, company information fields, and automatic validation toggle, using the structure from #E9",
74
+
"Plan: Implement configuration options for the RecordHook.\n#E10 = LLM[Add configuration options to the RecordHook for specifying Sheet Slug, company information fields, and automatic validation toggle, using the structure from #E9]"
75
+
],
76
+
[
77
+
"Verify the final RecordHook implementation and ensure it uses valid Event Topics.\n",
78
+
"#E11",
79
+
"PineconeAssistant",
80
+
"Verify the RecordHook implementation from #E10 and ensure it uses valid Event Topics",
81
+
"Plan: Verify the final RecordHook implementation and ensure it uses valid Event Topics.\n#E11 = PineconeAssistant[Verify the RecordHook implementation from #E10 and ensure it uses valid Event Topics]"
82
+
],
83
+
[
84
+
"Optimize the code and remove any unused imports or elements.\n",
85
+
"#E12",
86
+
"LLM",
87
+
"Optimize the RecordHook code from #E11, remove unused imports, and ensure all plugins and utils are correctly used",
88
+
"Plan: Optimize the code and remove any unused imports or elements.\n#E12 = LLM[Optimize the RecordHook code from #E11, remove unused imports, and ensure all plugins and utils are correctly used]"
89
+
],
90
+
[
91
+
"Create documentation for the company validation RecordHook plugin.\n",
92
+
"#E13",
93
+
"LLM",
94
+
"Create documentation for the company validation RecordHook plugin, including setup instructions, configuration options, and usage examples",
95
+
"Plan: Create documentation for the company validation RecordHook plugin.\n#E13 = LLM[Create documentation for the company validation RecordHook plugin, including setup instructions, configuration options, and usage examples]"
0 commit comments