
enum InovicePaymentTermsTemp{
  NET_30
  NET_45
  NET_60
}

type InvoiceTemplate @table(name: "invoice_templates") {
  id: UUID! @default(expr: "uuidV4()")
  name: String!
  
  ownerId: UUID!#vendor/business

  #vendor poner companyName
  vendorId: UUID
  vendor: Vendor @ref(fields: "vendorId", references: "id") 

  #businnes poner businessName
  businessId: UUID
  business: Business @ref(fields: "businessId", references: "id") 

  #order poner eventName
  orderId: UUID
  order: Order @ref(fields: "orderId", references: "id")

  #web
  paymentTerms: InovicePaymentTermsTemp
  invoiceNumber: String
  issueDate: Timestamp
  dueDate: Timestamp
  hub: String
  managerName: String
  vendorNumber: String
  roles: Any #here is for staff
  charges: Any
  otherCharges: Float
  subtotal: Float
  amount: Float
  notes: String

  staffCount: Int 
  chargesCount: Int

  createdAt: Timestamp @default(expr: "request.time")
  updatedAt: Timestamp @default(expr: "request.time")
  createdBy: String
}
