mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 10:53:23 +00:00
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:
@@ -100,6 +100,7 @@ export interface BillingPluginConfig {
|
||||
dashboard?: boolean
|
||||
}
|
||||
collections?: {
|
||||
customerRelation?: boolean | string // false to disable, string for custom collection slug
|
||||
customers?: string
|
||||
invoices?: string
|
||||
payments?: string
|
||||
@@ -154,9 +155,24 @@ export interface CustomerRecord {
|
||||
|
||||
export interface InvoiceRecord {
|
||||
amount: number
|
||||
billingAddress?: {
|
||||
city: string
|
||||
country: string
|
||||
line1: string
|
||||
line2?: string
|
||||
postalCode: string
|
||||
state?: string
|
||||
}
|
||||
createdAt: string
|
||||
currency: string
|
||||
customer?: string
|
||||
customer?: string // Optional relationship to customer collection
|
||||
customerInfo?: {
|
||||
company?: string
|
||||
email: string
|
||||
name: string
|
||||
phone?: string
|
||||
taxId?: string
|
||||
}
|
||||
dueDate?: string
|
||||
id: string
|
||||
items: InvoiceItem[]
|
||||
|
||||
Reference in New Issue
Block a user