78 lines
3 KiB
Python
78 lines
3 KiB
Python
from __future__ import annotations
|
|
|
|
import enum
|
|
|
|
from sqlalchemy import Boolean, ForeignKey, Integer, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.db.base import Base, TimestampMixin, UUIDMixin
|
|
|
|
|
|
class OrionReportSettingsScope(str, enum.Enum):
|
|
global_ = "GLOBAL"
|
|
|
|
|
|
class OrionLayoutProfile(str, enum.Enum):
|
|
compact = "COMPACT"
|
|
standard = "STANDARD"
|
|
|
|
|
|
class OrionSignatureMode(str, enum.Enum):
|
|
technical_only = "TECHNICAL_ONLY"
|
|
technical_and_client = "TECHNICAL_AND_CLIENT"
|
|
|
|
|
|
class OrionImageSize(str, enum.Enum):
|
|
small = "SMALL"
|
|
medium = "MEDIUM"
|
|
large = "LARGE"
|
|
|
|
|
|
class OrionPageMargin(str, enum.Enum):
|
|
narrow = "NARROW"
|
|
standard = "STANDARD"
|
|
wide = "WIDE"
|
|
|
|
|
|
class OrionSpacing(str, enum.Enum):
|
|
compact = "COMPACT"
|
|
standard = "STANDARD"
|
|
|
|
|
|
class OrionTableFontSize(str, enum.Enum):
|
|
small = "SMALL"
|
|
standard = "STANDARD"
|
|
|
|
|
|
class OrionImagePosition(str, enum.Enum):
|
|
stacked = "STACKED"
|
|
side_by_side = "SIDE_BY_SIDE"
|
|
|
|
|
|
class OrionLogoSize(str, enum.Enum):
|
|
small = "SMALL"
|
|
medium = "MEDIUM"
|
|
large = "LARGE"
|
|
|
|
|
|
class OrionReportSettings(Base, UUIDMixin, TimestampMixin):
|
|
__tablename__ = "orion_report_settings"
|
|
|
|
scope: Mapped[str] = mapped_column(String(40), nullable=False, unique=True, index=True)
|
|
layout_profile: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionLayoutProfile.standard.value)
|
|
show_cover_result_text: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
|
|
signature_mode: Mapped[str] = mapped_column(String(60), nullable=False, default=OrionSignatureMode.technical_only.value)
|
|
image_size: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionImageSize.medium.value)
|
|
page_break_before_main_chapters: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
|
|
page_margin: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionPageMargin.standard.value)
|
|
section_spacing: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionSpacing.standard.value)
|
|
table_layout: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionSpacing.standard.value)
|
|
table_font_size: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionTableFontSize.standard.value)
|
|
image_position: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionImagePosition.side_by_side.value)
|
|
max_images_per_page: Mapped[int] = mapped_column(Integer, nullable=False, default=2)
|
|
show_image_captions: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
|
|
show_header: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
|
|
show_footer: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
|
|
logo_size: Mapped[str] = mapped_column(String(40), nullable=False, default=OrionLogoSize.medium.value)
|
|
compact_cover: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
|
updated_by_user_id: Mapped[str | None] = mapped_column(ForeignKey("users.id"), nullable=True, index=True)
|