- the great reformat

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-06 18:20:58 -05:00
parent 30c530bcc4
commit e83badb454
912 changed files with 108516 additions and 107493 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,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
query QUERY_ALL_ACTIVE_APPOINTMENTS(

View File

@@ -1,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_ALL_ASSOCIATIONS = gql`
query QUERY_ALL_ASSOCIATIONS($email: String) {

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,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_AVAILABLE_JOBS = gql`
query QUERY_AVAILABLE_JOBS {

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,237 +1,237 @@
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
query QUERY_ALL_BILLS_PAGINATED(
$offset: Int
$limit: Int
$order: [bills_order_by!]!
) {
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(
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
}
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,330 +1,331 @@
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
use_paint_scale_data
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
use_paint_scale_data
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
employees {
id
first_name
active
last_name
employee_number
rates
user_email
external_id
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
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,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const UNREAD_CONVERSATION_COUNT = gql`
query UNREAD_CONVERSATION_COUNT {

View File

@@ -1,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_NEW_COURTESY_CAR = gql`
mutation INSERT_NEW_COURTESY_CAR(

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,146 +1,146 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_EMPLOYEES = gql`
query QUERY_EMPLOYEES {
employees(order_by: { employee_number: asc }) {
active
employee_number
first_name
flat_rate
id
last_name
query QUERY_EMPLOYEES {
employees(order_by: { employee_number: asc }) {
active
employee_number
first_name
flat_rate
id
last_name
}
}
}
`;
export const QUERY_EMPLOYEE_BY_ID = gql`
query QUERY_EMPLOYEE_BY_ID($id: uuid!) {
employees_by_pk(id: $id) {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
external_id
employee_vacations(order_by: { start: desc }) {
id
start
end
}
query QUERY_EMPLOYEE_BY_ID($id: uuid!) {
employees_by_pk(id: $id) {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
external_id
employee_vacations(order_by: { start: desc }) {
id
start
end
}
}
}
}
`;
export const CHECK_EMPLOYEE_NUMBER = gql`
query CHECK_EMPLOYEE_NUMBER($employeenumber: String!) {
employees_aggregate(
where: { employee_number: { _ilike: $employeenumber } }
) {
aggregate {
count
}
nodes {
id
}
query CHECK_EMPLOYEE_NUMBER($employeenumber: String!) {
employees_aggregate(
where: { employee_number: { _ilike: $employeenumber } }
) {
aggregate {
count
}
nodes {
id
}
}
}
}
`;
export const QUERY_ACTIVE_EMPLOYEES = gql`
query QUERY_ACTIVE_EMPLOYEES {
employees(where: { active: { _eq: true } }) {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
query QUERY_ACTIVE_EMPLOYEES {
employees(where: { active: { _eq: true } }) {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
}
}
}
`;
export const INSERT_EMPLOYEES = gql`
mutation INSERT_EMPLOYEES($employees: [employees_insert_input!]!) {
insert_employees(objects: $employees) {
returning {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
}
mutation INSERT_EMPLOYEES($employees: [employees_insert_input!]!) {
insert_employees(objects: $employees) {
returning {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
}
}
}
}
`;
export const UPDATE_EMPLOYEE = gql`
mutation UPDATE_EMPLOYEE($id: uuid!, $employee: employees_set_input) {
update_employees(where: { id: { _eq: $id } }, _set: $employee) {
returning {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
}
mutation UPDATE_EMPLOYEE($id: uuid!, $employee: employees_set_input) {
update_employees(where: { id: { _eq: $id } }, _set: $employee) {
returning {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
rates
pin
user_email
}
}
}
}
`;
export const DELETE_EMPLOYEE = gql`
mutation DELETE_EMPLOYEE($id: uuid!) {
delete_employees(where: { id: { _eq: $id } }) {
returning {
id
}
mutation DELETE_EMPLOYEE($id: uuid!) {
delete_employees(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
}
`;
export const QUERY_USERS_BY_EMAIL = gql`
query QUERY_USERS_BY_EMAIL($email: String!) {
users(where: { email: { _ilike: $email } }) {
email
query QUERY_USERS_BY_EMAIL($email: String!) {
users(where: { email: { _ilike: $email } }) {
email
}
}
}
`;
export const INSERT_VACATION = gql`
mutation INSERT_VACATION($vacation: employee_vacation_insert_input!) {
insert_employee_vacation_one(object: $vacation) {
id
start
end
mutation INSERT_VACATION($vacation: employee_vacation_insert_input!) {
insert_employee_vacation_one(object: $vacation) {
id
start
end
}
}
}
`;
export const DELETE_VACATION = gql`
mutation DELETE_VACATION($id: uuid!) {
delete_employee_vacation_by_pk(id: $id) {
id
mutation DELETE_VACATION($id: uuid!) {
delete_employee_vacation_by_pk(id: $id) {
id
}
}
}
`;

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,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_CONVERSATION_TAG = gql`
mutation INSERT_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {

View File

@@ -1,227 +1,227 @@
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
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
employee {
id
first_name
last_name
employee_number
}
productivehrs
}
}
`;
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
}
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
}
}
}
}
`;
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
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
}
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: "";
@@ -231,14 +231,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
@@ -246,35 +246,35 @@ 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
}
}
}
}
`;

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,4 +1,4 @@
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!]!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const INSERT_PAYMENT_RESPONSE = gql`
mutation INSERT_PAYMENT_RESPONSE(

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,4 +1,4 @@
import { gql } from "@apollo/client";
import {gql} from "@apollo/client";
export const QUERY_TICKETS_BY_JOBID = gql`
query QUERY_TICKETS_BY_JOBID($jobid: uuid!) {

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
}
}
}
`;