IO-1914 Schema for inventory and basic adding to inventory.
This commit is contained in:
49
client/src/graphql/inventory.queries.js
Normal file
49
client/src/graphql/inventory.queries.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import { gql } from "@apollo/client";
|
||||
|
||||
export const INSERT_INVENTORY_AND_CREDIT = gql`
|
||||
mutation INSERT_INVENTORY_AND_CREDIT(
|
||||
$inv: inventory_insert_input!
|
||||
$cm: bills_insert_input!
|
||||
) {
|
||||
insert_inventory_one(object: $inv) {
|
||||
id
|
||||
}
|
||||
insert_bills_one(object: $cm) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const UPDATE_INVENTORY_LINES = gql`
|
||||
mutation UPDATE_INVENTORY_LINES(
|
||||
$InventoryIds: [uuid!]!
|
||||
$consumedbybillid: uuid!
|
||||
) {
|
||||
update_inventory(
|
||||
where: { id: { _in: $InventoryIds } }
|
||||
_set: { consumedbybillid: $consumedbybillid }
|
||||
) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_OUTSTANDING_INVENTORY = gql`
|
||||
query QUERY_OUTSTANDING_INVENTORY {
|
||||
inventory(where: { consumedbybillid: { _is_null: true } }) {
|
||||
id
|
||||
actual_cost
|
||||
actual_price
|
||||
quantity
|
||||
billlineid
|
||||
line_desc
|
||||
billline {
|
||||
bill {
|
||||
invoice_number
|
||||
vendor {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user