IO-896 Fleet # Validation

This commit is contained in:
Patrick Fic
2021-04-13 14:12:41 -07:00
parent 94e59e7a65
commit 53ec5200e4
5 changed files with 178 additions and 17 deletions

View File

@@ -13,26 +13,45 @@ export const INSERT_NEW_COURTESY_CAR = gql`
`;
export const QUERY_AVAILABLE_CC = gql`
query QUERY_AVAILABLE_CC($today: date) {
courtesycars(where: {_or: [{serviceenddate: {_is_null: true}}, {serviceenddate: {_gt: $today}}], status: {_eq: "courtesycars.status.in"}}) {
color
dailycost
damage
fleetnumber
fuel
id
make
model
plate
status
year
dailycost
mileage
query QUERY_AVAILABLE_CC($today: date) {
courtesycars(
where: {
_or: [
{ serviceenddate: { _is_null: true } }
{ serviceenddate: { _gt: $today } }
]
status: { _eq: "courtesycars.status.in" }
}
) {
color
dailycost
damage
fleetnumber
fuel
id
make
model
plate
status
year
dailycost
mileage
}
}
}
`;
export const CHECK_CC_FLEET_NUMBER = gql`
query CHECK_VENDOR_NAME($name: String!) {
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
aggregate {
count
}
nodes {
id
}
}
}
`;
export const QUERY_ALL_CC = gql`
query QUERY_ALL_CC {
courtesycars {