from typing import Optional
import uuid
from datetime import datetime

from sqlalchemy import func
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column


class Base(DeclarativeBase):
    pass


class BaseMixin:
    id: Mapped[str] = mapped_column(primary_key=True, default=str(uuid.uuid4()))
    created_date: Mapped[datetime] = mapped_column(default=func.now())
    last_modified_date: Mapped[datetime] = mapped_column(default=func.now())
    version: Mapped[int] = mapped_column(default=0)


class BaseVideoMixin:
    cloud_link: Mapped[Optional[str]]
    file_name: Mapped[Optional[str]]
    path: Mapped[str]
    review: Mapped[bool]
    title: Mapped[str]
    url: Mapped[str]
    should_download: Mapped[bool]
