import { gql } from "@apollo/client";

export const GLOBAL_SEARCH_QUERY = gql`
  query GLOBAL_SEARCH_QUERY($search: String) {
    search_jobs(args: { search: $search }, limit: 25) {
      id
      ro_number
      status
      clm_no
      v_model_yr
      v_model_desc
      v_make_desc
      v_color
      ownr_fn
      ownr_ln
      ownr_co_nm
    }
    search_owners(args: { search: $search }, limit: 25) {
      id
      ownr_fn
      ownr_ln
      ownr_co_nm
      ownr_ph1
      ownr_ph2
      ownr_ph1_ty
      ownr_ph2_ty
    }
    search_vehicles(args: { search: $search }, limit: 25) {
      id
      v_model_yr
      v_model_desc
      v_make_desc
      v_color
      v_vin
      plate_no
    }
    search_payments(args: { search: $search }, limit: 25) {
      id
      amount
      paymentnum
      job {
        ro_number
        id
      }
      memo
      transactionid
    }
    search_bills(args: { search: $search }, limit: 25) {
      id
      date
      invoice_number
      vendor {
        id
        name
      }
    }
    search_phonebook(args: { search: $search }, limit: 25) {
      id
      firstname
      lastname
      company
      phone1
    }
  }
`;
