Files
bodyshop/client/src/graphql/bodyshop.queries.js
2020-09-22 08:50:41 -07:00

216 lines
4.2 KiB
JavaScript

import gql from "graphql-tag";
export const INTROSPECTION = gql`
query INTROSPECTION {
__schema {
types {
name
}
}
}
`;
export const QUERY_BODYSHOP = gql`
query QUERY_BODYSHOP {
bodyshops(where: { associations: { active: { _eq: true } } }) {
associations {
authlevel
useremail
user {
authid
email
dashboardlayout
employee {
id
}
}
}
address1
address2
city
country
created_at
email
phone
federal_tax_id
id
insurance_vendor_id
logo_img_path
md_ro_statuses
md_order_statuses
shopname
state
state_tax_id
updated_at
zip_post
shoprates
region_config
md_responsibility_centers
messagingservicesid
template_header
textid
production_config
invoice_tax_rates
inhousevendorid
accountingconfig
appt_length
stripe_acct_id
ssbuckets
scoreboard_target
md_referral_sources
md_messaging_presets
intakechecklist
speedprint
md_parts_locations
md_notes_presets
md_rbac
prodtargethrs
md_classes
md_ins_cos
md_categories
enforce_class
md_labor_rates
deliverchecklist
target_touchtime
employees {
id
first_name
last_name
employee_number
cost_center
}
}
}
`;
export const QUERY_SHOP_ID = gql`
query QUERY_SHOP_ID {
bodyshops(where: { associations: { active: { _eq: true } } }) {
id
}
}
`;
export const UPDATE_SHOP = gql`
mutation UPDATE_SHOP($id: uuid, $shop: bodyshops_set_input!) {
update_bodyshops(where: { id: { _eq: $id } }, _set: $shop) {
returning {
address1
address2
city
country
created_at
email
phone
federal_tax_id
id
insurance_vendor_id
logo_img_path
md_ro_statuses
md_order_statuses
shopname
state
state_tax_id
updated_at
zip_post
shoprates
region_config
md_responsibility_centers
messagingservicesid
template_header
textid
production_config
invoice_tax_rates
appt_length
stripe_acct_id
ssbuckets
scoreboard_target
md_referral_sources
md_messaging_presets
intakechecklist
speedprint
md_parts_locations
md_notes_presets
md_rbac
prodtargethrs
md_classes
md_ins_cos
md_categories
enforce_class
md_labor_rates
deliverchecklist
target_touchtime
employees {
id
first_name
last_name
employee_number
cost_center
}
}
}
}
`;
export const QUERY_INTAKE_CHECKLIST = gql`
query QUERY_INTAKE_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
bodyshops_by_pk(id: $shopId) {
id
intakechecklist
}
jobs_by_pk(id: $jobId) {
id
ro_number
est_number
scheduled_completion
scheduled_delivery
}
}
`;
export const QUERY_DELIVER_CHECKLIST = gql`
query QUERY_DELIVER_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
bodyshops_by_pk(id: $shopId) {
id
deliverchecklist
}
jobs_by_pk(id: $jobId) {
id
ro_number
}
}
`;
export const QUERY_STRIPE_ID = gql`
query QUERY_STRIPE_ID {
bodyshops {
stripe_acct_id
}
}
`;
export const QUERY_DASHBOARD_DETAILS = gql`
query QUERY_DASHBOARD_DETAILS {
jobs {
id
clm_total
scheduled_completion
date_invoiced
ins_co_nm
}
compJobs: jobs(where: { inproduction: { _eq: true } }) {
id
scheduled_completion
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAB" } }) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" } }) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
`;