Updated contract creation to include auto status changes. BOD-314
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
import gql from "graphql-tag";
|
||||
|
||||
export const INSERT_NEW_CONTRACT = gql`
|
||||
mutation INSERT_NEW_CONTRACT($contract: [cccontracts_insert_input!]!) {
|
||||
mutation INSERT_NEW_CONTRACT(
|
||||
$contract: [cccontracts_insert_input!]!
|
||||
$ccId: uuid!
|
||||
) {
|
||||
insert_cccontracts(objects: $contract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
update_courtesycars_by_pk(
|
||||
pk_columns: { id: $ccId }
|
||||
_set: { status: "courtesycars.status.out" }
|
||||
) {
|
||||
status
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -14,7 +14,12 @@ export const INSERT_NEW_COURTESY_CAR = gql`
|
||||
|
||||
export const QUERY_AVAILABLE_CC = gql`
|
||||
query QUERY_AVAILABLE_CC {
|
||||
courtesycars(where: { serviceenddate: { _is_null: true } }) {
|
||||
courtesycars(
|
||||
where: {
|
||||
serviceenddate: { _is_null: true }
|
||||
status: { _eq: "courtesycars.status.in" }
|
||||
}
|
||||
) {
|
||||
color
|
||||
dailycost
|
||||
damage
|
||||
@@ -26,6 +31,8 @@ export const QUERY_AVAILABLE_CC = gql`
|
||||
plate
|
||||
status
|
||||
year
|
||||
dailycost
|
||||
mileage
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -96,7 +103,9 @@ export const QUERY_CC_BY_PK = gql`
|
||||
status
|
||||
vin
|
||||
year
|
||||
mileage
|
||||
cccontracts {
|
||||
agreementnumber
|
||||
id
|
||||
status
|
||||
start
|
||||
|
||||
Reference in New Issue
Block a user