feature/IO-3255-simplified-parts-management - Checkpoint
This commit is contained in:
@@ -32,9 +32,76 @@ const INSERT_JOB_WITH_LINES = `
|
||||
}
|
||||
`;
|
||||
|
||||
const GET_JOB_BY_CLAIM = `
|
||||
query GetJobByClaim($shopid: uuid!, $clm_no: String!) {
|
||||
jobs(
|
||||
where: { shopid: { _eq: $shopid }, clm_no: { _eq: $clm_no } }
|
||||
order_by: { created_at: desc }
|
||||
limit: 1
|
||||
) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const UPDATE_JOB_BY_ID = `
|
||||
mutation UpdateJobById($id: uuid!, $job: jobs_set_input!) {
|
||||
update_jobs_by_pk(pk_columns: { id: $id }, _set: $job) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const UPSERT_JOBLINES = `
|
||||
mutation UpsertJoblines($joblines: [joblines_insert_input!]!) {
|
||||
insert_joblines(
|
||||
objects: $joblines
|
||||
on_conflict: {
|
||||
constraint: joblines_jobid_line_no_unq_seq_key
|
||||
update_columns: [
|
||||
status
|
||||
line_desc
|
||||
part_type
|
||||
part_qty
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
mod_lbr_ty
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
notes
|
||||
]
|
||||
}
|
||||
) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
const DELETE_JOBLINES_BY_JOBID = `
|
||||
mutation DeleteJoblinesByJobId($jobid: uuid!) {
|
||||
delete_joblines(where: { jobid: { _eq: $jobid } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const INSERT_JOBLINES = `
|
||||
mutation InsertJoblines($joblines: [joblines_insert_input!]!) {
|
||||
insert_joblines(objects: $joblines) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
module.exports = {
|
||||
GET_BODYSHOP_STATUS,
|
||||
GET_VEHICLE_BY_SHOP_VIN,
|
||||
INSERT_OWNER,
|
||||
INSERT_JOB_WITH_LINES
|
||||
INSERT_JOB_WITH_LINES,
|
||||
GET_JOB_BY_CLAIM,
|
||||
UPDATE_JOB_BY_ID,
|
||||
DELETE_JOBLINES_BY_JOBID,
|
||||
UPSERT_JOBLINES,
|
||||
INSERT_JOBLINES
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user