added more structure
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 3m29s
Run linting on the backend code / Build (pull_request) Successful in 27s
Run testing on the backend code / Build (pull_request) Failing after 12m29s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 34s

This commit is contained in:
2025-06-21 18:54:42 +02:00
parent f6d0cd5360
commit 6921ab57f8
8 changed files with 298 additions and 186 deletions

View File

@@ -2,6 +2,7 @@
from .landmark import Landmark
from ..utils.get_time_distance import get_time
from ..utils.description import description_and_keywords
class LinkedLandmarks:
"""
@@ -35,18 +36,23 @@ class LinkedLandmarks:
Create the links between the landmarks in the list by setting their
.next_uuid and the .time_to_next attributes.
"""
# Mark secondary landmarks as such
self.update_secondary_landmarks()
for i, landmark in enumerate(self._landmarks[:-1]):
# Set uuid of the next landmark
landmark.next_uuid = self._landmarks[i + 1].uuid
# Adjust time to reach and total time
time_to_next = get_time(landmark.location, self._landmarks[i + 1].location)
landmark.time_to_reach_next = time_to_next
self.total_time += time_to_next
self.total_time += landmark.duration
# Fill in the keywords and description. GOOD IDEA, BAD EXECUTION, tags aren't available anymore at this stage
# landmark.description, landmark.keywords = description_and_keywords(tags)
self._landmarks[-1].next_uuid = None
self._landmarks[-1].time_to_reach_next = 0

View File

@@ -0,0 +1,16 @@
from typing import Optional
from uuid import uuid4, UUID
from pydantic import BaseModel, Field
# Output to frontend
class ProtoLandmark(BaseModel) :
"""fef"""
uuid: UUID = Field(default_factory=uuid4)
location : tuple
attractiveness : int
duration : Optional[int] = 5
must_do : Optional[bool] = False
must_avoid : Optional[bool] = False