Skip to content

Commit

Permalink
✨(api) add create and update endpoints for statique objects
Browse files Browse the repository at this point in the history
We are only designing the API for now. Implemetation will come later.
  • Loading branch information
jmaupetit committed Apr 11, 2024
1 parent 5535550 commit df22da0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to

### Added

- Implement `/statique` endpoints and models
- Defined `/statique` endpoints and models

### Changed

Expand Down
35 changes: 34 additions & 1 deletion src/api/qualicharge/api/v1/routers/statique.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit df22da0

Please sign in to comment.