from sqlalchemy.orm import Session
from src.marketing.apps.Calendar.model import Calendar


def generate_unique_slug(db: Session, base_slug: str) -> str:
    slug = base_slug
    count = 0
    # Check if the slug already exists in the database
    # If it does, append a number to the slug until a unique one is found
    while db.query(Calendar).filter(Calendar.slug == slug).first():
        count += 1
        slug = f"{base_slug}-{count}"
    return slug

import pytz
from typing import List

def get_all_timezones() -> List[str]:
    """Get all available timezones from pytz."""
    return pytz.all_timezones 