Spaces:
Runtime error
Runtime error
| from enum import Enum as PyEnum | |
| from sqlalchemy import ( | |
| Column, | |
| DateTime, | |
| Enum, | |
| Float, | |
| ForeignKey, | |
| Integer, | |
| String, | |
| func, | |
| ) | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from ._base import Base | |
| class Category(PyEnum): | |
| TECHNICAL = "TECHNICAL" | |
| MANAGEMENT = "MANAGEMENT" | |
| PAST_PERFORMANCE = "PAST_PERFORMANCE" | |
| PRICE = "PRICE" | |
| class ProposalAIAnalysis(Base): | |
| __tablename__ = "proposal_ai_analyses" | |
| id = Column(UUID(as_uuid=True), primary_key=True, nullable=False) | |
| proposal_id = Column( | |
| UUID(as_uuid=True), | |
| ForeignKey("proposals.id", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| ai_score = Column(Float, nullable=False) | |
| created_at = Column(DateTime, nullable=False, default=func.now()) | |
| updated_at = Column( | |
| DateTime, nullable=False, default=func.now(), onupdate=func.now() | |
| ) | |
| class ProposalStrength(Base): | |
| __tablename__ = "proposal_strengths" | |
| id = Column(UUID(as_uuid=True), primary_key=True, nullable=False) | |
| proposal_id = Column( | |
| UUID(as_uuid=True), | |
| ForeignKey("proposals.id", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| strength_point = Column(String, nullable=False) | |
| category = Column(Enum(Category, name="strengthcategory"), nullable=False) | |
| created_at = Column(DateTime, nullable=False, default=func.now()) | |
| updated_at = Column( | |
| DateTime, nullable=False, default=func.now(), onupdate=func.now() | |
| ) | |
| class ProposalRejectionReason(Base): | |
| __tablename__ = "proposal_rejection_reasons" | |
| id = Column(UUID(as_uuid=True), primary_key=True, nullable=False) | |
| proposal_id = Column( | |
| UUID(as_uuid=True), | |
| ForeignKey("proposals.id", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| reason = Column(String, nullable=False) | |
| category = Column(Enum(Category, name="rejectioncategory"), nullable=False) | |
| created_at = Column(DateTime, nullable=False, default=func.now()) | |
| updated_at = Column( | |
| DateTime, nullable=False, default=func.now(), onupdate=func.now() | |
| ) | |
| class ProposalWeakness(Base): | |
| __tablename__ = "proposal_weaknesses" | |
| id = Column(UUID(as_uuid=True), primary_key=True, nullable=False) | |
| proposal_id = Column( | |
| UUID(as_uuid=True), | |
| ForeignKey("proposals.id", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| weakness_point = Column(String, nullable=False) | |
| category = Column(Enum(Category, name="weaknesscategory"), nullable=False) | |
| created_at = Column(DateTime, nullable=False, default=func.now()) | |
| updated_at = Column( | |
| DateTime, nullable=False, default=func.now(), onupdate=func.now() | |
| ) | |
| class ProposalImprovement(Base): | |
| __tablename__ = "proposal_improvements" | |
| id = Column(UUID(as_uuid=True), primary_key=True, nullable=False) | |
| proposal_id = Column( | |
| UUID(as_uuid=True), | |
| ForeignKey("proposals.id", ondelete="CASCADE"), | |
| nullable=False, | |
| ) | |
| improvement_point = Column(String, nullable=False) | |
| category = Column(Enum(Category, name="improvementcategory"), nullable=False) | |
| created_at = Column(DateTime, nullable=False, default=func.now()) | |
| updated_at = Column( | |
| DateTime, nullable=False, default=func.now(), onupdate=func.now() | |
| ) | |