IO-1550 Updated production boards to simplify subscription.

This commit is contained in:
Patrick Fic
2021-12-06 16:39:13 -08:00
parent df83acb5ed
commit 4393bf42ed
5 changed files with 200 additions and 56 deletions

View File

@@ -136,6 +136,27 @@ export const RECEIVE_PARTS_LINE = gql`
}
`;
export const UPDATE_JOB_LINE_SUBLET = gql`
mutation UPDATE_JOB_LINE_SUBLET(
$lineId: uuid!
$line: joblines_set_input!
$now: timestamptz!
$jobId: uuid!
) {
update_jobs_by_pk(pk_columns: { id: $jobId }, _set: { updated_at: $now }) {
id
updated_at
}
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
returning {
id
sublet_completed
sublet_ignored
}
}
}
`;
export const UPDATE_JOB_LINE = gql`
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {

View File

@@ -105,10 +105,18 @@ export const QUERY_PARTS_QUEUE = gql`
}
}
`;
export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
subscription SUBSCRIPTION_JOBS_IN_PRODUCTION {
jobs(where: { inproduction: { _eq: true } }) {
id
updated_at
}
}
`;
export const QUERY_EXACT_JOB_IN_PRODUCTION = gql`
query QUERY_EXACT_JOB_IN_PRODUCTION($id: uuid!) {
jobs(where: { id: { _eq: $id } }) {
id
status
ro_number
@@ -171,6 +179,79 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
line_desc
sublet_ignored
sublet_completed
jobid
}
}
}
`;
export const QUERY_JOBS_IN_PRODUCTION = gql`
query QUERY_JOBS_IN_PRODUCTION {
jobs(where: { inproduction: { _eq: true } }) {
id
updated_at
status
ro_number
ownr_fn
ownr_ln
ownr_co_nm
v_model_yr
v_model_desc
clm_no
v_make_desc
v_color
plate_no
actual_in
scheduled_completion
scheduled_delivery
date_last_contacted
date_next_contact
ins_co_nm
clm_total
ownr_ph1
ownr_ph2
special_coverage_policy
owner_owing
production_vars
kanbanparent
alt_transport
employee_body
employee_refinish
employee_prep
employee_csr
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
subletLines: joblines(
where: {
_and: { part_type: { _in: ["PAS", "PASL"] }, removed: { _eq: false } }
}
order_by: { line_no: asc }
) {
id
line_desc
sublet_ignored
sublet_completed
jobid
}
}
}
@@ -875,6 +956,7 @@ export const UPDATE_JOB = gql`
update_jobs(where: { id: { _eq: $jobId } }, _set: $job) {
returning {
id
date_exported
status
alt_transport
@@ -1589,46 +1671,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
}
}
`;
export const QUERY_JOBS_IN_PRODUCTION = gql`
query QUERY_JOBS_IN_PRODUCTION {
jobs(
where: { inproduction: { _eq: true } }
order_by: { scheduled_completion: asc }
) {
id
ro_number
ownr_co_nm
ownr_fn
ownr_ln
v_model_yr
v_make_desc
v_model_desc
scheduled_completion
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
`;
export const QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED = gql`
query QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED(