User Model
Class Definition
Namespace:ss.Internal.Management.Server.AutoRef
Table: users
Source: /home/daytona/workspace/source/ss.Integrated.Management.Server/Database/Models.cs:269
Properties
The unique identifier for the user.Column:
id (Primary Key)The osu! user ID from
https://osu.ppy.sh/users/{OsuID}Column: osu_idRelationship: Foreign key to OsuUserThe Discord user ID (snowflake) linking this user to their Discord account.Nullable to allow users who haven’t linked Discord yet.Column:
discord_idNavigation property to the cached osu! profile data.
Computed property that returns the osu! username or “Desconocido” (Unknown) if not available.Not stored in the database (marked with
[NotMapped]).OsuUser Model
Class Definition
Namespace:ss.Internal.Management.Server.AutoRef
Table: osu_user
Source: /home/daytona/workspace/source/ss.Integrated.Management.Server/Database/Models.cs:288
Properties
The osu! user ID. Must match a User’s
OsuID for the 1:1 relationship.Column: id (Primary Key)The osu! username at the time of last cache update.Column:
usernameThe user’s global ranking at the time of last cache update.Column:
global_rankThe user’s country ranking at the time of last cache update.Column:
country_rankPurpose
TheOsuUser table serves as a cache to avoid excessive API calls to the osu! servers. It stores a snapshot of the user’s profile data that can be refreshed periodically.
Player Model
Class Definition
Namespace:ss.Internal.Management.Server.AutoRef
Table: players
Source: /home/daytona/workspace/source/ss.Integrated.Management.Server/Database/Models.cs:306
Properties
The unique identifier for the player entry.Column:
id (Primary Key)Foreign key to the User this player record represents.Column:
user_idRelationship: Many-to-one with UserThe timestamp when the player registered for the tournament.Column:
registered_atJSON-stored availability schedule for the player.Format is implementation-dependent but typically stores time slots when the player is available.Column:
availabilityStorage: JSON stringForeign key to the QualifierRoom the player is assigned to.Nullable if the player hasn’t been assigned to a qualifier lobby yet.Column:
qualifier_room_idRelationship: Many-to-one with QualifierRoomNavigation property to the User entity.
Navigation property to the assigned QualifierRoom.
Entity Relationships
Usage Examples
Registering a New User
Registering a Player for Tournament
Assigning Player to Qualifier Lobby
Querying Players with Full Data
Updating osu! Profile Cache
Finding User by Discord ID
Checking Tournament Registration
Design Rationale
Separation of Concerns
-
User: Core identity linking osu! and Discord accounts
- Can exist independently of tournament participation
- Reusable across multiple tournaments
-
OsuUser: Cached profile data
- 1:1 relationship with User
- Reduces API calls to osu! servers
- Can be refreshed periodically
-
Player: Tournament-specific data
- Only exists when user registers for tournament
- Stores availability and qualifier assignment
- Separate from core user identity
Benefits
- Users can be registered in the system before tournament registration opens
- osu! profile data can be updated without affecting user identity
- Player-specific data is isolated from general user information
- System can support multiple tournaments by extending the Player model
Related Models
- MatchRoom - References User for team assignments
- QualifierRoom - References User for request tracking
- Player - References QualifierRoom for lobby assignment
- ScoreResults - References User for score tracking
- RefereeInfo - Similar identity model for referees