mirror of
https://github.com/omnara-ai/omnara.git
synced 2025-08-12 20:39:09 +03:00
feat: Update free tier (#60)
This commit is contained in:
@@ -376,7 +376,7 @@ make dev-serve # Start development servers
|
||||
|
||||
| Plan | Price | Features |
|
||||
|------|-------|----------|
|
||||
| **Free** | $0/mo | 20 agents/month, Core features |
|
||||
| **Free** | $0/mo | 10 agents/month, Core features |
|
||||
| **Pro** | $9/mo | Unlimited agents, Priority support |
|
||||
| **Enterprise** | [Contact Us](https://cal.com/ishaan-sehgal-8kc22w/omnara-demo) | Teams, SSO, Custom integrations |
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ def sync_subscription_status(subscriber_data: dict, db: Session) -> bool:
|
||||
# No active subscription - revert to free
|
||||
logger.info("No active Pro entitlement found, downgrading to free")
|
||||
subscription.plan_type = "free"
|
||||
subscription.agent_limit = 20
|
||||
subscription.agent_limit = 10
|
||||
subscription.provider = None # Clear provider when going to free
|
||||
subscription.provider_subscription_id = None # Clear subscription reference
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
"""Update free tier agent limit from 20 to 10
|
||||
|
||||
Revision ID: f903f2e200c9
|
||||
Revises: 20de0aa419ca
|
||||
Create Date: 2025-08-09 13:41:40.430740
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "f903f2e200c9"
|
||||
down_revision: Union[str, None] = "20de0aa419ca"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Update all existing free tier subscriptions from 20 to 10 agents
|
||||
op.execute("""
|
||||
UPDATE subscriptions
|
||||
SET agent_limit = 10
|
||||
WHERE plan_type = 'free' AND agent_limit = 20
|
||||
""")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# Revert free tier subscriptions back to 20 agents
|
||||
op.execute("""
|
||||
UPDATE subscriptions
|
||||
SET agent_limit = 20
|
||||
WHERE plan_type = 'free' AND agent_limit = 10
|
||||
""")
|
||||
@@ -99,7 +99,7 @@ class Settings(BaseSettings):
|
||||
)
|
||||
|
||||
# Plan Configuration - used when enforce_limits is True
|
||||
free_plan_agent_limit: int = 20 # 20 total agents per month
|
||||
free_plan_agent_limit: int = 10 # 10 total agents per month
|
||||
pro_plan_agent_limit: int = -1 # Unlimited
|
||||
pro_plan_price: float = 9
|
||||
enterprise_plan_agent_limit: int = -1 # Unlimited
|
||||
|
||||
@@ -85,7 +85,7 @@ def get_or_create_subscription(user_id: UUID, db: Session) -> Subscription:
|
||||
"""Get existing subscription or create a default free one."""
|
||||
subscription = db.query(Subscription).filter_by(user_id=user_id).first()
|
||||
if not subscription:
|
||||
# Create with defaults from model (plan_type="free", agent_limit=20)
|
||||
# Create with defaults from model (plan_type="free", agent_limit=10)
|
||||
subscription = Subscription(user_id=user_id)
|
||||
db.add(subscription)
|
||||
db.commit()
|
||||
|
||||
@@ -36,8 +36,8 @@ class Subscription(Base):
|
||||
|
||||
# Limits - -1 means unlimited (default to free plan limits)
|
||||
agent_limit: Mapped[int] = mapped_column(
|
||||
Integer, default=20
|
||||
) # Free plan: 20 agents/month
|
||||
Integer, default=10
|
||||
) # Free plan: 10 agents/month
|
||||
|
||||
# Payment provider information - minimal needed for operations
|
||||
provider: Mapped[str | None] = mapped_column(
|
||||
|
||||
Reference in New Issue
Block a user