refactor: replace SessionDep with explicit Annotated[Session, Depends(get_session)] across all routers

- Replace SessionDep type alias with explicit Annotated[Session, Depends(get_session)]
- Add missing imports for Session, Annotated, and Depends types
- Update all endpoint function signatures to use explicit dependency annotation
- Remove redundant `= Depends()` default values from session parameters
- Update docstrings and comments to reference new annotation pattern
- Apply changes consistently across all router
This commit is contained in:
oib
2026-03-07 15:45:11 +01:00
parent 93aae0edb3
commit 89e161c906
75 changed files with 371 additions and 372 deletions

View File

@@ -172,17 +172,19 @@ def details(ctx, gpu_id: str):
@gpu.command()
@click.argument("gpu_id")
@click.option("--hours", type=float, required=True, help="Rental duration in hours")
@click.option("--duration", type=float, required=True, help="Rental duration in hours")
@click.option("--total-cost", type=float, required=True, help="Total cost")
@click.option("--job-id", help="Job ID to associate with rental")
@click.pass_context
def book(ctx, gpu_id: str, hours: float, job_id: Optional[str]):
def book(ctx, gpu_id: str, duration: float, total_cost: float, job_id: Optional[str]):
"""Book a GPU"""
config = ctx.obj['config']
try:
booking_data = {
"gpu_id": gpu_id,
"duration_hours": hours
"duration_hours": duration,
"total_cost": total_cost
}
if job_id:
booking_data["job_id"] = job_id