fix: update letzshop API to use unified Order model properties

- Change message exceptions (MessageAttachmentException,
  InvalidConversationTypeException, InvalidRecipientTypeException)
  to extend BusinessLogicException instead of ValidationException
  which doesn't accept error_code parameter

- Update vendor letzshop API endpoints:
  - Change sync_status query param to status in list_orders()
  - Fix response mapping to use unified Order model properties
    (external_order_id, external_shipment_id, status, etc.)
  - Fix confirm_order() to get inventory unit IDs from order items
  - Fix set_tracking() to use external_shipment_id

- Add order_date to test fixtures (required NOT NULL field)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-22 23:13:00 +01:00
parent 6f8434f200
commit feca2e19fe
4 changed files with 86 additions and 45 deletions

View File

@@ -3,7 +3,7 @@
Messaging specific exceptions.
"""
from .base import BusinessLogicException, ResourceNotFoundException, ValidationException
from .base import BusinessLogicException, ResourceNotFoundException
class ConversationNotFoundException(ResourceNotFoundException):
@@ -41,7 +41,7 @@ class ConversationClosedException(BusinessLogicException):
)
class MessageAttachmentException(ValidationException):
class MessageAttachmentException(BusinessLogicException):
"""Raised when attachment validation fails."""
def __init__(self, message: str, details: dict | None = None):
@@ -63,7 +63,7 @@ class UnauthorizedConversationAccessException(BusinessLogicException):
)
class InvalidConversationTypeException(ValidationException):
class InvalidConversationTypeException(BusinessLogicException):
"""Raised when conversation type is not valid for the operation."""
def __init__(self, message: str, allowed_types: list[str] | None = None):
@@ -74,7 +74,7 @@ class InvalidConversationTypeException(ValidationException):
)
class InvalidRecipientTypeException(ValidationException):
class InvalidRecipientTypeException(BusinessLogicException):
"""Raised when recipient type doesn't match conversation type."""
def __init__(self, conversation_type: str, expected_recipient_type: str):