Fix HTML rendering for service descriptions, allow zero price for services, improve image_url handling
This commit is contained in:
@@ -217,6 +217,23 @@ class Booking(Base):
|
||||
service_name = Column(String(255))
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
# Completion fields
|
||||
completed_at = Column(DateTime(timezone=True), nullable=True)
|
||||
diagnosis = Column(Text, nullable=True) # Initial diagnosis/issue description
|
||||
work_performed = Column(Text, nullable=True) # What was done to fix it
|
||||
technician_notes = Column(Text, nullable=True) # Internal technician notes
|
||||
service_cost = Column(Float, nullable=True) # Final cost if different from base price
|
||||
|
||||
# Payment fields
|
||||
paid = Column(Boolean, default=False)
|
||||
paid_at = Column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
# Device information fields
|
||||
device_model = Column(String(255), nullable=True) # e.g., "Dell Latitude 5520"
|
||||
serial_number = Column(String(255), nullable=True)
|
||||
product_number = Column(String(255), nullable=True)
|
||||
screen_size = Column(String(50), nullable=True) # e.g., "15-inch", "13-inch"
|
||||
|
||||
service = relationship("Service", back_populates="bookings")
|
||||
user = relationship("User", back_populates="bookings")
|
||||
|
||||
@@ -300,4 +317,35 @@ class CompanyValue(Base):
|
||||
display_order = Column(Integer, default=0)
|
||||
is_active = Column(Boolean, default=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
|
||||
class MediaType(enum.Enum):
|
||||
IMAGE = "image"
|
||||
DOCUMENT = "document"
|
||||
VIDEO = "video"
|
||||
OTHER = "other"
|
||||
|
||||
|
||||
class Media(Base):
|
||||
__tablename__ = "media"
|
||||
|
||||
id = Column(String(36), primary_key=True, default=generate_uuid)
|
||||
filename = Column(String(255), nullable=False)
|
||||
original_filename = Column(String(255), nullable=False)
|
||||
file_path = Column(String(500), nullable=False)
|
||||
file_url = Column(String(500), nullable=False)
|
||||
file_size = Column(Integer, default=0) # Size in bytes
|
||||
mime_type = Column(String(100))
|
||||
media_type = Column(SQLEnum(MediaType), default=MediaType.IMAGE)
|
||||
alt_text = Column(String(255))
|
||||
title = Column(String(255))
|
||||
description = Column(Text)
|
||||
width = Column(Integer) # For images
|
||||
height = Column(Integer) # For images
|
||||
uploaded_by = Column(String(36), ForeignKey("users.id"), nullable=True)
|
||||
is_active = Column(Boolean, default=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
uploader = relationship("User", foreign_keys=[uploaded_by])
|
||||
Reference in New Issue
Block a user