119 lines
1.9 KiB
JavaScript
119 lines
1.9 KiB
JavaScript
import gql from "graphql-tag";
|
|
|
|
export const INSERT_NEW_COURTESY_CAR = gql`
|
|
mutation INSERT_NEW_COURTESY_CAR(
|
|
$courtesycar: [courtesycars_insert_input!]!
|
|
) {
|
|
insert_courtesycars(objects: $courtesycar) {
|
|
returning {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const QUERY_AVAILABLE_CC = gql`
|
|
query QUERY_AVAILABLE_CC {
|
|
courtesycars(where: { serviceenddate: { _is_null: true } }) {
|
|
color
|
|
dailycost
|
|
damage
|
|
fleetnumber
|
|
fuel
|
|
id
|
|
make
|
|
model
|
|
plate
|
|
status
|
|
year
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const QUERY_ALL_CC = gql`
|
|
query QUERY_ALL_CC {
|
|
courtesycars {
|
|
color
|
|
created_at
|
|
dailycost
|
|
damage
|
|
fleetnumber
|
|
fuel
|
|
id
|
|
insuranceexpires
|
|
leaseenddate
|
|
make
|
|
model
|
|
nextservicedate
|
|
nextservicekm
|
|
notes
|
|
plate
|
|
purchasedate
|
|
registrationexpires
|
|
serviceenddate
|
|
servicestartdate
|
|
status
|
|
vin
|
|
year
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const QUERY_CC_BY_PK = gql`
|
|
query QUERY_CC_BY_PK($id: uuid!) {
|
|
courtesycars_by_pk(id: $id) {
|
|
bodyshopid
|
|
color
|
|
created_at
|
|
dailycost
|
|
damage
|
|
fleetnumber
|
|
fuel
|
|
id
|
|
insuranceexpires
|
|
leaseenddate
|
|
make
|
|
model
|
|
nextservicedate
|
|
nextservicekm
|
|
notes
|
|
plate
|
|
purchasedate
|
|
registrationexpires
|
|
serviceenddate
|
|
servicestartdate
|
|
status
|
|
vin
|
|
year
|
|
cccontracts {
|
|
id
|
|
status
|
|
start
|
|
scheduledreturn
|
|
kmstart
|
|
kmend
|
|
driver_ln
|
|
driver_fn
|
|
job {
|
|
ro_number
|
|
est_number
|
|
ownr_ln
|
|
ownr_fn
|
|
ownr_co_nm
|
|
id
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const UPDATE_CC = gql`
|
|
mutation UPDATE_CC($ccId: uuid!, $cc: courtesycars_set_input!) {
|
|
update_courtesycars(where: { id: { _eq: $ccId } }, _set: $cc) {
|
|
returning {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
`;
|