View Source Bbox.Candidates (bbox v0.1.2)

Candidates module.

Link to this section Summary

Functions

Get candidate by code.

Create a new candidate.

List all candidates.

Link to this section Functions

@spec get_by_code!(charlist()) :: %Bbox.Candidates.Candidate{
  __meta__: term(),
  code: term(),
  email: term(),
  first_name: term(),
  inserted_at: term(),
  last_name: term(),
  party: term(),
  party_initials: term(),
  updated_at: term(),
  votes: term()
}

Get candidate by code.

Link to this function

insert(party, params \\ %{})

View Source
@spec insert(
  %Bbox.Parties.Party{
    __meta__: term(),
    candidates: term(),
    description: term(),
    initials: term(),
    inserted_at: term(),
    name: term(),
    updated_at: term()
  },
  map()
) ::
  {:ok,
   %Bbox.Candidates.Candidate{
     __meta__: term(),
     code: term(),
     email: term(),
     first_name: term(),
     inserted_at: term(),
     last_name: term(),
     party: term(),
     party_initials: term(),
     updated_at: term(),
     votes: term()
   }}
  | {:error, charlist()}

Create a new candidate.

@spec list!() :: [
  %Bbox.Candidates.Candidate{
    __meta__: term(),
    code: term(),
    email: term(),
    first_name: term(),
    inserted_at: term(),
    last_name: term(),
    party: term(),
    party_initials: term(),
    updated_at: term(),
    votes: term()
  }
]

List all candidates.