Spaces:
Paused
Paused
Download models/feedback.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 986 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/feedback.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/models/feedback.py
-
curl -L -o feedback.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/feedback.py
986 Bytes
| """ | |
| Feedback model — CSAT ratings submitted after ticket resolution. | |
| """ | |
| from sqlalchemy import Column, Integer, Text, ForeignKey, CheckConstraint | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from sqlalchemy.orm import relationship | |
| from core.database import Base | |
| from models.base import PrimaryKeyMixin, TimestampMixin | |
| class Feedback(Base, PrimaryKeyMixin, TimestampMixin): | |
| __tablename__ = "feedbacks" | |
| workspace_id = Column(UUID(as_uuid=True), ForeignKey("workspaces.id"), nullable=False, index=True) | |
| ticket_id = Column(UUID(as_uuid=True), ForeignKey("tickets.id"), nullable=False, unique=True, index=True) | |
| user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True) | |
| rating = Column(Integer, nullable=False) | |
| comment = Column(Text, nullable=True) | |
| __table_args__ = ( | |
| CheckConstraint("rating >= 1 AND rating <= 5", name="rating_range"), | |
| ) | |
| # Relationships | |
| ticket = relationship("Ticket", back_populates="feedback") | |