|
|
|
|
@@ -1,12 +1,16 @@
|
|
|
|
|
exports.FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID = `
|
|
|
|
|
query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID($mssid: String!, $phone: String!) {
|
|
|
|
|
query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID(
|
|
|
|
|
$mssid: String!
|
|
|
|
|
$phone: String!
|
|
|
|
|
) {
|
|
|
|
|
bodyshops(where: { messagingservicesid: { _eq: $mssid } }) {
|
|
|
|
|
id
|
|
|
|
|
conversations(where: { phone_num: { _eq: $phone } }) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_JOB_BY_RO_NUMBER = `
|
|
|
|
|
query GET_JOB_BY_RO_NUMBER($ro_number: String!) {
|
|
|
|
|
@@ -16,7 +20,8 @@ exports.GET_JOB_BY_RO_NUMBER = `
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_NEW_PAYMENT = `
|
|
|
|
|
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
|
|
|
|
|
@@ -25,23 +30,28 @@ exports.INSERT_NEW_PAYMENT = `
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_PAYMENT_RESPONSE = `
|
|
|
|
|
mutation INSERT_PAYMENT_RESPONSE($paymentResponse: [payment_response_insert_input!]!) {
|
|
|
|
|
mutation INSERT_PAYMENT_RESPONSE(
|
|
|
|
|
$paymentResponse: [payment_response_insert_input!]!
|
|
|
|
|
) {
|
|
|
|
|
insert_payment_response(objects: $paymentResponse) {
|
|
|
|
|
returning {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UNARCHIVE_CONVERSATION = `
|
|
|
|
|
mutation UNARCHIVE_CONVERSATION($id: uuid!) {
|
|
|
|
|
update_conversations_by_pk(pk_columns: {id: $id}, _set: {archived: false}) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_NEW_JOB_LINE = `
|
|
|
|
|
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
|
|
|
|
|
@@ -50,7 +60,8 @@ exports.INSERT_NEW_JOB_LINE = `
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UPDATE_JOB_LINE = `
|
|
|
|
|
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
|
|
|
|
|
@@ -71,7 +82,8 @@ exports.UPDATE_JOB_LINE = `
|
|
|
|
|
removed
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.RECEIVE_MESSAGE = `
|
|
|
|
|
mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
|
|
|
|
@@ -80,7 +92,7 @@ mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
|
|
|
|
conversation {
|
|
|
|
|
id
|
|
|
|
|
archived
|
|
|
|
|
bodyshop {
|
|
|
|
|
bodyshop{
|
|
|
|
|
imexshopid
|
|
|
|
|
}
|
|
|
|
|
created_at
|
|
|
|
|
@@ -102,7 +114,10 @@ mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
|
|
|
|
userid
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_MESSAGE = `
|
|
|
|
|
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) {
|
|
|
|
|
@@ -115,7 +130,7 @@ mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!)
|
|
|
|
|
conversation {
|
|
|
|
|
id
|
|
|
|
|
archived
|
|
|
|
|
bodyshop {
|
|
|
|
|
bodyshop{
|
|
|
|
|
imexshopid
|
|
|
|
|
}
|
|
|
|
|
created_at
|
|
|
|
|
@@ -137,7 +152,10 @@ mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!)
|
|
|
|
|
userid
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UPDATE_MESSAGE_STATUS = `
|
|
|
|
|
mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) {
|
|
|
|
|
@@ -146,7 +164,8 @@ mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_JOBS_FOR_RECEIVABLES_EXPORT = `
|
|
|
|
|
query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
|
|
|
|
@@ -209,7 +228,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
|
|
|
|
owner {
|
|
|
|
|
accountingid
|
|
|
|
|
}
|
|
|
|
|
joblines(where:{removed: {_eq:false}}) {
|
|
|
|
|
joblines(where:{removed: {_eq:false}}) {
|
|
|
|
|
id
|
|
|
|
|
line_desc
|
|
|
|
|
part_type
|
|
|
|
|
@@ -238,7 +257,8 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
|
|
|
|
timezone
|
|
|
|
|
md_ro_statuses
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_JOBS_FOR_CDK_EXPORT = `
|
|
|
|
|
query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
|
|
|
|
@@ -298,19 +318,19 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
|
|
|
|
v_make_desc
|
|
|
|
|
v_color
|
|
|
|
|
ca_customer_gst
|
|
|
|
|
bodyshop {
|
|
|
|
|
id
|
|
|
|
|
md_ro_statuses
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
accountingconfig
|
|
|
|
|
cdk_dealerid
|
|
|
|
|
cdk_configuration
|
|
|
|
|
timezone
|
|
|
|
|
}
|
|
|
|
|
bodyshop {
|
|
|
|
|
id
|
|
|
|
|
md_ro_statuses
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
accountingconfig
|
|
|
|
|
cdk_dealerid
|
|
|
|
|
cdk_configuration
|
|
|
|
|
timezone
|
|
|
|
|
}
|
|
|
|
|
owner {
|
|
|
|
|
accountingid
|
|
|
|
|
}
|
|
|
|
|
joblines(where:{removed: {_eq:false}}) {
|
|
|
|
|
joblines(where:{removed: {_eq:false}}) {
|
|
|
|
|
id
|
|
|
|
|
line_desc
|
|
|
|
|
part_type
|
|
|
|
|
@@ -325,7 +345,9 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
|
|
|
|
prt_dsmk_p
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_JOBS_FOR_PBS_EXPORT = `
|
|
|
|
|
query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
|
|
|
|
@@ -388,24 +410,24 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
|
|
|
|
v_make_desc
|
|
|
|
|
v_color
|
|
|
|
|
ca_customer_gst
|
|
|
|
|
vehicle {
|
|
|
|
|
vehicle{
|
|
|
|
|
v_trimcode
|
|
|
|
|
v_makecode
|
|
|
|
|
}
|
|
|
|
|
bodyshop {
|
|
|
|
|
id
|
|
|
|
|
md_ro_statuses
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
accountingconfig
|
|
|
|
|
pbs_serialnumber
|
|
|
|
|
pbs_configuration
|
|
|
|
|
timezone
|
|
|
|
|
}
|
|
|
|
|
bodyshop {
|
|
|
|
|
id
|
|
|
|
|
md_ro_statuses
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
accountingconfig
|
|
|
|
|
pbs_serialnumber
|
|
|
|
|
pbs_configuration
|
|
|
|
|
timezone
|
|
|
|
|
}
|
|
|
|
|
owner {
|
|
|
|
|
id
|
|
|
|
|
accountingid
|
|
|
|
|
}
|
|
|
|
|
joblines(where:{removed: {_eq:false}}) {
|
|
|
|
|
joblines(where:{removed: {_eq:false}}) {
|
|
|
|
|
id
|
|
|
|
|
line_desc
|
|
|
|
|
part_type
|
|
|
|
|
@@ -422,7 +444,9 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
|
|
|
|
line_ref
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_BILLS_FOR_PAYABLES_EXPORT = `
|
|
|
|
|
query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
|
|
|
|
@@ -466,17 +490,18 @@ query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
|
|
|
|
due_date
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|
|
|
|
query QUERY_PAYMENTS_FOR_EXPORT($payments: [uuid!]!) {
|
|
|
|
|
bodyshops(where: {associations: {active: {_eq: true}}}) {
|
|
|
|
|
id
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
accountingconfig
|
|
|
|
|
timezone
|
|
|
|
|
md_ins_cos
|
|
|
|
|
}
|
|
|
|
|
query QUERY_PAYMENTS_FOR_EXPORT($payments: [uuid!]!)
|
|
|
|
|
{ bodyshops(where: {associations: {active: {_eq: true}}}) {
|
|
|
|
|
id
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
accountingconfig
|
|
|
|
|
timezone
|
|
|
|
|
md_ins_cos
|
|
|
|
|
}
|
|
|
|
|
payments(where: {id: {_in: $payments}}) {
|
|
|
|
|
id
|
|
|
|
|
created_at
|
|
|
|
|
@@ -484,14 +509,15 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|
|
|
|
job {
|
|
|
|
|
id
|
|
|
|
|
ro_number
|
|
|
|
|
ownerid
|
|
|
|
|
ownr_ln
|
|
|
|
|
ownr_fn
|
|
|
|
|
ownr_addr1
|
|
|
|
|
ownr_addr2
|
|
|
|
|
ownr_zip
|
|
|
|
|
ownr_city
|
|
|
|
|
ownr_st
|
|
|
|
|
ownerid
|
|
|
|
|
ownr_ln
|
|
|
|
|
ownr_fn
|
|
|
|
|
ownr_addr1
|
|
|
|
|
ownr_addr2
|
|
|
|
|
ownr_zip
|
|
|
|
|
ownr_city
|
|
|
|
|
ownr_st
|
|
|
|
|
|
|
|
|
|
ins_co_nm
|
|
|
|
|
owner{
|
|
|
|
|
accountingid
|
|
|
|
|
@@ -499,7 +525,7 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|
|
|
|
ownr_fn
|
|
|
|
|
ownr_ln
|
|
|
|
|
ownr_co_nm
|
|
|
|
|
bodyshop {
|
|
|
|
|
bodyshop{
|
|
|
|
|
accountingconfig
|
|
|
|
|
md_responsibility_centers
|
|
|
|
|
md_ins_cos
|
|
|
|
|
@@ -516,7 +542,8 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|
|
|
|
paymentnum
|
|
|
|
|
date
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: timestamptz!, $jobId: uuid!) {
|
|
|
|
|
jobs_by_pk(id: $jobId) {
|
|
|
|
|
@@ -616,7 +643,8 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) {
|
|
|
|
|
employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) {
|
|
|
|
|
@@ -807,7 +835,8 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
|
|
|
|
totalliquidcost
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodyshopid: uuid!, $end: timestamptz) {
|
|
|
|
|
bodyshops_by_pk(id: $bodyshopid){
|
|
|
|
|
@@ -979,7 +1008,8 @@ exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodysh
|
|
|
|
|
totalliquidcost
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.ENTEGRAL_EXPORT = `
|
|
|
|
|
query ENTEGRAL_EXPORT($bodyshopid: uuid!) {
|
|
|
|
|
@@ -1068,7 +1098,8 @@ query ENTEGRAL_EXPORT($bodyshopid: uuid!) {
|
|
|
|
|
cieca_ttl
|
|
|
|
|
adjustment_bottom_line
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UPDATE_JOB = `
|
|
|
|
|
mutation UPDATE_JOB($jobId: uuid!, $job: jobs_set_input!) {
|
|
|
|
|
@@ -1083,7 +1114,8 @@ exports.UPDATE_JOB = `
|
|
|
|
|
lbr_adjustments
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
|
|
|
|
jobs_by_pk(id: $id) {
|
|
|
|
|
@@ -1095,7 +1127,7 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
|
|
|
|
kmout
|
|
|
|
|
comment
|
|
|
|
|
referral_source
|
|
|
|
|
referral_source_extra
|
|
|
|
|
referral_source_extra
|
|
|
|
|
unit_number
|
|
|
|
|
po_number
|
|
|
|
|
special_coverage_policy
|
|
|
|
|
@@ -1131,10 +1163,10 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
|
|
|
|
est_ct_fn
|
|
|
|
|
shopid
|
|
|
|
|
est_ct_ln
|
|
|
|
|
vehicle {
|
|
|
|
|
id
|
|
|
|
|
notes
|
|
|
|
|
}
|
|
|
|
|
vehicle{
|
|
|
|
|
id
|
|
|
|
|
notes
|
|
|
|
|
}
|
|
|
|
|
est_ph1
|
|
|
|
|
est_ea
|
|
|
|
|
selling_dealer
|
|
|
|
|
@@ -1494,17 +1526,19 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT
|
|
|
|
|
use_paint_scale_data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_IOEVENT = ` mutation INSERT_IOEVENT($event: ioevents_insert_input!) {
|
|
|
|
|
insert_ioevents_one(object: $event) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
|
|
|
|
bodyshops(where: {autohouseid: {_is_null: false}, _or: {autohouseid: {_neq: ""}}}){
|
|
|
|
|
id
|
|
|
|
|
bodyshops(where: {autohouseid: {_is_null: false}}){
|
|
|
|
|
id
|
|
|
|
|
shopname
|
|
|
|
|
address1
|
|
|
|
|
city
|
|
|
|
|
@@ -1520,10 +1554,11 @@ exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
|
|
|
|
imexshopid
|
|
|
|
|
timezone
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS {
|
|
|
|
|
bodyshops(where: {claimscorpid: {_is_null: false}, _or: {claimscorpid: {_neq: ""}}}){
|
|
|
|
|
bodyshops(where: {claimscorpid: {_is_null: false}}){
|
|
|
|
|
id
|
|
|
|
|
shopname
|
|
|
|
|
address1
|
|
|
|
|
@@ -1540,11 +1575,12 @@ exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS {
|
|
|
|
|
imexshopid
|
|
|
|
|
timezone
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
|
|
|
|
bodyshops(where: {entegral_id: {_is_null: false}, _or: {entegral_id: {_neq: ""}}}){
|
|
|
|
|
id
|
|
|
|
|
bodyshops(where: {entegral_id: {_is_null: false}}){
|
|
|
|
|
id
|
|
|
|
|
shopname
|
|
|
|
|
address1
|
|
|
|
|
city
|
|
|
|
|
@@ -1560,19 +1596,22 @@ exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
|
|
|
|
timezone
|
|
|
|
|
features
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.DELETE_ALL_DMS_VEHICLES = `mutation DELETE_ALL_DMS_VEHICLES{
|
|
|
|
|
delete_dms_vehicles(where: {}) {
|
|
|
|
|
affected_rows
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
exports.INSERT_DMS_VEHICLES = `mutation INSERT_DMS_VEHICLES($vehicles: [dms_vehicles_insert_input!]!) {
|
|
|
|
|
insert_dms_vehicles(objects: $vehicles) {
|
|
|
|
|
affected_rows
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
|
|
|
|
jobs_by_pk(id: $id) {
|
|
|
|
|
@@ -1689,7 +1728,8 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
|
|
|
|
unq_seq
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.GET_QBO_AUTH = `query GET_QBO_AUTH($email: String!) {
|
|
|
|
|
associations(where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
|
|
|
|
@@ -1703,13 +1743,15 @@ exports.SET_QBO_AUTH_WITH_REALM = `mutation SET_QBO_AUTH($email: String!, $qbo_a
|
|
|
|
|
update_associations(_set: {qbo_auth: $qbo_auth, qbo_realmId: $qbo_realmId}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
|
|
|
|
affected_rows
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.SET_QBO_AUTH = `mutation SET_QBO_AUTH($email: String!, $qbo_auth: jsonb!) {
|
|
|
|
|
update_associations(_set: {qbo_auth: $qbo_auth}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
|
|
|
|
affected_rows
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.MARK_JOB_EXPORTED = `
|
|
|
|
|
mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog_insert_input!, $bill: bills_set_input!) {
|
|
|
|
|
@@ -1728,9 +1770,10 @@ mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
update_bills(where:{jobid:{_eq :$jobId}}, _set:$bill){
|
|
|
|
|
affected_rows
|
|
|
|
|
affected_rows
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.MARK_BILLS_EXPORTED = `
|
|
|
|
|
mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
|
|
|
|
|
@@ -1742,25 +1785,28 @@ mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [expor
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
insert_exportlog(objects: $logs) {
|
|
|
|
|
returning{
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
returning{
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_EXPORT_LOG = `
|
|
|
|
|
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
|
|
|
|
|
insert_exportlog_one(object: $log) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_EXISTING_TRANSITION = `
|
|
|
|
|
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
|
|
|
|
|
insert_exportlog_one(object: $log) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UPDATE_OLD_TRANSITION = `mutation UPDATE_OLD_TRANSITION($jobid: uuid!, $existingTransition: transitions_set_input!){
|
|
|
|
|
update_transitions(where:{jobid:{_eq:$jobid}, end:{_is_null:true
|
|
|
|
|
@@ -1784,7 +1830,9 @@ exports.INSERT_NEW_TRANSITION = `mutation INSERT_NEW_TRANSITION($newTransition:
|
|
|
|
|
update_transitions(where: {id: {_eq: $oldTransitionId}}, _set: {duration: $duration}) {
|
|
|
|
|
affected_rows
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]!) {
|
|
|
|
|
jobs(where: {ro_number: {_in: $roNumbers}}) {
|
|
|
|
|
@@ -1794,7 +1842,9 @@ exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QBO_MARK_JOB_EXPORTED = `
|
|
|
|
|
mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exportlog_insert_input!]!) {
|
|
|
|
|
@@ -1807,8 +1857,9 @@ mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exp
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
exports.QBO_MARK_BILL_EXPORTED = `
|
|
|
|
|
mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
|
|
|
|
|
insert_exportlog(objects: $logs) {
|
|
|
|
|
@@ -1819,7 +1870,9 @@ mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs:
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QBO_MARK_PAYMENT_EXPORTED = `
|
|
|
|
|
mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_input!, $logs: [exportlog_insert_input!]!) {
|
|
|
|
|
@@ -1834,17 +1887,19 @@ mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_inp
|
|
|
|
|
}`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_EXPORT_LOG = `
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.INSERT_EMAIL_AUDIT = `mutation INSERT_EMAIL_AUDIT($email: email_audit_trail_insert_input!) {
|
|
|
|
|
insert_email_audit_trail_one(object: $email) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.DELETE_MEDIA_DOCUMENTS = `
|
|
|
|
|
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
|
|
|
|
@@ -1853,7 +1908,8 @@ mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UPDATE_EMAIL_AUDIT = `
|
|
|
|
|
mutation ($sesid: String!, $status: String, $context: jsonb) {
|
|
|
|
|
@@ -1905,7 +1961,8 @@ query GET_PBS_AP_ALLOCATIONS($billids: [uuid!]) {
|
|
|
|
|
quantity
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) {
|
|
|
|
|
jobs_by_pk(id: $id) {
|
|
|
|
|
@@ -1919,7 +1976,8 @@ exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) {
|
|
|
|
|
critical
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports.UPDATE_PARTS_CRITICAL = `mutation UPDATE_PARTS_CRITICAL ($IdsToMarkCritical:[uuid!]!, $jobid: uuid!){
|
|
|
|
|
critical: update_joblines(where:{id:{_in:$IdsToMarkCritical}}, _set:{critical: true}){
|
|
|
|
|
@@ -1935,4 +1993,5 @@ exports.ACTIVE_SHOP_BY_USER = `query ACTIVE_SHOP_BY_USER($user: String) {
|
|
|
|
|
id
|
|
|
|
|
shopid
|
|
|
|
|
}
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|