
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "company-explorer"))
from backend.database import SessionLocal, Industry, Persona, MarketingMatrix

def read_specific_entry(industry_name: str, persona_name: str):
    db = SessionLocal()
    try:
        entry = (
            db.query(MarketingMatrix)
            .join(Industry)
            .join(Persona)
            .filter(Industry.name == industry_name, Persona.name == persona_name)
            .first()
        )
        
        if not entry:
            print(f"No entry found for {industry_name} and {persona_name}")
            return

        print("--- Generated Text ---")
        print(f"Industry: {industry_name}")
        print(f"Persona: {persona_name}")
        print("\n[Intro]")
        print(entry.intro)
        print("\n[Social Proof]")
        print(entry.social_proof)
        print("----------------------")

    finally:
        db.close()

if __name__ == "__main__":
    read_specific_entry("Healthcare - Hospital", "Infrastruktur-Verantwortlicher")


