from pydantic import BaseModel, Field from typing import List, Optional from sqlalchemy import Column, Integer, String, Text from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class IdeaStage(BaseModel): name: str field: str question: str example: str class IdeaForm(BaseModel): idea_name: Optional[str] = Field(None, description="Name of the innovative idea") idea_overview: Optional[str] = Field(None, description="Simple overview of the idea") problem_solution: Optional[str] = Field(None, description="Customer problem and how the idea addresses it") target_customers: Optional[str] = Field(None, description="Potential customers and markets") market_value: Optional[str] = Field(None, description="Estimated market value") existing_solutions: Optional[str] = Field(None, description="Similar existing ideas or products") unique_value: Optional[str] = Field(None, description="How the idea is better or different") technical_challenges: Optional[str] = Field(None, description="Difficult technical problems") legal_barriers: Optional[str] = Field(None, description="Possible legal issues") data_dependencies: Optional[str] = Field(None, description="Required data types") team_roles: Optional[List[str]] = Field(default_factory=list, description="Required job roles") timeline: Optional[str] = Field(None, description="Estimated time to build main components") additional_info: Optional[str] = Field(None, description="Any additional information") class Config: validate_assignment = True @classmethod def parse_team_roles(cls, value): if isinstance(value, str): return [role.strip() for role in value.split(',')] if value else [] return value class InnovativeIdea(Base): __tablename__ = 'innovative_ideas' id = Column(Integer, primary_key=True, index=True) idea_name = Column(String, index=True) idea_overview = Column(Text) problem_solution = Column(Text) target_customers = Column(Text) market_value = Column(String) existing_solutions = Column(Text) unique_value = Column(Text) technical_challenges = Column(Text) legal_barriers = Column(Text) data_dependencies = Column(Text) team_roles = Column(Text) timeline = Column(Text) additional_info = Column(Text) IDEA_STAGES = [ IdeaStage(name="Idea Name", field="idea_name", question="Do you have a name for this idea?", example="Sharks with Laserbeams"), IdeaStage(name="Idea Overview", field="idea_overview", question="Tell me about your idea, give a very simple overview as you might explain to younger child.", example="My idea is to attach laserbeams to sharks to create the ultimate evil weapon. The laserbeams are powered by a battery that are recharged by the shark's swimming motion. The laserbeams are used to attack enemy submarines."), IdeaStage(name="Problem Solution", field="problem_solution", question="Tell me what Customer problem your idea addresses, and how does your idea address it?", example="Our customers' secret lairs are often attacked by submarines. If our clients had sharks with laserbeams they could attack and destroy the submarines, saving the secret lair from being discovered."), IdeaStage(name="Target Customers", field="target_customers", question="What customers might be interested in this idea? Or is this a internal cost-savings / efficiency idea?", example="Evil geniuses, tyrannical dictators, rogue government agencies"), IdeaStage(name="Market Value", field="market_value", question="What markets or industries is this idea for?", example="Defense Contractors, submarine manufacturers"), IdeaStage(name="Existing Solutions", field="existing_solutions", question="What are some similar ideas or products that already exist today?", example="Nuclear Attack submarines and giant squids are somewhat similar to Shark with Laserbeams."), IdeaStage(name="Unique Value", field="unique_value", question="How is your idea better or different?", example="Shark with Laserbeams are cheaper than Nuclear Attack submarines and the lasers are more powerful than squid tentacles."), IdeaStage(name="Technical Challenges", field="technical_challenges", question="Are there any difficult technical problems with making this idea happen?", example="We would need to design a waterproof housing for the laser and batteries. We might need to experiment with how powerful lasers need to be when underwater in order to melt submarine steel hulls. We need to explore how to capture sharks and install the waterproof harnesses for the lasers."), IdeaStage(name="Legal Barriers", field="legal_barriers", question="Any legal barriers?", example="We will need to obtain a weapons export license if we want to sell outside the United States."), IdeaStage(name="Data Dependencies", field="data_dependencies", question="Any data dependencies?", example="We might need to get data on underwater motion vectors for creating the aiming mechanism for the lasers."), IdeaStage(name="Team Roles", field="team_roles", question="What kind of people / job roles do you need to make this idea happen?", example="We will need marine biologists and fishermen for obtaining sharks. We will need electrical engineers, optical engineers and software engineers to create the laserbeam weapon. We will need project manager to help manage the budget and schedule. And we need a QA tester to ensure the laser is working underwater."), IdeaStage(name="Timeline", field="timeline", question="About how long will it take to build the main components of your idea?", example="It will take a 2-3weeks to capture a shark. It will take 2-3 weeks to modify the harness and calibrate the laserbeam. I estimate it will take 3 months to train the shark to attack submarines."), IdeaStage(name="Additional Info", field="additional_info", question="Anything else you'd want to add to help us understand and value your idea?", example="We might consider adding optional racing stripes or bioluminescent patterns ot the sharks as an upgrade with charge the customer for. We could explore a subscription model where we send the customers a new shark each quarter to replace sharks that age out of the program.") ]