Implemented with Repository Protocol pattern for offline fork support: - CollectionService with PostgresCollectionRepository - DeckService with PostgresDeckRepository - DeckValidator with DeckConfig + CardService injection - Starter deck definitions (5 types: grass, fire, water, psychic, lightning) - Pydantic schemas for collection and deck APIs - Unit tests for DeckValidator (32 tests passing) Architecture follows pure dependency injection - no service locator patterns. Added CLAUDE.md documenting DI requirements and patterns. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
817 B
Python
28 lines
817 B
Python
"""PostgreSQL repository implementations for Mantimon TCG.
|
|
|
|
This package contains PostgreSQL-specific implementations of the repository
|
|
protocols. These implementations use SQLAlchemy async sessions for database
|
|
access.
|
|
|
|
Usage:
|
|
from app.repositories.postgres import (
|
|
PostgresCollectionRepository,
|
|
PostgresDeckRepository,
|
|
)
|
|
|
|
# Create repository with database session
|
|
collection_repo = PostgresCollectionRepository(db_session)
|
|
deck_repo = PostgresDeckRepository(db_session)
|
|
|
|
# Use via service layer
|
|
service = CollectionService(collection_repo)
|
|
"""
|
|
|
|
from app.repositories.postgres.collection import PostgresCollectionRepository
|
|
from app.repositories.postgres.deck import PostgresDeckRepository
|
|
|
|
__all__ = [
|
|
"PostgresCollectionRepository",
|
|
"PostgresDeckRepository",
|
|
]
|