feat(orion): extend report layout settings to version 1.1
This commit is contained in:
parent
12e1761a5b
commit
613ffdc8b7
591 changed files with 3601 additions and 999 deletions
Binary file not shown.
|
|
@ -2,12 +2,23 @@ from __future__ import annotations
|
|||
|
||||
from datetime import date
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import EmailStr, Field, field_validator
|
||||
from pydantic import ConfigDict, EmailStr, Field, field_validator
|
||||
|
||||
from app.models.customer import CustomerType
|
||||
from app.models.equipment import EquipmentKind, EquipmentStatus
|
||||
from app.models.report_settings import (
|
||||
OrionImagePosition,
|
||||
OrionImageSize,
|
||||
OrionLayoutProfile,
|
||||
OrionLogoSize,
|
||||
OrionPageMargin,
|
||||
OrionSignatureMode,
|
||||
OrionSpacing,
|
||||
OrionTableFontSize,
|
||||
)
|
||||
from app.models.user import UserRole
|
||||
from app.models.validation import ValidationStatus
|
||||
from app.schemas.common import EntityRead, ORMModel
|
||||
|
|
@ -91,6 +102,32 @@ class DeviceUpdate(DeviceCreate):
|
|||
pass
|
||||
|
||||
|
||||
class OrionReportSettingsUpdate(ORMModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
layout_profile: OrionLayoutProfile
|
||||
show_cover_result_text: bool
|
||||
signature_mode: OrionSignatureMode
|
||||
image_size: OrionImageSize
|
||||
page_break_before_main_chapters: bool
|
||||
page_margin: OrionPageMargin
|
||||
section_spacing: OrionSpacing
|
||||
table_layout: OrionSpacing
|
||||
table_font_size: OrionTableFontSize
|
||||
image_position: OrionImagePosition
|
||||
max_images_per_page: Literal[1, 2, 4]
|
||||
show_image_captions: bool
|
||||
show_header: bool
|
||||
show_footer: bool
|
||||
logo_size: OrionLogoSize
|
||||
compact_cover: bool
|
||||
|
||||
|
||||
class OrionReportSettingsRead(OrionReportSettingsUpdate, EntityRead):
|
||||
scope: str
|
||||
updated_by_user_id: str | None = None
|
||||
|
||||
|
||||
class EquipmentCreate(ORMModel):
|
||||
kind: EquipmentKind
|
||||
manufacturer: str | None = None
|
||||
|
|
@ -297,3 +334,10 @@ class QuickStartCreateRequest(ORMModel):
|
|||
contact_id: UUID | None = None
|
||||
device_id: UUID | None = None
|
||||
validation_type: str
|
||||
|
||||
@field_validator("location_id", "contact_id", "device_id", mode="before")
|
||||
@classmethod
|
||||
def empty_string_to_none(cls, value):
|
||||
if value == "":
|
||||
return None
|
||||
return value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue