from django.db import migrations


def seed_content(apps, schema_editor):
    CompanyInformation = apps.get_model("travel", "CompanyInformation")
    HolidayPackage = apps.get_model("travel", "HolidayPackage")
    CabService = apps.get_model("travel", "CabService")
    Destination = apps.get_model("travel", "Destination")

    if not CompanyInformation.objects.exists():
        CompanyInformation.objects.create(
            company_name="Aarya Holidays & Cabs",
            tagline="Curated holidays and dependable cab travel from one trusted team.",
            introduction=(
                "Plan family getaways, group tours, corporate travel, airport transfers, "
                "and outstation cab journeys with clear guidance and comfortable coordination."
            ),
            story=(
                "Aarya Holidays & Cabs brings holiday planning and cab coordination together "
                "so travellers can move from enquiry to journey with confidence."
            ),
            mission="To make every trip simple, comfortable, transparent, and memorable.",
            vision="To become a trusted travel partner for holidays and cab services across India.",
            why_choose_text=(
                "Local route knowledge, responsive support, clear planning, and comfortable cab options "
                "make every booking feel personal and dependable."
            ),
            phone_number="+91 9035339515",
            whatsapp_number="+91 9035339515",
            email="aaryaholidayscabs@gmail.com",
            address="Sri Reddy Mahalasa Apartment, 1st floor, 3rd cross,VB layout, Krishna Raja puram, new Extension Bangalore - 560036",
            working_hours="Mon-Sun, 8:00 AM - 9:00 PM",
            google_map_embed_url="https://www.google.com/maps?q=Sri%20Reddy%20Mahalasa%20Apartment%2C%201st%20floor%2C%203rd%20cross%2CVB%20layout%2C%20Krishna%20Raja%20puram%2C%20new%20Extension%20Bangalore%20-%20560036&output=embed",
        )

    packages = [
        (
            "goa-beach-escape",
            "Goa Beach Escape",
            "3 Nights / 4 Days",
            "Goa",
            "A relaxed coastal break with beaches, local sightseeing, shopping time, and smooth cab support.",
        ),
        (
            "coorg-coffee-trails",
            "Coorg Coffee Trails",
            "2 Nights / 3 Days",
            "Coorg",
            "Coffee estates, misty viewpoints, waterfalls, and a comfortable road-trip rhythm.",
        ),
        (
            "ooty-hills-retreat",
            "Ooty Hills Retreat",
            "2 Nights / 3 Days",
            "Ooty",
            "A classic hill getaway with lake time, gardens, viewpoints, and scenic cab routes.",
        ),
        (
            "kerala-backwater-holiday",
            "Kerala Backwater Holiday",
            "4 Nights / 5 Days",
            "Kerala",
            "Backwaters, beaches, greenery, and relaxed transfers planned around your travel pace.",
        ),
        (
            "mysore-heritage-weekend",
            "Mysore Heritage Weekend",
            "1 Night / 2 Days",
            "Mysore",
            "Palace visits, heritage streets, local food stops, and an easy weekend travel plan.",
        ),
        (
            "chikmagalur-scenic-break",
            "Chikmagalur Scenic Break",
            "2 Nights / 3 Days",
            "Chikmagalur",
            "Hill views, coffee estates, waterfalls, and a peaceful road journey from start to finish.",
        ),
    ]
    for index, (slug, title, duration, location, description) in enumerate(packages, start=1):
        HolidayPackage.objects.get_or_create(
            slug=slug,
            defaults={
                "title": title,
                "duration": duration,
                "location": location,
                "short_description": description,
                "is_featured": index <= 3,
                "display_order": index,
            },
        )

    cab_services = [
        ("airport-pickup", "Airport Pickup", "Timely airport pickup with clear driver coordination and comfortable vehicles."),
        ("airport-drop", "Airport Drop", "Reliable airport drop service planned around your flight time and luggage needs."),
        ("local-cab", "Local Cab", "City travel for errands, sightseeing, meetings, shopping, and day plans."),
        ("outstation-cab", "Outstation Cab", "Comfortable outstation cabs for family trips, business routes, and weekend breaks."),
        ("round-trip", "Round Trip", "Flexible round-trip cab plans with practical route and timing support."),
        ("one-way", "One Way", "Point-to-point cab service for intercity travel without round-trip commitments."),
        ("corporate-travel", "Corporate Travel", "Professional cab coordination for teams, guests, meetings, and events."),
        ("wedding-travel", "Wedding Travel", "Guest movement and event travel support for weddings and family functions."),
    ]
    for index, (slug, title, description) in enumerate(cab_services, start=1):
        CabService.objects.get_or_create(
            slug=slug,
            defaults={
                "title": title,
                "description": description,
                "is_featured": index <= 4,
                "display_order": index,
            },
        )

    destinations = [
        ("goa", "Goa", "Beaches, coastal drives, markets, churches, nightlife, and relaxed holiday time."),
        ("coorg", "Coorg", "Coffee estates, waterfalls, viewpoints, and a cool green road-trip setting."),
        ("ooty", "Ooty", "Hill views, gardens, lake visits, tea estates, and classic family-friendly routes."),
        ("kerala", "Kerala", "Backwaters, beaches, wellness stays, hill stations, and scenic transfers."),
        ("mysore", "Mysore", "Palaces, heritage streets, temples, gardens, and easy weekend sightseeing."),
        ("chikmagalur", "Chikmagalur", "Coffee country, misty hills, waterfalls, and peaceful scenic routes."),
        ("manali", "Manali", "Mountain views, adventure stops, snow-season plans, and memorable long holidays."),
        ("kashmir", "Kashmir", "Valleys, lakes, gardens, snow views, and a polished northern holiday plan."),
    ]
    for index, (slug, name, description) in enumerate(destinations, start=1):
        Destination.objects.get_or_create(
            slug=slug,
            defaults={
                "name": name,
                "description": description,
                "is_featured": index <= 6,
                "display_order": index,
            },
        )


class Migration(migrations.Migration):
    dependencies = [
        ("travel", "0001_initial"),
    ]

    operations = [
        migrations.RunPython(seed_content, migrations.RunPython.noop),
    ]
