📦 Results¶
Result contracts for inventory operations.
This folder defines the result-first outcome model used by inventory mutations. It does not perform operations itself.
🎯 Purpose¶
Provide a consistent way to represent the outcome of inventory operations.
These contracts allow callers to determine whether an operation succeeded, failed, or partially applied.
🧩 What Lives Here¶
InvOpResult¶
A lightweight operation result containing:
- Success
- Code
- Message
Returned by mutation APIs instead of exceptions or boolean flags.
InvOpCode¶
The inventory operation outcome enum.
Represents reasons for success or failure, including:
- Ok
- InvalidArgs
- OutOfRange
- Empty
- NoSpace
- NotEnoughQuantity
- NotFound
- FilterMismatch
- SwapBlocked
- Partial
- NoAuthority
⚠️ Important Notes¶
- These types define result semantics only
- They do not perform mutation logic
- They should be treated as the canonical outcome contract for inventory operations
🧠 Usage Guidance¶
Exact success¶
Success is true only when the operation completed as requested.
Partial results¶
InvOpCode.Partial uses Success = false by design.
Callers should inspect both Success and Code when partial outcomes matter.
Message usage¶
Message provides optional human-readable context.
Use InvOpCode for programmatic logic.
🚫 Not for Production Use¶
This folder does not:
- Perform mutation logic
- Enforce authority
- Define UI formatting or localisation
- Guarantee messages are present
- Guarantee consistent wording across systems