fix: Address validation and consistency issues

- Restore missing customers collection import and creation
- Fix required field validation: customerInfo fields only required when no extractor
- Fix linting warnings in webhook handler
- Ensure consistent typing across all interfaces

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-15 21:17:29 +02:00
parent 5f8fee33bb
commit c14299e1fb
2 changed files with 11 additions and 8 deletions

View File

@@ -69,7 +69,7 @@ export function createInvoicesCollection(
description: 'Customer name',
readOnly: customerCollectionSlug && customerInfoExtractor ? true : false,
},
required: true,
required: !customerCollectionSlug || !customerInfoExtractor,
},
{
name: 'email',
@@ -78,7 +78,7 @@ export function createInvoicesCollection(
description: 'Customer email address',
readOnly: customerCollectionSlug && customerInfoExtractor ? true : false,
},
required: true,
required: !customerCollectionSlug || !customerInfoExtractor,
},
{
name: 'phone',
@@ -123,7 +123,7 @@ export function createInvoicesCollection(
description: 'Address line 1',
readOnly: customerCollectionSlug && customerInfoExtractor ? true : false,
},
required: true,
required: !customerCollectionSlug || !customerInfoExtractor,
},
{
name: 'line2',
@@ -139,7 +139,7 @@ export function createInvoicesCollection(
admin: {
readOnly: customerCollectionSlug && customerInfoExtractor ? true : false,
},
required: true,
required: !customerCollectionSlug || !customerInfoExtractor,
},
{
name: 'state',
@@ -156,7 +156,7 @@ export function createInvoicesCollection(
description: 'Postal or ZIP code',
readOnly: customerCollectionSlug && customerInfoExtractor ? true : false,
},
required: true,
required: !customerCollectionSlug || !customerInfoExtractor,
},
{
name: 'country',
@@ -166,7 +166,7 @@ export function createInvoicesCollection(
readOnly: customerCollectionSlug && customerInfoExtractor ? true : false,
},
maxLength: 2,
required: true,
required: !customerCollectionSlug || !customerInfoExtractor,
},
],
},