~ihabunek/triglav

ref: 3a1876166aa129c76c1b09fc562af764d04df4e1 triglav/lib/triglav/schemas/public_transport/trip.ex -rw-r--r-- 706 bytes
3a187616Ivan Habunek Fix detecting unexpected master route members 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
defmodule Triglav.Schemas.PublicTransport.Trip do
  @moduledoc """
  Matches an OSM relation of type="route" to a ZET route and contains some
  added information.
  """
  use Ecto.Schema

  alias Triglav.Schemas.Osmosis
  alias Triglav.Schemas.Zet
  alias Triglav.Schemas.PublicTransport.Platform

  @derive {Inspect, only: [:id, :relation_id, :sample_trip_id]}

  @type t :: %__MODULE__{}

  schema "public_transport_trips" do
    belongs_to :relation, Osmosis.Relation
    belongs_to :route, Zet.Route, type: :binary
    has_many :platforms, Platform
    field :geometry, Geo.PostGIS.Geometry
    field :exact, :boolean
    field :stop_ids, {:array, :string}
    field :sample_trip_id, :string
  end
end