import type { Region, UserRole } from '@prisma/client'; import { DEMO_PASSWORD } from '@/lib/constants'; export type DemoUser = { id: string; username: string; email: string; name: string; role: UserRole; region: Region | null; password: string; }; export type DemoAgency = { code: string; name: string; city: string; address: string; region: Region; category: string; owner: string; contact: string; phone: string; latitude: number; longitude: number; lastVisitAt: string; potential: 'Yuksek' | 'Orta' | 'Dusuk'; riskReason?: string; score: number; monthlyRevenue: number; growth: number; openActionCount: number; status: 'Yuksek Potansiyel' | 'Stabil' | 'Riskli'; }; export type DemoVisit = { id: string; agencyCode: string; agencyName: string; city: string; owner: string; date: string; type: 'Yuz yuze' | 'Online' | 'Telefon' | 'Ad-hoc'; status: 'Planli' | 'Tamamlandi' | 'Ertelendi'; note: string; title?: string; topic?: string; prepNote?: string; postNote?: string; sentiment?: 'POZITIF' | 'NOTR' | 'NEGATIF'; nextActions?: string[]; }; export type DemoKpi = { name: string; owner: string; target: number; actual: number; unit: string; }; export type DemoAccountingItem = { agencyName: string; balance: number; lastInvoice: number; status: 'Eslesmis' | 'Kontrol Gerekli' | 'Bekliyor'; }; export const demoUsers: DemoUser[] = [ { id: 'demo-admin', username: 'admin', email: 'admin@ajet.com.tr', name: 'AJet Admin', role: 'ADMIN', region: null, password: DEMO_PASSWORD, }, { id: 'demo-gm', username: 'gm', email: 'gm@ajet.com.tr', name: 'Genel Mudur', role: 'GENEL_MUDUR', region: null, password: DEMO_PASSWORD, }, { id: 'demo-sm-dogu', username: 'sm.dogu', email: 'sm.dogu@ajet.com.tr', name: 'Dogu Satis Muduru', role: 'SATIS_MUDURU', region: 'DOGU', password: DEMO_PASSWORD, }, { id: 'demo-sp1', username: 'sp1', email: 'sp1@ajet.com.tr', name: 'Saha Personeli Dogu', role: 'SATIS_PERSONELI', region: 'DOGU', password: DEMO_PASSWORD, }, { id: 'demo-analiz', username: 'analiz', email: 'analiz@ajet.com.tr', name: 'Veri Analisti', role: 'VERI_ANALISTI', region: null, password: DEMO_PASSWORD, }, { id: 'demo-muhasebe', username: 'muhasebe', email: 'muhasebe@ajet.com.tr', name: 'Muhasebe Uzmani', role: 'MUHASEBE', region: null, password: DEMO_PASSWORD, }, ]; export const demoAgencies: DemoAgency[] = [ { code: 'AJ-IST-001', name: 'Istanbul Jet Travel', city: 'Istanbul', address: 'Istiklal Cd. No: 42, Beyoglu, Istanbul', region: 'BATI', category: 'IATA', owner: 'Saha Personeli Bati', contact: 'Murat Kaya', phone: '+90 212 555 0101', latitude: 41.0369, longitude: 28.9851, lastVisitAt: '2026-03-28T10:30:00+03:00', potential: 'Yuksek', score: 92, monthlyRevenue: 4200000, growth: 14, openActionCount: 1, status: 'Yuksek Potansiyel', }, { code: 'AJ-ANT-001', name: 'Antalya Holiday Desk', city: 'Antalya', address: 'Lara Cd. No: 18, Muratpasa, Antalya', region: 'BATI', category: 'IATA', owner: 'Bati Satis Muduru', contact: 'Ozge Turan', phone: '+90 242 555 0107', latitude: 36.8841, longitude: 30.7056, lastVisitAt: '2026-04-15T11:00:00+03:00', potential: 'Yuksek', score: 89, monthlyRevenue: 3850000, growth: 18, openActionCount: 2, status: 'Yuksek Potansiyel', }, { code: 'AJ-ANK-001', name: 'Ankara Corporate Flights', city: 'Ankara', address: 'Tunali Hilmi Cd. No: 65, Cankaya, Ankara', region: 'DOGU', category: 'Kurumsal', owner: 'Saha Personeli Dogu', contact: 'Can Yildiz', phone: '+90 312 555 0103', latitude: 39.9076, longitude: 32.8614, lastVisitAt: '2026-03-18T14:00:00+03:00', potential: 'Orta', score: 81, monthlyRevenue: 2760000, growth: 7, openActionCount: 0, status: 'Stabil', }, { code: 'AJ-IZM-001', name: 'Izmir Horizon Tourism', city: 'Izmir', address: 'Cumhuriyet Blv. No: 110, Konak, Izmir', region: 'BATI', category: 'IATA', owner: 'Saha Personeli Bati', contact: 'Deniz Oz', phone: '+90 232 555 0105', latitude: 38.4237, longitude: 27.1428, lastVisitAt: '2026-02-24T09:45:00+03:00', potential: 'Orta', score: 74, monthlyRevenue: 1980000, growth: 3, openActionCount: 1, status: 'Stabil', }, { code: 'AJ-TRB-001', name: 'Trabzon Blacksea Travel', city: 'Trabzon', address: 'Kahramanmaras Cd. No: 8, Ortahisar, Trabzon', region: 'DOGU', category: 'Non-IATA', owner: 'Saha Personeli Dogu', contact: 'Burak Demir', phone: '+90 462 555 0109', latitude: 41.0027, longitude: 39.7168, lastVisitAt: '2026-01-30T15:30:00+03:00', potential: 'Dusuk', riskReason: 'Buyume negatif ve acik aksiyon sayisi yuksek.', score: 61, monthlyRevenue: 920000, growth: -6, openActionCount: 3, status: 'Riskli', }, ]; export const demoMoscowAgencies: DemoAgency[] = [ { code: 'AJ-MOW-001', name: 'Red Square Travel Center', city: 'Moskova', address: 'Nikolskaya St. 10, Tverskoy, Moscow', region: 'ONLINE', category: 'IATA', owner: 'Moskova Saha Ekibi', contact: 'Ivan Petrov', phone: '+7 495 555 0101', latitude: 55.7586, longitude: 37.6204, lastVisitAt: '2026-01-28T11:00:00+03:00', potential: 'Yuksek', riskReason: 'Merkez lokasyonda hacim dususu ve uzun ziyaret araligi var.', score: 64, monthlyRevenue: 2250000, growth: -9, openActionCount: 3, status: 'Riskli', }, { code: 'AJ-MOW-002', name: 'Arbat Business Flights', city: 'Moskova', address: 'Arbat St. 24, Arbat, Moscow', region: 'ONLINE', category: 'Kurumsal', owner: 'Moskova Saha Ekibi', contact: 'Elena Smirnova', phone: '+7 495 555 0102', latitude: 55.752, longitude: 37.592, lastVisitAt: '2026-02-06T13:15:00+03:00', potential: 'Yuksek', riskReason: 'Kurumsal portfoy buyumesi geride.', score: 72, monthlyRevenue: 1980000, growth: -4, openActionCount: 2, status: 'Riskli', }, { code: 'AJ-MOW-003', name: 'Moscow North Tour', city: 'Moskova', address: 'Leningradsky Ave. 62, Aeroport, Moscow', region: 'ONLINE', category: 'Non-IATA', owner: 'Moskova Saha Ekibi', contact: 'Mikhail Orlov', phone: '+7 495 555 0103', latitude: 55.8005, longitude: 37.532, lastVisitAt: '2026-01-18T10:00:00+03:00', potential: 'Orta', riskReason: 'Kuzey hatta satis ve aksiyon takibi zayif.', score: 69, monthlyRevenue: 1420000, growth: -11, openActionCount: 3, status: 'Riskli', }, { code: 'AJ-MOW-004', name: 'Sokol Corporate Desk', city: 'Moskova', address: 'Volokolamskoe Hwy. 2, Sokol, Moscow', region: 'ONLINE', category: 'Kurumsal', owner: 'Moskova Saha Ekibi', contact: 'Daria Volkova', phone: '+7 495 555 0104', latitude: 55.805, longitude: 37.515, lastVisitAt: '2026-03-02T16:00:00+03:00', potential: 'Orta', score: 78, monthlyRevenue: 1760000, growth: 2, openActionCount: 1, status: 'Stabil', }, { code: 'AJ-MOW-005', name: 'VDNH Holiday Sales', city: 'Moskova', address: 'Prospekt Mira 119, Ostankino, Moscow', region: 'ONLINE', category: 'IATA', owner: 'Moskova Saha Ekibi', contact: 'Sergey Kuznetsov', phone: '+7 495 555 0105', latitude: 55.821, longitude: 37.637, lastVisitAt: '2026-02-12T12:30:00+03:00', potential: 'Yuksek', riskReason: 'Yuksek potansiyel, sezon oncesi dusuk ivme.', score: 74, monthlyRevenue: 1880000, growth: -3, openActionCount: 2, status: 'Riskli', }, { code: 'AJ-MOW-006', name: 'Izmailovo Avia Partner', city: 'Moskova', address: 'Izmailovsky Blvd. 43, Izmailovo, Moscow', region: 'ONLINE', category: 'Non-IATA', owner: 'Moskova Saha Ekibi', contact: 'Anna Morozova', phone: '+7 495 555 0106', latitude: 55.789, longitude: 37.75, lastVisitAt: '2025-12-20T15:00:00+03:00', potential: 'Orta', riskReason: 'En dusuk skor grubu ve coklu acik aksiyon.', score: 58, monthlyRevenue: 960000, growth: -14, openActionCount: 4, status: 'Riskli', }, { code: 'AJ-MOW-007', name: 'Kurskaya Transit Agency', city: 'Moskova', address: 'Zemlyanoy Val St. 33, Basmanny, Moscow', region: 'ONLINE', category: 'IATA', owner: 'Moskova Saha Ekibi', contact: 'Pavel Sokolov', phone: '+7 495 555 0107', latitude: 55.758, longitude: 37.659, lastVisitAt: '2026-01-31T09:30:00+03:00', potential: 'Yuksek', riskReason: 'Transit hacmi dusuyor, merkez dogu hattina yakin.', score: 66, monthlyRevenue: 2110000, growth: -7, openActionCount: 3, status: 'Riskli', }, { code: 'AJ-MOW-008', name: 'Paveletsky Premium Travel', city: 'Moskova', address: 'Paveletskaya Sq. 2, Zamoskvorechye, Moscow', region: 'ONLINE', category: 'IATA', owner: 'Moskova Saha Ekibi', contact: 'Natalia Belova', phone: '+7 495 555 0108', latitude: 55.729, longitude: 37.637, lastVisitAt: '2026-03-20T14:00:00+03:00', potential: 'Yuksek', score: 83, monthlyRevenue: 2440000, growth: 6, openActionCount: 1, status: 'Yuksek Potansiyel', }, { code: 'AJ-MOW-009', name: 'Moscow South Connect', city: 'Moskova', address: 'Andropova Ave. 18, Nagatino, Moscow', region: 'ONLINE', category: 'Non-IATA', owner: 'Moskova Saha Ekibi', contact: 'Roman Fedorov', phone: '+7 495 555 0109', latitude: 55.681, longitude: 37.629, lastVisitAt: '2026-01-12T11:45:00+03:00', potential: 'Orta', riskReason: 'Guney hatta negatif buyume ve geciken takip var.', score: 62, monthlyRevenue: 1180000, growth: -12, openActionCount: 3, status: 'Riskli', }, { code: 'AJ-MOW-010', name: 'Sparrow Hills Group', city: 'Moskova', address: 'Universitetsky Ave. 9, Ramenki, Moscow', region: 'ONLINE', category: 'Kurumsal', owner: 'Moskova Saha Ekibi', contact: 'Olga Mikhailova', phone: '+7 495 555 0110', latitude: 55.7, longitude: 37.548, lastVisitAt: '2026-02-25T10:15:00+03:00', potential: 'Orta', riskReason: 'Bati-guney hattinda hafif ivme kaybi.', score: 76, monthlyRevenue: 1690000, growth: -2, openActionCount: 1, status: 'Stabil', }, { code: 'AJ-MOW-011', name: 'City West Aviation', city: 'Moskova', address: 'Presnenskaya Emb. 12, Presnensky, Moscow', region: 'ONLINE', category: 'Kurumsal', owner: 'Moskova Saha Ekibi', contact: 'Kirill Antonov', phone: '+7 495 555 0111', latitude: 55.749, longitude: 37.539, lastVisitAt: '2026-02-01T16:30:00+03:00', potential: 'Yuksek', riskReason: 'Yuksek potansiyel ama son temas eski.', score: 71, monthlyRevenue: 2050000, growth: -5, openActionCount: 2, status: 'Riskli', }, { code: 'AJ-MOW-012', name: 'Kuntsevo Leisure Office', city: 'Moskova', address: 'Yartsevskaya St. 19, Kuntsevo, Moscow', region: 'ONLINE', category: 'Non-IATA', owner: 'Moskova Saha Ekibi', contact: 'Viktoria Lebedeva', phone: '+7 495 555 0112', latitude: 55.74, longitude: 37.414, lastVisitAt: '2026-01-25T13:00:00+03:00', potential: 'Orta', riskReason: 'Bati ucunda dusen talep ve acik aksiyonlar var.', score: 67, monthlyRevenue: 1320000, growth: -8, openActionCount: 2, status: 'Riskli', }, ]; const europeanTravelMarkets = [ { country: 'Almanya', city: 'Berlin', prefix: 'BER', owner: 'Almanya Saha Ekibi', phonePrefix: '+49 30 555', center: { latitude: 52.52, longitude: 13.405 }, }, { country: 'Fransa', city: 'Paris', prefix: 'PAR', owner: 'Fransa Saha Ekibi', phonePrefix: '+33 1 555', center: { latitude: 48.8566, longitude: 2.3522 }, }, { country: 'Hollanda', city: 'Amsterdam', prefix: 'AMS', owner: 'Hollanda Saha Ekibi', phonePrefix: '+31 20 555', center: { latitude: 52.3676, longitude: 4.9041 }, }, { country: 'Italya', city: 'Roma', prefix: 'ROM', owner: 'Italya Saha Ekibi', phonePrefix: '+39 06 555', center: { latitude: 41.9028, longitude: 12.4964 }, }, { country: 'Ispanya', city: 'Madrid', prefix: 'MAD', owner: 'Ispanya Saha Ekibi', phonePrefix: '+34 91 555', center: { latitude: 40.4168, longitude: -3.7038 }, }, { country: 'Ingiltere', city: 'Londra', prefix: 'LON', owner: 'Ingiltere Saha Ekibi', phonePrefix: '+44 20 555', center: { latitude: 51.5072, longitude: -0.1276 }, }, ]; const europeanAgencyPatterns: Array<{ name: string; district: string; category: string; contact: string; offsetLat: number; offsetLng: number; lastVisitAt: string; potential: DemoAgency['potential']; score: number; monthlyRevenue: number; growth: number; openActionCount: number; status: DemoAgency['status']; riskReason?: string; }> = [ { name: 'Central Flight Center', district: 'Merkez', category: 'IATA', contact: 'Alex Morgan', offsetLat: 0.004, offsetLng: -0.006, lastVisitAt: '2026-01-18T10:00:00+03:00', potential: 'Yuksek', score: 63, monthlyRevenue: 2450000, growth: -10, openActionCount: 3, status: 'Riskli', riskReason: 'Merkez portfoyde hacim dususu ve uzun ziyaret araligi var.', }, { name: 'Corporate Air Desk', district: 'Is Bolgesi', category: 'Kurumsal', contact: 'Maria Weber', offsetLat: 0.026, offsetLng: 0.032, lastVisitAt: '2026-02-08T13:15:00+03:00', potential: 'Yuksek', score: 72, monthlyRevenue: 2920000, growth: -4, openActionCount: 2, status: 'Riskli', }, { name: 'Holiday Partner', district: 'Turizm Hatti', category: 'Non-IATA', contact: 'Sofia Marin', offsetLat: -0.021, offsetLng: 0.019, lastVisitAt: '2026-03-18T15:00:00+03:00', potential: 'Orta', score: 80, monthlyRevenue: 1320000, growth: 4, openActionCount: 1, status: 'Stabil', }, { name: 'West Aviation Office', district: 'Bati', category: 'IATA', contact: 'Daniel Rossi', offsetLat: 0.013, offsetLng: -0.07, lastVisitAt: '2026-01-29T09:30:00+03:00', potential: 'Orta', score: 68, monthlyRevenue: 1180000, growth: -8, openActionCount: 3, status: 'Riskli', }, { name: 'Premium Tours', district: 'Kuzey', category: 'IATA', contact: 'Emma Novak', offsetLat: 0.054, offsetLng: 0.014, lastVisitAt: '2026-03-24T12:30:00+03:00', potential: 'Yuksek', score: 86, monthlyRevenue: 2680000, growth: 9, openActionCount: 1, status: 'Yuksek Potansiyel', }, { name: 'Airport Sales Office', district: 'Havalimani', category: 'Kurumsal', contact: 'Noah Clark', offsetLat: -0.07, offsetLng: -0.11, lastVisitAt: '2025-12-20T16:00:00+03:00', potential: 'Yuksek', score: 60, monthlyRevenue: 2140000, growth: -13, openActionCount: 4, status: 'Riskli', riskReason: 'Havalimani hattinda eski temas ve riskli portfoy.', }, ]; export const demoEuropeanAgencies: DemoAgency[] = europeanTravelMarkets.flatMap( (market) => europeanAgencyPatterns.map((pattern, index) => ({ code: `AJ-${market.prefix}-${String(index + 1).padStart(3, '0')}`, name: `${market.city} ${pattern.name}`, city: market.city, address: `${pattern.district} demo adresi ${index + 1}, ${market.city}, ${market.country}`, region: 'ONLINE', category: pattern.category, owner: market.owner, contact: pattern.contact, phone: `${market.phonePrefix} ${String(100 + index)}`, latitude: Number((market.center.latitude + pattern.offsetLat).toFixed(4)), longitude: Number((market.center.longitude + pattern.offsetLng).toFixed(4)), lastVisitAt: pattern.lastVisitAt, potential: pattern.potential, riskReason: pattern.riskReason, score: pattern.score, monthlyRevenue: pattern.monthlyRevenue, growth: pattern.growth, openActionCount: pattern.openActionCount, status: pattern.status, })), ); export const demoVisits: DemoVisit[] = [ { id: 'visit-1', agencyCode: 'AJ-IST-001', agencyName: 'Istanbul Jet Travel', city: 'Istanbul', owner: 'Saha Personeli Bati', date: '2026-04-18T10:00:00+03:00', type: 'Yuz yuze', status: 'Planli', note: 'Yaz kampanyasi hedefleri ve ek kontenjan ihtiyaci gorusulecek.', }, { id: 'visit-2', agencyCode: 'AJ-ANK-001', agencyName: 'Ankara Corporate Flights', city: 'Ankara', owner: 'Saha Personeli Dogu', date: '2026-04-19T14:30:00+03:00', type: 'Online', status: 'Planli', note: 'Kurumsal musteri hacmi ve odeme vadeleri kontrol edilecek.', }, { id: 'visit-3', agencyCode: 'AJ-ANT-001', agencyName: 'Antalya Holiday Desk', city: 'Antalya', owner: 'Bati Satis Muduru', date: '2026-04-15T11:00:00+03:00', type: 'Yuz yuze', status: 'Tamamlandi', note: 'Sezon oncesi satis ivmesi guclu, ek tesvik talebi var.', }, { id: 'visit-4', agencyCode: 'AJ-TRB-001', agencyName: 'Trabzon Blacksea Travel', city: 'Trabzon', owner: 'Saha Personeli Dogu', date: '2026-04-16T16:00:00+03:00', type: 'Telefon', status: 'Ertelendi', note: 'Dusuk performans icin aksiyon planina takip gerekecek.', }, ]; export const demoKpis: DemoKpi[] = [ { name: 'Aylik Satis Hacmi', owner: 'Tum ekip', target: 15000000, actual: 13710000, unit: 'TRY', }, { name: 'Ziyaret Tamamlama', owner: 'Satis', target: 24, actual: 18, unit: 'adet', }, { name: 'Riskli Acente Aksiyonu', owner: 'Satis Mudurleri', target: 8, actual: 5, unit: 'adet', }, { name: 'Muhasebe Eslesme', owner: 'Muhasebe', target: 100, actual: 92, unit: '%', }, ]; export const demoAccountingItems: DemoAccountingItem[] = [ { agencyName: 'Istanbul Jet Travel', balance: 1240000, lastInvoice: 680000, status: 'Eslesmis', }, { agencyName: 'Antalya Holiday Desk', balance: 890000, lastInvoice: 520000, status: 'Bekliyor', }, { agencyName: 'Trabzon Blacksea Travel', balance: -180000, lastInvoice: 160000, status: 'Kontrol Gerekli', }, ]; export function findDemoUserByLogin(login: string) { const normalized = login.trim().toLowerCase(); return demoUsers.find((user) => { const email = user.email.toLowerCase(); return ( email === normalized || user.username === normalized || email.split('@')[0] === normalized ); }); } export function getMvpMetrics() { const revenue = demoAgencies.reduce( (total, agency) => total + agency.monthlyRevenue, 0, ); const openActions = demoAgencies.reduce( (total, agency) => total + agency.openActionCount, 0, ); const plannedVisits = demoVisits.filter( (visit) => visit.status === 'Planli', ).length; const averageScore = Math.round( demoAgencies.reduce((total, agency) => total + agency.score, 0) / demoAgencies.length, ); return [ { title: 'Aylik Satis', value: revenue, hint: 'Demo acente portfoyu', kind: 'currency' as const, }, { title: 'Aktif Acente', value: demoAgencies.length, hint: 'Test veri seti', kind: 'number' as const, }, { title: 'Planli Ziyaret', value: plannedVisits, hint: 'Bu hafta', kind: 'number' as const, }, { title: 'Ortalama Skor', value: averageScore, hint: '100 uzerinden', kind: 'score' as const, }, { title: 'Acik Aksiyon', value: openActions, hint: 'Takip gerektirir', kind: 'number' as const, }, ]; }