diff --git a/CHANGELOG.md b/CHANGELOG.md index a41ea486..adaf4541 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to ### Added -- Implement `/statique` endpoints and models +- Defined `/statique` endpoints and models ### Changed diff --git a/src/api/qualicharge/api/v1/routers/statique.py b/src/api/qualicharge/api/v1/routers/statique.py index 01d2e611..fa51aa75 100644 --- a/src/api/qualicharge/api/v1/routers/statique.py +++ b/src/api/qualicharge/api/v1/routers/statique.py @@ -4,7 +4,7 @@ from typing import Annotated, List from annotated_types import Len -from fastapi import APIRouter, status +from fastapi import APIRouter, Path, status from pydantic import BaseModel, computed_field from qualicharge.conf import settings @@ -40,6 +40,39 @@ async def list() -> List[Statique]: return [] +@router.get("/{id_pdc_itinerance}") +async def read( + id_pdc_itinerance: Annotated[ + str, + Path( + description=( + "L'identifiant du point de recharge délivré selon les modalités " + "définies à l'article 10 du décret n° 2017-26 du 12 janvier 2017." + ), + ), + ], +) -> Statique: + """Read statique item (point de charge).""" + raise NotImplementedError + + +@router.put("/{id_pdc_itinerance}") +async def update( + id_pdc_itinerance: Annotated[ + str, + Path( + description=( + "L'identifiant du point de recharge délivré selon les modalités " + "définies à l'article 10 du décret n° 2017-26 du 12 janvier 2017." + ), + ), + ], + statique: Statique, +) -> Statique: + """Update statique item (point de charge).""" + raise NotImplementedError + + @router.post("/", status_code=status.HTTP_201_CREATED) async def create(statique: Statique) -> StatiqueItemsCreatedResponse: """Create a statique item."""