feat(backend): Update models and endpoints configuration

- Enhanced ticket and comment models with proper relationships
- Updated client_profile model for better data handling
- Improved auth endpoint with better error handling
- Updated main app configuration and imports
- Added new dependencies to requirements.txt
- Enhanced tickets endpoint with attachment support
This commit is contained in:
2026-02-09 13:28:40 -07:00
parent ac0cb6f132
commit 91ff49cdec
9 changed files with 257 additions and 92 deletions

View File

@@ -126,6 +126,12 @@ class Ticket(Base):
cascade="all, delete-orphan"
)
attachments: Mapped[list["TicketAttachment"]] = relationship(
"TicketAttachment",
back_populates="ticket",
cascade="all, delete-orphan"
)
# ✅ AÑADIDOS: Constraints según schema.sql
__table_args__ = (
UniqueConstraint('tenant_id', 'ticket_number', name='uq_tickets_tenant_number'),