Leaderboards API

Implements API for HLT-221.

Get API for top 100 leaderboards. For current(logged in) user should be returned 100 leaderboards + leaderboard of current user if exist and marked it with leaderboard.currentUser: true, in other case should return top 100 lederboards for requested period

curl --location 'http://localhost:3000/api/v2/leaderboards/top-winners/365' \
--header 'Access-Control-Allow-Origin: true' \
--header 'Cookie: _casino_session=casino_session_data/token' \
--header 'Content-Type: application/json'
GET API_URL/api/v2/leaderboards/:key/:days

:key - specifies search criteria for leaderboards; possible value 'lucky-bet' and 'top-winners';
:days - specifies the time frame for which we seek the outcome; MAX=1095 days or 3 years

lucky-bet - represent largest multiplier(win/bet) for the period.
top-winners - represent largest amount of winnings for the period that calculated in euro cents

Example Response

[
  {
    "id": 900098,
    "date": "2024-06-30T12:00:00",
    "win": 300000000,
    "bet": 3000000,
    "multiplier": 100,
    "gameId": "zillion/BuffalosSun",
    "currency": "LTC",
    "playerName": "Ivan",
    "win_EUR_cents": "21066",
    "currentUser": true
  },
  {
    "id": 99999996,
    "date": "2024-07-16T12:00:00",
    "win": 200,
    "bet": 14,
    "multiplier": 14.285714285714286,
    "gameId": "booming/VegasWins",
    "currency": "EUR",
    "playerName": "Peter",
    "win_EUR_cents": "2000000",
    "currentUser": false
  },
]