Add owner work order approval page
Some checks failed
ci / test (push) Has been cancelled

This commit is contained in:
VPN SaaS Dev
2026-05-16 10:51:05 +09:00
parent ac5845d5a0
commit 545f4d088d
12 changed files with 1066 additions and 48 deletions

View File

@@ -172,6 +172,7 @@ class ServiceCenter(Base):
)
holidays = relationship("ServiceCenterHoliday", back_populates="service_center", cascade="all, delete-orphan")
appointments = relationship("ServiceAppointment", back_populates="service_center", cascade="all, delete-orphan")
catalog_items = relationship("WorkOrderCatalogItem", back_populates="service_center", cascade="all, delete-orphan")
class CarServiceLink(Base):
@@ -531,6 +532,35 @@ class InventoryTransaction(Base):
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
class WorkOrderCatalogItem(Base):
__tablename__ = "work_order_catalog_items"
id: Mapped[int] = mapped_column(primary_key=True)
service_center_id: Mapped[int | None] = mapped_column(ForeignKey("service_centers.id", ondelete="CASCADE"), index=True)
item_type: Mapped[str] = mapped_column(String(24), index=True)
title: Mapped[str] = mapped_column(String(180), index=True)
category: Mapped[str | None] = mapped_column(String(80), index=True)
description: Mapped[str | None] = mapped_column(Text)
work_type: Mapped[str | None] = mapped_column(String(40), index=True)
product_type: Mapped[str | None] = mapped_column(String(40), index=True)
brand: Mapped[str | None] = mapped_column(String(80))
sku: Mapped[str | None] = mapped_column(String(120), index=True)
unit: Mapped[str] = mapped_column(String(24), default="pcs", server_default="pcs")
default_quantity: Mapped[Decimal] = mapped_column(Numeric(10, 3), default=1, server_default="1")
default_unit_price: Mapped[Decimal] = mapped_column(Numeric(12, 2), default=0, server_default="0")
volume: Mapped[Decimal | None] = mapped_column(Numeric(8, 3))
viscosity: Mapped[str | None] = mapped_column(String(40))
specification: Mapped[str | None] = mapped_column(String(120))
metadata_json: Mapped[dict | None] = mapped_column(JSON)
is_active: Mapped[bool] = mapped_column(Boolean, default=True, server_default="true", index=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
)
service_center = relationship("ServiceCenter", back_populates="catalog_items")
class ServiceCenterReview(Base):
__tablename__ = "service_center_reviews"
__table_args__ = (UniqueConstraint("service_center_id", "user_id", name="uq_service_review_user"),)