From 865fee4ce2a24714aed28f3eda5703bee7d64b07 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 16 Jul 2025 09:04:42 -0400 Subject: [PATCH] Add: PointsLimit 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 52b067c..5f8a937 100644 --- a/dakiny_bot/database/models.py +++ b/dakiny_bot/database/models.py @@ -186,3 +186,25 @@ class Message(SQLModel, table=True): path: str = Field(sa_column=Column("Path", primary_key=True, nullable=False), max_length=100) id: int = Field(sa_column=Column("Id", BIGINT(unsigned=True), nullable=False)) + + +class PointsLimit(SQLModel, table=True): + """ + Table tracks how many points a user has gained in a week. + + Council didn't want users spamming points, so they added a limit to how many can be gained in a week. This table + tracks point gain per week. + + Attributes: + user_id: The user that earned points. Is a discord id if the user is a discord member, otherwise their rsn. + week: week number/year representation of the week. Ex: 04/2025. + event_points: Number of event points earned during this week. + clan_points: Number of clan points earned during this week. + """ + + user_id: str = Field(sa_column=Column("UserId", VARCHAR, primary_key=True, nullable=False), max_length=32) + + # Maybe should break this out into two columns, week and year. Better data validation and more clear. + week: str = Field(sa_column=Column("Week", VARCHAR, primary_key=True, nullable=False), max_length=7) + event_points: int = Field(sa_column=Column("EventPoints", INTEGER(unsigned=True), nullable=False), default=0) + clan_points: int = Field(sa_column=Column("ClanPoints", INTEGER(unsigned=True), nullable=False), default=0)