Skip to content
ct

Class

InventoryOperationRecord

Generated GDScript class reference for ItemVault.InventoryOperationRecord.

Status
Current
Version
v1.0
Updated
2026-07-31

Versioned, immutable record of a completed inventory operation. Captured at emission time so the record is frozen and does not depend on later mutation of inventory state. Every command that mutates or queries inventory produces one record on ItemVaultBus.inventory_operation_record.

Source: addons/item_vault/backend/inventory_operation_record.gd

Syntax

class InventoryOperationRecord extends RefCounted

Members

NameKindSummary
SCHEMA_VERSIONField
schema_versionPropertyCoarse terminal classification kept alongside the precise result code. `outcome` remains the canonical InventoryResultCode.Code. Schema version for forward/backward compatibility.
operation_idPropertyStable operation ID, monotonic within the backend's lifetime. Never reused within the same session.
session_idPropertyStable backend/session namespace. The numeric operation_id is only unique within this namespace; the pair remains unique across save/load restores.
operation_keyPropertyCollision-safe externally comparable operation identity.
command_typePropertyCommand type that produced this record (ADD_ITEM, REMOVE_ITEM, etc.).
item_idPropertyThe item identifier, when applicable.
quantityPropertyQuantity affected (added, removed, transferred, reserved, etc.).
source_container_idPropertySource container identifier, when applicable.
target_container_idPropertyTarget container identifier, when applicable.
currencyPropertyCurrency identifier for wallet operations.
outcomePropertyTyped outcome code (InventoryResultCode.Code).
outcome_kindPropertyCoarse outcome distinction for telemetry and retry handling.
failure_reasonPropertyTyped diagnostic reason independent of [member outcome].
deltaPropertyDetached typed state delta captured with the record.
messagePropertyHuman-readable detail for failures and diagnostics.
correlation_contextPropertyCaller-supplied opaque correlation context, echoed from the command.
overflow_quantityPropertyOverflow stack quantity when a partial operation could not fit everything. 0 = none.
item_instance_idPropertyStable item-instance identity, when the operation addresses one retained stack instance.
instance_idPropertyAlias matching the ItemStack/event field name.
stack_idPropertyConcrete stack boundary identity, distinct from an item-instance identity.
resource_idPropertyNamed retained resource, when the operation addresses one.
resource_deltaPropertySigned retained-resource delta, when applicable.
resource_old_amountPropertyRetained-resource amount before the operation, when applicable.
resource_new_amountPropertyRetained-resource amount after the operation, when applicable.
resource_reasonPropertyCaller/domain reason carried by a retained-resource operation.
rollback_quantityPropertyQuantity that was restored after a rolled-back mutation.
before_snapshotPropertySnapshot of the inventory before the operation (may be null for an unavailable inventory).
after_snapshotPropertySnapshot of the inventory after the operation (may be null for an unavailable inventory).
snapshotPropertyBackwards-compatible alias for the post-operation snapshot.
final_afterProperty
to_dictMethod