| | |
| | """ |
| | CRM System Test Script |
| | """ |
| | from customer_manager import CustomerManager |
| |
|
| | |
| | print("🧪 CRM Test Başlatılıyor...") |
| | print("="*50) |
| |
|
| | |
| | crm = CustomerManager() |
| |
|
| | |
| | print("\n1️⃣ Yeni müşteri test ediliyor...") |
| | customer1 = crm.get_or_create_customer("+905551234567", "Ahmet") |
| | print(f" ✅ Müşteri oluşturuldu: {customer1['name']} - {customer1['segment']}") |
| |
|
| | |
| | print("\n2️⃣ Selamlama mesajı testi...") |
| | context = crm.get_customer_context("+905551234567") |
| | print(f" Selamlama: {context['greeting']}") |
| |
|
| | |
| | print("\n3️⃣ Ürün araması güncelleme testi...") |
| | crm.update_interaction("+905551234567", "Marlin 5 var mı?", "Marlin 5") |
| | customer1 = crm.customers["+905551234567"] |
| | print(f" İlgi alanları: {customer1['interests']}") |
| | print(f" Toplam sorgu: {customer1['total_queries']}") |
| |
|
| | |
| | print("\n4️⃣ VIP müşteri testi...") |
| | customer2 = crm.get_or_create_customer("+905559876543", "Mehmet") |
| | |
| | crm.add_purchase("+905559876543", "Trek Madone SLR 9", 180000) |
| | crm.add_purchase("+905559876543", "Trek Domane SL 7", 95000) |
| | crm.add_purchase("+905559876543", "Trek FX Sport 6", 45000) |
| | customer2 = crm.customers["+905559876543"] |
| | print(f" ✅ VIP Müşteri: {customer2['name']} - {customer2['segment']}") |
| | context2 = crm.get_customer_context("+905559876543") |
| | print(f" VIP Selamlama: {context2['greeting']}") |
| |
|
| | |
| | print("\n5️⃣ Analitik raporu...") |
| | analytics = crm.get_analytics() |
| | print(f" Toplam müşteri: {analytics['total_customers']}") |
| | print(f" Segment dağılımı: {analytics['segments']}") |
| | print(f" Toplam satış: {analytics['total_purchases']}") |
| | print(f" Toplam gelir: ₺{analytics['total_revenue']:,.0f}") |
| |
|
| | |
| | print("\n6️⃣ Müşteri listesi...") |
| | customers = crm.get_customer_list() |
| | for customer in customers: |
| | print(f" - {customer['name']} ({customer['phone']}) - {customer['segment']} - {customer['total_queries']} sorgu") |
| |
|
| | print("\n" + "="*50) |
| | print("✅ CRM Testleri Tamamlandı!") |
| | print("\n📊 Dashboard'u görmek için:") |
| | print(" http://localhost:8000/crm-analytics") |