add image flow

This commit is contained in:
2026-04-19 12:54:25 +02:00
parent 57800f2123
commit 5fdf3f4ab2
14 changed files with 606 additions and 21 deletions
+13 -1
View File
@@ -1,6 +1,6 @@
from datetime import UTC, datetime
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, LargeBinary, String, Text
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.db import Base
@@ -18,6 +18,10 @@ class Box(Base):
note: Mapped[str | None] = mapped_column(Text, nullable=True)
room: Mapped[str | None] = mapped_column(String(100), nullable=True)
status: Mapped[str | None] = mapped_column(String(50), nullable=True)
image_blob: Mapped[bytes | None] = mapped_column(LargeBinary, nullable=True)
image_mime_type: Mapped[str | None] = mapped_column(String(50), nullable=True)
image_width: Mapped[int | None] = mapped_column(Integer, nullable=True)
image_height: Mapped[int | None] = mapped_column(Integer, nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow, nullable=False)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
@@ -42,6 +46,10 @@ class Item(Base):
note: Mapped[str | None] = mapped_column(Text, nullable=True)
quantity: Mapped[int | None] = mapped_column(Integer, nullable=True)
is_container: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
image_blob: Mapped[bytes | None] = mapped_column(LargeBinary, nullable=True)
image_mime_type: Mapped[str | None] = mapped_column(String(50), nullable=True)
image_width: Mapped[int | None] = mapped_column(Integer, nullable=True)
image_height: Mapped[int | None] = mapped_column(Integer, nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow, nullable=False)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
@@ -69,6 +77,10 @@ class SubItem(Base):
name: Mapped[str] = mapped_column(String(100), nullable=False)
note: Mapped[str | None] = mapped_column(Text, nullable=True)
quantity: Mapped[int | None] = mapped_column(Integer, nullable=True)
image_blob: Mapped[bytes | None] = mapped_column(LargeBinary, nullable=True)
image_mime_type: Mapped[str | None] = mapped_column(String(50), nullable=True)
image_width: Mapped[int | None] = mapped_column(Integer, nullable=True)
image_height: Mapped[int | None] = mapped_column(Integer, nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow, nullable=False)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),