Removed productionview view from Hasura and replaced with standard GQL queries. BOD-243

This commit is contained in:
Patrick Fic
2020-08-03 13:43:39 -07:00
parent 3a8b4ddf5a
commit 75b1ed44e8
8 changed files with 68 additions and 135 deletions

View File

@@ -50,53 +50,9 @@ export const QUERY_ALL_ACTIVE_JOBS = gql`
}
`;
export const QUERY_JOBS_IN_PRODUCTION = gql`
query QUERY_JOBS_IN_PRODUCTION {
productionview {
id
status
ro_number
est_number
ownr_fn
ownr_ln
v_model_yr
v_model_desc
clm_no
v_make_desc
v_color
plate_no
actual_in
scheduled_completion
scheduled_delivery
ins_co_nm
clm_total
ownr_ph1
special_coverage_policy
production_vars
labhrs
larhrs
employee_body_rel {
id
first_name
last_name
}
employee_refinish_rel {
id
first_name
last_name
}
employee_prep_rel{
id
first_name
last_name
}
}
}
`;
export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
subscription SUBSCRIPTION_JOBS_IN_PRODUCTION($statusList: [String!]!) {
productionview(where: { status: { _in: $statusList } }) {
jobs(where: { status: { _in: $statusList } }) {
id
status
ro_number
@@ -117,9 +73,6 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
ownr_ph1
special_coverage_policy
production_vars
labhrs
larhrs
partcount
kanbanparent
employee_body_rel {
id
@@ -136,6 +89,26 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
first_name
last_name
}
partcount: joblines_aggregate {
nodes {
status
}
}
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
}
}
}
}
}
`;