Skip to main content
The Invoice entity represents invoices in the Well system. It allows managing invoices with different statuses, amounts and payment information, linked to suppliers.

Table structure

Table name: invoices

Main fields

NameTypeRequiredConstraintsAllowed ValuesDescriptionExample
idstring, UUID, πŸ”’ systemβœ… YesUnique identifier (read-only)–Unique identifier of the invoice”invoice-uuid-123”
supplierSupplier (UUID)βœ… YesForeign key reference–Reference to the supplier”supplier-uuid-456”
namestringβœ… Yes1–200 chars–Invoice name or description”Office supplies - March 2024”
statusstring (enum)βšͺ Nodefault: β€˜draft’draft, issued, paid, canceledInvoice status”issued”
invoice_datestring (ISO 8601)βœ… Yesdate format–Invoice date”2024-03-15”
total_amountstring (decimal)βœ… Yesnumeric precision 12,2–Total amount with decimal precision”1250.50”
currencystring (3 char)βœ… YesISO 4217 codeEUR, USD, GBP, etc.Currency code”EUR”
invoice_numberstringβšͺ Nonullable–Invoice number”INV-2024-001”
due_datestring (ISO 8601)βšͺ Nodate format, nullable–Due date”2024-04-15”
created_atstring (ISO 8601) πŸ”’ system–auto timestamp–Creation timestamp”2023-01-01T12:00:00Z”
updated_atstring (ISO 8601) πŸ”’ system–auto timestamp–Last updated timestamp”2024-01-01T12:00:00Z”
deleted_atstring | null πŸ”’ systemβšͺ Nonullable ISO 8601–Deletion timestamp (soft delete)β€œ2024-01-01T12:00:00Z”

Invoice statuses

InvoiceStatusEnum

enum InvoiceStatusEnum {
  DRAFT = 'draft',        // Draft
  ISSUED = 'issued',      // Issued
  PAID = 'paid',         // Paid
  CANCELED = 'canceled'   // Canceled
}

Status lifecycle

DRAFT β†’ ISSUED β†’ PAID
   ↓       ↓
   CANCELED (at any time)

Relations

Many-to-One relations

  • Supplier: The supplier who issued the invoice
⌘I