-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Registre d'arrêts : premiers modèles
See #4354.
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule Transport.Registry.Model.DataSource do | ||
@moduledoc """ | ||
Common attributes describing a data source. | ||
""" | ||
|
||
defstruct [ | ||
:id, | ||
:checksum, | ||
:last_updated_at, | ||
:validity_period | ||
] | ||
|
||
@type t :: %__MODULE__{ | ||
id: data_source_id(), | ||
checksum: binary(), | ||
last_updated_at: DateTime.t(), | ||
validity_period: date_time_range() | ||
} | ||
|
||
@type data_source_id :: binary() | ||
|
||
@type date_time_range :: binary() | ||
end |
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,57 @@ | ||
defmodule Transport.Registry.Model.StopIdentifier do | ||
@moduledoc """ | ||
Representation of a Stop ID. | ||
""" | ||
|
||
defstruct [ | ||
:id, | ||
:type | ||
] | ||
|
||
@type t :: %__MODULE__{ | ||
id: binary(), | ||
type: identifier_type() | ||
} | ||
|
||
@type identifier_type :: :main | :private_code | :stop_code | :other | ||
end | ||
|
||
defmodule Transport.Registry.Model.Stop do | ||
@moduledoc """ | ||
Common attributes describing a stop. | ||
""" | ||
alias Transport.Registry.Model.DataSource | ||
alias Transport.Registry.Model.StopIdentifier | ||
|
||
defstruct [ | ||
:main_id, | ||
:display_name, | ||
:data_source_id, | ||
:data_source_format, | ||
:parent_id, | ||
:latitude, | ||
:longitude, | ||
projection: :utm_wgs84, | ||
stop_type: :stop, | ||
secondary_ids: [] | ||
] | ||
|
||
@type t :: %__MODULE__{ | ||
main_id: StopIdentifier.t(), | ||
display_name: binary(), | ||
data_source_id: DataSource.data_source_id(), | ||
data_source_format: data_source_format_type(), | ||
parent_id: StopIdentifier.t() | nil, | ||
latitude: float(), | ||
longitude: float(), | ||
projection: projection(), | ||
stop_type: stop_type(), | ||
secondary_ids: [StopIdentifier.t()] | ||
} | ||
|
||
@type data_source_format_type :: :gtfs | :netex | ||
|
||
@type stop_type :: :stop | :quay | :other | ||
|
||
@type projection :: :utm_wgs84 | :lambert93_rgf93 | ||
end |