feat(infra): add repository implementations, mappers, FastAPI wiring, and technique indexes

This commit is contained in:
2026-02-18 19:10:50 +01:00
parent 5c55e7c17f
commit 1521005b62
9 changed files with 618 additions and 0 deletions

View File

@@ -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)