IO-2206 WIP Time Ticket Approval Queue.

This commit is contained in:
Patrick Fic
2023-04-21 11:23:48 -07:00
parent d4d10998f8
commit ad9868b575
13 changed files with 804 additions and 21 deletions

View File

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