feat: Add No Website button to onboarding Step 2 with business description form
This commit is contained in:
24
backend/models/business_info_request.py
Normal file
24
backend/models/business_info_request.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Business Information Request Models for ALwrity backend."""
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
class BusinessInfoRequest(BaseModel):
|
||||
user_id: Optional[int] = None
|
||||
business_description: str = Field(..., min_length=10, max_length=1000, description="Description of the business")
|
||||
industry: Optional[str] = Field(None, max_length=100, description="Industry sector")
|
||||
target_audience: Optional[str] = Field(None, max_length=500, description="Target audience description")
|
||||
business_goals: Optional[str] = Field(None, max_length=1000, description="Business goals and objectives")
|
||||
|
||||
class BusinessInfoResponse(BaseModel):
|
||||
id: int
|
||||
user_id: Optional[int]
|
||||
business_description: str
|
||||
industry: Optional[str]
|
||||
target_audience: Optional[str]
|
||||
business_goals: Optional[str]
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
38
backend/models/user_business_info.py
Normal file
38
backend/models/user_business_info.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""User Business Information Model for ALwrity backend."""
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy import Column, Integer, String, Text, DateTime, func
|
||||
from loguru import logger
|
||||
from datetime import datetime
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
logger.info("🔄 Loading UserBusinessInfo model...")
|
||||
|
||||
class UserBusinessInfo(Base):
|
||||
__tablename__ = 'user_business_info'
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, index=True, nullable=True)
|
||||
business_description = Column(Text, nullable=False)
|
||||
industry = Column(String(100), nullable=True)
|
||||
target_audience = Column(Text, nullable=True)
|
||||
business_goals = Column(Text, nullable=True)
|
||||
created_at = Column(DateTime, default=func.now())
|
||||
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
|
||||
|
||||
def __repr__(self):
|
||||
return f"<UserBusinessInfo(id={self.id}, user_id={self.user_id}, industry='{self.industry}')>"
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
"user_id": self.user_id,
|
||||
"business_description": self.business_description,
|
||||
"industry": self.industry,
|
||||
"target_audience": self.target_audience,
|
||||
"business_goals": self.business_goals,
|
||||
"created_at": self.created_at.isoformat() if self.created_at else None,
|
||||
"updated_at": self.updated_at.isoformat() if self.updated_at else None,
|
||||
}
|
||||
|
||||
logger.info("✅ UserBusinessInfo model loaded successfully!")
|
||||
Reference in New Issue
Block a user