- Create .env.example for environment variables - Update README with project structure and development setup instructions - Implement FastAPI application with API routes for scenarios and parameters - Add database models for scenarios, parameters, and simulation results - Introduce validation middleware for JSON requests - Create services for running simulations and generating reports - Add testing strategy and directory structure in documentation
18 lines
587 B
Python
18 lines
587 B
Python
from sqlalchemy import Column, Integer, String, Float, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
from config.database import Base
|
|
|
|
|
|
class Parameter(Base):
|
|
__tablename__ = "parameter"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
scenario_id = Column(Integer, ForeignKey("scenario.id"), nullable=False)
|
|
name = Column(String, nullable=False)
|
|
value = Column(Float, nullable=False)
|
|
|
|
scenario = relationship("Scenario", back_populates="parameters")
|
|
|
|
def __repr__(self):
|
|
return f"<Parameter id={self.id} name={self.name} value={self.value}>"
|