cleaned up backend to use classes and yaml files

This commit is contained in:
2024-07-20 23:16:35 +02:00
parent 14a7f555df
commit 94fa735d54
9 changed files with 1300 additions and 935 deletions

View File

@@ -8,7 +8,7 @@ class Landmark(BaseModel) :
# Properties of the landmark
name : str
type: Literal['sightseeing', 'nature', 'shopping']
type: Literal['sightseeing', 'nature', 'shopping', 'start', 'finish']
location : tuple
osm_type : str
osm_id : int
@@ -22,8 +22,8 @@ class Landmark(BaseModel) :
uuid: str = Field(default_factory=uuid4) # TODO implement this ASAP
# Additional properties depending on specific tour
must_do : bool
must_avoid : bool
must_do : Optional[bool] = False
must_avoid : Optional[bool] = False
is_secondary : Optional[bool] = False # TODO future
time_to_reach_next : Optional[int] = 0 # TODO fix this in existing code

View File

@@ -3,7 +3,7 @@ from typing import Optional, Literal
class Preference(BaseModel) :
name: str
type: Literal['sightseeing', 'nature', 'shopping']
type: Literal['sightseeing', 'nature', 'shopping', 'start', 'finish']
score: int # score could be from 1 to 5
# Input for optimization