Ecto schema for the leaderboards table.
A leaderboard is a self-contained scoreboard that can be permanent or time-limited. Each leaderboard has its own settings for sort order and score operator.
Slug
The slug is a human-readable identifier (e.g., "weekly_kills") that can be reused
across multiple leaderboard instances (seasons). Use the slug to always target the
currently active leaderboard, or use the integer id for a specific instance.
Hidden
A hidden board is ranked and read like any other — by id, by slug, its records — but no public listing shows it (the leaderboards page, the API index). A host that shows a board on its own pages hides it.
Icon
icon_url is optional; when nil, clients show their default leaderboard
icon (the web UI uses GamendWeb.Icons.default(:leaderboard)).
Sort Order
:desc— Higher scores rank first (default):asc— Lower scores rank first (e.g., fastest time)
Operators
:set— Always replace with new score:best— Only update if new score is better (default):incr— Add to existing score:decr— Subtract from existing score
Summary
Functions
Returns true if the leaderboard is currently active (not ended).
Changeset for creating a new leaderboard.
Returns true if the leaderboard has ended.
Changeset for updating an existing leaderboard. Does not allow changing slug, sort_order, or operator after creation.
Types
@type operator() :: :set | :best | :incr | :decr
@type sort_order() :: :desc | :asc
@type t() :: %Gamend.Leaderboards.Leaderboard{ __meta__: term(), description: term(), ends_at: term(), hidden: term(), icon_url: term(), id: term(), inserted_at: term(), metadata: term(), operator: term(), records: term(), slug: term(), sort_order: term(), starts_at: term(), title: term(), updated_at: term() }
Functions
Returns true if the leaderboard is currently active (not ended).
Changeset for creating a new leaderboard.
Returns true if the leaderboard has ended.
Changeset for updating an existing leaderboard. Does not allow changing slug, sort_order, or operator after creation.