Files
orion/app/modules/prospecting/models/interaction.py
Samir Boulahtit 6d6eba75bf
Some checks failed
CI / pytest (push) Failing after 48m31s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
CI / ruff (push) Successful in 11s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 28s
feat(prospecting): add complete prospecting module for lead discovery and scoring
Migrates scanning pipeline from marketing-.lu-domains app into Orion module.
Supports digital (domain scan) and offline (manual capture) lead channels
with enrichment, scoring, campaign management, and interaction tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 00:59:47 +01:00

55 lines
1.5 KiB
Python

# app/modules/prospecting/models/interaction.py
"""
Interaction tracking for prospect follow-ups.
Logs all touchpoints: calls, emails, meetings, visits, notes.
"""
import enum
from sqlalchemy import Column, Date, Enum, ForeignKey, Integer, String, Text
from sqlalchemy.orm import relationship
from app.core.database import Base
from models.database.base import TimestampMixin
class InteractionType(str, enum.Enum):
NOTE = "note"
CALL = "call"
EMAIL_SENT = "email_sent"
EMAIL_RECEIVED = "email_received"
MEETING = "meeting"
VISIT = "visit"
SMS = "sms"
PROPOSAL_SENT = "proposal_sent"
class InteractionOutcome(str, enum.Enum):
POSITIVE = "positive"
NEUTRAL = "neutral"
NEGATIVE = "negative"
NO_ANSWER = "no_answer"
class ProspectInteraction(Base, TimestampMixin):
"""A logged interaction with a prospect."""
__tablename__ = "prospect_interactions"
id = Column(Integer, primary_key=True, index=True)
prospect_id = Column(Integer, ForeignKey("prospects.id", ondelete="CASCADE"), nullable=False, index=True)
interaction_type = Column(Enum(InteractionType), nullable=False)
subject = Column(String(255), nullable=True)
notes = Column(Text, nullable=True)
outcome = Column(Enum(InteractionOutcome), nullable=True)
next_action = Column(String(255), nullable=True)
next_action_date = Column(Date, nullable=True)
created_by_user_id = Column(Integer, nullable=False)
# Relationships
prospect = relationship("Prospect", back_populates="interactions")