Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor WellCompletions back-end code #317

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/src/backend/primary/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from .routers.correlations.router import router as correlations_router
from .routers.grid.router import router as grid_router
from .routers.pvt.router import router as pvt_router
from .routers.well_completion.router import router as well_completion_router
from .routers.well_completions.router import router as well_completions_router
from .routers.well.router import router as well_router
from .routers.surface_polygons.router import router as surface_polygons_router

Expand Down Expand Up @@ -53,7 +53,7 @@ def custom_generate_unique_id(route: APIRoute) -> str:
app.include_router(correlations_router, prefix="/correlations", tags=["correlations"])
app.include_router(grid_router, prefix="/grid", tags=["grid"])
app.include_router(pvt_router, prefix="/pvt", tags=["pvt"])
app.include_router(well_completion_router, prefix="/well_completion", tags=["well_completion"])
app.include_router(well_completions_router, prefix="/well_completions", tags=["well_completions"])
app.include_router(well_router, prefix="/well", tags=["well"])
app.include_router(surface_polygons_router, prefix="/surface_polygons", tags=["surface_polygons"])

Expand Down
30 changes: 0 additions & 30 deletions backend/src/backend/primary/routers/well_completion/router.py

This file was deleted.

This file was deleted.

29 changes: 29 additions & 0 deletions backend/src/backend/primary/routers/well_completions/router.py
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 backend/src/services/sumo_access/well_completion_access.py

This file was deleted.

Loading