Skip to content

Add player awards system#24

Open
Kesomannen wants to merge 1 commit into
devfrom
agents/player-awards-system-implementation
Open

Add player awards system#24
Kesomannen wants to merge 1 commit into
devfrom
agents/player-awards-system-implementation

Conversation

@Kesomannen
Copy link
Copy Markdown
Collaborator

Overview

Implements a complete player awards system for managing and displaying awards given to players over multiple seasons.

Key Features

  • Award Type Management: Create award types with name and division-visibility toggle
  • Award Assignment: Assign awards to players within specific divisions (implies season) or league-wide
  • Admin Interface: Dedicated admin section at /admin/utmarkelser for moderators and admins
  • Player Display: Awards shown on player profiles with season/division context
  • Privacy-Aware: Respects hidden-season filtering so non-admins don't see awards from hidden seasons

Changes

  • Database: Added award_type and player_award tables with proper relations
  • Remotes: Created award.remote.ts with CRUD operations, role-gated to moderators
  • Admin UI: New pages for listing award types and managing awards per type
  • Components: Added PlayerSelect.svelte for searchable player selection in admin UIs
  • Player Page: Awards section displays with formatted season/division context
  • Migration: Drizzle migration 20260519180801_awards

Award Structure

  • Award Types: Define immutable categories (name + showDivision flag)
  • Award Instances: Lightweight (player + type + optional division)
  • Seasons: Derived from division; hall-of-fame awards have no division

Permissions

  • Moderators (and admins) only: create/update/delete award types and awards
  • Players: can view their own awards and others' awards (respecting hidden-season filters)

Next Steps

  • Run pnpm db:push locally to apply migration
  • Update standings page to include awards (deferred for later session)

Notes

  • Pre-existing Prettier and env var issues prevent full lint/check; these are unrelated to awards and can be addressed separately
  • Component follow codebase conventions: Svelte 5 runes, bits-ui, SaveContext/ConfirmContext patterns

Implement awards management and display with:
- Database schema for award types and player award instances
- Admin UI for managing award types and assigning awards to players
- Player search functionality for award selection
- Awards display on player pages with season/division context
- Hidden-season filtering to respect privacy settings
- Role-based access control (moderator+)
Copilot AI review requested due to automatic review settings May 19, 2026 18:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants