Table updates for new appointments fields. Schedule modal baseline functionality. Refactor schedule components to be more reusable.

This commit is contained in:
Patrick Fic
2020-02-06 13:39:39 -08:00
parent 1a14fb8da6
commit fae1e8cdeb
35 changed files with 785 additions and 67 deletions

View File

@@ -1,8 +1,8 @@
import { gql } from "apollo-boost";
export const QUERY_ALL_APPOINTMENTS = gql`
query QUERY_ALL_APPOINTMENTS {
appointments {
export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
query QUERY_ALL_ACTIVE_APPOINTMENTS {
appointments(where: { canceled: { _eq: false } }) {
start
id
end
@@ -35,3 +35,42 @@ export const INSERT_APPOINTMENT = gql`
}
}
`;
export const QUERY_APPOINTMENT_BY_DATE = gql`
query QUERY_APPOINTMENT_BY_DATE($start: timestamptz, $end: timestamptz) {
appointments(where: { start: { _lte: $end, _gte: $start } }) {
start
id
end
job {
ro_number
ownr_ln
ownr_fn
ownr_ph1
ownr_ea
clm_total
id
clm_no
vehicle {
id
v_model_yr
v_make_desc
v_model_desc
}
}
}
}
`;
export const CANCEL_APPOINTMENT_BY_ID = gql`
mutation CANCEL_APPOINTMENT_BY_ID($appid: uuid!) {
update_appointments(
where: { id: { _eq: $appid } }
_set: { canceled: true }
) {
returning {
id
}
}
}
`;