Open sbocconi opened 2 years ago
Is it normal that accountingQuantity and onhandQuantity are null?
No, at least accountingQuantity on a resource should be a quantity, even if it is zero something. But if I am following correctly, you are using raise
with toResourceInventoriedAs
? If so, the problem could be that raise
(and most event actions) assume resourceInventoriedAs
. Just a guess.
Hi @fosterlynn, thank you for your reply.
I use toResourceInventoriedAs
because resourceInventoriedAs
returns null
(or maybe I am using it wrongly).
This call
mutation($event:EconomicEventCreateParams!, $newInventoriedResource:EconomicResourceCreateParams) {
createEconomicEvent(event:$event, newInventoriedResource:$newInventoriedResource) {
economicEvent {
id
provider {
id
name
note
}
resourceQuantity {
hasNumericalValue
hasUnit {
label
symbol
}
}
toResourceInventoriedAs {
id
name
onhandQuantity {
hasNumericalValue
hasUnit {
label
symbol
}
}
accountingQuantity {
hasNumericalValue
hasUnit {
label
symbol
}
}
}
resourceInventoriedAs {
id
name
onhandQuantity {
hasNumericalValue
hasUnit {
label
symbol
}
}
accountingQuantity {
hasNumericalValue
hasUnit {
label
symbol
}
}
}
}
}
}
with variables:
{
"event": {
"note": "update event",
"action": "raise",
"provider": "01FP094V38QGMK08N6VEM8HREN",
"receiver": "01FP094V38QGMK08N6VEM8HREN",
"resourceInventoriedAs": "http://cleanlease.nl/zs/6663",
"resourceQuantity": {
"hasUnit": "01FRTRG75V5WDG8GQ8A81MJ8D5",
"hasNumericalValue": 1
}
},
"newInventoriedResource": {
"name": "Gown"
}
}
returns the following:
{
"data": {
"createEconomicEvent": {
"economicEvent": {
"id": "01FS6SP3TCNC9VWXZJJTB3HV8E",
"provider": {
"id": "01FP094V38QGMK08N6VEM8HREN",
"name": "AGENT_OLVG",
"note": "Simulation Agent"
},
"resourceInventoriedAs": null,
"resourceQuantity": {
"hasNumericalValue": 1,
"hasUnit": {
"label": "u_piece",
"symbol": "om2:one"
}
},
"toResourceInventoriedAs": {
"accountingQuantity": null,
"id": "01FS6SP3SC1QFS3GK7GMG3Q9P5",
"name": "Gown",
"onhandQuantity": null
}
}
}
}
}
so resourceInventoriedAs
is just null. I guess this is not the expected behaviour.
with variables;
I get the following output:
Is it normal that accountingQuantity and onhandQuantity are
null
?