Initial commit: VoIdeaAI - voice-first AI idea assistant

This commit is contained in:
2026-05-13 12:51:42 +03:00
commit 688d043dad
421 changed files with 47915 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
"""User model for VoIdea."""
from datetime import datetime
from typing import Any, Optional
from sqlalchemy import Boolean, DateTime, String
from sqlalchemy.dialects.postgresql import JSONB, UUID
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.core.base import SQLBase, TimestampMixin, UUIDMixin
class User(SQLBase, UUIDMixin, TimestampMixin):
__tablename__ = "users"
email: Mapped[str] = mapped_column(
String(255), unique=True, index=True, nullable=False
)
password_hash: Mapped[Optional[str]] = mapped_column(
String(255), nullable=True
)
display_name: Mapped[str] = mapped_column(
String(255), nullable=False
)
avatar_url: Mapped[Optional[str]] = mapped_column(
String(512), nullable=True
)
is_active: Mapped[bool] = mapped_column(
Boolean, default=True, nullable=False
)
is_superuser: Mapped[bool] = mapped_column(
Boolean, default=False, nullable=False
)
# v2.0 role system
role: Mapped[str] = mapped_column(
String(20), default="user", nullable=False, index=True
)
is_owner: Mapped[bool] = mapped_column(
Boolean, default=False, nullable=False
)
permissions: Mapped[Optional[dict[str, Any]]] = mapped_column(
JSONB, nullable=True, default=None
)
accepted_terms_at: Mapped[Optional[datetime]] = mapped_column(
nullable=True
)
accepted_terms_version: Mapped[Optional[str]] = mapped_column(
String(20), nullable=True
)
pipeline_tuning: Mapped[Optional[dict[str, Any]]] = mapped_column(
JSONB, nullable=True, default=None
)
oauth_provider: Mapped[Optional[str]] = mapped_column(
String(50), nullable=True
)
oauth_id: Mapped[Optional[str]] = mapped_column(
String(255), nullable=True
)
ideas = relationship("Idea", back_populates="user", lazy="selectin")