feature/IO-3000-messaging-sockets-migrations2 -
- testing and edge cases Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -1515,7 +1515,8 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
||||
}`;
|
||||
//TODO:AIO The above query used to have parts order lines in it. Validate that this doesn't need it.
|
||||
|
||||
exports.QUERY_JOB_COSTING_DETAILS = ` query QUERY_JOB_COSTING_DETAILS($id: uuid!) {
|
||||
exports.QUERY_JOB_COSTING_DETAILS = `
|
||||
query QUERY_JOB_COSTING_DETAILS($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
ro_number
|
||||
clm_total
|
||||
@@ -2566,68 +2567,9 @@ exports.GET_JOBS_BY_PKS = `query GET_JOBS_BY_PKS($ids: [uuid!]!) {
|
||||
}
|
||||
`;
|
||||
|
||||
exports.GET_CONVERSATIONS = `query GET_CONVERSATIONS($bodyshopId: uuid!) {
|
||||
conversations(
|
||||
where: { bodyshopid: { _eq: $bodyshopId }, archived: { _eq: false } },
|
||||
order_by: { updated_at: desc },
|
||||
limit: 50
|
||||
) {
|
||||
phone_num
|
||||
id
|
||||
updated_at
|
||||
unreadcnt
|
||||
archived
|
||||
label
|
||||
messages_aggregate(where: { read: { _eq: false }, isoutbound: { _eq: false } }) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
}
|
||||
job_conversations {
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
exports.MARK_MESSAGES_AS_READ = `mutation MARK_MESSAGES_AS_READ($conversationId: uuid!) {
|
||||
update_messages(where: { conversationid: { _eq: $conversationId } }, _set: { read: true }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
exports.GET_CONVERSATION_DETAILS = `
|
||||
query GET_CONVERSATION_DETAILS($conversationId: uuid!) {
|
||||
conversation: conversations_by_pk(id: $conversationId) {
|
||||
id
|
||||
phone_num
|
||||
updated_at
|
||||
label
|
||||
job_conversations {
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
}
|
||||
}
|
||||
messages: messages(where: { conversationid: { _eq: $conversationId } }, order_by: { created_at: asc }) {
|
||||
id
|
||||
text
|
||||
created_at
|
||||
read
|
||||
isoutbound
|
||||
userid
|
||||
image_path
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user