feat(infra): add repository implementations, mappers, FastAPI wiring, and technique indexes
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""Technique ORM model <-> domain entity mapper."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.domain.entities.technique import TechniqueEntity
|
||||
from app.domain.enums import TechniqueStatus
|
||||
|
||||
|
||||
class TechniqueMapper:
|
||||
"""Converts between SQLAlchemy Technique model and TechniqueEntity."""
|
||||
|
||||
@staticmethod
|
||||
def to_entity(model: object) -> TechniqueEntity:
|
||||
"""Convert an ORM Technique model to a domain TechniqueEntity."""
|
||||
return TechniqueEntity.from_orm(model)
|
||||
|
||||
@staticmethod
|
||||
def to_model_updates(entity: TechniqueEntity, model: object) -> None:
|
||||
"""Apply entity changes back onto an existing ORM model."""
|
||||
entity.apply_to(model)
|
||||
Reference in New Issue
Block a user