feat: implement scenario comparison validation and API endpoint with comprehensive unit tests
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
"""Domain-level exceptions for service and repository layers."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Sequence
|
||||
|
||||
|
||||
class EntityNotFoundError(Exception):
|
||||
"""Raised when a requested entity cannot be located."""
|
||||
@@ -7,3 +10,15 @@ class EntityNotFoundError(Exception):
|
||||
|
||||
class EntityConflictError(Exception):
|
||||
"""Raised when attempting to create or update an entity that violates uniqueness."""
|
||||
|
||||
|
||||
@dataclass(eq=False)
|
||||
class ScenarioValidationError(Exception):
|
||||
"""Raised when scenarios fail comparison validation rules."""
|
||||
|
||||
code: str
|
||||
message: str
|
||||
scenario_ids: Sequence[int] | None = None
|
||||
|
||||
def __str__(self) -> str: # pragma: no cover - mirrors message for logging
|
||||
return self.message
|
||||
|
||||
Reference in New Issue
Block a user