feat: add jobs CRUD API with manual execution

- Full CRUD for backup jobs
- Manual job trigger endpoint with background execution
- Schedule creation endpoint
- Tests for job creation, update, execution, and 404 cases
This commit is contained in:
2026-05-11 21:12:01 +02:00
parent 810aae1b6e
commit 1f1ed72494
3 changed files with 210 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from fastapi import FastAPI
from contextlib import asynccontextmanager
from app.database import engine, Base
from app.routers import sources, jobs
@asynccontextmanager
async def lifespan(app: FastAPI):
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
yield
app = FastAPI(title="Backup Tool API", lifespan=lifespan)
app.include_router(sources.router)
app.include_router(jobs.router)