From 76f4a9f37f5e27c9eea6f780377d54d345d824a0 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 16 Jul 2025 08:51:51 -0400 Subject: [PATCH] Add: Points model. --- dakiny_bot/database/models.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dakiny_bot/database/models.py b/dakiny_bot/database/models.py index adc38f0..554a2b7 100644 --- a/dakiny_bot/database/models.py +++ b/dakiny_bot/database/models.py @@ -146,3 +146,25 @@ class Presence(SQLModel, table=True): id: int | None = Field(sa_column=Column("Id", INTEGER, primary_key=True), default=None) presence: str = Field(sa_column=Column("Presence", VARCHAR, nullable=False), max_length=100) + + +class Points(SQLModel, table=True): + """ + Stores activity points a user can gain by participating in clan activities. + + Event points and clan points were separated out. + + Attributes: + quarter_name: Name of the quarter the points were earned in. + user_id: The user that earned them. Is a discord id if the user is a discord member, otherwise their rsn. + discord_member: Boolean on whether the user is a discord member or not. Used to know what the user_id + represents. + event_points: Event points earned during the quarter. + clan_points: Clan points earned during the quarter. + """ + + quarter_name: str = Field(sa_column=Column("QuarterName", VARCHAR, primary_key=True, nullable=False), max_length=30) + user_id: str = Field(sa_column=Column("UserId", VARCHAR, primary_key=True, nullable=False), max_length=32) + discord_member: bool = Field(sa_column=Column("DiscordMember", BOOLEAN, nullable=False)) + event_points: int = Field(sa_column=Column("EventPoints", INTEGER(unsigned=True), nullable=False)) + clan_points: int = Field(sa_column=Column("ClanPoints", INTEGER(unsigned=True), nullable=False))