[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.
This commit is contained in:
131
company-explorer/backend/scripts/seed_marketing_data.py
Normal file
131
company-explorer/backend/scripts/seed_marketing_data.py
Normal file
@@ -0,0 +1,131 @@
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
|
||||
# Setup Environment to import backend modules
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
|
||||
from backend.database import SessionLocal, Persona, JobRolePattern
|
||||
|
||||
def seed_archetypes():
|
||||
db = SessionLocal()
|
||||
print("Seeding Strategic Archetypes (Pains & Gains)...")
|
||||
|
||||
# --- 1. The 4 Strategic Archetypes ---
|
||||
# Based on user input and synthesis of previous specific roles
|
||||
archetypes = [
|
||||
{
|
||||
"name": "Operativer Entscheider",
|
||||
"pains": [
|
||||
"Personelle Unterbesetzung und hohe Fluktuation führen zu Überstunden und Qualitätsmängeln.",
|
||||
"Manuelle, wiederkehrende Prozesse binden wertvolle Ressourcen und senken die Effizienz.",
|
||||
"Sicherstellung gleichbleibend hoher Standards (Hygiene/Service) ist bei Personalmangel kaum möglich."
|
||||
],
|
||||
"gains": [
|
||||
"Spürbare Entlastung des Teams von Routineaufgaben (20-40%).",
|
||||
"Garantierte, gleichbleibend hohe Ausführungsqualität rund um die Uhr.",
|
||||
"Stabilisierung der operativen Abläufe unabhängig von kurzfristigen Personalausfällen."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Infrastruktur-Verantwortlicher",
|
||||
"pains": [
|
||||
"Integration neuer Systeme in bestehende Gebäude/IT ist oft komplex und risikobehaftet.",
|
||||
"Sorge vor hohen Ausfallzeiten und aufwändiger Fehlerbehebung ohne internes Spezialwissen.",
|
||||
"Unklare Wartungsaufwände und Schnittstellenprobleme (WLAN, Aufzüge, Türen)."
|
||||
],
|
||||
"gains": [
|
||||
"Reibungslose, fachgerechte Integration in die bestehende Infrastruktur.",
|
||||
"Maximale Betriebssicherheit durch proaktives Monitoring und schnelle Reaktionszeiten.",
|
||||
"Volle Transparenz über Systemstatus und Wartungsbedarf."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Wirtschaftlicher Entscheider",
|
||||
"pains": [
|
||||
"Steigende operative Kosten (Personal, Material) drücken auf die Margen.",
|
||||
"Unklare Amortisation (ROI) und Risiko von Fehlinvestitionen bei neuen Technologien.",
|
||||
"Intransparente Folgekosten (TCO) über die Lebensdauer der Anlagen."
|
||||
],
|
||||
"gains": [
|
||||
"Nachweisbare Senkung der operativen Kosten (10-25%).",
|
||||
"Transparente und planbare Kostenstruktur (TCO) ohne versteckte Überraschungen.",
|
||||
"Schneller, messbarer Return on Investment durch Effizienzsteigerung."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Innovations-Treiber",
|
||||
"pains": [
|
||||
"Verlust der Wettbewerbsfähigkeit durch veraltete Prozesse und Kundenangebote.",
|
||||
"Schwierigkeit, das Unternehmen als modernes, zukunftsorientiertes Brand zu positionieren.",
|
||||
"Verpasste Chancen durch fehlende Datengrundlage für Optimierungen."
|
||||
],
|
||||
"gains": [
|
||||
"Positionierung als Innovationsführer und Steigerung der Arbeitgeberattraktivität.",
|
||||
"Nutzung modernster Technologie als sichtbares Differenzierungsmerkmal.",
|
||||
"Gewinnung wertvoller Daten zur kontinuierlichen Prozessoptimierung."
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
# Clear existing Personas to avoid mix-up with old granular ones
|
||||
# (In production, we might want to be more careful, but here we want a clean slate for the new archetypes)
|
||||
try:
|
||||
db.query(Persona).delete()
|
||||
db.commit()
|
||||
print("Cleared old Personas.")
|
||||
except Exception as e:
|
||||
print(f"Warning clearing personas: {e}")
|
||||
|
||||
for p_data in archetypes:
|
||||
print(f"Creating Archetype: {p_data['name']}")
|
||||
new_persona = Persona(
|
||||
name=p_data["name"],
|
||||
pains=json.dumps(p_data["pains"]),
|
||||
gains=json.dumps(p_data["gains"])
|
||||
)
|
||||
db.add(new_persona)
|
||||
|
||||
db.commit()
|
||||
|
||||
# --- 2. Update JobRolePatterns to map to Archetypes ---
|
||||
# We map the patterns to the new 4 Archetypes
|
||||
|
||||
mapping_updates = [
|
||||
# Wirtschaftlicher Entscheider
|
||||
{"role": "Wirtschaftlicher Entscheider", "patterns": ["geschäftsführer", "ceo", "director", "einkauf", "procurement", "finance", "cfo"]},
|
||||
|
||||
# Operativer Entscheider
|
||||
{"role": "Operativer Entscheider", "patterns": ["housekeeping", "hausdame", "hauswirtschaft", "reinigung", "restaurant", "f&b", "werksleiter", "produktionsleiter", "lager", "logistik", "operations", "coo"]},
|
||||
|
||||
# Infrastruktur-Verantwortlicher
|
||||
{"role": "Infrastruktur-Verantwortlicher", "patterns": ["facility", "technik", "instandhaltung", "it-leiter", "cto", "admin", "building"]},
|
||||
|
||||
# Innovations-Treiber
|
||||
{"role": "Innovations-Treiber", "patterns": ["innovation", "digital", "transformation", "business dev", "marketing"]}
|
||||
]
|
||||
|
||||
# Clear old mappings to prevent confusion
|
||||
db.query(JobRolePattern).delete()
|
||||
db.commit()
|
||||
print("Cleared old JobRolePatterns.")
|
||||
|
||||
for group in mapping_updates:
|
||||
role_name = group["role"]
|
||||
for pattern_text in group["patterns"]:
|
||||
print(f"Mapping '{pattern_text}' -> '{role_name}'")
|
||||
# All seeded patterns are regex contains checks
|
||||
new_pattern = JobRolePattern(
|
||||
pattern_type='regex',
|
||||
pattern_value=pattern_text, # Stored without wildcards
|
||||
role=role_name,
|
||||
priority=100, # Default priority for seeded patterns
|
||||
created_by='system'
|
||||
)
|
||||
db.add(new_pattern)
|
||||
|
||||
db.commit()
|
||||
print("Archetypes and Mappings Seeded Successfully.")
|
||||
db.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
seed_archetypes()
|
||||
Reference in New Issue
Block a user