IO-1612 Add employee vacation tracking.

This commit is contained in:
Patrick Fic
2022-01-05 11:45:37 -08:00
parent 6457acc61e
commit 50926547b3
17 changed files with 678 additions and 199 deletions

View File

@@ -4,7 +4,21 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
query QUERY_ALL_ACTIVE_APPOINTMENTS(
$start: timestamptz!
$end: timestamptz!
$startd: date!
$endd: date!
) {
employee_vacation(
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
) {
id
start
end
employee {
id
last_name
first_name
}
}
appointments(
where: {
canceled: { _eq: false }
@@ -109,7 +123,24 @@ export const INSERT_APPOINTMENT = gql`
`;
export const QUERY_APPOINTMENT_BY_DATE = gql`
query QUERY_APPOINTMENT_BY_DATE($start: timestamptz, $end: timestamptz) {
query QUERY_APPOINTMENT_BY_DATE(
$start: timestamptz
$end: timestamptz
$startd: date!
$endd: date!
) {
employee_vacation(
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
) {
id
start
end
employee {
id
last_name
first_name
}
}
appointments(
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
) {