Implement and refactor AI ATS backend features in Python FastAPI with PostgreSQL, SQLAlchemy/SQLModel, DTO-first Pydantic responses, strict typing, dependency injection, modular service architecture, standardized error handling, and project-structure compliance. Use when adding endpoints, schemas, services, DB models, migrations, Celery flows, Gemini integrations, vector search, or production backend cleanup.
Deliver production-grade backend changes for this AI ATS codebase using clean architecture, strict type safety, modular services, and stable API contracts.
.github/copilot-instructions.md before making any implementation decision.Depends(get_db)), never direct DB session imports in routers.app/routers (do not migrate to app/api/endpoints unless explicitly requested).models/: persistence shape only.schemas/: input/output DTOs and validation only.services/: business logic and external integrations only.response_model=... and return schema DTOs, not ORM entities../assets/response-envelope-dto.template.py as the default starting point for envelope DTOs.model_validate, typed fields, clear schema contracts).Create, Update, Response, paginated list envelopes when needed), starting from ./assets/response-envelope-dto.template.py.summary, description, tags, and response_model.model_validate().metadata.create_all).BaseAppException.{ "error": "ErrorCode", "message": "User-friendly message", "details": {} }try/except blocks.except Exception blocks entirely.Apply strict weighted grading logic:
score, reasoning, missing_skills.For resume processing workers:
asyncio.gather() or equivalent sub-tasks)../assets/response-envelope-dto.template.py.except Exception blocks were introduced.app/routers) unless explicitly asked otherwise.