Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add /api/v1/users/{user_id}/stats endpoint #744

Merged
merged 3 commits into from
Jan 15, 2023

Conversation

andreaskoepf
Copy link
Collaborator

@andreaskoepf andreaskoepf commented Jan 15, 2023

Allow to query UserScores (all time frames) for a single user.

Result JSON:

{
  "day": {
    "rank": 1,
    "user_id": "38312e49-8cd6-4e7c-8bad-c626e452b1e7",
    "username": "__dummy_user__",
    "auth_method": "local",
    "display_name": "Dummy User",
    "leader_score": 312,
    "base_date": "2023-01-14T16:49:24.883512",
    "modified_date": "2023-01-15T16:49:24.883524",
    "prompts": 0,
    "replies_assistant": 0,
    "replies_prompter": 0,
    "labels_simple": 0,
    "labels_full": 0,
    "rankings_total": 0,
    "rankings_good": 0,
    "accepted_prompts": 0,
    "accepted_replies_assistant": 0,
    "accepted_replies_prompter": 0,
    "reply_ranked_1": 24,
    "reply_ranked_2": 24,
    "reply_ranked_3": 24,
    "streak_last_day_date": null,
    "streak_days": null
  },
  "week": {
   // ...
  },
  "month": {
   // ...
  },
  "total": {
   // ...
  }
}

@andreaskoepf andreaskoepf requested a review from yk as a code owner January 15, 2023 16:52
@yk yk added the backend label Jan 15, 2023
Copy link
Collaborator

@yk yk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@andreaskoepf andreaskoepf enabled auto-merge (squash) January 15, 2023 20:24
@andreaskoepf andreaskoepf merged commit e58ffd6 into main Jan 15, 2023
@andreaskoepf andreaskoepf deleted the 713_gamification_layer_user branch January 15, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants