Initial commit: Robot ökoszisztéma v2.0 - Stabilizált jármű és szerviz robotok

This commit is contained in:
Kincses
2026-03-04 02:03:03 +01:00
commit 250f4f4b8f
7942 changed files with 449625 additions and 0 deletions

30
backend/app/models/document.py Executable file
View File

@@ -0,0 +1,30 @@
# /opt/docker/dev/service_finder/backend/app/models/document.py
import uuid
from datetime import datetime
from typing import Optional
from sqlalchemy import String, Integer, Boolean, DateTime, ForeignKey, text
from sqlalchemy.dialects.postgresql import UUID as PG_UUID
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy.sql import func
from app.db.base_class import Base
class Document(Base):
""" NAS alapú dokumentumtár metaadatai. """
__tablename__ = "documents"
id: Mapped[uuid.UUID] = mapped_column(PG_UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
parent_type: Mapped[str] = mapped_column(String(20)) # 'organization' vagy 'asset'
parent_id: Mapped[str] = mapped_column(String(50), index=True)
doc_type: Mapped[Optional[str]] = mapped_column(String(50))
original_name: Mapped[str] = mapped_column(String(255))
file_hash: Mapped[str] = mapped_column(String(64))
file_ext: Mapped[str] = mapped_column(String(10), default="webp")
mime_type: Mapped[str] = mapped_column(String(100), default="image/webp")
file_size: Mapped[Optional[int]] = mapped_column(Integer)
has_thumbnail: Mapped[bool] = mapped_column(Boolean, default=False)
thumbnail_path: Mapped[Optional[str]] = mapped_column(String(255))
uploaded_by: Mapped[Optional[int]] = mapped_column(Integer, ForeignKey("identity.users.id"))
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())