const String getInvoicesQuery = '''
query GetInvoices (\$status: InvoiceStatus, \$first: Int!, \$after: String) {
  client_invoices( status: \$status, first: \$first, after: \$after) {
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
      total
      count
      currentPage
      lastPage
    }
    edges {
      ...invoice
      cursor
    }
  }
}


fragment invoice on InvoiceEdge {
  node {
    id
    business {
      id
      name
      avatar
      registration
      contact{
        id
        first_name
        last_name
        email
        phone
      }
    }
    event {
      id
      status
      start_time
      end_time
      contract_type
      ...hub
      name
      date
      purchase_order
    }
    status
    contract_type
    contract_value
    total
    addons_amount
    work_amount
    issued_at
    due_at
    ...items
    dispute {
      id
      reason
      details
      support_note
    }
  }
}

fragment items on Invoice {
  items {
    id
    staff {
      id
      first_name
      last_name
      email
      phone
      address
    }
    position {
      id
      start_time
      end_time
      break
      count
      rate
      ...business_skill
      staff{
      id
        pivot {
          id
          status
          start_at
          end_at
          clock_in
          clock_out
        }
      }
    }
    work_hours
    rate
    addons_amount
    work_amount
    total_amount
  }
}

fragment business_skill on EventShiftPosition {
  business_skill {
    id
    skill {
      id
      name
      slug
    }
    price
    is_active
  }
}

fragment hub on Event {
  hub {
    id
    name
    full_address {
      formatted_address
    }
  }
}

''';

const String approveInvoiceMutation = '''
mutation ApproveInvoice(\$id: ID!) {
  confirm_client_invoice(id: \$id) {
    id
  }
}
''';

const String disputeInvoiceMutation = '''
mutation DisputeInvoice(\$id: ID!, \$reason: String!, \$comment: String!) {
  dispute_client_invoice(id: \$id, reason: \$reason, details: \$comment) {
    id
  }
}
''';
