Added basic bucketed smart scheduling BOD-4

This commit is contained in:
Patrick Fic
2020-06-24 11:20:27 -07:00
parent 73ff905b58
commit 997ea6cbcf
8 changed files with 148 additions and 52 deletions

View File

@@ -111,8 +111,8 @@ query QUERY_INVOICES_FOR_PAYABLES_EXPORT($invoices: [uuid!]!) {
exports.QUERY_UPCOMING_APPOINTMENTS = `
query QUERY_UPCOMING_APPOINTMENTS($now: timestamptz!, $jobId: uuid!) {
jobs_by_pk(id: $jobId){
bodyshop{
jobs_by_pk(id: $jobId) {
bodyshop {
ssbuckets
}
jobhrs: joblines_aggregate {
@@ -122,23 +122,27 @@ query QUERY_UPCOMING_APPOINTMENTS($now: timestamptz!, $jobId: uuid!) {
}
}
}
}
appointments(where: {start: {_gt: $now}}) {
start
isintake
id
job {
joblines_aggregate {
aggregate {
sum {
mod_lb_hrs
}
appointments(where: {_and: {canceled: {_eq: false}, start: {_gte: $now}}}) {
start
isintake
id
job {
joblines_aggregate {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
productionview {
id
labhrs
larhrs
scheduled_completion
}
}
`;