- the great reformat

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-06 18:23:46 -05:00
parent 3b54fd27bb
commit 4eb8faa5d9
383 changed files with 54009 additions and 52734 deletions

View File

@@ -1,174 +1,174 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_JOBS_FOR_EXPORT = gql`
query QUERY_JOBS_FOR_EXPORT($invoicedStatus: String!) {
jobs(
where: {
date_exported: { _is_null: true }
status: { _eq: $invoicedStatus }
}
) {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
date_invoiced
date_exported
status
v_model_desc
v_make_desc
v_model_yr
v_color
query QUERY_JOBS_FOR_EXPORT($invoicedStatus: String!) {
jobs(
where: {
date_exported: { _is_null: true }
status: { _eq: $invoicedStatus }
}
) {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
date_invoiced
date_exported
status
v_model_desc
v_make_desc
v_model_yr
v_color
clm_total
clm_no
ins_co_nm
exportlogs {
id
successful
}
clm_total
clm_no
ins_co_nm
exportlogs {
id
successful
}
}
}
}
`;
export const QUERY_BILLS_FOR_EXPORT = gql`
query QUERY_BILLS_FOR_EXPORT {
bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
id
exported
date
invoice_number
is_credit_memo
total
exportlogs {
id
successful
}
job {
id
ro_number
}
vendor {
name
id
}
query QUERY_BILLS_FOR_EXPORT {
bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
id
exported
date
invoice_number
is_credit_memo
total
exportlogs {
id
successful
}
job {
id
ro_number
}
vendor {
name
id
}
}
}
}
`;
export const QUERY_PAYMENTS_FOR_EXPORT = gql`
query QUERY_PAYMENTS_FOR_EXPORT {
payments(
where: { exportedat: { _is_null: true } }
order_by: { created_at: desc }
) {
id
amount
job {
ro_number
query QUERY_PAYMENTS_FOR_EXPORT {
payments(
where: { exportedat: { _is_null: true } }
order_by: { created_at: desc }
) {
id
amount
job {
ro_number
id
ownr_fn
ownr_ln
ownr_co_nm
}
payer
memo
exportedat
stripeid
created_at
transactionid
paymentnum
date
exportlogs {
id
successful
}
id
ownr_fn
ownr_ln
ownr_co_nm
}
payer
memo
exportedat
stripeid
created_at
transactionid
paymentnum
date
exportlogs {
id
successful
}
}
}
}
`;
export const INSERT_EXPORT_LOG = gql`
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
insert_exportlog(objects: $logs) {
affected_rows
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
insert_exportlog(objects: $logs) {
affected_rows
}
}
}
`;
export const QUERY_PHONEBOOK_PAGINATED = gql`
query QUERY_PHONEBOOK_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [phonebook_order_by!]
) {
search_phonebook(
offset: $offset
limit: $limit
order_by: $order
args: { search: $search }
query QUERY_PHONEBOOK_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [phonebook_order_by!]
) {
id
created_at
firstname
lastname
phone1
phone2
state
zip
fax
email
country
company
city
category
address2
address1
search_phonebook(
offset: $offset
limit: $limit
order_by: $order
args: { search: $search }
) {
id
created_at
firstname
lastname
phone1
phone2
state
zip
fax
email
country
company
city
category
address2
address1
}
search_phonebook_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
search_phonebook_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;
export const QUERY_EXPORT_LOG_PAGINATED = gql`
query QUERY_ALL_EXPORTLOG_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [exportlog_order_by!]
) {
search_exportlog(
offset: $offset
limit: $limit
order_by: $order
args: { search: $search }
query QUERY_ALL_EXPORTLOG_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [exportlog_order_by!]
) {
id
job {
ro_number
id
}
payment {
id
paymentnum
}
bill {
invoice_number
id
}
successful
message
created_at
useremail
search_exportlog(
offset: $offset
limit: $limit
order_by: $order
args: { search: $search }
) {
id
job {
ro_number
id
}
payment {
id
paymentnum
}
bill {
invoice_number
id
}
successful
message
created_at
useremail
}
search_exportlog_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
search_exportlog_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;

View File

@@ -1,21 +1,21 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_ALLOCATION = gql`
mutation INSERT_ALLOCATION($alloc: [allocations_insert_input!]!) {
insert_allocations(objects: $alloc) {
returning {
id
}
mutation INSERT_ALLOCATION($alloc: [allocations_insert_input!]!) {
insert_allocations(objects: $alloc) {
returning {
id
}
}
}
}
`;
export const DELETE_ALLOCATION = gql`
mutation DELETE_ALLOCATION($id: uuid!) {
delete_allocations(where: { id: { _eq: $id } }) {
returning {
id
}
mutation DELETE_ALLOCATION($id: uuid!) {
delete_allocations(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
}
`;

View File

@@ -1,22 +1,22 @@
import { onError } from "@apollo/client/link/error";
import {onError} from "@apollo/client/link/error";
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
import * as Sentry from "@sentry/react";
const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => {
if (graphQLErrors) {
graphQLErrors.forEach(({ message, locations, path }) => {
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
);
Sentry.captureException({ message, locations, path });
});
({graphQLErrors, networkError, operation, forward}) => {
if (graphQLErrors) {
graphQLErrors.forEach(({message, locations, path}) => {
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
);
Sentry.captureException({message, locations, path});
});
}
if (networkError)
console.log(`[Network error]: ${JSON.stringify(networkError)}`);
console.log(operation.getContext());
return forward(operation);
}
if (networkError)
console.log(`[Network error]: ${JSON.stringify(networkError)}`);
console.log(operation.getContext());
return forward(operation);
}
);
export default errorLink;

View File

