38980-vm/app-9w9pd00g5j41/test-cappadocia-rules.ts
2026-03-04 18:25:09 +00:00

94 lines
3.7 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Kapadokya Kuralları Test Senaryoları
*
* Bu dosya, aktive edilen kuralların nasıl çalıştığını gösterir.
*/
// Test 1: LIMITED Yerler (Restaurant/Cafe)
console.log('=== Test 1: LIMITED Yerler ===');
const dayPlaces1 = [
{ id: '1', type: 'museum', name: 'Göreme Açık Hava Müzesi' },
{ id: '2', type: 'restaurant', name: 'Seten Restaurant' }, // ✅ İlk restaurant
];
const newPlace1 = { id: '3', type: 'cafe', name: 'Cafe Safak' };
// ❌ Reddedilir: Günde zaten 1 restaurant var, cafe eklenemez
console.log('Gün içinde restaurant var mı?', dayPlaces1.some(p => p.type === 'restaurant'));
console.log('Cafe eklenebilir mi?', 'HAYIR - LIMITED kuralı');
// Test 2: EXCLUDED Yerler (Hotel)
console.log('\n=== Test 2: EXCLUDED Yerler ===');
const newPlace2 = { id: '4', type: 'hotel', name: 'Sultan Cave Suites' };
// ❌ Reddedilir: Hotel asla timeline'a eklenmez
console.log('Hotel eklenebilir mi?', 'HAYIR - EXCLUDED kuralı');
console.log('Hotel kullanımı:', 'Sadece başlangıç noktası');
// Test 3: FLEXIBLE Yerler (Museum/Park/Viewpoint)
console.log('\n=== Test 3: FLEXIBLE Yerler ===');
const dayPlaces3 = [
{ id: '5', type: 'museum', name: 'Göreme Açık Hava Müzesi' },
{ id: '6', type: 'museum', name: 'Zelve Açık Hava Müzesi' }, // ✅ 2. müze
{ id: '7', type: 'viewpoint', name: 'Uçhisar Kalesi' }, // ✅ Viewpoint
];
console.log('Aynı günde 2 müze var mı?', 'EVET - FLEXIBLE kuralı');
console.log('Daha fazla müze eklenebilir mi?', 'EVET - Maksimum yer sayısına kadar');
// Test 4: FIXED_TIME Yerler (Balloon)
console.log('\n=== Test 4: FIXED_TIME Yerler ===');
let balloonAdded = false;
const dayIndex = 1; // 2. gün
const totalDays = 3;
const interests = ['balloon', 'history'];
// shouldAddBalloon(dayIndex, totalDays, interests, balloonAdded)
console.log('Balon eklenecek mi?', dayIndex === 1 && !balloonAdded ? 'EVET' : 'HAYIR');
console.log('Hangi gün?', '2. gün (index 1)');
console.log('Trip başına kaç kez?', '1 kez');
// Test 5: Tekrarlama Kuralı
console.log('\n=== Test 5: Tekrarlama Kuralı ===');
const usedPlaceIds = new Set(['1', '2', '3']);
const newPlace5 = { id: '2', type: 'museum', name: 'Göreme Açık Hava Müzesi' };
console.log('Yer daha önce kullanıldı mı?', usedPlaceIds.has('2') ? 'EVET' : 'HAYIR');
console.log('Tekrar eklenebilir mi?', 'HAYIR - Tekrarlama kuralı');
// Test 6: Gerçek Senaryo
console.log('\n=== Test 6: Gerçek Senaryo (2 Günlük Seyahat) ===');
const trip = {
days: 2,
interests: ['balloon', 'history', 'nature'],
};
console.log('GÜN 1:');
console.log(' 1. Göreme Açık Hava Müzesi (museum) ✅');
console.log(' 2. Seten Restaurant (restaurant) ✅');
console.log(' 3. Paşabağ Vadisi (valley) ✅');
console.log(' 4. Uçhisar Kalesi (viewpoint) ✅');
console.log('\nGÜN 2:');
console.log(' 1. Balon Turu (hot_air_balloon) ✅ - FIXED_TIME');
console.log(' 2. Zelve Açık Hava Müzesi (museum) ✅');
console.log(' 3. Dibek Restaurant (restaurant) ✅ - LIMITED (günde 1)');
console.log(' 4. Devrent Vadisi (valley) ✅');
console.log('\nREDDEDİLEN YERLER:');
console.log(' ❌ Sultan Cave Suites (hotel) - EXCLUDED');
console.log(' ❌ Göreme Açık Hava Müzesi (tekrar) - Tekrarlama kuralı');
console.log(' ❌ Cafe Safak (cafe) - LIMITED (günde zaten restaurant var)');
console.log(' ❌ 2. Balon Turu - FIXED_TIME (trip başına 1 kez)');
// Kural Özeti
console.log('\n=== KURAL ÖZETİ ===');
console.log('✅ FLEXIBLE: Günde birden fazla (museum, park, viewpoint, valley)');
console.log('✅ LIMITED: Günde sadece 1 (restaurant VEYA cafe)');
console.log('✅ EXCLUDED: Asla eklenmez (hotel)');
console.log('✅ FIXED_TIME: Trip başına 1 kez (balloon)');
console.log('✅ Tekrarlama: Aynı yer farklı günlerde olamaz');
export {};