Sha256: 50f6105d124818df7c53a379b4184b8de3ecff4b211b88c85cb0be0fd00da918

Contents?: true

Size: 1.26 KB

Versions: 38

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    # This type represents a polling station.
    class PollingStationType < Decidim::Api::Types::BaseObject
      description "A polling station for a voting"

      field :id, GraphQL::Types::ID, "The internal ID of this polling station", null: false
      field :title, Decidim::Core::TranslatedFieldType, "The title for this polling station", null: true
      field :address, GraphQL::Types::String, "The physical address of this polling station (used for geolocation)", null: true
      field :coordinates, Decidim::Core::CoordinatesType, "Physical coordinates for this polling station", null: true
      field :location, Decidim::Core::TranslatedFieldType, "The location of this polling station (free format)", null: true
      field :location_hints, Decidim::Core::TranslatedFieldType, "The location of this polling station (free format)", null: true
      field :created_at, Decidim::Core::DateTimeType, "When this polling station was created", null: true
      field :updated_at, Decidim::Core::DateTimeType, "When this polling station was updated", null: true
      field :voting, Decidim::Votings::VotingType, null: false

      def coordinates
        [object.latitude, object.longitude]
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.9 lib/decidim/api/polling_station_type.rb
decidim-elections-0.28.3 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.8 lib/decidim/api/polling_station_type.rb
decidim-elections-0.28.2 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.7 lib/decidim/api/polling_station_type.rb
decidim-elections-0.28.1 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.6 lib/decidim/api/polling_station_type.rb
decidim-elections-0.26.10 lib/decidim/api/polling_station_type.rb
decidim-elections-0.26.9 lib/decidim/api/polling_station_type.rb
decidim-elections-0.28.0 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.5 lib/decidim/api/polling_station_type.rb
decidim-elections-0.28.0.rc5 lib/decidim/api/polling_station_type.rb
decidim-elections-0.28.0.rc4 lib/decidim/api/polling_station_type.rb
decidim-elections-0.26.8 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.4 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.3 lib/decidim/api/polling_station_type.rb
decidim-elections-0.26.7 lib/decidim/api/polling_station_type.rb
decidim-elections-0.26.5 lib/decidim/api/polling_station_type.rb
decidim-elections-0.27.2 lib/decidim/api/polling_station_type.rb