enum InvoiceStatus {
  DRAFT
  PENDING_REVIEW
  APPROVED
  DISPUTED
  UNDER_REVIEW
  RESOLVED
  OVERDUE
  PAID
  RECONCILED
  CANCELLED
}

type Invoice @table(name: "invoices") {
  id: UUID! @default(expr: "uuidV4()")
  invoiceNumber: String!
  amount: Float!
  status: InvoiceStatus!
  issueDate: Timestamp!
  dueDate: Timestamp!
  disputedItems: String
  isAutoGenerated: Boolean @default(expr: "false")   # is_auto_generated
  createdDate: Timestamp @default(expr: "request.time")
  updatedDate: Timestamp @default(expr: "request.time")
  createdBy: String @default(expr: "auth.uid")
}
