feat: add card import feature with fuzzy matching

- Add UserCardImport model (stores imported card names as JSON)
- Create card_import_schemas.py with request/response models
- Create card_import.py router with import/get/delete endpoints
- Add Alembic migration 004 (user_card_imports table)
- Fuzzy matching for card name matching (60% threshold)
- Integration with deckbuilding via imported cards
- Endpoints: GET /api/v1/card-import/status, POST /, DELETE /, GET /summary
This commit is contained in:
2026-07-24 04:47:42 +00:00
parent c23f88cd41
commit 867b7a9c37
9 changed files with 436 additions and 3 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ from fastapi.middleware.cors import CORSMiddleware
from app.core.settings import get_settings
from app.core.database import engine, mtg_engine, async_session, mtg_async_session
from app.routers import auth, users, decks, rooms, games, admin, card_router, interactions, refresh, user_data
from app.routers import auth, users, decks, rooms, games, admin, card_router, interactions, refresh, user_data, card_import
from app.services.mtgjson_manager import MTGJSONManager
@@ -141,7 +141,7 @@ app.include_router(card_router.router, prefix="/api", tags=["MTG Cards"])
app.include_router(interactions.router, tags=["Card Interactions"])
app.include_router(refresh.router)
app.include_router(user_data.router, prefix="/api/v1/user-data", tags=["User Data"])
app.include_router(card_import.router, prefix="/api/v1/card-import", tags=["Card Import"])
@app.get("/health", tags=["Health"])
async def health_check():