🎨 Reorganize back-end code
This commit is contained in:
31
backend/api/schemas/stop.py
Normal file
31
backend/api/schemas/stop.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from idfm_interface import StopAreaType
|
||||
|
||||
|
||||
class Stop(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
town: str
|
||||
epsg3857_x: float
|
||||
epsg3857_y: float
|
||||
lines: list[int]
|
||||
|
||||
|
||||
class StopArea(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
town: str
|
||||
type: StopAreaType
|
||||
lines: list[int] # SNCF lines are linked to stop areas and not stops.
|
||||
stops: list[Stop]
|
||||
|
||||
|
||||
Point = tuple[float, float]
|
||||
|
||||
|
||||
class StopShape(BaseModel):
|
||||
id: int
|
||||
type: int
|
||||
epsg3857_bbox: list[Point]
|
||||
epsg3857_points: list[Point]
|
Reference in New Issue
Block a user