feat: Add embedded customer info to invoices with configurable relationship

- Add customerInfo and billingAddress fields to invoice collection
- Make customer relationship optional and configurable via plugin config
- Update TypeScript types to reflect new invoice structure
- Allow disabling customer relationship with customerRelation: false

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-15 20:55:25 +02:00
parent 2c5459e457
commit c561dcb026
8 changed files with 222 additions and 125 deletions

View File

@@ -6,8 +6,8 @@ import { billingPlugin } from '../dist/index.js'
import sharp from 'sharp'
import { fileURLToPath } from 'url'
import { testEmailAdapter } from './helpers/testEmailAdapter.js'
import { seed } from './seed.js'
import { testEmailAdapter } from './helpers/testEmailAdapter'
import { seed } from './seed'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
@@ -59,6 +59,8 @@ const buildConfigWithSQLite = () => {
customers: 'customers',
invoices: 'invoices',
refunds: 'refunds',
// customerRelation: false, // Set to false to disable customer relationship in invoices
// customerRelation: 'clients', // Or set to a custom collection slug
}
}),
],