const invoiceSchema = {
type: 'object',
properties: {
invoiceNumber: {
type: 'string',
description: 'Invoice number or reference ID (e.g., INV-2024-001)'
},
invoiceDate: {
type: 'string',
description: 'Invoice date in YYYY-MM-DD format'
},
dueDate: {
type: 'string',
description: 'Payment due date in YYYY-MM-DD format'
},
vendor: {
type: 'object',
description: 'Seller/vendor information',
properties: {
name: { type: 'string', description: 'Company or business name' },
address: { type: 'string', description: 'Full street address' },
city: { type: 'string' },
country: { type: 'string' },
taxId: { type: 'string', description: 'VAT number or tax ID' },
email: { type: 'string' },
phone: { type: 'string' }
},
required: ['name']
},
customer: {
type: 'object',
description: 'Buyer/customer information',
properties: {
name: { type: 'string' },
address: { type: 'string' },
taxId: { type: 'string' }
}
},
lineItems: {
type: 'array',
description: 'Individual items or services on the invoice',
items: {
type: 'object',
properties: {
description: { type: 'string', description: 'Item or service description' },
quantity: { type: 'number', description: 'Number of units' },
unitPrice: { type: 'number', description: 'Price per unit' },
amount: { type: 'number', description: 'Line total (quantity × unitPrice)' }
},
required: ['description', 'amount']
}
},
subtotal: {
type: 'number',
description: 'Sum of line items before tax'
},
taxRate: {
type: 'number',
description: 'Tax rate as percentage (e.g., 20 for 20%)'
},
taxAmount: {
type: 'number',
description: 'Total tax amount'
},
total: {
type: 'number',
description: 'Final amount due including tax'
},
currency: {
type: 'string',
description: 'Currency code (e.g., USD, EUR, GBP)'
}
},
required: ['invoiceNumber', 'total']
};