Add inventory domain foundation
This commit is contained in:
1 parent
d4df20b740
commit
d1d02962da
8 files changed
+1135
No files matched your search
@@ -0,0 +1,25 @@
|
||||
"""Inventory domain exceptions."""
|
||||
|
||||
|
||||
class InventoryError(Exception):
|
||||
"""Base exception for inventory operations."""
|
||||
|
||||
|
||||
class InventoryValidationError(InventoryError):
|
||||
"""Raised when an inventory business rule is violated."""
|
||||
|
||||
|
||||
class DuplicateAssetID(InventoryError):
|
||||
"""Raised when an Asset ID is already assigned to another miner."""
|
||||
|
||||
def __init__(self, asset_id: str):
|
||||
self.asset_id = asset_id
|
||||
super().__init__(f"Asset ID already exists: {asset_id}")
|
||||
|
||||
|
||||
class MinerNotFound(InventoryError):
|
||||
"""Raised when an inventory miner cannot be found."""
|
||||
|
||||
def __init__(self, miner_id: object):
|
||||
self.miner_id = miner_id
|
||||
super().__init__(f"Miner not found: {miner_id}")
|
||||
Reference in new issue
Block a user