"""Technique ORM model <-> domain entity mapper."""

# Enable future language features for compatibility
from __future__ import annotations

# Import TechniqueEntity from app.domain.entities.technique
from app.domain.entities.technique import TechniqueEntity


# Define class TechniqueMapper
class TechniqueMapper:
    """Converts between SQLAlchemy Technique model and TechniqueEntity."""

    # Apply the @staticmethod decorator
    @staticmethod
    # Define function to_entity
    def to_entity(model: object) -> TechniqueEntity:
        """Convert an ORM Technique model to a domain TechniqueEntity."""
        # Return TechniqueEntity.from_orm(model)
        return TechniqueEntity.from_orm(model)

    # Apply the @staticmethod decorator
    @staticmethod
    # Define function to_model_updates
    def to_model_updates(entity: TechniqueEntity, model: object) -> None:
        """Apply entity changes back onto an existing ORM model."""
        # Call entity.apply_to()
        entity.apply_to(model)
