65 lines
2.7 KiB
Python
65 lines
2.7 KiB
Python
import sqlite3
|
|
import datetime
|
|
|
|
DB_PATH = "companies_v3_fixed_2.db"
|
|
|
|
def seed_matrix():
|
|
print(f"Connecting to {DB_PATH}...")
|
|
conn = sqlite3.connect(DB_PATH)
|
|
cursor = conn.cursor()
|
|
|
|
# Configuration of Test Scenarios
|
|
scenarios = [
|
|
{
|
|
"ind_id": 1, # Logistics
|
|
"pers_id": 3, # Wirtschaftlicher Entscheider (GF)
|
|
"subject": "Kostenreduktion in Ihrer Intralogistik durch autonome Reinigung",
|
|
"intro": "als Geschäftsführer wissen Sie: Effizienz ist der Schlüssel. Unsere Roboter senken Ihre Reinigungskosten um bis zu 30% und amortisieren sich in unter 12 Monaten.",
|
|
"proof": "Referenzkunden wie DB Schenker und DHL setzen bereits auf unsere Flotte und konnten ihre Prozesskosten signifikant senken."
|
|
},
|
|
{
|
|
"ind_id": 1, # Logistics
|
|
"pers_id": 1, # Operativer Entscheider (Lagerleiter maps here!)
|
|
"subject": "Weniger Stress mit der Sauberkeit in Ihren Hallen",
|
|
"intro": "kennen Sie das Problem: Die Reinigungskräfte fallen aus und der Staub legt sich auf die Ware. Unsere autonomen Systeme reinigen nachts, zuverlässig und ohne, dass Sie sich darum kümmern müssen.",
|
|
"proof": "Lagerleiter bei Fiege berichten von einer deutlichen Entlastung des Teams und saubereren Böden ohne Mehraufwand."
|
|
}
|
|
]
|
|
|
|
try:
|
|
now = datetime.datetime.utcnow().isoformat()
|
|
|
|
for s in scenarios:
|
|
# Check existance
|
|
cursor.execute(
|
|
"SELECT id FROM marketing_matrix WHERE industry_id = ? AND persona_id = ?",
|
|
(s['ind_id'], s['pers_id'])
|
|
)
|
|
existing = cursor.fetchone()
|
|
|
|
if existing:
|
|
print(f"Updating Matrix for Ind {s['ind_id']} / Pers {s['pers_id']}...")
|
|
cursor.execute("""
|
|
UPDATE marketing_matrix
|
|
SET subject = ?, intro = ?, social_proof = ?, updated_at = ?
|
|
WHERE id = ?
|
|
""", (s['subject'], s['intro'], s['proof'], now, existing[0]))
|
|
else:
|
|
print(f"Inserting Matrix for Ind {s['ind_id']} / Pers {s['pers_id']}...")
|
|
cursor.execute("""
|
|
INSERT INTO marketing_matrix (industry_id, persona_id, subject, intro, social_proof, updated_at)
|
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
""", (s['ind_id'], s['pers_id'], s['subject'], s['intro'], s['proof'], now))
|
|
|
|
conn.commit()
|
|
print("✅ Matrix updated with realistic test data.")
|
|
|
|
except Exception as e:
|
|
print(f"❌ Error: {e}")
|
|
conn.rollback()
|
|
finally:
|
|
conn.close()
|
|
|
|
if __name__ == "__main__":
|
|
seed_matrix()
|