
mutation createInvoiceTemplate(
  $name: String!
  $ownerId: UUID!

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

  $paymentTerms: InovicePaymentTermsTemp
  $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) {
  invoiceTemplate_insert(
    data: {
      name: $name
      ownerId: $ownerId

      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 updateInvoiceTemplate(
  $id: UUID!

  $name: String
  $ownerId: UUID

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

  $paymentTerms: InovicePaymentTermsTemp
  $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) {
  invoiceTemplate_update(
    id: $id
    data: {
      name: $name
      ownerId: $ownerId

      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 deleteInvoiceTemplate($id: UUID!) @auth(level: USER) {
  invoiceTemplate_delete(id: $id)
}
