InventoryItemConsumedPayload inventory.item.consumed@1
Generated at from
openvibe-contracts v0.127.0 and
openvibe-sdk v0.37.0.
- Version
- 1.0.0
- Owner
- inventory
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-054
- Schema
https://openvibe.network/contracts/events/payloads/inventory.item.consumed.v1.json
inventory.item.consumed v1 (OpenVibe.Inventory, ADR-054). An issuer consumed an instance (a one-use item used up). Envelope: subject { type: user, id: owner }, visibility subject.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
instance_id | string | yes |
| |
definition_id | string | yes |
| |
owner | string | yes |
| |
issuer | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: example
{
"instance_id": "inv_01JZ00000000000000000001NV",
"definition_id": "itd_01JZ00000000000000000001TD",
"owner": "usr_01JZ0000000000000000000AAA",
"issuer": "service:games"
}Rejected: missing-field
{
"definition_id": "itd_01JZ00000000000000000001TD",
"owner": "usr_01JZ0000000000000000000AAA",
"issuer": "service:games"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('inventory.item.consumed@1', value); // { valid, errors: [{ path, message }] }