-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add endpoints vessels/excursions/segments & vessels/positions/last
- Loading branch information
herve.le-bars
committed
Jun 4, 2024
1 parent
742560d
commit 5af3139
Showing
7 changed files
with
219 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from datetime import datetime | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
from shapely import Geometry, Point | ||
from shapely.geometry import mapping, shape | ||
from bloom.domain.vessel import Vessel | ||
from bloom.domain.port import Port | ||
|
||
from typing import Union | ||
|
||
|
||
class VesselLastPosition(BaseModel): | ||
model_config = ConfigDict(arbitrary_types_allowed=True, | ||
json_encoders = { | ||
Geometry: lambda p: mapping(p), | ||
},) | ||
vessel: Vessel = None | ||
excursion_id: Union[int, None] = None | ||
position: Union[Point, None] = None | ||
timestamp: Union[datetime, None] = None | ||
heading: Union[float, None] = None | ||
speed: Union[float, None] = None | ||
arrival_port: Union[Port, None] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters