mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-19 18:45:15 +02:00
feat(backend): add new incentive task type for Reddit follow
Introduce a new incentive task type, REDDIT_FOLLOW, to encourage users to join the SurfSense community on Reddit. This includes a title, description, pages reward, and action URL for the task.
This commit is contained in:
parent
0b65c3a98c
commit
16b839138d
2 changed files with 42 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
||||||
|
"""Add REDDIT_FOLLOW to incentive task type enum
|
||||||
|
|
||||||
|
Revision ID: 83
|
||||||
|
Revises: 82
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
1. Add REDDIT_FOLLOW value to incentivetasktype enum
|
||||||
|
"""
|
||||||
|
|
||||||
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision: str = "83"
|
||||||
|
down_revision: str | None = "82"
|
||||||
|
branch_labels: str | Sequence[str] | None = None
|
||||||
|
depends_on: str | Sequence[str] | None = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
"""Add REDDIT_FOLLOW to incentivetasktype enum."""
|
||||||
|
op.execute("ALTER TYPE incentivetasktype ADD VALUE IF NOT EXISTS 'REDDIT_FOLLOW'")
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
"""Remove REDDIT_FOLLOW 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
|
||||||
|
|
@ -163,6 +163,7 @@ class IncentiveTaskType(str, Enum):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
GITHUB_STAR = "GITHUB_STAR"
|
GITHUB_STAR = "GITHUB_STAR"
|
||||||
|
REDDIT_FOLLOW = "REDDIT_FOLLOW"
|
||||||
# Future tasks can be added here:
|
# Future tasks can be added here:
|
||||||
# GITHUB_ISSUE = "GITHUB_ISSUE"
|
# GITHUB_ISSUE = "GITHUB_ISSUE"
|
||||||
# SOCIAL_SHARE = "SOCIAL_SHARE"
|
# SOCIAL_SHARE = "SOCIAL_SHARE"
|
||||||
|
|
@ -178,6 +179,12 @@ INCENTIVE_TASKS_CONFIG = {
|
||||||
"pages_reward": 100,
|
"pages_reward": 100,
|
||||||
"action_url": "https://github.com/MODSetter/SurfSense",
|
"action_url": "https://github.com/MODSetter/SurfSense",
|
||||||
},
|
},
|
||||||
|
IncentiveTaskType.REDDIT_FOLLOW: {
|
||||||
|
"title": "Join our Subreddit",
|
||||||
|
"description": "Join the SurfSense community on Reddit",
|
||||||
|
"pages_reward": 100,
|
||||||
|
"action_url": "https://www.reddit.com/r/SurfSense/",
|
||||||
|
},
|
||||||
# Future tasks can be configured here:
|
# Future tasks can be configured here:
|
||||||
# IncentiveTaskType.GITHUB_ISSUE: {
|
# IncentiveTaskType.GITHUB_ISSUE: {
|
||||||
# "title": "Create an issue",
|
# "title": "Create an issue",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue