- Removed 11 duplicate router files (auth.py, users.py, decks.py, card_router.py, interactions.py, user_data.py, rooms.py, games/router.py, refresh.py, card_import.py, ws.py) - Removed duplicate core files (logging_config.py, settings.py) - Removed unused services (card_mirror_service.py, mtgjson_loader.py, mtgjson_uploader.py) - Removed unused schemas (proto_messages.py, protocol_constants.py) - Created run.py startup script for simple execution - Created app/core/config.py for unified configuration management - Created app/core/logging.py for logging configuration - Consolidated routers into 6 focused files (auth_router.py, users_router.py, decks_router.py, cards_router.py, user_data_router.py, games_router.py) - Updated all imports to use consolidated model paths - Added backward compatibility aliases in database.py - Created SIMPLIFICATION_SUMMARY.md documentation Architecture improvements: - Single unified database engine with auto-detection (SQLite/PostgreSQL) - Consolidated models into 2 files (models.py, mtg_models.py) - Clean router structure with one file per domain - Simplified configuration with sensible defaults - SQLite by default for development, PostgreSQL for production Testing: - All imports verified working - App loads successfully - Ready for development and testing
132 lines
6.6 KiB
Python
132 lines
6.6 KiB
Python
"""Schemas package initialization."""
|
|
from app.schemas.schemas import (
|
|
LoginRequest, LoginResponse, RefreshTokenRequest, TokenResponse,
|
|
UserBase, UserCreate, UserUpdate, UserResponse,
|
|
DeckCreate, DeckUpdate, DeckResponse,
|
|
FolderCreate, FolderResponse,
|
|
GameCreate, GameResponse,
|
|
RoomResponse,
|
|
BanCreate, BanResponse,
|
|
ErrorResponse, ValidationErrorResponse,
|
|
PaginationParams, PaginatedResponse,
|
|
CardMirrorResponse, DeckCardLinkResponse, DeckWithCardsResponse,
|
|
)
|
|
from app.schemas.user_data_schemas import (
|
|
DeckVersionStatus, GameReplayStatus, GameOutcomeType,
|
|
GroupMemberRole, NetworkMemberRole, UserPreferenceTheme, ActivityType,
|
|
SessionResponse, SessionCleanupResponse,
|
|
DeckVersionCreate, DeckVersionUpdate, DeckVersionResponse, DeckVersionListResponse,
|
|
GameReplayCreate, GameReplayUpdate, GameReplayResponse, GameReplayListResponse,
|
|
GameOutcomeCreate, GameOutcomeResponse, GameOutcomeListResponse,
|
|
UserStatisticsResponse, StatisticsUpdateResponse,
|
|
GroupCreate, GroupUpdate, GroupMemberCreate, GroupMemberUpdate, GroupMemberRemove,
|
|
GroupResponse, GroupListResponse, GroupChatMessageCreate, GroupChatMessageResponse, GroupChatMessageListResponse,
|
|
NetworkCreate, NetworkUpdate, NetworkMemberCreate,
|
|
NetworkResponse, NetworkListResponse,
|
|
UserPreferenceUpdate, UserPreferenceResponse,
|
|
ActivityLogEntry, ActivityLogListResponse,
|
|
MessageResponse, CountResponse, ErrorDetail,
|
|
)
|
|
from app.schemas.user_card_collection import (
|
|
CardCondition, AcquisitionMethod,
|
|
CardCollectionCreate, CardCollectionUpdate, CardCollectionResponse, CardCollectionListResponse,
|
|
WishlistCreate, WishlistUpdate, WishlistResponse, WishlistListResponse,
|
|
CollectionStatistics, CollectionSummaryResponse,
|
|
)
|
|
from app.schemas.user_deck_schemas import (
|
|
DeckStatus, DeckZone, SuggestionType,
|
|
UserDeckCreate, UserDeckUpdate, UserDeckResponse, UserDeckListResponse,
|
|
DeckCardCreate, DeckCardUpdate, DeckCardResponse, DeckCardWithDetailsResponse, DeckCardListResponse,
|
|
PrecedentCreate, PrecedentUpdate, PrecedentResponse, PrecedentListResponse,
|
|
SuggestionCreate, SuggestionResponse, SuggestionListResponse,
|
|
DeckFinalizeRequest, DeckFinalizeResponse, DeckDeleteResponse,
|
|
CardSearchRequest,
|
|
)
|
|
from app.schemas.card_import_schemas import (
|
|
CardImportRequest, CardImportResponse as CardImportResponseV2, CardImportStatusResponse as CardImportStatusResponseV2,
|
|
CardMatchResult as CardMatchResultV2, CardImportSummary as CardImportSummaryV2,
|
|
CardImportBatchCreate, CardImportBatchResponse,
|
|
UserCardImportCreate, UserCardImportResponse, UserCardImportRecordResponse,
|
|
)
|
|
from app.schemas.card_search_schemas import (
|
|
CardResponse, SetResponse, CardTypeResponse,
|
|
CardSearchResponse as CardSearchResponseV2,
|
|
CardImportResponse as CardImportResponseV3,
|
|
CardImportStatusResponse as CardImportStatusResponseV3,
|
|
CardMatchResult as CardMatchResultV3,
|
|
CardImportSummary as CardImportSummaryV3,
|
|
)
|
|
from app.schemas.game_schemas import (
|
|
GameCreate as GameCreateV2, GameResponse as GameResponseV2, GameJoinRequest, GameLeaveRequest,
|
|
GameListResponse, GamePlayerResponse, GameStateResponse,
|
|
)
|
|
from app.schemas.mtg_card_schemas import (
|
|
MtgCardResponse, MtgCardSearchRequest, MtgCardSearchResponse,
|
|
MtgSetResponse, MtgCardMirrorResponse,
|
|
DeckCardLinkResponse as DeckCardLinkResponseV2, DeckWithCardsResponse as DeckWithCardsResponseV2,
|
|
)
|
|
|
|
__all__ = [
|
|
# Auth
|
|
"LoginRequest", "LoginResponse", "RefreshTokenRequest", "TokenResponse",
|
|
# User
|
|
"UserBase", "UserCreate", "UserUpdate", "UserResponse",
|
|
# Deck
|
|
"DeckCreate", "DeckUpdate", "DeckResponse",
|
|
"FolderCreate", "FolderResponse",
|
|
# Game
|
|
"GameCreate", "GameResponse", "RoomResponse",
|
|
"GameJoinRequest", "GameLeaveRequest", "GameListResponse", "GamePlayerResponse", "GameStateResponse",
|
|
# Ban
|
|
"BanCreate", "BanResponse",
|
|
# Error
|
|
"ErrorResponse", "ValidationErrorResponse",
|
|
# Pagination
|
|
"PaginationParams", "PaginatedResponse",
|
|
# Card Mirror
|
|
"CardMirrorResponse", "DeckCardLinkResponse", "DeckWithCardsResponse",
|
|
# User Data
|
|
"DeckVersionStatus", "GameReplayStatus", "GameOutcomeType",
|
|
"GroupMemberRole", "NetworkMemberRole", "UserPreferenceTheme", "ActivityType",
|
|
"SessionResponse", "SessionCleanupResponse",
|
|
"DeckVersionCreate", "DeckVersionUpdate", "DeckVersionResponse", "DeckVersionListResponse",
|
|
"GameReplayCreate", "GameReplayUpdate", "GameReplayResponse", "GameReplayListResponse",
|
|
"GameOutcomeCreate", "GameOutcomeResponse", "GameOutcomeListResponse",
|
|
"UserStatisticsResponse", "StatisticsUpdateResponse",
|
|
"GroupCreate", "GroupUpdate", "GroupMemberCreate", "GroupMemberUpdate", "GroupMemberRemove",
|
|
"GroupResponse", "GroupListResponse", "GroupChatMessageCreate", "GroupChatMessageResponse", "GroupChatMessageListResponse",
|
|
"NetworkCreate", "NetworkUpdate", "NetworkMemberCreate",
|
|
"NetworkResponse", "NetworkListResponse",
|
|
"UserPreferenceUpdate", "UserPreferenceResponse",
|
|
"ActivityLogEntry", "ActivityLogListResponse",
|
|
"MessageResponse", "CountResponse", "ErrorDetail",
|
|
# Card Collection
|
|
"CardCondition", "AcquisitionMethod",
|
|
"CardCollectionCreate", "CardCollectionUpdate", "CardCollectionResponse", "CardCollectionListResponse",
|
|
"WishlistCreate", "WishlistUpdate", "WishlistResponse", "WishlistListResponse",
|
|
"CollectionStatistics", "CollectionSummaryResponse",
|
|
# User Deck
|
|
"DeckStatus", "DeckZone", "SuggestionType",
|
|
"UserDeckCreate", "UserDeckUpdate", "UserDeckResponse", "UserDeckListResponse",
|
|
"DeckCardCreate", "DeckCardUpdate", "DeckCardResponse", "DeckCardWithDetailsResponse", "DeckCardListResponse",
|
|
"PrecedentCreate", "PrecedentUpdate", "PrecedentResponse", "PrecedentListResponse",
|
|
"SuggestionCreate", "SuggestionResponse", "SuggestionListResponse",
|
|
"DeckFinalizeRequest", "DeckFinalizeResponse", "DeckDeleteResponse",
|
|
"CardSearchRequest", "CardSearchResponse",
|
|
# Card Import
|
|
"CardImportRequest", "CardImportResponseV2", "CardImportStatusResponseV2",
|
|
"CardMatchResultV2", "CardImportSummaryV2",
|
|
"CardImportBatchCreate", "CardImportBatchResponse",
|
|
"UserCardImportCreate", "UserCardImportResponse", "UserCardImportRecordResponse",
|
|
# Card Search
|
|
"CardResponse", "SetResponse", "CardTypeResponse",
|
|
"CardSearchResponseV2", "CardImportResponseV3", "CardImportStatusResponseV3",
|
|
"CardMatchResultV3", "CardImportSummaryV3",
|
|
# Game Schemas
|
|
"GameCreateV2", "GameResponseV2",
|
|
# MTG Card Schemas
|
|
"MtgCardResponse", "MtgCardSearchRequest", "MtgCardSearchResponse",
|
|
"MtgSetResponse", "MtgCardMirrorResponse",
|
|
"DeckCardLinkResponseV2", "DeckWithCardsResponseV2",
|
|
]
|