feat: Enhanced CE schema and Notion sync (Pains/Gains)
This commit is contained in:
@@ -18,21 +18,35 @@ class Company(Base):
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
|
||||
# Core Identity
|
||||
# Core Identity (Golden Record - from Research)
|
||||
name = Column(String, index=True)
|
||||
website = Column(String, index=True) # Normalized Domain preferred
|
||||
crm_id = Column(String, unique=True, index=True, nullable=True) # Link to D365
|
||||
|
||||
# CRM Original Data (Source of Truth for Import)
|
||||
crm_name = Column(String, nullable=True)
|
||||
crm_website = Column(String, nullable=True)
|
||||
crm_address = Column(String, nullable=True) # Full address string or JSON
|
||||
crm_vat = Column(String, nullable=True)
|
||||
|
||||
# Classification
|
||||
industry_crm = Column(String, nullable=True) # The "allowed" industry
|
||||
industry_ai = Column(String, nullable=True) # The AI suggested industry
|
||||
|
||||
# Location
|
||||
# Location (Golden Record)
|
||||
city = Column(String, nullable=True)
|
||||
country = Column(String, default="DE")
|
||||
|
||||
# Workflow Status
|
||||
status = Column(String, default="NEW", index=True)
|
||||
status = Column(String, default="NEW", index=True) # NEW, TO_ENRICH, ENRICHED, QUALIFIED, DISQUALIFIED
|
||||
|
||||
# Quality & Confidence
|
||||
confidence_score = Column(Float, default=0.0) # Overall confidence
|
||||
data_mismatch_score = Column(Float, default=0.0) # 0.0=Match, 1.0=Mismatch
|
||||
|
||||
# Scraping Status Flags
|
||||
website_scrape_status = Column(String, default="PENDING") # PENDING, SUCCESS, FAILED, BLOCKED
|
||||
wiki_search_status = Column(String, default="PENDING") # PENDING, FOUND, NOT_FOUND
|
||||
|
||||
# Granular Process Tracking (Timestamps)
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
@@ -106,6 +120,13 @@ class Industry(Base):
|
||||
status_notion = Column(String, nullable=True) # e.g. "P1 Focus Industry"
|
||||
is_focus = Column(Boolean, default=False) # Derived from status_notion
|
||||
|
||||
# Enhanced Fields (v3.1 - Pains/Gains/Priority)
|
||||
pains = Column(Text, nullable=True)
|
||||
gains = Column(Text, nullable=True)
|
||||
notes = Column(Text, nullable=True)
|
||||
priority = Column(String, nullable=True) # Replaces old status concept ("Freigegeben")
|
||||
ops_focus_secondary = Column(Boolean, default=False)
|
||||
|
||||
# NEW SCHEMA FIELDS (from MIGRATION_PLAN)
|
||||
metric_type = Column(String, nullable=True) # Unit_Count, Area_in, Area_out
|
||||
min_requirement = Column(Float, nullable=True)
|
||||
@@ -117,6 +138,7 @@ class Industry(Base):
|
||||
|
||||
# Optional link to a Robotics Category (the "product" relevant for this industry)
|
||||
primary_category_id = Column(Integer, ForeignKey("robotics_categories.id"), nullable=True)
|
||||
secondary_category_id = Column(Integer, ForeignKey("robotics_categories.id"), nullable=True)
|
||||
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user