|
|
import uuid |
|
|
from datetime import datetime, timedelta |
|
|
from src.backend.database.candidates.client import SessionLocal |
|
|
from src.backend.database.candidates.models import Candidate, CVScreeningResult, VoiceScreeningResult |
|
|
from src.backend.state.candidate import CandidateStatus |
|
|
|
|
|
def setup_demo_state(): |
|
|
print("π Setting up demo state...") |
|
|
session = SessionLocal() |
|
|
|
|
|
|
|
|
existing = session.query(Candidate).filter(Candidate.email == "jane.doe@example.com").first() |
|
|
if existing: |
|
|
print(f"Creating clean slate: Deleting existing candidate {existing.full_name}...") |
|
|
session.delete(existing) |
|
|
session.commit() |
|
|
|
|
|
|
|
|
candidate_id = uuid.uuid4() |
|
|
jane = Candidate( |
|
|
id=candidate_id, |
|
|
full_name="Jane Doe", |
|
|
email="jane.doe@example.com", |
|
|
phone_number="+15550101", |
|
|
status=CandidateStatus.voice_passed, |
|
|
created_at=datetime.utcnow() - timedelta(days=2) |
|
|
) |
|
|
session.add(jane) |
|
|
|
|
|
|
|
|
cv_result = CVScreeningResult( |
|
|
candidate_id=candidate_id, |
|
|
job_title="Senior Product Manager", |
|
|
skills_match_score=92.0, |
|
|
experience_match_score=88.0, |
|
|
education_match_score=95.0, |
|
|
overall_fit_score=91.0, |
|
|
llm_feedback="Candidate demonstrates exceptional strategic thinking and relevant experience in SaaS product management. Strong leadership background.", |
|
|
timestamp=datetime.utcnow() - timedelta(days=2) |
|
|
) |
|
|
session.add(cv_result) |
|
|
|
|
|
|
|
|
voice_result = VoiceScreeningResult( |
|
|
candidate_id=candidate_id, |
|
|
transcript_text="I have over 5 years of experience leading agile teams... I believe communication is key to product success... In my last role, I increased user retention by 20%...", |
|
|
sentiment_score=0.8, |
|
|
confidence_score=0.9, |
|
|
communication_score=9.5, |
|
|
llm_summary="Candidate spoke clearly and confidently. Provided concrete examples of past success (20% retention increase). demonstrated strong understanding of agile methodologies.", |
|
|
llm_judgment_json={"decision": "pass", "reasoning": "High confidence and clear articulation of value."}, |
|
|
timestamp=datetime.utcnow() - timedelta(hours=1) |
|
|
) |
|
|
session.add(voice_result) |
|
|
|
|
|
session.commit() |
|
|
print(f"β
Successfully created candidate: Jane Doe (ID: {candidate_id})") |
|
|
print(" - Status: voice_passed") |
|
|
print(" - Has CV Result: Yes") |
|
|
print(" - Has Voice Result: Yes") |
|
|
print("\nReady for demo video recording! π₯") |
|
|
|
|
|
if __name__ == "__main__": |
|
|
setup_demo_state() |
|
|
|
|
|
|