-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor WellCompletions back-end code (#317)
- Loading branch information
1 parent
dc926f5
commit 4a83790
Showing
29 changed files
with
447 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
backend/src/backend/primary/routers/well_completion/router.py
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
backend/src/backend/primary/routers/well_completion/schemas.py
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
backend/src/backend/primary/routers/well_completions/router.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import Optional | ||
|
||
from fastapi import APIRouter, Depends, HTTPException, Query | ||
|
||
from src.backend.auth.auth_helper import AuthHelper | ||
from src.services.utils.authenticated_user import AuthenticatedUser | ||
|
||
from src.services.sumo_access.well_completions_access import WellCompletionsAccess | ||
from src.services.sumo_access.well_completions_types import WellCompletionsData | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get("/well_completions_data/") | ||
def get_well_completions_data( | ||
# fmt:off | ||
authenticated_user: AuthenticatedUser = Depends(AuthHelper.get_authenticated_user), | ||
case_uuid: str = Query(description="Sumo case uuid"), | ||
ensemble_name: str = Query(description="Ensemble name"), | ||
realization: Optional[int] = Query(None, description="Optional realization to include. If not specified, all realizations will be returned."), | ||
# fmt:on | ||
) -> WellCompletionsData: | ||
access = WellCompletionsAccess(authenticated_user.get_sumo_access_token(), case_uuid, ensemble_name) | ||
well_completions_data = access.get_well_completions_data(realization=realization) | ||
|
||
if not well_completions_data: | ||
raise HTTPException(status_code=404, detail="Well completions data not found") | ||
|
||
return well_completions_data |
70 changes: 0 additions & 70 deletions
70
backend/src/services/sumo_access/well_completion_access.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.