You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
843 B
Python

from typing import Dict, List, Optional
from fastapi import APIRouter, HTTPException, status
from fastapi.params import Query
from src.database.core import DbSession
from src.models import StandardResponse
from .service import get_all_budget_constrains
router = APIRouter()
@router.get("/{session_id}", response_model=StandardResponse[Dict])
async def get_target_reliability(
db_session: DbSession,
session_id: str,
cost_threshold: float = Query(100),
):
"""Get all scope pagination."""
results, consequesce = await get_all_budget_constrains(
db_session=db_session, session_id=session_id, cost_threshold=cost_threshold
)
return StandardResponse(
data={
"results": results,
"consequence": consequesce
},
message="Data retrieved successfully",
)