ReviewDecision domain model
This commit is contained in:
parent
5aa76af78c
commit
29e855e5b3
7 changed files with 130 additions and 0 deletions
|
|
@ -344,6 +344,38 @@ def get_analysis_run(
|
|||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get("/repos/{repository_id}/review-decisions")
|
||||
def list_repository_review_decisions(
|
||||
repository_id: int,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> list[dict[str, object]]:
|
||||
try:
|
||||
return [
|
||||
asdict(decision)
|
||||
for decision in service.list_review_decisions(repository_id)
|
||||
]
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get("/repos/{repository_id}/analysis-runs/{analysis_run_id}/review-decisions")
|
||||
def list_analysis_run_review_decisions(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> list[dict[str, object]]:
|
||||
try:
|
||||
return [
|
||||
asdict(decision)
|
||||
for decision in service.list_review_decisions(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
)
|
||||
]
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get("/repos/{repository_id}/observed-facts")
|
||||
def list_observed_facts(
|
||||
repository_id: int,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue