
mutation createInvoice(
  $status: InvoiceStatus!

  $vendorId: UUID!
  $businessId: UUID!
  $orderId: UUID!

  $paymentTerms: InovicePaymentTerms
  $invoiceNumber: String!
  $issueDate: Timestamp!
  $dueDate: Timestamp!
  $hub: String
  $managerName: String
  $vendorNumber: String
  $roles: Any
  $charges: Any
  $otherCharges: Float
  $subtotal: Float
  $amount: Float!
  $notes: String

  $staffCount: Int
  $chargesCount: Int

) @auth(level: USER) {
  invoice_insert(
    data: {
      status: $status

      vendorId: $vendorId
      businessId: $businessId
      orderId: $orderId

      paymentTerms: $paymentTerms
      invoiceNumber: $invoiceNumber
      issueDate: $issueDate
      dueDate: $dueDate
      hub: $hub
      managerName: $managerName
      vendorNumber: $vendorNumber
      roles: $roles
      charges: $charges
      otherCharges: $otherCharges
      subtotal: $subtotal
      amount: $amount
      notes: $notes

      staffCount: $staffCount
      chargesCount: $chargesCount

    }
  )
}

mutation updateInvoice(
  $id: UUID!

  $status: InvoiceStatus

  $vendorId: UUID
  $businessId: UUID
  $orderId: UUID

  $paymentTerms: InovicePaymentTerms
  $invoiceNumber: String
  $issueDate: Timestamp
  $dueDate: Timestamp
  $hub: String
  $managerName: String
  $vendorNumber: String
  $roles: Any
  $charges: Any
  $otherCharges: Float
  $subtotal: Float
  $amount: Float
  $notes: String

  $staffCount: Int
  $chargesCount: Int


  $disputedItems: Any
  $disputeReason: String
  $disputeDetails: String
) @auth(level: USER) {
  invoice_update(
    id: $id
    data: {
      status: $status

      vendorId: $vendorId
      businessId: $businessId
      orderId: $orderId

      paymentTerms: $paymentTerms
      invoiceNumber: $invoiceNumber
      issueDate: $issueDate
      dueDate: $dueDate
      hub: $hub
      managerName: $managerName
      vendorNumber: $vendorNumber
      roles: $roles
      charges: $charges
      otherCharges: $otherCharges
      subtotal: $subtotal
      amount: $amount
      notes: $notes

      staffCount: $staffCount
      chargesCount: $chargesCount

      disputedItems: $disputedItems
      disputeReason: $disputeReason
      disputeDetails: $disputeDetails

    }
  )
}

mutation deleteInvoice($id: UUID!) @auth(level: USER) {
  invoice_delete(id: $id)
}
