import uuid
from datetime import datetime

from sqlalchemy import func, Column, String
from sqlalchemy.dialects.mysql import BIT
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column


class Base(DeclarativeBase):
    pass


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


class BaseVideoMixin:
    cloud_link = Column(String(255))
    file_name = Column(String(255))
    path = Column(String(255))
    review = Column(BIT(1))
    title = Column(String(255))
    url = Column(String(255), unique=True)
    should_download = Column(BIT(1))
