feat: add new incentive task type for Discord

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-02-03 22:32:39 -08:00
parent b6e1741a40
commit 5cb59bbde8
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,33 @@
"""Add DISCORD_JOIN to incentive task type enum
Revision ID: 91
Revises: 90
Changes:
1. Add DISCORD_JOIN value to incentivetasktype enum
"""
from collections.abc import Sequence
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "91"
down_revision: str | None = "90"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
"""Add DISCORD_JOIN to incentivetasktype enum."""
op.execute("ALTER TYPE incentivetasktype ADD VALUE IF NOT EXISTS 'DISCORD_JOIN'")
def downgrade() -> None:
"""Remove DISCORD_JOIN from incentivetasktype enum.
Note: PostgreSQL doesn't support removing values from enums directly.
This would require recreating the enum type, which is complex and risky.
For safety, we leave the enum value in place during downgrade.
"""
pass

View file

@ -164,6 +164,7 @@ class IncentiveTaskType(str, Enum):
GITHUB_STAR = "GITHUB_STAR"
REDDIT_FOLLOW = "REDDIT_FOLLOW"
DISCORD_JOIN = "DISCORD_JOIN"
# Future tasks can be added here:
# GITHUB_ISSUE = "GITHUB_ISSUE"
# SOCIAL_SHARE = "SOCIAL_SHARE"
@ -185,6 +186,12 @@ INCENTIVE_TASKS_CONFIG = {
"pages_reward": 100,
"action_url": "https://www.reddit.com/r/SurfSense/",
},
IncentiveTaskType.DISCORD_JOIN: {
"title": "Join our Discord",
"description": "Join the SurfSense community on Discord",
"pages_reward": 100,
"action_url": "https://discord.gg/ejRNvftDp9",
},
# Future tasks can be configured here:
# IncentiveTaskType.GITHUB_ISSUE: {
# "title": "Create an issue",