@@ -1,439 +1,439 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
query QUERY_ALL_ACTIVE_APPOINTMENTS(
$start: timestamptz!
$end: timestamptz!
$startd: date!
$endd: date!
) {
employee_vacation(
where: {
_or: [
{ start: { _gte: $startd } }
{ end: { _lte: $endd } }
{ _and: [{ start: { _lte: $startd } }, { end: { _gte: $endd } }] }
]
}
query QUERY_ALL_ACTIVE_APPOINTMENTS(
$start: timestamptz!
$end: timestamptz!
$startd: date!
$endd: date!
) {
id
start
end
employee {
id
last_name
first_name
}
}
appointments(
where: {
canceled: { _eq: false }
end: { _lte: $end }
start: { _gte: $start }
}
) {
start
id
end
arrived
title
isintake
block
color
note
job {
alt_transport
ro_number
ownr_ln
ownr_co_nm
ownr_fn
ownr_ph1
ownr_ph2
ownr_ea
clm_total
id
clm_no
ins_co_nm
v_model_yr
v_make_desc
v_model_desc
est_ct_fn
est_ct_ln
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
employee_vacation(
where: {
_or: [
{ start: { _gte: $startd } }
{ end: { _lte: $endd } }
{ _and: [{ start: { _lte: $startd } }, { end: { _gte: $endd } }] }
]
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
id
start
end
employee {
id
last_name
first_name
}
}
appointments(
where: {
canceled: { _eq: false }
end: { _lte: $end }
start: { _gte: $start }
}
) {
start
id
end
arrived
title
isintake
block
color
note
job {
alt_transport
ro_number
ownr_ln
ownr_co_nm
ownr_fn
ownr_ph1
ownr_ph2
ownr_ea
clm_total
id
clm_no
ins_co_nm
v_model_yr
v_make_desc
v_model_desc
est_ct_fn
est_ct_ln
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
}
}
}
}
`;
export const INSERT_APPOINTMENT_BLOCK = gql`
mutation INSERT_APPOINTMENT_BLOCK($app: [appointments_insert_input!]!) {
insert_appointments(objects: $app) {
returning {
id
start
end
arrived
title
isintake
block
note
}
mutation INSERT_APPOINTMENT_BLOCK($app: [appointments_insert_input!]!) {
insert_appointments(objects: $app) {
returning {
id
start
end
arrived
title
isintake
block
note
}
}
}
}
`;
export const INSERT_MANUAL_APPT = gql`
mutation INSERT_MANUAL_APPT($apt: appointments_insert_input!) {
insert_appointments_one(object: $apt) {
start
id
end
arrived
title
isintake
block
color
note
canceled
job {
id
}
mutation INSERT_MANUAL_APPT($apt: appointments_insert_input!) {
insert_appointments_one(object: $apt) {
start
id
end
arrived
title
isintake
block
color
note
canceled
job {
id
}
}
}
}
`;
export const INSERT_APPOINTMENT = gql`
mutation INSERT_APPOINTMENT(
$app: [appointments_insert_input!]!
$jobId: uuid
$altTransport: String
) {
insert_appointments(objects: $app) {
returning {
id
start
end
arrived
title
isintake
block
color
note
}
}
update_jobs(
where: { id: { _eq: $jobId } }
_set: { alt_transport: $altTransport }
mutation INSERT_APPOINTMENT(
$app: [appointments_insert_input!]!
$jobId: uuid
$altTransport: String
) {
returning {
id
alt_transport
}
insert_appointments(objects: $app) {
returning {
id
start
end
arrived
title
isintake
block
color
note
}
}
update_jobs(
where: { id: { _eq: $jobId } }
_set: { alt_transport: $altTransport }
) {
returning {
id
alt_transport
}
}
}
}
`;
export const QUERY_APPOINTMENT_BY_DATE = gql`
query QUERY_APPOINTMENT_BY_DATE(
$start: timestamptz
$end: timestamptz
$startd: date!
$endd: date!
) {
employee_vacation(
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
query QUERY_APPOINTMENT_BY_DATE(
$start: timestamptz
$end: timestamptz
$startd: date!
$endd: date!
) {
id
start
end
employee {
id
last_name
first_name
}
}
appointments(
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
) {
start
id
end
title
isintake
block
color
note
job {
alt_transport
ro_number
ownr_ln
ownr_fn
ownr_ph1
ownr_ph2
ownr_ea
clm_total
id
clm_no
vehicle {
id
v_model_yr
v_make_desc
v_model_desc
}
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
employee_vacation(
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
) {
aggregate {
sum {
mod_lb_hrs
id
start
end
employee {
id
last_name
first_name
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
appointments(
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
start
id
end
title
isintake
block
color
note
job {
alt_transport
ro_number
ownr_ln
ownr_fn
ownr_ph1
ownr_ph2
ownr_ea
clm_total
id
clm_no
vehicle {
id
v_model_yr
v_make_desc
v_model_desc
}
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
}
}
}
}
`;
export const UPDATE_APPOINTMENT = gql`
mutation UPDATE_APPOINTMENT($appid: uuid!, $app: appointments_set_input) {
update_appointments(where: { id: { _eq: $appid } }, _set: $app) {
returning {
id
start
id
end
arrived
title
isintake
block
color
note
}
mutation UPDATE_APPOINTMENT($appid: uuid!, $app: appointments_set_input) {
update_appointments(where: { id: { _eq: $appid } }, _set: $app) {
returning {
id
start
id
end
arrived
title
isintake
block
color
note
}
}
}
}
`;
export const CANCEL_APPOINTMENT_BY_ID = gql`
mutation CANCEL_APPOINTMENT_BY_ID($appid: uuid!) {
update_appointments(
where: { id: { _eq: $appid } }
_set: { canceled: true }
) {
returning {
id
canceled
}
mutation CANCEL_APPOINTMENT_BY_ID($appid: uuid!) {
update_appointments(
where: { id: { _eq: $appid } }
_set: { canceled: true }
) {
returning {
id
canceled
}
}
}
}
`;
export const CANCEL_APPOINTMENTS_BY_JOB_ID = gql`
mutation CANCEL_APPOINTMENTS_BY_JOB_ID($jobid: uuid!, $job: jobs_set_input) {
update_appointments(
where: { _and: { jobid: { _eq: $jobid }, arrived: { _eq: false } } }
_set: { canceled: true }
) {
returning {
id
canceled
}
mutation CANCEL_APPOINTMENTS_BY_JOB_ID($jobid: uuid!, $job: jobs_set_input) {
update_appointments(
where: { _and: { jobid: { _eq: $jobid }, arrived: { _eq: false } } }
_set: { canceled: true }
) {
returning {
id
canceled
}
}
update_jobs_by_pk(pk_columns: { id: $jobid }, _set: $job) {
date_scheduled
id
scheduled_in
scheduled_completion
status
lost_sale_reason
date_lost_sale
}
}
update_jobs_by_pk(pk_columns: { id: $jobid }, _set: $job) {
date_scheduled
id
scheduled_in
scheduled_completion
status
lost_sale_reason
date_lost_sale
}
}
`;
export const QUERY_APPOINTMENTS_BY_JOBID = gql`
query QUERY_APPOINTMENTS_BY_JOBID($jobid: uuid!) {
appointments(where: { jobid: { _eq: $jobid } }, order_by: { start: desc }) {
start
id
end
color
isintake
arrived
canceled
created_at
block
note
query QUERY_APPOINTMENTS_BY_JOBID($jobid: uuid!) {
appointments(where: { jobid: { _eq: $jobid } }, order_by: { start: desc }) {
start
id
end
color
isintake
arrived
canceled
created_at
block
note
}
}
}
`;
export const QUERY_SCHEDULE_LOAD_DATA = gql`
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
prodJobs: jobs(
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
) {
id
actual_in
scheduled_in
actual_completion
scheduled_completion
inproduction
ro_number
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
prodJobs: jobs(
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
) {
id
actual_in
scheduled_in
actual_completion
scheduled_completion
inproduction
ro_number
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
compJobs: jobs(
where: {
_and: [
{ suspended: { _eq: false } }
{
_or: [
{ scheduled_completion: { _gte: $start, _lte: $end } }
{ actual_completion: { _gte: $start, _lte: $end } }
]
}
]
}
) {
id
status
ro_number
scheduled_completion
actual_completion
scheduled_in
ownr_fn
ownr_ln
ownr_co_nm
inproduction
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
arrJobs: jobs(
where: {
scheduled_in: { _gte: $start, _lte: $end }
suspended: { _eq: false }
}
) {
id
scheduled_in
actual_in
scheduled_completion
ro_number
ownr_fn
ownr_ln
ownr_co_nm
alt_transport
actual_completion
inproduction
status
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
}
compJobs: jobs(
where: {
_and: [
{ suspended: { _eq: false } }
{
_or: [
{ scheduled_completion: { _gte: $start, _lte: $end } }
{ actual_completion: { _gte: $start, _lte: $end } }
]
}
]
}
) {
id
status
ro_number
scheduled_completion
actual_completion
scheduled_in
ownr_fn
ownr_ln
ownr_co_nm
inproduction
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
arrJobs: jobs(
where: {
scheduled_in: { _gte: $start, _lte: $end }
suspended: { _eq: false }
}
) {
id
scheduled_in
actual_in
scheduled_completion
ro_number
ownr_fn
ownr_ln
ownr_co_nm
alt_transport
actual_completion
inproduction
status
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
`;
export const MARK_APPOINTMENT_ARRIVED = gql`
mutation MARK_APPOINTMENT_ARRIVED($appointmentId: uuid!) {
update_appointments(
where: { id: { _eq: $appointmentId } }
_set: { arrived: true }
) {
affected_rows
returning {
id
arrived
}
mutation MARK_APPOINTMENT_ARRIVED($appointmentId: uuid!) {
update_appointments(
where: { id: { _eq: $appointmentId } }
_set: { arrived: true }
) {
affected_rows
returning {
id
arrived
}
}
}
}
`;
export const MARK_LATEST_APPOINTMENT_ARRIVED = gql`
mutation MARK_LATEST_APPOINTMENT_ARRIVED($jobId: uuid!) {
update_appointments(
where: {
jobid: { _eq: $jobId }
canceled: { _eq: false }
isintake: { _eq: true }
}
_set: { arrived: true }
) {
affected_rows
returning {
id
arrived
}
mutation MARK_LATEST_APPOINTMENT_ARRIVED($jobId: uuid!) {
update_appointments(
where: {
jobid: { _eq: $jobId }
canceled: { _eq: false }
isintake: { _eq: true }
}
_set: { arrived: true }
) {
affected_rows
returning {
id
arrived
}
}
}
}
`;

View File

@@ -1,70 +1,70 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_ALL_ASSOCIATIONS = gql`
query QUERY_ALL_ASSOCIATIONS($email: String) {
associations(
where: { useremail: { _eq: $email } }
order_by: { bodyshop: { shopname: asc } }
) {
id
active
bodyshop {
shopname
}
query QUERY_ALL_ASSOCIATIONS($email: String) {
associations(
where: { useremail: { _eq: $email } }
order_by: { bodyshop: { shopname: asc } }
) {
id
active
bodyshop {
shopname
}
}
}
}
`;
export const UPDATE_ASSOCIATION = gql`
mutation UPDATE_ASSOCIATION($assocId: uuid, $assocActive: Boolean) {
update_associations(
where: { id: { _eq: $assocId } }
_set: { active: $assocActive }
) {
returning {
id
active
authlevel
default_prod_list_view
}
mutation UPDATE_ASSOCIATION($assocId: uuid, $assocActive: Boolean) {
update_associations(
where: { id: { _eq: $assocId } }
_set: { active: $assocActive }
) {
returning {
id
active
authlevel
default_prod_list_view
}
}
}
}
`;
export const UPDATE_ACTIVE_ASSOCIATION = gql`
mutation UPDATE_ACTIVE_ASSOCIATION($newActiveAssocId: uuid) {
nweActive: update_associations(
where: { id: { _eq: $newActiveAssocId } }
_set: { active: true }
) {
returning {
id
shopid
active
}
mutation UPDATE_ACTIVE_ASSOCIATION($newActiveAssocId: uuid) {
nweActive: update_associations(
where: { id: { _eq: $newActiveAssocId } }
_set: { active: true }
) {
returning {
id
shopid
active
}
}
inactive: update_associations(
where: { id: { _neq: $newActiveAssocId } }
_set: { active: false }
) {
returning {
id
shopid
active
}
}
}
inactive: update_associations(
where: { id: { _neq: $newActiveAssocId } }
_set: { active: false }
) {
returning {
id
shopid
active
}
}
}
`;
export const UPDATE_ACTIVE_PROD_LIST_VIEW = gql`
mutation UPDATE_ACTIVE_PROD_LIST_VIEW($assocId: uuid, $view: String) {
update_associations(
where: { id: { _eq: $assocId } }
_set: { default_prod_list_view: $view }
) {
returning {
id
default_prod_list_view
}
mutation UPDATE_ACTIVE_PROD_LIST_VIEW($assocId: uuid, $view: String) {
update_associations(
where: { id: { _eq: $assocId } }
_set: { default_prod_list_view: $view }
) {
returning {
id
default_prod_list_view
}
}
}
}
`;

View File

@@ -1,46 +1,46 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_AUDIT_TRAIL = gql`
query QUERY_AUDIT_TRAIL($jobid: uuid!) {
audit_trail(
where: { jobid: { _eq: $jobid } }
order_by: { created: desc }
) {
useremail
jobid
operation
id
created
bodyshopid
query QUERY_AUDIT_TRAIL($jobid: uuid!) {
audit_trail(
where: { jobid: { _eq: $jobid } }
order_by: { created: desc }
) {
useremail
jobid
operation
id
created
bodyshopid
}
email_audit_trail(
where: { jobid: { _eq: $jobid } }
order_by: { created_at: desc }
) {
cc
contents
created_at
id
jobid
noteid
subject
to
useremail
status
}
}
email_audit_trail(
where: { jobid: { _eq: $jobid } }
order_by: { created_at: desc }
) {
cc
contents
created_at
id
jobid
noteid
subject
to
useremail
status
}
}
`;
export const INSERT_AUDIT_TRAIL = gql`
mutation INSERT_AUDIT_TRAIL($auditObj: audit_trail_insert_input!) {
insert_audit_trail_one(object: $auditObj) {
id
jobid
billid
bodyshopid
created
operation
useremail
mutation INSERT_AUDIT_TRAIL($auditObj: audit_trail_insert_input!) {
insert_audit_trail_one(object: $auditObj) {
id
jobid
billid
bodyshopid
created
operation
useremail
}
}
}
`;

View File

@@ -1,118 +1,118 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_AVAILABLE_JOBS = gql`
query QUERY_AVAILABLE_JOBS {
available_jobs(order_by: { updated_at: desc }) {
cieca_id
clm_amt
clm_no
created_at
id
issupplement
ownr_name
source_system
supplement_number
updated_at
uploaded_by
ins_co_nm
vehicle_info
job {
id
ro_number
status
}
query QUERY_AVAILABLE_JOBS {
available_jobs(order_by: { updated_at: desc }) {
cieca_id
clm_amt
clm_no
created_at
id
issupplement
ownr_name
source_system
supplement_number
updated_at
uploaded_by
ins_co_nm
vehicle_info
job {
id
ro_number
status
}
}
}
}
`;
export const QUERY_AVAILABLE_NEW_JOBS = gql`
query QUERY_AVAILABLE_NEW_JOBS {
available_jobs(
where: { issupplement: { _eq: false } }
order_by: { updated_at: desc }
) {
cieca_id
clm_amt
clm_no
created_at
id
issupplement
ownr_name
source_system
supplement_number
updated_at
uploaded_by
ins_co_nm
vehicle_info
query QUERY_AVAILABLE_NEW_JOBS {
available_jobs(
where: { issupplement: { _eq: false } }
order_by: { updated_at: desc }
) {
cieca_id
clm_amt
clm_no
created_at
id
issupplement
ownr_name
source_system
supplement_number
updated_at
uploaded_by
ins_co_nm
vehicle_info
}
}
}
`;
export const QUERY_AVAILABLE_SUPPLEMENT_JOBS = gql`
query QUERY_AVAILABLE_SUPPLEMENT_JOBS {
available_jobs(
where: { issupplement: { _eq: true } }
order_by: { updated_at: desc }
) {
cieca_id
clm_amt
clm_no
created_at
id
issupplement
ownr_name
source_system
supplement_number
updated_at
uploaded_by
ins_co_nm
vehicle_info
job {
id
ro_number
}
query QUERY_AVAILABLE_SUPPLEMENT_JOBS {
available_jobs(
where: { issupplement: { _eq: true } }
order_by: { updated_at: desc }
) {
cieca_id
clm_amt
clm_no
created_at
id
issupplement
ownr_name
source_system
supplement_number
updated_at
uploaded_by
ins_co_nm
vehicle_info
job {
id
ro_number
}
}
}
}
`;
export const DELETE_AVAILABLE_JOB = gql`
mutation DELETE_AVAILABLE_JOB($id: uuid) {
delete_available_jobs(where: { id: { _eq: $id } }) {
affected_rows
mutation DELETE_AVAILABLE_JOB($id: uuid) {
delete_available_jobs(where: { id: { _eq: $id } }) {
affected_rows
}
}
}
`;
export const DELETE_ALL_AVAILABLE_JOBS = gql`
mutation DELETE_ALL_AVAILABLE_JOBS {
delete_available_jobs(where: {}) {
affected_rows
mutation DELETE_ALL_AVAILABLE_JOBS {
delete_available_jobs(where: {}) {
affected_rows
}
}
}
`;
export const DELETE_ALL_AVAILABLE_NEW_JOBS = gql`
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
delete_available_jobs(where: { issupplement: { _eq: false } }) {
affected_rows
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
delete_available_jobs(where: { issupplement: { _eq: false } }) {
affected_rows
}
}
}
`;
export const DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS = gql`
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
delete_available_jobs(where: { issupplement: { _eq: true } }) {
affected_rows
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
delete_available_jobs(where: { issupplement: { _eq: true } }) {
affected_rows
}
}
}
`;
export const QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK = gql`
query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) {
available_jobs_by_pk(id: $id) {
id
issupplement
est_data
query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) {
available_jobs_by_pk(id: $id) {
id
issupplement
est_data
}
}
}
`;

View File

@@ -1,31 +1,31 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const UPDATE_BILL_LINE = gql`
mutation UPDATE_BILL_LINE(
$billLineId: uuid!
$billLine: billlines_set_input!
) {
update_billlines(where: { id: { _eq: $billLineId } }, _set: $billLine) {
returning {
id
}
mutation UPDATE_BILL_LINE(
$billLineId: uuid!
$billLine: billlines_set_input!
) {
update_billlines(where: { id: { _eq: $billLineId } }, _set: $billLine) {
returning {
id
}
}
}
}
`;
export const DELETE_BILL_LINE = gql`
mutation DELETE_BILL_LINE($id: uuid!) {
delete_billlines_by_pk(id: $id) {
id
mutation DELETE_BILL_LINE($id: uuid!) {
delete_billlines_by_pk(id: $id) {
id
}
}
}
`;
export const INSERT_NEW_BILL_LINES = gql`
mutation INSERT_NEW_BILL_LINES($billLines: [billlines_insert_input!]!) {
insert_billlines(objects: $billLines) {
returning {
id
}
mutation INSERT_NEW_BILL_LINES($billLines: [billlines_insert_input!]!) {
insert_billlines(objects: $billLines) {
returning {
id
}
}
}
}
`;

View File

@@ -1,250 +1,250 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_BILL = gql`
mutation INSERT_NEW_BILL($bill: [bills_insert_input!]!) {
insert_bills(objects: $bill) {
returning {
id
invoice_number
}
mutation INSERT_NEW_BILL($bill: [bills_insert_input!]!) {
insert_bills(objects: $bill) {
returning {
id
invoice_number
}
}
}
}
`;
export const DELETE_BILL = gql`
mutation DELETE_BILL($billId: uuid!) {
delete_bills_by_pk(id: $billId) {
id
mutation DELETE_BILL($billId: uuid!) {
delete_bills_by_pk(id: $billId) {
id
}
}
}
`;
export const QUERY_ALL_BILLS_PAGINATED = gql`
query QUERY_ALL_BILLS_PAGINATED(
$offset: Int
$limit: Int
$order: [bills_order_by!]!
) {
bills(offset: $offset, limit: $limit, order_by: $order) {
id
vendorid
vendor {
id
name
}
federal_tax_rate
local_tax_rate
state_tax_rate
is_credit_memo
total
invoice_number
date
isinhouse
exported
job {
id
ro_number
}
query QUERY_ALL_BILLS_PAGINATED(
$offset: Int
$limit: Int
$order: [bills_order_by!]!
) {
bills(offset: $offset, limit: $limit, order_by: $order) {
id
vendorid
vendor {
id
name
}
federal_tax_rate
local_tax_rate
state_tax_rate
is_credit_memo
total
invoice_number
date
isinhouse
exported
job {
id
ro_number
}
}
bills_aggregate {
aggregate {
count(distinct: true)
}
}
}
bills_aggregate {
aggregate {
count(distinct: true)
}
}
}
`;
export const QUERY_BILLS_BY_JOBID = gql`
query QUERY_PARTS_BILLS_BY_JOBID($jobid: uuid!) {
parts_orders(
where: { jobid: { _eq: $jobid } }
order_by: { order_date: desc }
) {
id
vendor {
id
name
email
}
order_date
deliver_by
return
orderedby
parts_order_lines {
id
act_price
db_price
line_desc
oem_partno
status
line_remarks
quantity
job_line_id
part_type
cost
cm_received
jobline {
id
part_type
query QUERY_PARTS_BILLS_BY_JOBID($jobid: uuid!) {
parts_orders(
where: { jobid: { _eq: $jobid } }
order_by: { order_date: desc }
) {
id
vendor {
id
name
email
}
order_date
deliver_by
return
orderedby
parts_order_lines {
id
act_price
db_price
line_desc
oem_partno
status
line_remarks
quantity
job_line_id
part_type
cost
cm_received
jobline {
id
part_type
}
backordered_eta
backordered_on
}
order_number
comments
user_email
}
backordered_eta
backordered_on
}
order_number
comments
user_email
}
parts_dispatch(where: { jobid: { _eq: $jobid } }) {
id
dispatched_at
dispatched_by
employeeid
number
parts_dispatch_lines {
joblineid
id
quantity
accepted_at
jobline {
id
line_desc
parts_dispatch(where: { jobid: { _eq: $jobid } }) {
id
dispatched_at
dispatched_by
employeeid
number
parts_dispatch_lines {
joblineid
id
quantity
accepted_at
jobline {
id
line_desc
}
}
}
}
}
bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
id
vendorid
vendor {
id
name
email
}
total
invoice_number
date
federal_tax_rate
state_tax_rate
local_tax_rate
is_credit_memo
isinhouse
exported
billlines {
actual_price
quantity
actual_cost
cost_center
id
joblineid
line_desc
applicable_taxes
deductedfromlbr
lbr_adjustment
jobline {
oem_partno
part_type
bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
id
vendorid
vendor {
id
name
email
}
total
invoice_number
date
federal_tax_rate
state_tax_rate
local_tax_rate
is_credit_memo
isinhouse
exported
billlines {
actual_price
quantity
actual_cost
cost_center
id
joblineid
line_desc
applicable_taxes
deductedfromlbr
lbr_adjustment
jobline {
oem_partno
part_type
}
}
}
}
}
}
`;
export const QUERY_BILL_BY_PK = gql`
query QUERY_BILL_BY_PK($billid: uuid!) {
bills_by_pk(id: $billid) {
due_date
exported
exported_at
id
invoice_number
date
is_credit_memo
jobid
total
updated_at
vendorid
local_tax_rate
state_tax_rate
federal_tax_rate
isinhouse
inventories {
id
line_desc
}
vendor {
id
name
discount
}
billlines {
id
line_desc
actual_price
actual_cost
cost_center
quantity
joblineid
inventories {
id
query QUERY_BILL_BY_PK($billid: uuid!) {
bills_by_pk(id: $billid) {
due_date
exported
exported_at
id
invoice_number
date
is_credit_memo
jobid
total
updated_at
vendorid
local_tax_rate
state_tax_rate
federal_tax_rate
isinhouse
inventories {
id
line_desc
}
vendor {
id
name
discount
}
billlines {
id
line_desc
actual_price
actual_cost
cost_center
quantity
joblineid
inventories {
id
}
jobline {
oem_partno
part_type
}
applicable_taxes
deductedfromlbr
lbr_adjustment
}
documents {
id
key
name
type
size
}
}
jobline {
oem_partno
part_type
}
applicable_taxes
deductedfromlbr
lbr_adjustment
}
documents {
id
key
name
type
size
}
}
}
`;
export const UPDATE_BILL = gql`
mutation UPDATE_BILL($billId: uuid!, $bill: bills_set_input!) {
update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
returning {
id
exported
exported_at
}
mutation UPDATE_BILL($billId: uuid!, $bill: bills_set_input!) {
update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
returning {
id
exported
exported_at
}
}
}
}
`;
export const UPDATE_BILLS = gql`
mutation UPDATE_BILLS($billIdList: [uuid!]!, $bill: bills_set_input!) {
update_bills(where: { id: { _in: $billIdList } }, _set: $bill) {
returning {
id
exported
exported_at
}
mutation UPDATE_BILLS($billIdList: [uuid!]!, $bill: bills_set_input!) {
update_bills(where: { id: { _in: $billIdList } }, _set: $bill) {
returning {
id
exported
exported_at
}
}
}
}
`;
export const CHECK_BILL_INVOICE_NUMBER = gql`
query CHECK_BILL_INVOICE_NUMBER($invoice_number: String!, $vendorid: uuid!) {
bills_aggregate(
where: {
_and: {
invoice_number: { _ilike: $invoice_number }
vendorid: { _eq: $vendorid }
query CHECK_BILL_INVOICE_NUMBER($invoice_number: String!, $vendorid: uuid!) {
bills_aggregate(
where: {
_and: {
invoice_number: { _ilike: $invoice_number }
vendorid: { _eq: $vendorid }
}
}
) {
aggregate {
count
}
nodes {
id
}
}
}
) {
aggregate {
count
}
nodes {
id
}
}
}
`;

View File

@@ -1,358 +1,359 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INTROSPECTION = gql`
query INTROSPECTION {
__schema {
types {
name
}
query INTROSPECTION {
__schema {
types {
name
}
}
}
}
`;
export const QUERY_EULA = gql`
query QUERY_EULA($now: timestamptz!) {
eulas(where: {effective_date: {_lte: $now}, _or: [{end_date: {_is_null: true}}, {end_date: {_gt: $now}}]}) {
id
content
query QUERY_EULA($now: timestamptz!) {
eulas(where: {effective_date: {_lte: $now}, _or: [{end_date: {_is_null: true}}, {end_date: {_gt: $now}}]}) {
id
content
eula_acceptances {
id
date_accepted
}
eula_acceptances {
id
date_accepted
}
}
}
}
`;
export const QUERY_BODYSHOP = gql`
query QUERY_BODYSHOP {
bodyshops(where: { associations: { active: { _eq: true } } }) {
associations {
id
authlevel
useremail
default_prod_list_view
user {
authid
email
dashboardlayout
validemail
employee {
query QUERY_BODYSHOP {
bodyshops(where: { associations: { active: { _eq: true } } }) {
associations {
id
authlevel
useremail
default_prod_list_view
user {
authid
email
dashboardlayout
validemail
employee {
id
}
}
}
address1
address2
city
country
created_at
email
phone
federal_tax_id
id
}
insurance_vendor_id
logo_img_path
md_ro_statuses
md_order_statuses
md_functionality_toggles
shopname
state
state_tax_id
updated_at
zip_post
shoprates
region_config
md_responsibility_centers
messagingservicesid
template_header
textid
production_config
bill_tax_rates
inhousevendorid
accountingconfig
appt_length
stripe_acct_id
ssbuckets
scoreboard_target
md_referral_sources
md_messaging_presets
intakechecklist
speedprint
md_parts_locations
md_notes_presets
md_rbac
prodtargethrs
md_classes
md_ins_cos
md_categories
enforce_class
md_labor_rates
deliverchecklist
target_touchtime
appt_colors
appt_alt_transport
schedule_start_time
schedule_end_time
imexshopid
default_adjustment_rate
workingdays
use_fippa
md_payment_types
md_hour_split
sub_status
jobsizelimit
md_ccc_rates
enforce_referral
website
jc_hourly_rates
md_jobline_presets
cdk_dealerid
features
attach_pdf_to_email
tt_allow_post_to_invoiced
cdk_configuration
md_estimators
md_ded_notes
pbs_configuration
pbs_serialnumber
md_filehandlers
md_email_cc
timezone
ss_configuration
md_from_emails
last_name_first
md_parts_order_comment
bill_allow_post_to_closed
md_to_emails
uselocalmediaserver
localmediaserverhttp
localmediaservernetwork
localmediatoken
enforce_conversion_csr
md_lost_sale_reasons
md_parts_scan
enforce_conversion_category
tt_enforce_hours_for_tech_console
md_tasks_presets
use_paint_scale_data
employee_teams(
order_by: { name: asc }
where: { active: { _eq: true } }
) {
id
name
employee_team_members {
id
employeeid
labor_rates
percentage
}
}
employees {
user_email
id
active
first_name
last_name
employee_number
rates
external_id
flat_rate
}
}
}
address1
address2
city
country
created_at
email
phone
federal_tax_id
id
insurance_vendor_id
logo_img_path
md_ro_statuses
md_order_statuses
md_functionality_toggles
shopname
state
state_tax_id
updated_at
zip_post
shoprates
region_config
md_responsibility_centers
messagingservicesid
template_header
textid
production_config
bill_tax_rates
inhousevendorid
accountingconfig
appt_length
stripe_acct_id
ssbuckets
scoreboard_target
md_referral_sources
md_messaging_presets
intakechecklist
speedprint
md_parts_locations
md_notes_presets
md_rbac
prodtargethrs
md_classes
md_ins_cos
md_categories
enforce_class
md_labor_rates
deliverchecklist
target_touchtime
appt_colors
appt_alt_transport
schedule_start_time
schedule_end_time
imexshopid
default_adjustment_rate
workingdays
use_fippa
md_payment_types
md_hour_split
sub_status
jobsizelimit
md_ccc_rates
enforce_referral
website
jc_hourly_rates
md_jobline_presets
cdk_dealerid
features
attach_pdf_to_email
tt_allow_post_to_invoiced
cdk_configuration
md_estimators
md_ded_notes
pbs_configuration
pbs_serialnumber
md_filehandlers
md_email_cc
timezone
ss_configuration
md_from_emails
last_name_first
md_parts_order_comment
bill_allow_post_to_closed
md_to_emails
uselocalmediaserver
localmediaserverhttp
localmediaservernetwork
localmediatoken
enforce_conversion_csr
md_lost_sale_reasons
md_parts_scan
enforce_conversion_category
tt_enforce_hours_for_tech_console
md_tasks_presets
use_paint_scale_data
employee_teams(
order_by: { name: asc }
where: { active: { _eq: true } }
) {
id
name
employee_team_members {
id
employeeid
labor_rates
percentage
}
}
employees {
user_email
id
active
first_name
last_name
employee_number
rates
external_id
flat_rate
}
}
}
`;
export const QUERY_SHOP_ID = gql`
query QUERY_SHOP_ID {
bodyshops(where: { associations: { active: { _eq: true } } }) {
id
query QUERY_SHOP_ID {
bodyshops(where: { associations: { active: { _eq: true } } }) {
id
}
}
}
`;
export const UPDATE_SHOP = gql`
mutation UPDATE_SHOP($id: uuid, $shop: bodyshops_set_input!) {
update_bodyshops(where: { id: { _eq: $id } }, _set: $shop) {
returning {
address1
address2
city
country
created_at
email
phone
federal_tax_id
id
insurance_vendor_id
logo_img_path
md_ro_statuses
md_order_statuses
md_functionality_toggles
shopname
state
state_tax_id
updated_at
zip_post
shoprates
region_config
md_responsibility_centers
messagingservicesid
template_header
textid
production_config
bill_tax_rates
appt_length
stripe_acct_id
ssbuckets
scoreboard_target
md_referral_sources
md_messaging_presets
intakechecklist
speedprint
md_parts_locations
md_notes_presets
md_rbac
prodtargethrs
md_classes
md_ins_cos
md_categories
enforce_class
md_labor_rates
deliverchecklist
target_touchtime
appt_colors
appt_alt_transport
schedule_start_time
schedule_end_time
imexshopid
default_adjustment_rate
workingdays
use_fippa
md_payment_types
md_hour_split
sub_status
jobsizelimit
md_ccc_rates
enforce_referral
website
jc_hourly_rates
md_jobline_presets
cdk_dealerid
attach_pdf_to_email
tt_allow_post_to_invoiced
cdk_configuration
md_estimators
md_ded_notes
pbs_configuration
pbs_serialnumber
md_filehandlers
md_email_cc
timezone
ss_configuration
md_from_emails
last_name_first
md_parts_order_comment
bill_allow_post_to_closed
md_to_emails
uselocalmediaserver
localmediaserverhttp
localmediaservernetwork
localmediatoken
enforce_conversion_csr
md_lost_sale_reasons
md_parts_scan
enforce_conversion_category
tt_enforce_hours_for_tech_console
md_tasks_presets
employee_teams(
order_by: { name: asc }
where: { active: { _eq: true } }
) {
id
name
employee_team_members {
id
employeeid
labor_rates
percentage
}
mutation UPDATE_SHOP($id: uuid, $shop: bodyshops_set_input!) {
update_bodyshops(where: { id: { _eq: $id } }, _set: $shop) {
returning {
address1
address2
city
country
created_at
email
phone
federal_tax_id
id
insurance_vendor_id
logo_img_path
md_ro_statuses
md_order_statuses
md_functionality_toggles
shopname
state
state_tax_id
updated_at
zip_post
shoprates
region_config
md_responsibility_centers
messagingservicesid
template_header
textid
production_config
bill_tax_rates
appt_length
stripe_acct_id
ssbuckets
scoreboard_target
md_referral_sources
md_messaging_presets
intakechecklist
speedprint
md_parts_locations
md_notes_presets
md_rbac
prodtargethrs
md_classes
md_ins_cos
md_categories
enforce_class
md_labor_rates
deliverchecklist
target_touchtime
appt_colors
appt_alt_transport
schedule_start_time
schedule_end_time
imexshopid
default_adjustment_rate
workingdays
use_fippa
md_payment_types
md_hour_split
sub_status
jobsizelimit
md_ccc_rates
enforce_referral
website
jc_hourly_rates
md_jobline_presets
cdk_dealerid
attach_pdf_to_email
tt_allow_post_to_invoiced
cdk_configuration
md_estimators
md_ded_notes
pbs_configuration
pbs_serialnumber
md_filehandlers
md_email_cc
timezone
ss_configuration
md_from_emails
last_name_first
md_parts_order_comment
bill_allow_post_to_closed
md_to_emails
uselocalmediaserver
localmediaserverhttp
localmediaservernetwork
localmediatoken
enforce_conversion_csr
md_lost_sale_reasons
md_parts_scan
enforce_conversion_category
tt_enforce_hours_for_tech_console
md_tasks_presets
employee_teams(
order_by: { name: asc }
where: { active: { _eq: true } }
) {
id
name
employee_team_members {
id
employeeid
labor_rates
percentage
}
}
employees {
id
first_name
active
last_name
employee_number
rates
user_email
external_id
}
}
}
employees {
id
first_name
active
last_name
employee_number
rates
user_email
external_id
}
}
}
}
`;
export const QUERY_INTAKE_CHECKLIST = gql`
query QUERY_INTAKE_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
bodyshops_by_pk(id: $shopId) {
id
intakechecklist
query QUERY_INTAKE_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
bodyshops_by_pk(id: $shopId) {
id
intakechecklist
}
jobs_by_pk(id: $jobId) {
id
ro_number
production_vars
scheduled_completion
scheduled_delivery
intakechecklist
status
owner {
allow_text_message
id
}
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
}
}
}
}
}
jobs_by_pk(id: $jobId) {
id
ro_number
production_vars
scheduled_completion
scheduled_delivery
intakechecklist
status
owner {
allow_text_message
id
}
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_DELIVER_CHECKLIST = gql`
query QUERY_DELIVER_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
bodyshops_by_pk(id: $shopId) {
id
deliverchecklist
query QUERY_DELIVER_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
bodyshops_by_pk(id: $shopId) {
id
deliverchecklist
}
jobs_by_pk(id: $jobId) {
id
ro_number
actual_completion
actual_delivery
}
}
jobs_by_pk(id: $jobId) {
id
ro_number
actual_completion
actual_delivery
}
}
`;
export const QUERY_STRIPE_ID = gql`
query QUERY_STRIPE_ID {
bodyshops(where: { associations: { active: { _eq: true } } }) {
stripe_acct_id
query QUERY_STRIPE_ID {
bodyshops(where: { associations: { active: { _eq: true } } }) {
stripe_acct_id
}
}
}
`;

View File

@@ -1,233 +1,233 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_CONTRACT = gql`
mutation INSERT_NEW_CONTRACT(
$contract: [cccontracts_insert_input!]!
$ccId: uuid!
$damage: String
$mileage: numeric
) {
insert_cccontracts(objects: $contract) {
returning {
id
}
}
update_courtesycars_by_pk(
pk_columns: { id: $ccId }
_set: {
status: "courtesycars.status.out"
mileage: $mileage
damage: $damage
}
mutation INSERT_NEW_CONTRACT(
$contract: [cccontracts_insert_input!]!
$ccId: uuid!
$damage: String
$mileage: numeric
) {
status
id
damage
mileage
insert_cccontracts(objects: $contract) {
returning {
id
}
}
update_courtesycars_by_pk(
pk_columns: { id: $ccId }
_set: {
status: "courtesycars.status.out"
mileage: $mileage
damage: $damage
}
) {
status
id
damage
mileage
}
}
}
`;
export const UPDATE_CONTRACT = gql`
mutation UPDATE_CONTRACT(
$contractId: uuid!
$cccontract: cccontracts_set_input!
) {
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
returning {
id
}
mutation UPDATE_CONTRACT(
$contractId: uuid!
$cccontract: cccontracts_set_input!
) {
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
returning {
id
}
}
}
}
`;
export const RETURN_CONTRACT = gql`
mutation RETURN_CONTRACT(
$contractId: uuid!
$cccontract: cccontracts_set_input!
$courtesycarid: uuid!
$courtesycar: courtesycars_set_input!
) {
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
returning {
id
}
}
update_courtesycars(
where: { id: { _eq: $courtesycarid } }
_set: $courtesycar
mutation RETURN_CONTRACT(
$contractId: uuid!
$cccontract: cccontracts_set_input!
$courtesycarid: uuid!
$courtesycar: courtesycars_set_input!
) {
returning {
id
}
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
returning {
id
}
}
update_courtesycars(
where: { id: { _eq: $courtesycarid } }
_set: $courtesycar
) {
returning {
id
}
}
}
}
`;
export const QUERY_CONTRACT_BY_PK = gql`
query QUERY_CONTRACT_BY_PK($id: uuid!) {
cccontracts_by_pk(id: $id) {
actualreturn
agreementnumber
courtesycarid
driver_addr1
driver_city
driver_addr2
driver_dlexpiry
driver_dlnumber
driver_dlst
driver_dob
driver_fn
driver_ln
driver_ph1
driver_state
driver_zip
id
jobid
dailyrate
actax
dailyfreekm
refuelcharge
excesskmrate
cleanupcharge
damagewaiver
federaltax
statetax
localtax
coverage
fuelin
fuelout
damage
job {
id
query QUERY_CONTRACT_BY_PK($id: uuid!) {
cccontracts_by_pk(id: $id) {
actualreturn
agreementnumber
courtesycarid
driver_addr1
driver_city
driver_addr2
driver_dlexpiry
driver_dlnumber
driver_dlst
driver_dob
driver_fn
driver_ln
driver_ph1
driver_state
driver_zip
id
jobid
dailyrate
actax
dailyfreekm
refuelcharge
excesskmrate
cleanupcharge
damagewaiver
federaltax
statetax
localtax
coverage
fuelin
fuelout
damage
job {
id
ro_number
v_make_desc
v_model_desc
ownr_fn
ownr_ln
ownr_co_nm
clm_no
scheduled_completion
ownerid
vehicleid
owner {
ownr_fn
ownr_ln
id
ownr_co_nm
ro_number
v_make_desc
v_model_desc
ownr_fn
ownr_ln
ownr_co_nm
clm_no
scheduled_completion
ownerid
vehicleid
owner {
ownr_fn
ownr_ln
id
ownr_co_nm
}
vehicle {
id
v_make_desc
v_model_desc
v_model_yr
v_vin
}
}
kmend
kmstart
scheduledreturn
start
status
updated_at
courtesycar {
id
fleetnumber
make
model
year
plate
}
}
vehicle {
id
v_make_desc
v_model_desc
v_model_yr
v_vin
}
}
kmend
kmstart
scheduledreturn
start
status
updated_at
courtesycar {
id
fleetnumber
make
model
year
plate
}
}
}
`;
export const QUERY_ACTIVE_CONTRACTS_PAGINATED = gql`
query QUERY_ACTIVE_CONTRACTS_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [cccontracts_order_by!]!
) {
search_cccontracts(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
query QUERY_ACTIVE_CONTRACTS_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [cccontracts_order_by!]!
) {
agreementnumber
courtesycarid
driver_fn
driver_ln
driver_ph1
id
jobid
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
scheduledreturn
actualreturn
start
status
courtesycar {
id
fleetnumber
make
model
year
plate
}
search_cccontracts(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
) {
agreementnumber
courtesycarid
driver_fn
driver_ln
driver_ph1
id
jobid
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
scheduledreturn
actualreturn
start
status
courtesycar {
id
fleetnumber
make
model
year
plate
}
}
search_cccontracts_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
search_cccontracts_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;
export const FIND_CONTRACT = gql`
query FIND_CONTRACT($plate: String, $time: timestamptz!) {
cccontracts(
where: {
_or: [
{ actualreturn: { _gte: $time } }
{ actualreturn: { _is_null: true } }
]
start: { _lte: $time }
courtesycar: { plate: { _eq: $plate } }
}
) {
agreementnumber
courtesycarid
driver_fn
driver_ln
driver_ph1
id
jobid
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
scheduledreturn
actualreturn
start
status
courtesycar {
id
fleetnumber
make
model
year
plate
}
query FIND_CONTRACT($plate: String, $time: timestamptz!) {
cccontracts(
where: {
_or: [
{ actualreturn: { _gte: $time } }
{ actualreturn: { _is_null: true } }
]
start: { _lte: $time }
courtesycar: { plate: { _eq: $plate } }
}
) {
agreementnumber
courtesycarid
driver_fn
driver_ln
driver_ph1
id
jobid
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
scheduledreturn
actualreturn
start
status
courtesycar {
id
fleetnumber
make
model
year
plate
}
}
}
}
`;

View File

@@ -1,134 +1,134 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const UNREAD_CONVERSATION_COUNT = gql`
query UNREAD_CONVERSATION_COUNT {
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}
query UNREAD_CONVERSATION_COUNT {
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}
}
}
}
`;
export const CONVERSATION_LIST_QUERY = gql`
query CONVERSATION_LIST_QUERY($offset: Int!) {
conversations(
order_by: { updated_at: desc }
limit: 50
offset: $offset
where: { archived: { _eq: false } }
) {
phone_num
id
updated_at
unreadcnt
archived
label
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
query CONVERSATION_LIST_QUERY($offset: Int!) {
conversations(
order_by: { updated_at: desc }
limit: 50
offset: $offset
where: { archived: { _eq: false } }
) {
phone_num
id
updated_at
unreadcnt
archived
label
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}
}
job_conversations {
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
}
}
}
job_conversations {
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
}
}
}
`;
export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
subscription CONVERSATION_SUBSCRIPTION_BY_PK($conversationId: uuid!) {
messages(
order_by: { created_at: asc_nulls_first }
where: { conversationid: { _eq: $conversationId } }
) {
id
status
text
isoutbound
image
image_path
userid
created_at
read
subscription CONVERSATION_SUBSCRIPTION_BY_PK($conversationId: uuid!) {
messages(
order_by: { created_at: asc_nulls_first }
where: { conversationid: { _eq: $conversationId } }
) {
id
status
text
isoutbound
image
image_path
userid
created_at
read
}
}
}
`;
export const GET_CONVERSATION_DETAILS = gql`
query GET_CONVERSATION_DETAILS($conversationId: uuid!) {
conversations_by_pk(id: $conversationId) {
id
phone_num
archived
label
job_conversations {
jobid
conversationid
job {
id
ownr_fn
ownr_ln
ownr_co_nm
ro_number
query GET_CONVERSATION_DETAILS($conversationId: uuid!) {
conversations_by_pk(id: $conversationId) {
id
phone_num
archived
label
job_conversations {
jobid
conversationid
job {
id
ownr_fn
ownr_ln
ownr_co_nm
ro_number
}
}
}
}
}
}
`;
export const CONVERSATION_ID_BY_PHONE = gql`
query CONVERSATION_ID_BY_PHONE($phone: String!) {
conversations(where: { phone_num: { _eq: $phone } }) {
id
job_conversations {
jobid
id
}
query CONVERSATION_ID_BY_PHONE($phone: String!) {
conversations(where: { phone_num: { _eq: $phone } }) {
id
job_conversations {
jobid
id
}
}
}
}
`;
export const CREATE_CONVERSATION = gql`
mutation CREATE_CONVERSATION($conversation: [conversations_insert_input!]!) {
insert_conversations(objects: $conversation) {
returning {
id
}
mutation CREATE_CONVERSATION($conversation: [conversations_insert_input!]!) {
insert_conversations(objects: $conversation) {
returning {
id
}
}
}
}
`;
export const TOGGLE_CONVERSATION_ARCHIVE = gql`
mutation TOGGLE_CONVERSATION_ARCHIVE($id: uuid!, $archived: Boolean) {
update_conversations_by_pk(
pk_columns: { id: $id }
_set: { archived: $archived }
) {
archived
id
mutation TOGGLE_CONVERSATION_ARCHIVE($id: uuid!, $archived: Boolean) {
update_conversations_by_pk(
pk_columns: { id: $id }
_set: { archived: $archived }
) {
archived
id
}
}
}
`;
export const UPDATE_CONVERSATION_LABEL = gql`
mutation UPDATE_CONVERSATION_LABEL($id: uuid!, $label: String) {
update_conversations_by_pk(
pk_columns: { id: $id }
_set: { label: $label }
) {
label
id
mutation UPDATE_CONVERSATION_LABEL($id: uuid!, $label: String) {
update_conversations_by_pk(
pk_columns: { id: $id }
_set: { label: $label }
) {
label
id
}
}
}
`;

View File

@@ -1,172 +1,172 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_COURTESY_CAR = gql`
mutation INSERT_NEW_COURTESY_CAR(
$courtesycar: [courtesycars_insert_input!]!
) {
insert_courtesycars(objects: $courtesycar) {
returning {
id
}
mutation INSERT_NEW_COURTESY_CAR(
$courtesycar: [courtesycars_insert_input!]!
) {
insert_courtesycars(objects: $courtesycar) {
returning {
id
}
}
}
}
`;
export const QUERY_AVAILABLE_CC = gql`
query QUERY_AVAILABLE_CC($today: date) {
courtesycars(
where: {
_or: [
{ serviceenddate: { _is_null: true } }
{ serviceenddate: { _gt: $today } }
]
status: { _eq: "courtesycars.status.in" }
}
) {
color
dailycost
damage
fleetnumber
fuel
id
make
mileage
model
notes
nextservicekm
nextservicedate
plate
readiness
status
year
query QUERY_AVAILABLE_CC($today: date) {
courtesycars(
where: {
_or: [
{ serviceenddate: { _is_null: true } }
{ serviceenddate: { _gt: $today } }
]
status: { _eq: "courtesycars.status.in" }
}
) {
color
dailycost
damage
fleetnumber
fuel
id
make
mileage
model
notes
nextservicekm
nextservicedate
plate
readiness
status
year
}
}
}
`;
export const CHECK_CC_FLEET_NUMBER = gql`
query CHECK_VENDOR_NAME($name: String!) {
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
aggregate {
count
}
nodes {
id
}
query CHECK_VENDOR_NAME($name: String!) {
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
aggregate {
count
}
nodes {
id
}
}
}
}
`;
export const QUERY_ALL_CC = gql`
query QUERY_ALL_CC {
courtesycars {
color
created_at
dailycost
damage
fleetnumber
fuel
id
insuranceexpires
leaseenddate
make
mileage
model
nextservicedate
nextservicekm
notes
plate
purchasedate
readiness
registrationexpires
serviceenddate
servicestartdate
status
vin
year
cccontracts(
where: { status: { _eq: "contracts.status.out" } }
order_by: { contract_date: desc }
limit: 1
) {
id
scheduledreturn
job {
id
ownr_fn
ownr_ln
ownr_co_nm
ro_number
query QUERY_ALL_CC {
courtesycars {
color
created_at
dailycost
damage
fleetnumber
fuel
id
insuranceexpires
leaseenddate
make
mileage
model
nextservicedate
nextservicekm
notes
plate
purchasedate
readiness
registrationexpires
serviceenddate
servicestartdate
status
vin
year
cccontracts(
where: { status: { _eq: "contracts.status.out" } }
order_by: { contract_date: desc }
limit: 1
) {
id
scheduledreturn
job {
id
ownr_fn
ownr_ln
ownr_co_nm
ro_number
}
}
}
}
}
}
`;
export const QUERY_CC_BY_PK = gql`
query QUERY_CC_BY_PK(
$id: uuid!
$offset: Int
$limit: Int
$order: [cccontracts_order_by!]!
) {
courtesycars_by_pk(id: $id) {
bodyshopid
color
created_at
dailycost
damage
fleetnumber
fuel
id
insuranceexpires
leaseenddate
make
mileage
model
nextservicedate
nextservicekm
notes
plate
purchasedate
readiness
registrationexpires
serviceenddate
servicestartdate
status
vin
year
cccontracts_aggregate {
aggregate {
count(distinct: true)
query QUERY_CC_BY_PK(
$id: uuid!
$offset: Int
$limit: Int
$order: [cccontracts_order_by!]!
) {
courtesycars_by_pk(id: $id) {
bodyshopid
color
created_at
dailycost
damage
fleetnumber
fuel
id
insuranceexpires
leaseenddate
make
mileage
model
nextservicedate
nextservicekm
notes
plate
purchasedate
readiness
registrationexpires
serviceenddate
servicestartdate
status
vin
year
cccontracts_aggregate {
aggregate {
count(distinct: true)
}
}
cccontracts(offset: $offset, limit: $limit, order_by: $order) {
agreementnumber
driver_fn
driver_ln
id
kmstart
kmend
scheduledreturn
start
status
job {
id
ownr_ln
ownr_fn
ownr_co_nm
ro_number
}
}
}
}
cccontracts(offset: $offset, limit: $limit, order_by: $order) {
agreementnumber
driver_fn
driver_ln
id
kmstart
kmend
scheduledreturn
start
status
job {
id
ownr_ln
ownr_fn
ownr_co_nm
ro_number
}
}
}
}
`;
export const UPDATE_CC = gql`
mutation UPDATE_CC($ccId: uuid!, $cc: courtesycars_set_input!) {
update_courtesycars(where: { id: { _eq: $ccId } }, _set: $cc) {
returning {
id
}
mutation UPDATE_CC($ccId: uuid!, $cc: courtesycars_set_input!) {
update_courtesycars(where: { id: { _eq: $ccId } }, _set: $cc) {
returning {
id
}
}
}
}
`;

View File

@@ -1,97 +1,97 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_SURVEY = gql`
query QUERY_SURVEY($surveyId: uuid!) {
csi_by_pk(id: $surveyId) {
relateddata
valid
validuntil
id
csiquestion {
id
config
}
query QUERY_SURVEY($surveyId: uuid!) {
csi_by_pk(id: $surveyId) {
relateddata
valid
validuntil
id
csiquestion {
id
config
}
}
}
}
`;
export const COMPLETE_SURVEY = gql`
mutation COMPLETE_SURVEY($surveyId: uuid!, $survey: csi_set_input) {
update_csi(where: { id: { _eq: $surveyId } }, _set: $survey) {
affected_rows
mutation COMPLETE_SURVEY($surveyId: uuid!, $survey: csi_set_input) {
update_csi(where: { id: { _eq: $surveyId } }, _set: $survey) {
affected_rows
}
}
}
`;
export const GET_ALL_QUESTION_SETS = gql`
query GET_ALL_QUESTION_SETS {
csiquestions(order_by: { created_at: desc }) {
id
created_at
config
current
csis_aggregate {
aggregate {
count
query GET_ALL_QUESTION_SETS {
csiquestions(order_by: { created_at: desc }) {
id
created_at
config
current
csis_aggregate {
aggregate {
count
}
}
}
}
}
}
`;
export const GET_CURRENT_QUESTIONSET_ID = gql`
query GET_CURRENT_QUESTIONSET_ID {
csiquestions(where: { current: { _eq: true } }) {
id
query GET_CURRENT_QUESTIONSET_ID {
csiquestions(where: { current: { _eq: true } }) {
id
}
}
}
`;
export const INSERT_CSI = gql`
mutation INSERT_CSI($csiInput: [csi_insert_input!]!) {
insert_csi(objects: $csiInput) {
returning {
id
}
mutation INSERT_CSI($csiInput: [csi_insert_input!]!) {
insert_csi(objects: $csiInput) {
returning {
id
}
}
}
}
`;
export const QUERY_CSI_RESPONSE_PAGINATED = gql`
query QUERY_CSI_RESPONSE_PAGINATED(
$offset: Int
$limit: Int
$order: [csi_order_by!]!
) {
csi(offset: $offset, limit: $limit, order_by: $order) {
id
completedon
job {
ownr_fn
ownr_ln
ro_number
query QUERY_CSI_RESPONSE_PAGINATED(
$offset: Int
$limit: Int
$order: [csi_order_by!]!
) {
csi(offset: $offset, limit: $limit, order_by: $order) {
id
completedon
job {
ownr_fn
ownr_ln
ro_number
id
}
id
}
}
csi_aggregate {
aggregate {
count(distinct: true)
}
}
}
csi_aggregate {
aggregate {
count(distinct: true)
}
}
}
`;
export const QUERY_CSI_RESPONSE_BY_PK = gql`
query QUERY_CSI_RESPONSE_BY_PK($id: uuid!) {
csi_by_pk(id: $id) {
relateddata
valid
validuntil
id
response
csiquestion {
id
config
}
query QUERY_CSI_RESPONSE_BY_PK($id: uuid!) {
csi_by_pk(id: $id) {
relateddata
valid
validuntil
id
response
csiquestion {
id
config
}
}
}
}
`;

View File

@@ -1,13 +1,13 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const SEARCH_DMS_VEHICLES = gql`
query SEARCH_DMS_VEHICLES($search: String) {
search_dms_vehicles(args: { search: $search }) {
id
make
makecode
model
modelcode
query SEARCH_DMS_VEHICLES($search: String) {
search_dms_vehicles(args: { search: $search }) {
id
make
makecode
model
modelcode
}
}
}
`;

View File

@@ -1,128 +1,128 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const GET_DOCUMENT_BY_PK = gql`
query GET_DOCUMENT_BY_PK($documentId: uuid!) {
documents_by_pk(id: $documentId) {
id
name
key
type
size
takenat
extension
jobid
query GET_DOCUMENT_BY_PK($documentId: uuid!) {
documents_by_pk(id: $documentId) {
id
name
key
type
size
takenat
extension
jobid
}
}
}
`;
export const GET_DOCUMENTS_BY_JOB = gql`
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
jobs_by_pk(id: $jobId) {
id
ro_number
}
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
aggregate {
sum {
size
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
jobs_by_pk(id: $jobId) {
id
ro_number
}
}
}
documents(order_by: { takenat: desc }, where: { jobid: { _eq: $jobId } }) {
id
name
key
type
size
takenat
extension
bill {
id
invoice_number
date
vendor {
id
name
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
aggregate {
sum {
size
}
}
}
documents(order_by: { takenat: desc }, where: { jobid: { _eq: $jobId } }) {
id
name
key
type
size
takenat
extension
bill {
id
invoice_number
date
vendor {
id
name
}
}
}
}
}
}
`;
export const GET_DOC_SIZE_BY_JOB = gql`
query GET_DOC_SIZE_BY_JOB($jobId: uuid!) {
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
aggregate {
sum {
size
query GET_DOC_SIZE_BY_JOB($jobId: uuid!) {
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
aggregate {
sum {
size
}
}
}
}
}
}
`;
export const INSERT_NEW_DOCUMENT = gql`
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
insert_documents(objects: $docInput) {
returning {
id
name
key
size
takenat
}
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
insert_documents(objects: $docInput) {
returning {
id
name
key
size
takenat
}
}
}
}
`;
export const DELETE_DOCUMENT = gql`
mutation DELETE_DOCUMENT($id: uuid) {
delete_documents(where: { id: { _eq: $id } }) {
returning {
id
}
mutation DELETE_DOCUMENT($id: uuid) {
delete_documents(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
}
`;
export const DELETE_DOCUMENTS = gql`
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
delete_documents(where: { id: { _in: $ids } }) {
returning {
id
}
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
delete_documents(where: { id: { _in: $ids } }) {
returning {
id
}
}
}
}
`;
export const QUERY_TEMPORARY_DOCS = gql`
query QUERY_TEMPORARY_DOCS {
documents(
where: { jobid: { _is_null: true } }
order_by: { takenat: desc }
) {
id
name
key
type
extension
size
takenat
query QUERY_TEMPORARY_DOCS {
documents(
where: { jobid: { _is_null: true } }
order_by: { takenat: desc }
) {
id
name
key
type
extension
size
takenat
}
}
}
`;
export const UPDATE_DOCUMENT = gql`
mutation UPDATE_DOCUMENT($id: uuid!, $document: documents_set_input!) {
update_documents_by_pk(pk_columns: { id: $id }, _set: $document) {
billid
bodyshopid
extension
id
jobid
name
type
key
size
takenat
mutation UPDATE_DOCUMENT($id: uuid!, $document: documents_set_input!) {
update_documents_by_pk(pk_columns: { id: $id }, _set: $document) {
billid
bodyshopid
extension
id
jobid
name
type
key
size
takenat
}
}
}
`;

View File

@@ -1,96 +1,96 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_TEAMS = gql`
query QUERY_TEAMS {
employee_teams(order_by: { name: asc }) {
id
max_load
name
employee_team_members {
id
employeeid
labor_rates
percentage
}
query QUERY_TEAMS {
employee_teams(order_by: { name: asc }) {
id
max_load
name
employee_team_members {
id
employeeid
labor_rates
percentage
}
}
}
}
`;
export const UPDATE_EMPLOYEE_TEAM = gql`
mutation UPDATE_EMPLOYEE_TEAM(
$employeeTeamId: uuid!
$employeeTeam: employee_teams_set_input
$teamMemberDeletes: [uuid!]
$teamMemberUpdates: [employee_team_members_updates!]!
$teamMemberInserts: [employee_team_members_insert_input!]!
) {
update_employee_team_members_many(updates: $teamMemberUpdates) {
returning {
employeeid
id
labor_rates
percentage
}
}
delete_employee_team_members(where: { id: { _in: $teamMemberDeletes } }) {
affected_rows
}
insert_employee_team_members(objects: $teamMemberInserts) {
returning {
employeeid
id
labor_rates
percentage
}
}
update_employee_teams_by_pk(
pk_columns: { id: $employeeTeamId }
_set: $employeeTeam
mutation UPDATE_EMPLOYEE_TEAM(
$employeeTeamId: uuid!
$employeeTeam: employee_teams_set_input
$teamMemberDeletes: [uuid!]
$teamMemberUpdates: [employee_team_members_updates!]!
$teamMemberInserts: [employee_team_members_insert_input!]!
) {
active
id
max_load
name
employee_team_members {
employeeid
id
labor_rates
percentage
}
update_employee_team_members_many(updates: $teamMemberUpdates) {
returning {
employeeid
id
labor_rates
percentage
}
}
delete_employee_team_members(where: { id: { _in: $teamMemberDeletes } }) {
affected_rows
}
insert_employee_team_members(objects: $teamMemberInserts) {
returning {
employeeid
id
labor_rates
percentage
}
}
update_employee_teams_by_pk(
pk_columns: { id: $employeeTeamId }
_set: $employeeTeam
) {
active
id
max_load
name
employee_team_members {
employeeid
id
labor_rates
percentage
}
}
}
}
`;
export const INSERT_EMPLOYEE_TEAM = gql`
mutation INSERT_EMPLOYEE_TEAM($employeeTeam: employee_teams_insert_input!) {
insert_employee_teams_one(object: $employeeTeam) {
active
id
max_load
name
employee_team_members {
employeeid
id
labor_rates
percentage
}
mutation INSERT_EMPLOYEE_TEAM($employeeTeam: employee_teams_insert_input!) {
insert_employee_teams_one(object: $employeeTeam) {
active
id
max_load
name
employee_team_members {
employeeid
id
labor_rates
percentage
}
}
}
}
`;
export const QUERY_EMPLOYEE_TEAM_BY_ID = gql`
query QUERY_EMPLOYEE_TEAM_BY_ID($id: uuid!) {
employee_teams_by_pk(id: $id) {
active
id
max_load
name
employee_team_members {
employeeid
id
labor_rates
percentage
}
query QUERY_EMPLOYEE_TEAM_BY_ID($id: uuid!) {
employee_teams_by_pk(id: $id) {
active
id
max_load
name
employee_team_members {
employeeid
id
labor_rates
percentage
}
}
}
}
`;

View File

@@ -1,181 +1,181 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_INVENTORY_AND_CREDIT = gql`
mutation INSERT_INVENTORY_AND_CREDIT(
$inv: inventory_insert_input!
$cm: bills_insert_input!
$pol: parts_orders_insert_input!
$joblineId: uuid!
$joblineStatus: String
) {
insert_inventory_one(object: $inv) {
id
}
insert_bills_one(object: $cm) {
id
}
insert_parts_orders_one(object: $pol) {
id
}
update_joblines_by_pk(
pk_columns: { id: $joblineId }
_set: { status: $joblineStatus }
mutation INSERT_INVENTORY_AND_CREDIT(
$inv: inventory_insert_input!
$cm: bills_insert_input!
$pol: parts_orders_insert_input!
$joblineId: uuid!
$joblineStatus: String
) {
id
status
insert_inventory_one(object: $inv) {
id
}
insert_bills_one(object: $cm) {
id
}
insert_parts_orders_one(object: $pol) {
id
}
update_joblines_by_pk(
pk_columns: { id: $joblineId }
_set: { status: $joblineStatus }
) {
id
status
}
}
}
`;
export const UPDATE_INVENTORY_LINES = gql`
mutation UPDATE_INVENTORY_LINES(
$InventoryIds: [uuid!]!
$consumedbybillid: uuid!
) {
update_inventory(
where: { id: { _in: $InventoryIds } }
_set: { consumedbybillid: $consumedbybillid }
mutation UPDATE_INVENTORY_LINES(
$InventoryIds: [uuid!]!
$consumedbybillid: uuid!
) {
affected_rows
update_inventory(
where: { id: { _in: $InventoryIds } }
_set: { consumedbybillid: $consumedbybillid }
) {
affected_rows
}
}
}
`;
export const QUERY_OUTSTANDING_INVENTORY = gql`
query QUERY_OUTSTANDING_INVENTORY {
inventory(
where: { consumedbybillid: { _is_null: true } }
order_by: { line_desc: asc }
) {
id
actual_cost
actual_price
quantity
billlineid
line_desc
comment
manualinvoicenumber
manualvendor
consumedbybillid
billline {
bill {
invoice_number
vendor {
name
}
query QUERY_OUTSTANDING_INVENTORY {
inventory(
where: { consumedbybillid: { _is_null: true } }
order_by: { line_desc: asc }
) {
id
actual_cost
actual_price
quantity
billlineid
line_desc
comment
manualinvoicenumber
manualvendor
consumedbybillid
billline {
bill {
invoice_number
vendor {
name
}
}
}
}
}
}
}
`;
export const QUERY_INVENTORY_PAGINATED = gql`
query QUERY_INVENTORY_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [inventory_order_by!]
$consumedIsNull: Boolean
) {
search_inventory(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
where: { consumedbybillid: { _is_null: $consumedIsNull } }
query QUERY_INVENTORY_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [inventory_order_by!]
$consumedIsNull: Boolean
) {
id
line_desc
actual_price
actual_cost
comment
manualinvoicenumber
manualvendor
consumedbybillid
bill {
id
invoice_number
job {
ro_number
id
}
}
billline {
id
bill {
id
invoice_number
job {
search_inventory(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
where: { consumedbybillid: { _is_null: $consumedIsNull } }
) {
id
v_make_desc
v_model_desc
v_model_yr
}
vendor {
id
name
}
line_desc
actual_price
actual_cost
comment
manualinvoicenumber
manualvendor
consumedbybillid
bill {
id
invoice_number
job {
ro_number
id
}
}
billline {
id
bill {
id
invoice_number
job {
id
v_make_desc
v_model_desc
v_model_yr
}
vendor {
id
name
}
}
}
}
search_inventory_aggregate(
args: { search: $search }
where: { consumedbybillid: { _is_null: $consumedIsNull } }
) {
aggregate {
count(distinct: true)
}
}
}
}
search_inventory_aggregate(
args: { search: $search }
where: { consumedbybillid: { _is_null: $consumedIsNull } }
) {
aggregate {
count(distinct: true)
}
}
}
`;
export const DELETE_INVENTORY_LINE = gql`
mutation DELETE_INVENTORY_LINE($lineId: uuid!) {
delete_inventory_by_pk(id: $lineId) {
id
mutation DELETE_INVENTORY_LINE($lineId: uuid!) {
delete_inventory_by_pk(id: $lineId) {
id
}
}
}
`;
export const INSERT_INVENTORY_LINE = gql`
mutation INSERT_INVENTORY_LINE($inventoryItem: inventory_insert_input!) {
insert_inventory_one(object: $inventoryItem) {
id
line_desc
consumedbybillid
billlineid
actual_price
actual_cost
comment
manualinvoicenumber
manualvendor
bill {
invoice_number
}
mutation INSERT_INVENTORY_LINE($inventoryItem: inventory_insert_input!) {
insert_inventory_one(object: $inventoryItem) {
id
line_desc
consumedbybillid
billlineid
actual_price
actual_cost
comment
manualinvoicenumber
manualvendor
bill {
invoice_number
}
}
}
}
`;
export const UPDATE_INVENTORY_LINE = gql`
mutation UPDATE_INVENTORY_LINE(
$inventoryId: uuid!
$inventoryItem: inventory_set_input!
) {
update_inventory_by_pk(
pk_columns: { id: $inventoryId }
_set: $inventoryItem
mutation UPDATE_INVENTORY_LINE(
$inventoryId: uuid!
$inventoryItem: inventory_set_input!
) {
id
line_desc
consumedbybillid
billlineid
actual_price
actual_cost
comment
manualinvoicenumber
manualvendor
bill {
invoice_number
}
update_inventory_by_pk(
pk_columns: { id: $inventoryId }
_set: $inventoryItem
) {
id
line_desc
consumedbybillid
billlineid
actual_price
actual_cost
comment
manualinvoicenumber
manualvendor
bill {
invoice_number
}
}
}
}
`;

View File

@@ -1,44 +1,44 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_CONVERSATION_TAG = gql`
mutation INSERT_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
insert_job_conversations(
objects: { conversationid: $conversationId, jobid: $jobId }
on_conflict: { constraint: job_conversations_pkey, update_columns: jobid }
) {
returning {
jobid
conversationid
id
conversation {
id
job_conversations {
id
jobid
conversationid
job {
ownr_fn
ownr_ln
ownr_co_nm
mutation INSERT_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
insert_job_conversations(
objects: { conversationid: $conversationId, jobid: $jobId }
on_conflict: { constraint: job_conversations_pkey, update_columns: jobid }
) {
returning {
jobid
conversationid
id
conversation {
id
job_conversations {
id
jobid
conversationid
job {
ownr_fn
ownr_ln
ownr_co_nm
}
}
}
}
}
}
}
}
}
`;
export const REMOVE_CONVERSATION_TAG = gql`
mutation REMOVE_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
delete_job_conversations(
where: {
_and: {
jobid: { _eq: $jobId }
conversationid: { _eq: $conversationId }
mutation REMOVE_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
delete_job_conversations(
where: {
_and: {
jobid: { _eq: $jobId }
conversationid: { _eq: $conversationId }
}
}
) {
affected_rows
}
}
) {
affected_rows
}
}
`;

View File

@@ -1,291 +1,291 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const GET_ALL_JOBLINES_BY_PK = gql`
query GET_ALL_JOBLINES_BY_PK($id: uuid!) {
joblines(where: { jobid: { _eq: $id } }, order_by: { line_no: asc }) {
id
line_no
unq_seq
line_ind
line_desc
part_type
oem_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
status
notes
location
tax_part
manual_line
query GET_ALL_JOBLINES_BY_PK($id: uuid!) {
joblines(where: { jobid: { _eq: $id } }, order_by: { line_no: asc }) {
id
line_no
unq_seq
line_ind
line_desc
part_type
oem_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
status
notes
location
tax_part
manual_line
}
}
}
`;
export const GET_LINE_TICKET_BY_PK = gql`
query GET_LINE_TICKET_BY_PK($id: uuid!) {
jobs_by_pk(id: $id) {
id
lbr_adjustments
converted
status
query GET_LINE_TICKET_BY_PK($id: uuid!) {
jobs_by_pk(id: $id) {
id
lbr_adjustments
converted
status
}
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
id
line_desc
part_type
oem_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
convertedtolbr
convertedtolbr_data
}
timetickets(where: { jobid: { _eq: $id } }) {
actualhrs
ciecacode
cost_center
created_by
date
id
jobid
employeeid
memo
flat_rate
clockon
clockoff
rate
committed_at
commited_by
task_name
employee {
id
first_name
last_name
employee_number
}
productivehrs
}
}
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
id
line_desc
part_type
oem_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
convertedtolbr
convertedtolbr_data
}
timetickets(where: { jobid: { _eq: $id } }) {
actualhrs
ciecacode
cost_center
created_by
date
id
jobid
employeeid
memo
flat_rate
clockon
clockoff
rate
committed_at
commited_by
task_name
employee {
id
first_name
last_name
employee_number
}
productivehrs
}
}
`;
export const GET_JOB_INFO_DRAW_CALCULATIONS = gql`
query GET_JOB_INFO_DRAW_CALCULATIONS($id: uuid!) {
jobs_by_pk(id: $id) {
id
lbr_adjustments
converted
rate_lab
rate_lad
rate_laa
rate_la1
rate_la2
rate_la3
rate_la4
rate_lau
rate_lar
rate_lag
rate_laf
rate_lam
query GET_JOB_INFO_DRAW_CALCULATIONS($id: uuid!) {
jobs_by_pk(id: $id) {
id
lbr_adjustments
converted
rate_lab
rate_lad
rate_laa
rate_la1
rate_la2
rate_la3
rate_la4
rate_lau
rate_lar
rate_lag
rate_laf
rate_lam
}
timetickets(where: { jobid: { _eq: $id } }) {
actualhrs
ciecacode
cost_center
date
id
jobid
employeeid
memo
flat_rate
clockon
clockoff
rate
employee {
id
first_name
last_name
employee_number
}
productivehrs
}
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
id
line_desc
part_type
oem_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
convertedtolbr
convertedtolbr_data
}
}
timetickets(where: { jobid: { _eq: $id } }) {
actualhrs
ciecacode
cost_center
date
id
jobid
employeeid
memo
flat_rate
clockon
clockoff
rate
employee {
id
first_name
last_name
employee_number
}
productivehrs
}
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
id
line_desc
part_type
oem_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
convertedtolbr
convertedtolbr_data
}
}
`;
export const UPDATE_JOB_LINE_STATUS = gql`
mutation UPDATE_JOB_LINE_STATUS(
$ids: [uuid!]!
$status: String!
$location: String
) {
update_joblines(
where: { id: { _in: $ids } }
_set: { status: $status, location: $location }
mutation UPDATE_JOB_LINE_STATUS(
$ids: [uuid!]!
$status: String!
$location: String
) {
affected_rows
returning {
id
status
location
}
update_joblines(
where: { id: { _in: $ids } }
_set: { status: $status, location: $location }
) {
affected_rows
returning {
id
status
location
}
}
}
}
`;
export const INSERT_NEW_JOB_LINE = gql`
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
insert_joblines(objects: $lineInput) {
returning {
id
}
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
insert_joblines(objects: $lineInput) {
returning {
id
}
}
}
}
`;
export const RECEIVE_PARTS_LINE = gql`
mutation RECEIVE_PARTS_LINE(
$lineId: uuid!
$line: joblines_set_input!
$orderLineId: uuid!
$orderLine: parts_order_lines_set_input!
) {
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
returning {
id
notes
mod_lbr_ty
part_qty
db_price
act_price
line_desc
oem_partno
notes
location
status
removed
}
}
update_parts_order_lines_by_pk(
pk_columns: { id: $orderLineId }
_set: $orderLine
mutation RECEIVE_PARTS_LINE(
$lineId: uuid!
$line: joblines_set_input!
$orderLineId: uuid!
$orderLine: parts_order_lines_set_input!
) {
id
line_desc
backordered_on
backordered_eta
status
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
returning {
id
notes
mod_lbr_ty
part_qty
db_price
act_price
line_desc
oem_partno
notes
location
status
removed
}
}
update_parts_order_lines_by_pk(
pk_columns: { id: $orderLineId }
_set: $orderLine
) {
id
line_desc
backordered_on
backordered_eta
status
}
}
}
`;
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
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
}
}
}
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) {
returning {
id
notes
mod_lbr_ty
part_qty
db_price
act_price
line_desc
line_no
oem_partno
notes
location
status
removed
convertedtolbr
convertedtolbr_data
assigned_team
}
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
returning {
id
notes
mod_lbr_ty
part_qty
db_price
act_price
line_desc
line_no
oem_partno
notes
location
status
removed
convertedtolbr
convertedtolbr_data
assigned_team
}
}
}
}
`;
export const GET_JOB_LINES_TO_ENTER_BILL = gql`
query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
joblines(
where: { jobid: { _eq: $id } }
order_by: { act_price: desc_nulls_last }
) {
removed
id
line_desc
part_type
oem_partno
alt_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
alt_partno
assigned_team
query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
joblines(
where: { jobid: { _eq: $id } }
order_by: { act_price: desc_nulls_last }
) {
removed
id
line_desc
part_type
oem_partno
alt_partno
db_price
act_price
part_qty
mod_lbr_ty
db_hrs
mod_lb_hrs
lbr_op
lbr_amt
op_code_desc
alt_partno
assigned_team
}
jobs_by_pk(id: $id) {
id
status
ious {
id
ro_number
}
v_make_desc
}
}
jobs_by_pk(id: $id) {
id
status
ious {
id
ro_number
}
v_make_desc
}
}
`;
// oem_partno: {
// _neq: "";
@@ -295,14 +295,14 @@ export const GET_JOB_LINES_TO_ENTER_BILL = gql`
// }
export const generateJobLinesUpdatesForInvoicing = (joblines) => {
const updates = joblines.reduce((acc, jl, idx) => {
return (
acc +
`a${idx}:update_joblines(where: {id: {_eq: "${
jl.id
}"}}, _set: {profitcenter_labor: "${
jl.profitcenter_labor || ""
}", profitcenter_part: "${jl.profitcenter_part || ""}"}) {
const updates = joblines.reduce((acc, jl, idx) => {
return (
acc +
`a${idx}:update_joblines(where: {id: {_eq: "${
jl.id
}"}}, _set: {profitcenter_labor: "${
jl.profitcenter_labor || ""
}", profitcenter_part: "${jl.profitcenter_part || ""}"}) {
returning {
line_desc
profitcenter_part
@@ -310,62 +310,62 @@ export const generateJobLinesUpdatesForInvoicing = (joblines) => {
id
}
}`
);
}, "");
);
}, "");
return gql`
mutation UPDATE_JOBLINES_FOR_INVOICING{
${updates}
}
`;
return gql`
mutation UPDATE_JOBLINES_FOR_INVOICING{
${updates}
}
`;
};
export const DELETE_JOB_LINE_BY_PK = gql`
mutation DELETE_JOB_LINE_BY_PK($joblineId: uuid!) {
update_joblines_by_pk(
pk_columns: { id: $joblineId }
_set: { removed: true }
) {
removed
id
mutation DELETE_JOB_LINE_BY_PK($joblineId: uuid!) {
update_joblines_by_pk(
pk_columns: { id: $joblineId }
_set: { removed: true }
) {
removed
id
}
}
}
`;
export const UPDATE_JOB_LINES_IOU = gql`
mutation UPDATE_JOB_LINES_IOU($ids: [uuid!]!) {
update_joblines(where: { id: { _in: $ids } }, _set: { ioucreated: true }) {
returning {
ioucreated
id
}
mutation UPDATE_JOB_LINES_IOU($ids: [uuid!]!) {
update_joblines(where: { id: { _in: $ids } }, _set: { ioucreated: true }) {
returning {
ioucreated
id
}
}
}
}
`;
export const UPDATE_LINE_PPC = gql`
mutation UPDATE_LINE_PPC($id: uuid!, $jobline: joblines_set_input) {
update_joblines_by_pk(pk_columns: { id: $id }, _set: $jobline) {
jobid
id
act_price_before_ppc
act_price
mutation UPDATE_LINE_PPC($id: uuid!, $jobline: joblines_set_input) {
update_joblines_by_pk(pk_columns: { id: $id }, _set: $jobline) {
jobid
id
act_price_before_ppc
act_price
}
}
}
`;
export const UPDATE_LINE_BULK_ASSIGN = gql`
mutation UPDATE_LINE_BULK_ASSIGN(
$ids: [uuid!]!
$jobline: joblines_set_input
) {
update_joblines_many(
updates: { _set: $jobline, where: { id: { _in: $ids } } }
mutation UPDATE_LINE_BULK_ASSIGN(
$ids: [uuid!]!
$jobline: joblines_set_input
) {
returning {
id
assigned_team
}
update_joblines_many(
updates: { _set: $jobline, where: { id: { _in: $ids } } }
) {
returning {
id
assigned_team
}
}
}
}
`;

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,16 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const MARK_MESSAGES_AS_READ_BY_CONVERSATION = gql`
mutation MARK_MESSAGES_AS_READ_BY_CONVERSATION($conversationId: uuid) {
update_messages(
where: { conversationid: { _eq: $conversationId } }
_set: { read: true }
) {
returning {
id
read
isoutbound
}
mutation MARK_MESSAGES_AS_READ_BY_CONVERSATION($conversationId: uuid) {
update_messages(
where: { conversationid: { _eq: $conversationId } }
_set: { read: true }
) {
returning {
id
read
isoutbound
}
}
}
}
`;

View File

@@ -1,22 +1,22 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const GET_LANDING_NAV_ITEMS = gql`
query nav_items {
masterdata_by_pk(key: "LANDING_NAV_ITEMS") {
value
query nav_items {
masterdata_by_pk(key: "LANDING_NAV_ITEMS") {
value
}
}
}
`;
export const GET_NAV_ITEMS = gql`
query nav_items {
masterdata_by_pk(key: "NAV_ITEMS") {
value
query nav_items {
masterdata_by_pk(key: "NAV_ITEMS") {
value
}
}
}
`;
export const GET_SELECTED_NAV_ITEM = gql`
query selected_nav_item {
selectedNavItem @client
}
query selected_nav_item {
selectedNavItem @client
}
`;

View File

@@ -1,79 +1,79 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_NOTE = gql`
mutation INSERT_NEW_NOTE($noteInput: [notes_insert_input!]!) {
insert_notes(objects: $noteInput) {
returning {
created_at
created_by
critical
id
jobid
private
text
updated_at
audit
type
}
mutation INSERT_NEW_NOTE($noteInput: [notes_insert_input!]!) {
insert_notes(objects: $noteInput) {
returning {
created_at
created_by
critical
id
jobid
private
text
updated_at
audit
type
}
}
}
}
`;
export const QUERY_NOTES_BY_JOB_PK = gql`
query QUERY_NOTES_BY_JOB_PK($id: uuid!) {
jobs_by_pk(id: $id) {
id
ro_number
vehicle {
jobs {
id
ro_number
status
clm_no
query QUERY_NOTES_BY_JOB_PK($id: uuid!) {
jobs_by_pk(id: $id) {
id
ro_number
vehicle {
jobs {
id
ro_number
status
clm_no
}
}
notes {
created_at
created_by
critical
id
jobid
private
text
updated_at
audit
type
}
}
}
notes {
created_at
created_by
critical
id
jobid
private
text
updated_at
audit
type
}
}
}
`;
export const UPDATE_NOTE = gql`
mutation UPDATE_NOTE($noteId: uuid!, $note: notes_set_input!) {
update_notes(where: { id: { _eq: $noteId } }, _set: $note) {
returning {
id
created_at
created_by
critical
id
jobid
private
text
updated_at
audit
type
}
mutation UPDATE_NOTE($noteId: uuid!, $note: notes_set_input!) {
update_notes(where: { id: { _eq: $noteId } }, _set: $note) {
returning {
id
created_at
created_by
critical
id
jobid
private
text
updated_at
audit
type
}
}
}
}
`;
export const DELETE_NOTE = gql`
mutation DELETE_NOTE($noteId: uuid!) {
delete_notes(where: { id: { _eq: $noteId } }) {
returning {
id
}
mutation DELETE_NOTE($noteId: uuid!) {
delete_notes(where: { id: { _eq: $noteId } }) {
returning {
id
}
}
}
}
`;

View File

@@ -1,189 +1,189 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_SEARCH_OWNER_BY_IDX = gql`
query QUERY_SEARCH_OWNER_BY_IDX($search: String!) {
search_owners(args: { search: $search }, limit: 100) {
ownr_fn
ownr_ln
ownr_co_nm
ownr_ph1
ownr_ph2
ownr_addr1
ownr_addr2
ownr_city
ownr_ctry
ownr_ea
ownr_st
ownr_zip
id
note
query QUERY_SEARCH_OWNER_BY_IDX($search: String!) {
search_owners(args: { search: $search }, limit: 100) {
ownr_fn
ownr_ln
ownr_co_nm
ownr_ph1
ownr_ph2
ownr_addr1
ownr_addr2
ownr_city
ownr_ctry
ownr_ea
ownr_st
ownr_zip
id
note
}
}
}
`;
export const SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE = gql`
query SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
owners_by_pk(id: $id) {
id
ownr_fn
ownr_ln
ownr_co_nm
ownr_addr1
query SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
owners_by_pk(id: $id) {
id
ownr_fn
ownr_ln
ownr_co_nm
ownr_addr1
}
}
}
`;
export const SEARCH_OWNERS_FOR_AUTOCOMPLETE = gql`
query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) {
search_owners(
args: { search: $search }
limit: 25
order_by: { ownr_ln: desc_nulls_last }
) {
id
ownr_fn
ownr_ln
ownr_co_nm
ownr_addr1
query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) {
search_owners(
args: { search: $search }
limit: 25
order_by: { ownr_ln: desc_nulls_last }
) {
id
ownr_fn
ownr_ln
ownr_co_nm
ownr_addr1
}
}
}
`;
export const QUERY_OWNER_BY_ID = gql`
query QUERY_OWNER_BY_ID($id: uuid!) {
owners_by_pk(id: $id) {
id
allow_text_message
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
preferred_contact
note
tax_number
jobs(order_by: { date_open: desc }) {
id
ro_number
clm_no
status
clm_total
v_model_yr
v_model_desc
v_make_desc
vehicleid
}
query QUERY_OWNER_BY_ID($id: uuid!) {
owners_by_pk(id: $id) {
id
allow_text_message
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
preferred_contact
note
tax_number
jobs(order_by: { date_open: desc }) {
id
ro_number
clm_no
status
clm_total
v_model_yr
v_model_desc
v_make_desc
vehicleid
}
}
}
}
`;
export const UPDATE_OWNER = gql`
mutation UPDATE_OWNER($ownerId: uuid!, $owner: owners_set_input!) {
update_owners(where: { id: { _eq: $ownerId } }, _set: $owner) {
returning {
id
}
mutation UPDATE_OWNER($ownerId: uuid!, $owner: owners_set_input!) {
update_owners(where: { id: { _eq: $ownerId } }, _set: $owner) {
returning {
id
}
}
}
}
`;
export const DELETE_OWNER = gql`
mutation DELETE_OWNER($id: uuid!) {
delete_owners_by_pk(id: $id) {
id
mutation DELETE_OWNER($id: uuid!) {
delete_owners_by_pk(id: $id) {
id
}
}
}
`;
export const QUERY_ALL_OWNERS = gql`
query QUERY_ALL_OWNERS {
owners {
id
allow_text_message
created_at
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
preferred_contact
updated_at
query QUERY_ALL_OWNERS {
owners {
id
allow_text_message
created_at
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
preferred_contact
updated_at
}
}
}
`;
export const QUERY_ALL_OWNERS_PAGINATED = gql`
query QUERY_ALL_OWNERS_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [owners_order_by!]!
) {
search_owners(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
query QUERY_ALL_OWNERS_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [owners_order_by!]!
) {
id
allow_text_message
created_at
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
preferred_contact
updated_at
search_owners(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
) {
id
allow_text_message
created_at
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
preferred_contact
updated_at
}
search_owners_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
search_owners_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;
export const QUERY_OWNER_FOR_JOB_CREATION = gql`
query QUERY_OWNER_FOR_JOB_CREATION($id: uuid!) {
owners_by_pk(id: $id) {
id
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
query QUERY_OWNER_FOR_JOB_CREATION($id: uuid!) {
owners_by_pk(id: $id) {
id
ownr_addr1
ownr_addr2
ownr_co_nm
ownr_city
ownr_ctry
ownr_ea
ownr_fn
ownr_ph1
ownr_ln
ownr_ph2
ownr_st
ownr_title
ownr_zip
}
}
}
`;

View File

@@ -1,79 +1,79 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_PARTS_DISPATCH = gql`
mutation INSERT_PARTS_DISPATCH($partsDispatch: parts_dispatch_insert_input!) {
insert_parts_dispatch_one(object: $partsDispatch) {
id
jobid
number
employeeid
parts_dispatch_lines {
id
joblineid
quantity
}
mutation INSERT_PARTS_DISPATCH($partsDispatch: parts_dispatch_insert_input!) {
insert_parts_dispatch_one(object: $partsDispatch) {
id
jobid
number
employeeid
parts_dispatch_lines {
id
joblineid
quantity
}
}
}
}
`;
export const GET_UNACCEPTED_PARTS_DISPATCH = gql`
query GET_UNACCEPTED_PARTS_DISPATCH(
$techId: uuid!
$offset: Int
$limit: Int
) {
parts_dispatch_aggregate(
where: {
employeeid: { _eq: $techId }
parts_dispatch_lines: { accepted_at: { _is_null: true } }
}
query GET_UNACCEPTED_PARTS_DISPATCH(
$techId: uuid!
$offset: Int
$limit: Int
) {
aggregate {
count(distinct: true)
}
}
parts_dispatch(
offset: $offset
limit: $limit
where: {
employeeid: { _eq: $techId }
parts_dispatch_lines: { accepted_at: { _is_null: true } }
}
) {
id
job {
id
ro_number
status
v_make_desc
v_model_desc
v_model_yr
v_color
}
dispatched_at
dispatched_by
parts_dispatch_lines {
id
accepted_at
jobline {
line_desc
id
parts_dispatch_aggregate(
where: {
employeeid: { _eq: $techId }
parts_dispatch_lines: { accepted_at: { _is_null: true } }
}
) {
aggregate {
count(distinct: true)
}
}
parts_dispatch(
offset: $offset
limit: $limit
where: {
employeeid: { _eq: $techId }
parts_dispatch_lines: { accepted_at: { _is_null: true } }
}
) {
id
job {
id
ro_number
status
v_make_desc
v_model_desc
v_model_yr
v_color
}
dispatched_at
dispatched_by
parts_dispatch_lines {
id
accepted_at
jobline {
line_desc
id
}
quantity
joblineid
}
}
quantity
joblineid
}
}
}
`;
export const UPDATE_PARTS_DISPATCH_LINE = gql`
mutation UPDATE_PARTS_DISPATCH_LINE(
$id: uuid!
$line: parts_dispatch_lines_set_input!
) {
update_parts_dispatch_lines_by_pk(pk_columns: { id: $id }, _set: $line) {
accepted_at
id
mutation UPDATE_PARTS_DISPATCH_LINE(
$id: uuid!
$line: parts_dispatch_lines_set_input!
) {
update_parts_dispatch_lines_by_pk(pk_columns: { id: $id }, _set: $line) {
accepted_at
id
}
}
}
`;

View File

@@ -1,398 +1,398 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_PARTS_ORDERS = gql`
mutation INSERT_NEW_PARTS_ORDERS($po: [parts_orders_insert_input!]!) {
insert_parts_orders(objects: $po) {
returning {
id
order_number
}
mutation INSERT_NEW_PARTS_ORDERS($po: [parts_orders_insert_input!]!) {
insert_parts_orders(objects: $po) {
returning {
id
order_number
}
}
}
}
`;
export const QUERY_PARTS_ORDER_OEC = gql`
query QUERY_PARTS_ORDER_OEC($id: uuid!) {
parts_orders_by_pk(id: $id) {
parts_order_lines {
jobline {
tran_code
act_price
db_ref
db_price
db_hrs
glass_flag
id
lbr_amt
lbr_hrs_j
lbr_inc
lbr_op
lbr_op_j
lbr_tax
lbr_typ_j
line_desc
line_ind
line_no
line_ref
location
misc_amt
misc_sublt
misc_tax
mod_lb_hrs
mod_lbr_ty
oem_partno
op_code_desc
paint_stg
paint_tone
part_qty
part_type
price_inc
price_j
prt_dsmk_m
prt_dsmk_p
tax_part
unq_seq
alt_co_id
alt_overrd
alt_part_i
alt_partm
alt_partno
bett_amt
bett_pctg
bett_tax
bett_type
cert_part
est_seq
query QUERY_PARTS_ORDER_OEC($id: uuid!) {
parts_orders_by_pk(id: $id) {
parts_order_lines {
jobline {
tran_code
act_price
db_ref
db_price
db_hrs
glass_flag
id
lbr_amt
lbr_hrs_j
lbr_inc
lbr_op
lbr_op_j
lbr_tax
lbr_typ_j
line_desc
line_ind
line_no
line_ref
location
misc_amt
misc_sublt
misc_tax
mod_lb_hrs
mod_lbr_ty
oem_partno
op_code_desc
paint_stg
paint_tone
part_qty
part_type
price_inc
price_j
prt_dsmk_m
prt_dsmk_p
tax_part
unq_seq
alt_co_id
alt_overrd
alt_part_i
alt_partm
alt_partno
bett_amt
bett_pctg
bett_tax
bett_type
cert_part
est_seq
}
act_price
id
db_price
line_desc
quantity
part_type
}
job {
bodyshop {
shopname
bill_tax_rates
}
ro_number
clm_no
asgn_no
asgn_date
state_tax_rate
area_of_damage
asgn_no
asgn_type
ciecaid
clm_addr1
clm_city
clm_addr2
clm_ct_fn
clm_ct_ln
clm_ct_ph
clm_ct_phx
clm_ctry
clm_ea
clm_fax
clm_faxx
clm_ofc_id
clm_ofc_nm
clm_ph1
clm_ph1x
clm_ph2
clm_ph2x
clm_st
clm_title
clm_total
clm_zip
ded_amt
est_addr1
est_addr2
est_city
est_co_nm
est_ct_fn
est_ctry
est_ct_ln
est_ea
est_ph1
est_st
est_zip
g_bett_amt
id
ins_addr1
ins_city
ins_addr2
ins_co_id
ins_co_nm
ins_ct_fn
ins_ct_ln
ins_ct_ph
ins_ct_phx
ins_ctry
ins_ea
ins_fax
ins_faxx
ins_memo
ins_ph1
ins_ph1x
ins_ph2
ins_ph2x
ins_st
ins_title
ins_zip
insd_addr1
insd_addr2
insd_city
insd_co_nm
insd_ctry
insd_ea
insd_fax
insd_faxx
insd_fn
insd_ln
insd_ph1
insd_ph1x
insd_ph2
insd_ph2x
insd_st
insd_title
insd_zip
job_totals
loss_cat
loss_date
loss_desc
loss_of_use
loss_type
ownr_addr1
ownr_addr2
ownr_city
ownr_co_nm
ownr_ctry
ownr_ea
ownr_fax
ownr_faxx
ownr_ph1
ownr_fn
ownr_ln
ownr_ph1x
ownr_ph2
ownr_ph2x
ownr_st
ownr_title
ownr_zip
parts_tax_rates
pay_amt
pay_date
pay_type
pay_chknm
payee_nms
plate_no
plate_st
po_number
policy_no
tax_lbr_rt
tax_levies_rt
tax_paint_mat_rt
tax_predis
tax_prethr
tax_pstthr
tax_registration_number
tax_str_rt
tax_shop_mat_rt
tax_sub_rt
tax_thramt
tax_tow_rt
theft_ind
tlos_ind
towin
v_color
v_make_desc
v_model_desc
v_model_yr
v_vin
vehicle {
v_bstyle
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_options
v_paint_codes
v_model_yr
v_model_desc
v_mldgcode
v_makecode
v_make_desc
v_engine
v_cond
v_color
trim_color
shopid
plate_no
plate_st
db_v_code
v_vin
}
agt_zip
agt_st
agt_ph2x
agt_ph2
agt_ph1x
agt_ph1
agt_lic_no
agt_faxx
agt_fax
agt_ea
agt_ctry
agt_ct_phx
agt_ct_ph
agt_ct_ln
agt_ct_fn
agt_co_nm
agt_co_id
agt_city
agt_addr1
agt_addr2
adj_g_disc
rate_matd
rate_mash
rate_mapa
rate_mahw
rate_macs
rate_mabl
rate_ma3s
rate_ma2t
rate_ma2s
rate_lau
rate_las
rate_lar
rate_lam
rate_lag
rate_laf
rate_lae
rate_lad
rate_lab
rate_laa
rate_la4
rate_la3
rate_la2
rate_la1
}
}
act_price
id
db_price
line_desc
quantity
part_type
}
job {
bodyshop {
shopname
bill_tax_rates
}
ro_number
clm_no
asgn_no
asgn_date
state_tax_rate
area_of_damage
asgn_no
asgn_type
ciecaid
clm_addr1
clm_city
clm_addr2
clm_ct_fn
clm_ct_ln
clm_ct_ph
clm_ct_phx
clm_ctry
clm_ea
clm_fax
clm_faxx
clm_ofc_id
clm_ofc_nm
clm_ph1
clm_ph1x
clm_ph2
clm_ph2x
clm_st
clm_title
clm_total
clm_zip
ded_amt
est_addr1
est_addr2
est_city
est_co_nm
est_ct_fn
est_ctry
est_ct_ln
est_ea
est_ph1
est_st
est_zip
g_bett_amt
id
ins_addr1
ins_city
ins_addr2
ins_co_id
ins_co_nm
ins_ct_fn
ins_ct_ln
ins_ct_ph
ins_ct_phx
ins_ctry
ins_ea
ins_fax
ins_faxx
ins_memo
ins_ph1
ins_ph1x
ins_ph2
ins_ph2x
ins_st
ins_title
ins_zip
insd_addr1
insd_addr2
insd_city
insd_co_nm
insd_ctry
insd_ea
insd_fax
insd_faxx
insd_fn
insd_ln
insd_ph1
insd_ph1x
insd_ph2
insd_ph2x
insd_st
insd_title
insd_zip
job_totals
loss_cat
loss_date
loss_desc
loss_of_use
loss_type
ownr_addr1
ownr_addr2
ownr_city
ownr_co_nm
ownr_ctry
ownr_ea
ownr_fax
ownr_faxx
ownr_ph1
ownr_fn
ownr_ln
ownr_ph1x
ownr_ph2
ownr_ph2x
ownr_st
ownr_title
ownr_zip
parts_tax_rates
pay_amt
pay_date
pay_type
pay_chknm
payee_nms
plate_no
plate_st
po_number
policy_no
tax_lbr_rt
tax_levies_rt
tax_paint_mat_rt
tax_predis
tax_prethr
tax_pstthr
tax_registration_number
tax_str_rt
tax_shop_mat_rt
tax_sub_rt
tax_thramt
tax_tow_rt
theft_ind
tlos_ind
towin
v_color
v_make_desc
v_model_desc
v_model_yr
v_vin
vehicle {
v_bstyle
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_options
v_paint_codes
v_model_yr
v_model_desc
v_mldgcode
v_makecode
v_make_desc
v_engine
v_cond
v_color
trim_color
shopid
plate_no
plate_st
db_v_code
v_vin
}
agt_zip
agt_st
agt_ph2x
agt_ph2
agt_ph1x
agt_ph1
agt_lic_no
agt_faxx
agt_fax
agt_ea
agt_ctry
agt_ct_phx
agt_ct_ph
agt_ct_ln
agt_ct_fn
agt_co_nm
agt_co_id
agt_city
agt_addr1
agt_addr2
adj_g_disc
rate_matd
rate_mash
rate_mapa
rate_mahw
rate_macs
rate_mabl
rate_ma3s
rate_ma2t
rate_ma2s
rate_lau
rate_las
rate_lar
rate_lam
rate_lag
rate_laf
rate_lae
rate_lad
rate_lab
rate_laa
rate_la4
rate_la3
rate_la2
rate_la1
}
}
}
`;
export const DELETE_PARTS_ORDER = gql`
mutation DELETE_PARTS_ORDER($partsOrderId: uuid!) {
delete_parts_orders_by_pk(id: $partsOrderId) {
id
mutation DELETE_PARTS_ORDER($partsOrderId: uuid!) {
delete_parts_orders_by_pk(id: $partsOrderId) {
id
}
}
}
`;
export const DELETE_PARTS_ORDER_LINE = gql`
mutation DELETE_PARTS_ORDER_LINE($partsOrderLineId: uuid!) {
delete_parts_order_lines_by_pk(id: $partsOrderLineId) {
id
mutation DELETE_PARTS_ORDER_LINE($partsOrderLineId: uuid!) {
delete_parts_order_lines_by_pk(id: $partsOrderLineId) {
id
}
}
}
`;
export const MUTATION_UPDATE_PO_CM_REECEIVED = gql`
mutation MUTATION_UPDATE_PO_CM_REECEIVED(
$partsLineId: uuid!
$partsOrder: parts_order_lines_set_input
) {
update_parts_order_lines(
where: { id: { _eq: $partsLineId } }
_set: $partsOrder
mutation MUTATION_UPDATE_PO_CM_REECEIVED(
$partsLineId: uuid!
$partsOrder: parts_order_lines_set_input
) {
returning {
id
cm_received
}
update_parts_order_lines(
where: { id: { _eq: $partsLineId } }
_set: $partsOrder
) {
returning {
id
cm_received
}
}
}
}
`;
export const MUTATION_UPDATE_BO_ETA = gql`
mutation MUTATION_UPDATE_BO_ETA(
$partsLineId: uuid!
$partsOrder: parts_order_lines_set_input
) {
update_parts_order_lines(
where: { id: { _eq: $partsLineId } }
_set: $partsOrder
mutation MUTATION_UPDATE_BO_ETA(
$partsLineId: uuid!
$partsOrder: parts_order_lines_set_input
) {
returning {
status
backordered_eta
id
}
update_parts_order_lines(
where: { id: { _eq: $partsLineId } }
_set: $partsOrder
) {
returning {
status
backordered_eta
id
}
}
}
}
`;
export const MUTATION_BACKORDER_PART_LINE = gql`
mutation MUTATION_BACKORDER_PART_LINE(
$jobLineId: uuid!
$partsLineId: uuid!
$status: String!
$partsOrder: parts_order_lines_set_input
) {
update_parts_order_lines(
where: { id: { _eq: $partsLineId } }
_set: $partsOrder
mutation MUTATION_BACKORDER_PART_LINE(
$jobLineId: uuid!
$partsLineId: uuid!
$status: String!
$partsOrder: parts_order_lines_set_input
) {
returning {
status
backordered_on
backordered_eta
id
}
update_parts_order_lines(
where: { id: { _eq: $partsLineId } }
_set: $partsOrder
) {
returning {
status
backordered_on
backordered_eta
id
}
}
update_joblines(
where: { id: { _eq: $jobLineId } }
_set: { status: $status }
) {
returning {
status
id
}
}
}
update_joblines(
where: { id: { _eq: $jobLineId } }
_set: { status: $status }
) {
returning {
status
id
}
}
}
`;
export const QUERY_UNRECEIVED_LINES = gql`
query QUERY_UNRECEIVED_LINES($jobId: uuid!, $vendorId: uuid!) {
parts_order_lines(
where: {
parts_order: { jobid: { _eq: $jobId }, vendorid: { _eq: $vendorId } }
cm_received: { _neq: true }
}
) {
cm_received
id
line_desc
quantity
act_price
cost
oem_partno
query QUERY_UNRECEIVED_LINES($jobId: uuid!, $vendorId: uuid!) {
parts_order_lines(
where: {
parts_order: { jobid: { _eq: $jobId }, vendorid: { _eq: $vendorId } }
cm_received: { _neq: true }
}
) {
cm_received
id
line_desc
quantity
act_price
cost
oem_partno
}
}
}
`;
export const MUTATION_MARK_RETURN_RECEIVED = gql`
mutation MUTATION_MARK_RETURN_RECEIVED($partsLineIds: [uuid!]!) {
update_parts_order_lines(
where: { id: { _in: $partsLineIds } }
_set: { cm_received: true }
) {
returning {
id
cm_received
}
mutation MUTATION_MARK_RETURN_RECEIVED($partsLineIds: [uuid!]!) {
update_parts_order_lines(
where: { id: { _in: $partsLineIds } }
_set: { cm_received: true }
) {
returning {
id
cm_received
}
}
}
}
`;

View File

@@ -1,53 +1,53 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_PAYMENT_RESPONSE = gql`
mutation INSERT_PAYMENT_RESPONSE(
$paymentResponse: [payment_response_insert_input!]!
) {
insert_payment_response(objects: $paymentResponse) {
returning {
id
}
mutation INSERT_PAYMENT_RESPONSE(
$paymentResponse: [payment_response_insert_input!]!
) {
insert_payment_response(objects: $paymentResponse) {
returning {
id
}
}
}
}
`;
export const QUERY_PAYMENT_RESPONSE_BY_PAYMENT_ID = gql`
query QUERY_PAYMENT_RESPONSE_BY_PK($paymentid: uuid!) {
payment_response(where: { paymentid: { _eq: $paymentid } }) {
id
jobid
bodyshopid
paymentid
amount
declinereason
ext_paymentid
successful
response
query QUERY_PAYMENT_RESPONSE_BY_PK($paymentid: uuid!) {
payment_response(where: { paymentid: { _eq: $paymentid } }) {
id
jobid
bodyshopid
paymentid
amount
declinereason
ext_paymentid
successful
response
}
}
}
`;
export const QUERY_RO_AND_OWNER_BY_JOB_PKS = gql`
query QUERY_RO_AND_OWNER_BY_JOB_PKS($jobids: [uuid!]!) {
jobs(where: { id: { _in: $jobids } }) {
ro_number
ownr_fn
ownr_ln
ownr_ea
ownr_zip
query QUERY_RO_AND_OWNER_BY_JOB_PKS($jobids: [uuid!]!) {
jobs(where: { id: { _in: $jobids } }) {
ro_number
ownr_fn
ownr_ln
ownr_ea
ownr_zip
}
}
}
`;
export const GET_REFUNDABLE_AMOUNT_BY_JOBID = gql`
query GET_REFUNDABLE_AMOUNT_BY_JOBID($jobid: uuid!) {
payment_response_aggregate(where: { jobid: { _eq: $jobid } }) {
aggregate {
sum {
amount
query GET_REFUNDABLE_AMOUNT_BY_JOBID($jobid: uuid!) {
payment_response_aggregate(where: { jobid: { _eq: $jobid } }) {
aggregate {
sum {
amount
}
}
}
}
}
}
`;

View File

@@ -1,182 +1,182 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_PAYMENT = gql`
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
insert_payments(objects: $paymentInput) {
returning {
id
jobid
amount
payer
created_at
transactionid
memo
date
type
exportedat
}
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
insert_payments(objects: $paymentInput) {
returning {
id
jobid
amount
payer
created_at
transactionid
memo
date
type
exportedat
}
}
}
}
`;
export const QUERY_ALL_PAYMENTS_PAGINATED = gql`
query QUERY_ALL_PAYMENTS_PAGINATED(
$offset: Int
$limit: Int
$order: [payments_order_by!]!
) {
payments(offset: $offset, limit: $limit, order_by: $order) {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
query QUERY_ALL_PAYMENTS_PAGINATED(
$offset: Int
$limit: Int
$order: [payments_order_by!]!
) {
payments(offset: $offset, limit: $limit, order_by: $order) {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
payments_aggregate {
aggregate {
count(distinct: true)
}
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
payments_aggregate {
aggregate {
count(distinct: true)
}
}
}
`;
export const UPDATE_PAYMENT = gql`
mutation UPDATE_PAYMENT($paymentId: uuid!, $payment: payments_set_input!) {
update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) {
returning {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
mutation UPDATE_PAYMENT($paymentId: uuid!, $payment: payments_set_input!) {
update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) {
returning {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
}
memo
payer
paymentnum
stripeid
transactionid
type
}
}
}
`;
export const UPDATE_PAYMENTS = gql`
mutation UPDATE_PAYMENTS(
$paymentIdList: [uuid!]!
$payment: payments_set_input!
) {
update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) {
returning {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
mutation UPDATE_PAYMENTS(
$paymentIdList: [uuid!]!
$payment: payments_set_input!
) {
update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) {
returning {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
}
memo
payer
paymentnum
stripeid
transactionid
type
}
}
}
`;
export const QUERY_JOB_PAYMENT_TOTALS = gql`
query QUERY_JOB_PAYMENT_TOTALS($id: uuid!) {
jobs_by_pk(id: $id) {
id
job_totals
payments {
id
amount
date
}
query QUERY_JOB_PAYMENT_TOTALS($id: uuid!) {
jobs_by_pk(id: $id) {
id
job_totals
payments {
id
amount
date
}
}
}
}
`;
export const QUERY_PAYMENT_BY_ID = gql`
query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
payments_by_pk(id: $paymentId) {
id
amount
created_at
exportedat
date
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
payments_by_pk(id: $paymentId) {
id
amount
created_at
exportedat
date
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
}
`;

View File

@@ -1,92 +1,92 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_PHONEBOOK_PAGINATED = gql`
query QUERY_PHONEBOOK_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [phonebook_order_by!]
) {
search_phonebook(
offset: $offset
limit: $limit
order_by: $order
args: { search: $search }
query QUERY_PHONEBOOK_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [phonebook_order_by!]
) {
id
created_at
firstname
lastname
phone1
phone2
state
zip
fax
email
country
company
city
category
address2
address1
search_phonebook(
offset: $offset
limit: $limit
order_by: $order
args: { search: $search }
) {
id
created_at
firstname
lastname
phone1
phone2
state
zip
fax
email
country
company
city
category
address2
address1
}
search_phonebook_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
search_phonebook_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;
export const QUERY_PHONEBOOK_BY_ID = gql`
query QUERY_PHONEBOOK_BY_ID($id: uuid!) {
phonebook_by_pk(id: $id) {
id
created_at
firstname
lastname
phone1
phone2
state
zip
fax
email
country
company
city
category
address2
address1
query QUERY_PHONEBOOK_BY_ID($id: uuid!) {
phonebook_by_pk(id: $id) {
id
created_at
firstname
lastname
phone1
phone2
state
zip
fax
email
country
company
city
category
address2
address1
}
}
}
`;
export const UPDATE_PHONEBOOK = gql`
mutation UPDATE_VENDOR($id: uuid!, $phonebook: phonebook_set_input!) {
update_phonebook(where: { id: { _eq: $id } }, _set: $phonebook) {
returning {
id
}
mutation UPDATE_VENDOR($id: uuid!, $phonebook: phonebook_set_input!) {
update_phonebook(where: { id: { _eq: $id } }, _set: $phonebook) {
returning {
id
}
}
}
}
`;
export const INSERT_NEW_PHONEBOOK = gql`
mutation INSERT_NEW_PHONEBOOK($phonebook_entry: [phonebook_insert_input!]!) {
insert_phonebook(objects: $phonebook_entry) {
returning {
id
}
mutation INSERT_NEW_PHONEBOOK($phonebook_entry: [phonebook_insert_input!]!) {
insert_phonebook(objects: $phonebook_entry) {
returning {
id
}
}
}
}
`;
export const DELETE_PHONEBOOK = gql`
mutation DELETE_PHONEBOOK($id: uuid!) {
delete_phonebook(where: { id: { _eq: $id } }) {
returning {
id
}
mutation DELETE_PHONEBOOK($id: uuid!) {
delete_phonebook(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
}
`;

View File

@@ -1,4 +1,4 @@
import { buildSchema } from "graphql";
import {buildSchema} from "graphql";
export default buildSchema(`
schema {

View File

@@ -1,129 +1,129 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_SCOREBOARD = gql`
query QUERY_SCOREBOARD($start: date!, $end: date!) {
scoreboard(
where: { _and: { date: { _gte: $start, _lte: $end } } }
order_by: { date: asc }
) {
id
painthrs
bodyhrs
date
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
v_make_desc
v_model_desc
v_model_yr
job_totals
}
query QUERY_SCOREBOARD($start: date!, $end: date!) {
scoreboard(
where: { _and: { date: { _gte: $start, _lte: $end } } }
order_by: { date: asc }
) {
id
painthrs
bodyhrs
date
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
v_make_desc
v_model_desc
v_model_yr
job_totals
}
}
}
}
`;
export const DELETE_SCOREBOARD_ENTRY = gql`
mutation DELETE_SCOREBOARD_ENTRY($sbId: uuid!) {
delete_scoreboard_by_pk(id: $sbId) {
id
mutation DELETE_SCOREBOARD_ENTRY($sbId: uuid!) {
delete_scoreboard_by_pk(id: $sbId) {
id
}
}
}
`;
export const INSERT_SCOREBOARD_ENTRY = gql`
mutation INSERT_SCOREBOARD_ENTRY($sbInput: [scoreboard_insert_input!]!) {
insert_scoreboard(objects: $sbInput) {
returning {
id
date
bodyhrs
painthrs
}
mutation INSERT_SCOREBOARD_ENTRY($sbInput: [scoreboard_insert_input!]!) {
insert_scoreboard(objects: $sbInput) {
returning {
id
date
bodyhrs
painthrs
}
}
}
}
`;
export const UPDATE_SCOREBOARD_ENTRY = gql`
mutation UPDATE_SCOREBOARD_ENTRY(
$sbId: uuid!
$sbInput: scoreboard_set_input!
) {
update_scoreboard_by_pk(_set: $sbInput, pk_columns: { id: $sbId }) {
id
date
bodyhrs
painthrs
mutation UPDATE_SCOREBOARD_ENTRY(
$sbId: uuid!
$sbInput: scoreboard_set_input!
) {
update_scoreboard_by_pk(_set: $sbInput, pk_columns: { id: $sbId }) {
id
date
bodyhrs
painthrs
}
}
}
`;
export const QUERY_SCOREBOARD_ENTRY = gql`
query QUERY_SCOREBOARD_ENTRY($jobid: uuid!) {
scoreboard(where: { jobid: { _eq: $jobid } }) {
bodyhrs
date
id
painthrs
query QUERY_SCOREBOARD_ENTRY($jobid: uuid!) {
scoreboard(where: { jobid: { _eq: $jobid } }) {
bodyhrs
date
id
painthrs
}
}
}
`;
export const GET_BLOCKED_DAYS = gql`
query GET_BLOCKED_DAYS($start: timestamptz, $end: timestamptz) {
appointments(
where: {
_and: [
{ block: { _eq: true } }
{ canceled: { _eq: false } }
{ start: { _gte: $start } }
{ end: { _lte: $end } }
]
}
) {
id
block
start
end
query GET_BLOCKED_DAYS($start: timestamptz, $end: timestamptz) {
appointments(
where: {
_and: [
{ block: { _eq: true } }
{ canceled: { _eq: false } }
{ start: { _gte: $start } }
{ end: { _lte: $end } }
]
}
) {
id
block
start
end
}
}
}
`;
export const QUERY_SCOREBOARD_PAGINATED = gql`
query QUERY_SCOREBOARD_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [scoreboard_order_by!]
) {
scoreboard(
where: { job: { ro_number: { _ilike: $search } } }
offset: $offset
limit: $limit
order_by: $order
query QUERY_SCOREBOARD_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [scoreboard_order_by!]
) {
id
jobid
job {
id
ro_number
invoice_date
v_make_desc
v_model_desc
v_model_yr
ownr_fn
ownr_ln
ownr_co_nm
}
date
bodyhrs
painthrs
scoreboard(
where: { job: { ro_number: { _ilike: $search } } }
offset: $offset
limit: $limit
order_by: $order
) {
id
jobid
job {
id
ro_number
invoice_date
v_make_desc
v_model_desc
v_model_yr
ownr_fn
ownr_ln
ownr_co_nm
}
date
bodyhrs
painthrs
}
scoreboard_aggregate(where: { job: { ro_number: { _ilike: $search } } }) {
aggregate {
count(distinct: true)
}
}
}
scoreboard_aggregate(where: { job: { ro_number: { _ilike: $search } } }) {
aggregate {
count(distinct: true)
}
}
}
`;

View File

@@ -1,63 +1,63 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const GLOBAL_SEARCH_QUERY = gql`
query GLOBAL_SEARCH_QUERY($search: String) {
search_jobs(args: { search: $search }, limit: 25) {
id
ro_number
status
clm_no
v_model_yr
v_model_desc
v_make_desc
v_color
ownr_fn
ownr_ln
ownr_co_nm
query GLOBAL_SEARCH_QUERY($search: String) {
search_jobs(args: { search: $search }, limit: 25) {
id
ro_number
status
clm_no
v_model_yr
v_model_desc
v_make_desc
v_color
ownr_fn
ownr_ln
ownr_co_nm
}
search_owners(args: { search: $search }, limit: 25) {
id
ownr_fn
ownr_ln
ownr_co_nm
ownr_ph1
ownr_ph2
}
search_vehicles(args: { search: $search }, limit: 25) {
id
v_model_yr
v_model_desc
v_make_desc
v_color
v_vin
plate_no
}
search_payments(args: { search: $search }, limit: 25) {
id
amount
paymentnum
job {
ro_number
id
}
memo
transactionid
}
search_bills(args: { search: $search }, limit: 25) {
id
date
invoice_number
vendor {
id
name
}
}
search_phonebook(args: { search: $search }, limit: 25) {
id
firstname
lastname
company
phone1
}
}
search_owners(args: { search: $search }, limit: 25) {
id
ownr_fn
ownr_ln
ownr_co_nm
ownr_ph1
ownr_ph2
}
search_vehicles(args: { search: $search }, limit: 25) {
id
v_model_yr
v_model_desc
v_make_desc
v_color
v_vin
plate_no
}
search_payments(args: { search: $search }, limit: 25) {
id
amount
paymentnum
job {
ro_number
id
}
memo
transactionid
}
search_bills(args: { search: $search }, limit: 25) {
id
date
invoice_number
vendor {
id
name
}
}
search_phonebook(args: { search: $search }, limit: 25) {
id
firstname
lastname
company
phone1
}
}
`;

View File

@@ -1,76 +1,76 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_TEMPLATES_BY_NAME = gql`
query QUERY_TEMPLATES_BY_NAME($name: String!) {
templates(where: { name: { _eq: $name } }) {
id
name
query
html
bodyshopid
query QUERY_TEMPLATES_BY_NAME($name: String!) {
templates(where: { name: { _eq: $name } }) {
id
name
query
html
bodyshopid
}
}
}
`;
export const QUERY_TEMPLATES_BY_NAME_FOR_DUPE = gql`
query QUERY_TEMPLATES_BY_NAME_FOR_DUPE($name: String!) {
templates(where: { name: { _eq: $name } }) {
id
name
query
html
bodyshopid
jsontemplate
query QUERY_TEMPLATES_BY_NAME_FOR_DUPE($name: String!) {
templates(where: { name: { _eq: $name } }) {
id
name
query
html
bodyshopid
jsontemplate
}
}
}
`;
export const QUERY_CUSTOM_TEMPLATES = gql`
query QUERY_CUSTOM_TEMPLATES {
templates(where: { bodyshopid: { _is_null: false } }) {
id
name
query QUERY_CUSTOM_TEMPLATES {
templates(where: { bodyshopid: { _is_null: false } }) {
id
name
}
}
}
`;
export const QUERY_TEMPLATE_BY_PK = gql`
query QUERY_TEMPLATE_BY_PK($templateId: uuid!) {
templates_by_pk(id: $templateId) {
id
name
query
html
jsontemplate
query QUERY_TEMPLATE_BY_PK($templateId: uuid!) {
templates_by_pk(id: $templateId) {
id
name
query
html
jsontemplate
}
}
}
`;
export const UPDATE_TEMPLATE = gql`
mutation UPDATE_TEMPLATE(
$templateId: uuid!
$template: templates_set_input!
) {
update_templates(where: { id: { _eq: $templateId } }, _set: $template) {
returning {
id
}
mutation UPDATE_TEMPLATE(
$templateId: uuid!
$template: templates_set_input!
) {
update_templates(where: { id: { _eq: $templateId } }, _set: $template) {
returning {
id
}
}
}
}
`;
export const INSERT_TEMPLATE = gql`
mutation INSERT_TEMPLATE($template: templates_insert_input!) {
insert_templates(objects: [$template]) {
returning {
id
}
mutation INSERT_TEMPLATE($template: templates_insert_input!) {
insert_templates(objects: [$template]) {
returning {
id
}
}
}
}
`;
export const DELETE_TEMPLATE = gql`
mutation DELETE_TEMPLATE($templateId: uuid!) {
delete_templates(where: { id: { _eq: $templateId } }) {
affected_rows
mutation DELETE_TEMPLATE($templateId: uuid!) {
delete_templates(where: { id: { _eq: $templateId } }) {
affected_rows
}
}
}
`;

View File

@@ -1,442 +1,442 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_TICKETS_BY_JOBID = gql`
query QUERY_TICKETS_BY_JOBID($jobid: uuid!) {
timetickets(
where: { jobid: { _eq: $jobid } }
order_by: { date: desc_nulls_first }
) {
actualhrs
cost_center
ciecacode
rate
productivehrs
id
memo
jobid
flat_rate
commited_by
committed_at
employee {
employee_number
first_name
last_name
id
}
query QUERY_TICKETS_BY_JOBID($jobid: uuid!) {
timetickets(
where: { jobid: { _eq: $jobid } }
order_by: { date: desc_nulls_first }
) {
actualhrs
cost_center
ciecacode
rate
productivehrs
id
memo
jobid
flat_rate
commited_by
committed_at
employee {
employee_number
first_name
last_name
id
}
}
}
}
`;
export const QUERY_TIME_TICKETS_IN_RANGE = gql`
query QUERY_TIME_TICKETS_IN_RANGE($start: date!, $end: date!) {
timetickets(
where: { date: { _gte: $start, _lte: $end } }
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
flat_rate
commited_by
committed_at
task_name
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
query QUERY_TIME_TICKETS_IN_RANGE($start: date!, $end: date!) {
timetickets(
where: { date: { _gte: $start, _lte: $end } }
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
flat_rate
commited_by
committed_at
task_name
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
}
}
`;
export const QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE = gql`
query QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE(
$employeeid: uuid!
$start: date!
$end: date!
$fixedStart: date!
$fixedEnd: date!
) {
timetickets(
where: {
date: { _gte: $start, _lte: $end }
employeeid: { _eq: $employeeid }
}
order_by: { date: desc_nulls_first }
query QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE(
$employeeid: uuid!
$start: date!
$end: date!
$fixedStart: date!
$fixedEnd: date!
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
commited_by
committed_at
flat_rate
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
timetickets(
where: {
date: { _gte: $start, _lte: $end }
employeeid: { _eq: $employeeid }
}
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
commited_by
committed_at
flat_rate
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
fixedperiod: timetickets(
where: {
date: { _gte: $fixedStart, _lte: $fixedEnd }
employeeid: { _eq: $employeeid }
}
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
flat_rate
commited_by
committed_at
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
}
fixedperiod: timetickets(
where: {
date: { _gte: $fixedStart, _lte: $fixedEnd }
employeeid: { _eq: $employeeid }
}
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
flat_rate
commited_by
committed_at
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
}
`;
export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
query QUERY_TIME_TICKETS_IN_RANGE_SB(
$start: date!
$end: date!
$fixedStart: date!
$fixedEnd: date!
$jobStart: timestamptz!
$jobEnd: timestamptz!
) {
timetickets(
where: {
date: { _gte: $start, _lte: $end }
cost_center: { _neq: "timetickets.labels.shift" }
}
order_by: { date: desc_nulls_first }
query QUERY_TIME_TICKETS_IN_RANGE_SB(
$start: date!
$end: date!
$fixedStart: date!
$fixedEnd: date!
$jobStart: timestamptz!
$jobEnd: timestamptz!
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
actualhrs
productivehrs
memo
jobid
committed_at
commited_by
flat_rate
commited_by
committed_at
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
timetickets(
where: {
date: { _gte: $start, _lte: $end }
cost_center: { _neq: "timetickets.labels.shift" }
}
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
actualhrs
productivehrs
memo
jobid
committed_at
commited_by
flat_rate
commited_by
committed_at
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
fixedperiod: timetickets(
where: {
date: { _gte: $fixedStart, _lte: $fixedEnd }
cost_center: { _neq: "timetickets.labels.shift" }
}
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
flat_rate
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
jobs(
where: {
date_invoiced: { _is_null: true }
ro_number: { _is_null: false }
voided: { _eq: false }
_or: [
{ actual_completion: { _gte: $jobStart, _lte: $jobEnd } }
{ actual_delivery: { _gte: $jobStart, _lte: $jobEnd } }
]
}
) {
id
joblines(order_by: { line_no: asc }, where: { removed: { _eq: false } }) {
convertedtolbr
convertedtolbr_data
mod_lb_hrs
mod_lbr_ty
}
}
}
fixedperiod: timetickets(
where: {
date: { _gte: $fixedStart, _lte: $fixedEnd }
cost_center: { _neq: "timetickets.labels.shift" }
}
order_by: { date: desc_nulls_first }
) {
actualhrs
ciecacode
clockoff
clockon
cost_center
created_at
created_by
date
id
rate
productivehrs
memo
jobid
flat_rate
job {
id
ro_number
}
employeeid
employee {
id
employee_number
first_name
last_name
}
}
jobs(
where: {
date_invoiced: { _is_null: true }
ro_number: { _is_null: false }
voided: { _eq: false }
_or: [
{ actual_completion: { _gte: $jobStart, _lte: $jobEnd } }
{ actual_delivery: { _gte: $jobStart, _lte: $jobEnd } }
]
}
) {
id
joblines(order_by: { line_no: asc }, where: { removed: { _eq: false } }) {
convertedtolbr
convertedtolbr_data
mod_lb_hrs
mod_lbr_ty
}
}
}
`;
export const INSERT_NEW_TIME_TICKET = gql`
mutation INSERT_NEW_TIME_TICKET(
$timeTicketInput: [timetickets_insert_input!]!
) {
insert_timetickets(objects: $timeTicketInput) {
returning {
id
created_by
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
date
memo
flat_rate
commited_by
committed_at
}
mutation INSERT_NEW_TIME_TICKET(
$timeTicketInput: [timetickets_insert_input!]!
) {
insert_timetickets(objects: $timeTicketInput) {
returning {
id
created_by
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
date
memo
flat_rate
commited_by
committed_at
}
}
}
}
`;
export const INSERT_TIME_TICKET_AND_APPROVE = gql`
mutation INSERT_TIME_TICKET_AND_APPROVE(
$timeTicketInput: [timetickets_insert_input!]!
$approvalIds: [uuid!]!
$approvalUpdate: tt_approval_queue_set_input
) {
insert_timetickets(objects: $timeTicketInput) {
returning {
id
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
date
memo
flat_rate
commited_by
committed_at
}
}
update_tt_approval_queue(
where: { id: { _in: $approvalIds } }
_set: $approvalUpdate
mutation INSERT_TIME_TICKET_AND_APPROVE(
$timeTicketInput: [timetickets_insert_input!]!
$approvalIds: [uuid!]!
$approvalUpdate: tt_approval_queue_set_input
) {
returning {
id
approved_at
approved_at
insert_timetickets(objects: $timeTicketInput) {
returning {
id
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
date
memo
flat_rate
commited_by
committed_at
}
}
update_tt_approval_queue(
where: { id: { _in: $approvalIds } }
_set: $approvalUpdate
) {
returning {
id
approved_at
approved_at
}
}
}
}
}
`;
export const UPDATE_TIME_TICKET = gql`
mutation UPDATE_TIME_TICKET(
$timeticketId: uuid!
$timeticket: timetickets_set_input!
) {
update_timetickets(
where: { id: { _eq: $timeticketId } }
_set: $timeticket
mutation UPDATE_TIME_TICKET(
$timeticketId: uuid!
$timeticket: timetickets_set_input!
) {
returning {
id
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
created_at
updated_at
jobid
date
flat_rate
memo
committed_at
commited_by
}
update_timetickets(
where: { id: { _eq: $timeticketId } }
_set: $timeticket
) {
returning {
id
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
created_at
updated_at
jobid
date
flat_rate
memo
committed_at
commited_by
}
}
}
}
`;
export const UPDATE_TIME_TICKETS = gql`
mutation UPDATE_TIME_TICKETS(
$timeticketIds: [uuid!]!
$timeticket: timetickets_set_input!
) {
update_timetickets(
where: { id: { _in: $timeticketIds } }
_set: $timeticket
mutation UPDATE_TIME_TICKETS(
$timeticketIds: [uuid!]!
$timeticket: timetickets_set_input!
) {
returning {
id
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
created_at
updated_at
jobid
date
flat_rate
memo
committed_at
commited_by
}
update_timetickets(
where: { id: { _in: $timeticketIds } }
_set: $timeticket
) {
returning {
id
clockon
clockoff
employeeid
productivehrs
actualhrs
ciecacode
created_at
updated_at
jobid
date
flat_rate
memo
committed_at
commited_by
}
}
}
}
`;
export const QUERY_ACTIVE_TIME_TICKETS = gql`
query QUERY_ACTIVE_TIME_TICKETS($employeeId: uuid) {
timetickets(
order_by: { date: desc_nulls_first }
where: {
_and: {
clockoff: { _is_null: true }
employeeid: { _eq: $employeeId }
clockon: { _is_null: false }
jobid: { _is_null: false }
query QUERY_ACTIVE_TIME_TICKETS($employeeId: uuid) {
timetickets(
order_by: { date: desc_nulls_first }
where: {
_and: {
clockoff: { _is_null: true }
employeeid: { _eq: $employeeId }
clockon: { _is_null: false }
jobid: { _is_null: false }
}
}
) {
id
clockon
memo
cost_center
flat_rate
jobid
commited_by
committed_at
job {
id
ownr_fn
ownr_ln
ownr_co_nm
v_model_desc
v_make_desc
v_model_yr
ro_number
}
}
}
) {
id
clockon
memo
cost_center
flat_rate
jobid
commited_by
committed_at
job {
id
ownr_fn
ownr_ln
ownr_co_nm
v_model_desc
v_make_desc
v_model_yr
ro_number
}
}
}
`;
export const QUERY_ACTIVE_SHIFT_TIME_TICKETS = gql`
query QUERY_ACTIVE_SHIFT_TIME_TICKETS($employeeId: uuid) {
timetickets(
where: {
_and: {
clockoff: { _is_null: true }
employeeid: { _eq: $employeeId }
clockon: { _is_null: false }
jobid: { _is_null: true }
query QUERY_ACTIVE_SHIFT_TIME_TICKETS($employeeId: uuid) {
timetickets(
where: {
_and: {
clockoff: { _is_null: true }
employeeid: { _eq: $employeeId }
clockon: { _is_null: false }
jobid: { _is_null: true }
}
}
) {
id
clockon
memo
jobid
job {
id
ownr_fn
ownr_ln
ownr_co_nm
v_model_desc
v_make_desc
v_model_yr
ro_number
}
}
}
) {
id
clockon
memo
jobid
job {
id
ownr_fn
ownr_ln
ownr_co_nm
v_model_desc
v_make_desc
v_model_yr
ro_number
}
}
}
`;
export const DELETE_TIME_TICKET = gql`
mutation DELETE_TIME_TICKET($id: uuid!) {
delete_timetickets_by_pk(id: $id) {
id
mutation DELETE_TIME_TICKET($id: uuid!) {
delete_timetickets_by_pk(id: $id) {
id
}
}
}
`;

View File

@@ -1,98 +1,98 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_ALL_TT_APPROVALS_PAGINATED = gql`
query QUERY_ALL_TT_APPROVALS_PAGINATED(
$offset: Int
$limit: Int
$order: [tt_approval_queue_order_by!]!
) {
tt_approval_queue(
offset: $offset
limit: $limit
order_by: $order
where: { approved_at: { _is_null: true } }
query QUERY_ALL_TT_APPROVALS_PAGINATED(
$offset: Int
$limit: Int
$order: [tt_approval_queue_order_by!]!
) {
id
jobid
bodyshopid
employeeid
employee {
first_name
last_name
id
}
job {
ro_number
status
id
}
employeeid
actualhrs
productivehrs
ciecacode
cost_center
date
rate
tt_approval_queue(
offset: $offset
limit: $limit
order_by: $order
where: { approved_at: { _is_null: true } }
) {
id
jobid
bodyshopid
employeeid
employee {
first_name
last_name
id
}
job {
ro_number
status
id
}
employeeid
actualhrs
productivehrs
ciecacode
cost_center
date
rate
}
tt_approval_queue_aggregate {
aggregate {
count(distinct: true)
}
}
}
tt_approval_queue_aggregate {
aggregate {
count(distinct: true)
}
}
}
`;
export const INSERT_NEW_TT_APPROVALS = gql`
mutation INSERT_NEW_TT_APPROVALS(
$timeTicketInput: [tt_approval_queue_insert_input!]!
) {
insert_tt_approval_queue(objects: $timeTicketInput) {
returning {
id
employeeid
productivehrs
actualhrs
ciecacode
date
memo
flat_rate
}
mutation INSERT_NEW_TT_APPROVALS(
$timeTicketInput: [tt_approval_queue_insert_input!]!
) {
insert_tt_approval_queue(objects: $timeTicketInput) {
returning {
id
employeeid
productivehrs
actualhrs
ciecacode
date
memo
flat_rate
}
}
}
}
`;
export const QUERY_TT_APPROVALS_BY_IDS = gql`
query QUERY_TT_APPROVALS_BY_IDS($ids: [uuid!]!) {
tt_approval_queue(where: { id: { _in: $ids } }) {
id
productivehrs
actualhrs
rate
memo
jobid
flat_rate
employeeid
date
ciecacode
bodyshopid
cost_center
query QUERY_TT_APPROVALS_BY_IDS($ids: [uuid!]!) {
tt_approval_queue(where: { id: { _in: $ids } }) {
id
productivehrs
actualhrs
rate
memo
jobid
flat_rate
employeeid
date
ciecacode
bodyshopid
cost_center
}
}
}
`;
export const UPDATE_TT_BY_APPROVAL = gql`
mutation UPDATE_TT_BY_APPROVAL(
$ttApprovalUpdates: [tt_approval_queue_updates!]!
) {
update_tt_approval_queue_many(updates: $ttApprovalUpdates) {
returning {
id
approved_at
approved_by
timeticket {
id
mutation UPDATE_TT_BY_APPROVAL(
$ttApprovalUpdates: [tt_approval_queue_updates!]!
) {
update_tt_approval_queue_many(updates: $ttApprovalUpdates) {
returning {
id
approved_at
approved_by
timeticket {
id
}
}
}
}
}
}
`;

View File

@@ -1,101 +1,101 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_SHOP_ASSOCIATIONS = gql`
query QUERY_SHOP_ASSOCIATIONS($shopid: uuid!) {
associations(where: { shopid: { _eq: $shopid } }) {
id
authlevel
shopid
user {
email
}
query QUERY_SHOP_ASSOCIATIONS($shopid: uuid!) {
associations(where: { shopid: { _eq: $shopid } }) {
id
authlevel
shopid
user {
email
}
}
}
}
`;
export const UPDATE_ASSOCIATION = gql`
mutation UPDATE_ASSOCIATION(
$assocId: uuid!
$assoc: associations_set_input!
) {
update_associations(where: { id: { _eq: $assocId } }, _set: $assoc) {
returning {
id
authlevel
shopid
user {
email
mutation UPDATE_ASSOCIATION(
$assocId: uuid!
$assoc: associations_set_input!
) {
update_associations(where: { id: { _eq: $assocId } }, _set: $assoc) {
returning {
id
authlevel
shopid
user {
email
}
}
}
}
}
}
`;
export const INSERT_EULA_ACCEPTANCE = gql`
mutation INSERT_EULA_ACCEPTANCE($eulaAcceptance:eula_acceptances_insert_input!) {
insert_eula_acceptances_one(object: $eulaAcceptance){
id
mutation INSERT_EULA_ACCEPTANCE($eulaAcceptance:eula_acceptances_insert_input!) {
insert_eula_acceptances_one(object: $eulaAcceptance){
id
}
}
}
`;
export const UPSERT_USER = gql`
mutation UPSERT_USER($authEmail: String!, $authToken: String!) {
insert_users(
objects: [{ email: $authEmail, authid: $authToken }]
on_conflict: { constraint: users_pkey, update_columns: [authid] }
) {
returning {
authid
}
mutation UPSERT_USER($authEmail: String!, $authToken: String!) {
insert_users(
objects: [{ email: $authEmail, authid: $authToken }]
on_conflict: { constraint: users_pkey, update_columns: [authid] }
) {
returning {
authid
}
}
}
}
`;
export const UPDATE_DASHBOARD_LAYOUT = gql`
mutation UPDATE_DASHBOARD_LAYOUT($email: String!, $layout: jsonb!) {
update_users_by_pk(
pk_columns: { email: $email }
_set: { dashboardlayout: $layout }
) {
email
dashboardlayout
mutation UPDATE_DASHBOARD_LAYOUT($email: String!, $layout: jsonb!) {
update_users_by_pk(
pk_columns: { email: $email }
_set: { dashboardlayout: $layout }
) {
email
dashboardlayout
}
}
}
`;
export const UPDATE_FCM_TOKEN = gql`
mutation UPDATE_FCM_TOKEN($authEmail: String!, $token: jsonb!) {
update_users(
where: { email: { _eq: $authEmail } }
_append: { fcmtokens: $token }
) {
affected_rows
returning {
fcmtokens
}
mutation UPDATE_FCM_TOKEN($authEmail: String!, $token: jsonb!) {
update_users(
where: { email: { _eq: $authEmail } }
_append: { fcmtokens: $token }
) {
affected_rows
returning {
fcmtokens
}
}
}
}
`;
export const QUERY_KANBAN_SETTINGS = gql`
query QUERY_KANBAN_SETTINGS($email: String!) {
associations(
where: { _and: { useremail: { _eq: $email }, active: { _eq: true } } }
) {
id
kanban_settings
query QUERY_KANBAN_SETTINGS($email: String!) {
associations(
where: { _and: { useremail: { _eq: $email }, active: { _eq: true } } }
) {
id
kanban_settings
}
}
}
`;
export const UPDATE_KANBAN_SETTINGS = gql`
mutation UPDATE_KANBAN_SETTINGS($id: uuid!, $ks: jsonb) {
update_associations_by_pk(
pk_columns: { id: $id }
_set: { kanban_settings: $ks }
) {
id
kanban_settings
mutation UPDATE_KANBAN_SETTINGS($id: uuid!, $ks: jsonb) {
update_associations_by_pk(
pk_columns: { id: $id }
_set: { kanban_settings: $ks }
) {
id
kanban_settings
}
}
}
`;

View File

@@ -1,195 +1,195 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_VEHICLE_BY_ID = gql`
query QUERY_VEHICLE_BY_ID($id: uuid!) {
vehicles_by_pk(id: $id) {
created_at
db_v_code
id
plate_no
plate_st
v_vin
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_paint_codes
v_options
v_model_yr
v_model_desc
v_mldgcode
v_makecode
v_make_desc
v_engine
v_cond
v_color
v_bstyle
updated_at
trim_color
notes
jobs(order_by: { date_open: desc }) {
id
ro_number
ownr_fn
ownr_ln
owner {
id
query QUERY_VEHICLE_BY_ID($id: uuid!) {
vehicles_by_pk(id: $id) {
created_at
db_v_code
id
plate_no
plate_st
v_vin
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_paint_codes
v_options
v_model_yr
v_model_desc
v_mldgcode
v_makecode
v_make_desc
v_engine
v_cond
v_color
v_bstyle
updated_at
trim_color
notes
jobs(order_by: { date_open: desc }) {
id
ro_number
ownr_fn
ownr_ln
owner {
id
}
clm_no
status
clm_total
}
}
clm_no
status
clm_total
}
}
}
`;
export const UPDATE_VEHICLE = gql`
mutation UPDATE_VEHICLE($vehId: uuid!, $vehicle: vehicles_set_input!) {
update_vehicles(where: { id: { _eq: $vehId } }, _set: $vehicle) {
returning {
id
}
mutation UPDATE_VEHICLE($vehId: uuid!, $vehicle: vehicles_set_input!) {
update_vehicles(where: { id: { _eq: $vehId } }, _set: $vehicle) {
returning {
id
}
}
}
}
`;
export const DELETE_VEHICLE = gql`
mutation DELETE_VEHICLE($id: uuid!) {
delete_vehicles_by_pk(id: $id) {
id
mutation DELETE_VEHICLE($id: uuid!) {
delete_vehicles_by_pk(id: $id) {
id
}
}
}
`;
export const QUERY_ALL_VEHICLES = gql`
query QUERY_ALL_VEHICLES {
vehicles {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
query QUERY_ALL_VEHICLES {
vehicles {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
}
}
}
`;
export const QUERY_ALL_VEHICLES_PAGINATED = gql`
query QUERY_ALL_VEHICLES(
$search: String
$offset: Int
$limit: Int
$order: [vehicles_order_by!]!
) {
search_vehicles(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
query QUERY_ALL_VEHICLES(
$search: String
$offset: Int
$limit: Int
$order: [vehicles_order_by!]!
) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
search_vehicles(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
}
search_vehicles_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
search_vehicles_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;
export const SEARCH_VEHICLE_BY_VIN = gql`
query SEARCH_VEHICLE_BY_VIN($vin: String!) {
vehicles(where: { v_vin: { _ilike: $vin } }) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_paint_codes
v_options
v_mldgcode
v_makecode
v_engine
v_cond
trim_color
db_v_code
query SEARCH_VEHICLE_BY_VIN($vin: String!) {
vehicles(where: { v_vin: { _ilike: $vin } }) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_paint_codes
v_options
v_mldgcode
v_makecode
v_engine
v_cond
trim_color
db_v_code
}
}
}
`;
export const SEARCH_VEHICLES = gql`
query SEARCH_VEHICLES($search: String!) {
search_vehicles(args: { search: $search }) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_paint_codes
v_options
v_mldgcode
v_makecode
v_engine
v_cond
trim_color
db_v_code
query SEARCH_VEHICLES($search: String!) {
search_vehicles(args: { search: $search }) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_paint_codes
v_options
v_mldgcode
v_makecode
v_engine
v_cond
trim_color
db_v_code
}
}
}
`;
export const SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE = gql`
query SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
vehicles_by_pk(id: $id) {
id
v_vin
v_model_yr
v_make_desc
v_model_desc
query SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
vehicles_by_pk(id: $id) {
id
v_vin
v_model_yr
v_make_desc
v_model_desc
}
}
}
`;
export const SEARCH_VEHICLES_FOR_AUTOCOMPLETE = gql`
query SEARCH_VEHICLES_FOR_AUTOCOMPLETE($search: String) {
search_vehicles(args: { search: $search }, limit: 25) {
id
v_vin
v_model_yr
v_make_desc
v_model_desc
query SEARCH_VEHICLES_FOR_AUTOCOMPLETE($search: String) {
search_vehicles(args: { search: $search }, limit: 25) {
id
v_vin
v_model_yr
v_make_desc
v_model_desc
}
}
}
`;

View File

@@ -1,129 +1,129 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_VENDOR_BY_ID = gql`
query QUERY_VENDOR_BY_ID($id: uuid!) {
vendors_by_pk(id: $id) {
zip
street2
state
name
id
favorite
email
due_date
discount
country
cost_center
city
street1
active
phone
dmsid
query QUERY_VENDOR_BY_ID($id: uuid!) {
vendors_by_pk(id: $id) {
zip
street2
state
name
id
favorite
email
due_date
discount
country
cost_center
city
street1
active
phone
dmsid
}
}
}
`;
export const CHECK_VENDOR_NAME = gql`
query CHECK_VENDOR_NAME($name: String!) {
vendors_aggregate(where: { name: { _ilike: $name } }) {
aggregate {
count
}
nodes {
id
}
query CHECK_VENDOR_NAME($name: String!) {
vendors_aggregate(where: { name: { _ilike: $name } }) {
aggregate {
count
}
nodes {
id
}
}
}
}
`;
export const UPDATE_VENDOR = gql`
mutation UPDATE_VENDOR($id: uuid!, $vendor: vendors_set_input!) {
update_vendors(where: { id: { _eq: $id } }, _set: $vendor) {
returning {
id
}
mutation UPDATE_VENDOR($id: uuid!, $vendor: vendors_set_input!) {
update_vendors(where: { id: { _eq: $id } }, _set: $vendor) {
returning {
id
}
}
}
}
`;
export const QUERY_ALL_VENDORS = gql`
query QUERY_ALL_VENDORS {
vendors(order_by: { name: asc }) {
name
id
cost_center
city
phone
active
query QUERY_ALL_VENDORS {
vendors(order_by: { name: asc }) {
name
id
cost_center
city
phone
active
}
}
}
`;
export const INSERT_NEW_VENDOR = gql`
mutation INSERT_NEW_VENDOR($vendorInput: [vendors_insert_input!]!) {
insert_vendors(objects: $vendorInput) {
returning {
id
}
mutation INSERT_NEW_VENDOR($vendorInput: [vendors_insert_input!]!) {
insert_vendors(objects: $vendorInput) {
returning {
id
}
}
}
}
`;
export const DELETE_VENDOR = gql`
mutation DELETE_VENDOR($id: uuid!) {
delete_vendors(where: { id: { _eq: $id } }) {
returning {
id
}
mutation DELETE_VENDOR($id: uuid!) {
delete_vendors(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
}
`;
export const QUERY_ALL_VENDORS_FOR_ORDER = gql`
query QUERY_ALL_VENDORS_FOR_ORDER($jobId: uuid) {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
cost_center
id
favorite
discount
email
active
phone
query QUERY_ALL_VENDORS_FOR_ORDER($jobId: uuid) {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
cost_center
id
favorite
discount
email
active
phone
}
jobs(where: { id: { _eq: $jobId } }) {
v_make_desc
}
}
jobs(where: { id: { _eq: $jobId } }) {
v_make_desc
}
}
`;
export const SEARCH_VENDOR_AUTOCOMPLETE = gql`
query SEARCH_VENDOR_AUTOCOMPLETE {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
discount
id
cost_center
active
favorite
query SEARCH_VENDOR_AUTOCOMPLETE {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
discount
id
cost_center
active
favorite
}
}
}
`;
export const SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR = gql`
query SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
discount
id
cost_center
street1
street2
zip
country
city
email
state
active
query SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
discount
id
cost_center
street1
street2
zip
country
city
email
state
active
}
}
}
`;