IO-2215 Critical parts scanning

This commit is contained in:
Patrick Fic
2023-03-14 08:41:26 -07:00
parent 73bcc72fc3
commit 3891fbefdf
12 changed files with 215 additions and 2 deletions

View File

@@ -906,7 +906,7 @@ exports.UPDATE_JOB = `
}
`;
exports.GET_JOB_BY_PK = ` query GET_JOB_BY_PK($id: uuid!) {
exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
jobs_by_pk(id: $id) {
updated_at
alt_transport
@@ -1719,3 +1719,27 @@ query GET_PBS_AP_ALLOCATIONS($billids: [uuid!]) {
}
}
`;
exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) {
jobs_by_pk(id: $id) {
bodyshop {
id
md_parts_scan
}
joblines(where: {removed: {_eq: false}}) {
id
line_desc
critical
}
}
}
`;
exports.UPDATE_PARTS_CRITICAL = `mutation UPDATE_PARTS_CRITICAL ($IdsToMarkCritical:[uuid!]!, $jobid: uuid!){
critical: update_joblines(where:{id:{_in:$IdsToMarkCritical}}, _set:{critical: true}){
affected_rows
}
notcritical: update_joblines(where:{id:{_nin:$IdsToMarkCritical}, jobid: {_eq: $jobid}}, _set:{critical: false}){
affected_rows
}
}`;