fix: Improve invoice customer data handling and validation

- Make customerInfo fields conditionally required based on customer relationship
- Add admin UI conditional visibility to hide embedded fields when relationship exists
- Fix address field naming inconsistency (postal_code -> postalCode)
- Update types to properly reflect optional customerInfo/billingAddress
- Add validation to ensure either customer relationship or embedded info is provided

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-15 21:04:35 +02:00
parent c561dcb026
commit b3368ba34f
4 changed files with 26 additions and 12 deletions

View File

@@ -140,7 +140,7 @@ export interface CustomerRecord {
country?: string
line1?: string
line2?: string
postal_code?: string
postalCode?: string
state?: string
}
createdAt: string