bfd58e3419
Bug A: Media Library thumbnails were gray because <img src> cannot send JWT auth headers. Added useAuthBlob() hook (fetch + createObjectURL) in MediaBrowser.tsx. Also fixed publish_asset Celery task to populate product_id + cad_file_id on MediaAsset for thumbnail fallback resolution. Bug B: Product dimensions now shown in Product Details card with Ruler icon and "from CAD" label when cad_mesh_attributes.dimensions_mm exists. Bug C: Replaced 128×128 CAD thumbnail with InlineCadViewer component. Queries gltf_geometry MediaAssets, fetches GLB via auth fetch → blob URL → Three.js Canvas with OrbitControls. Falls back to thumbnail + "Load 3D Model" button. Polling when GLB generation is in progress. Bug D: trimesh was in [cad] optional extra but Dockerfile only installed [dev]. Changed to pip install -e ".[dev,cad]" — trimesh now available in backend container, GLB + Colors export works. Also added bbox extraction (STL-first numpy parsing) in render_step_thumbnail and admin "Re-extract CAD Metadata" bulk endpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
74 lines
2.1 KiB
Python
74 lines
2.1 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
from pydantic import BaseModel
|
|
from app.domains.rendering.schemas import RenderPositionOut
|
|
|
|
|
|
class ProductCreate(BaseModel):
|
|
pim_id: str
|
|
name: str | None = None
|
|
category_key: str | None = None
|
|
ebene1: str | None = None
|
|
ebene2: str | None = None
|
|
baureihe: str | None = None
|
|
produkt_baureihe: str | None = None
|
|
lagertyp: str | None = None
|
|
name_cad_modell: str | None = None
|
|
gewuenschte_bildnummer: str | None = None
|
|
medias_rendering: bool | None = None
|
|
components: list[dict] = []
|
|
cad_part_materials: list[dict] = []
|
|
notes: str | None = None
|
|
is_active: bool = True
|
|
source_excel: str | None = None
|
|
|
|
|
|
class ProductPatch(BaseModel):
|
|
name: str | None = None
|
|
category_key: str | None = None
|
|
ebene1: str | None = None
|
|
ebene2: str | None = None
|
|
baureihe: str | None = None
|
|
produkt_baureihe: str | None = None
|
|
lagertyp: str | None = None
|
|
name_cad_modell: str | None = None
|
|
gewuenschte_bildnummer: str | None = None
|
|
medias_rendering: bool | None = None
|
|
components: list[dict] | None = None
|
|
cad_part_materials: list[dict] | None = None
|
|
notes: str | None = None
|
|
is_active: bool | None = None
|
|
|
|
|
|
class ProductOut(BaseModel):
|
|
id: uuid.UUID
|
|
pim_id: str
|
|
name: str | None
|
|
category_key: str | None
|
|
ebene1: str | None
|
|
ebene2: str | None
|
|
baureihe: str | None
|
|
produkt_baureihe: str | None
|
|
lagertyp: str | None
|
|
name_cad_modell: str | None
|
|
gewuenschte_bildnummer: str | None
|
|
medias_rendering: bool | None
|
|
components: list[dict]
|
|
cad_part_materials: list[dict]
|
|
cad_file_id: uuid.UUID | None
|
|
thumbnail_url: str | None = None
|
|
render_image_url: str | None = None
|
|
processing_status: str | None = None
|
|
stl_cached: list[str] = []
|
|
cad_parsed_objects: list[str] | None = None
|
|
cad_mesh_attributes: dict | None = None
|
|
arbeitspaket: str | None = None
|
|
notes: str | None
|
|
is_active: bool
|
|
source_excel: str | None
|
|
render_positions: list[RenderPositionOut] = []
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|