"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv_1 = __importDefault(require("dotenv"));
const mongoose_1 = __importDefault(require("mongoose"));
const Package_1 = __importDefault(require("./models/Package"));
dotenv_1.default.config();
const IS_PRODUCTION = process.env.IS_PRODUCTION === "true";
const DB_URL = (IS_PRODUCTION ? process.env.MONGO_URI_PROD : process.env.MONGO_URI_DEV) || "mongodb://localhost:27017/cycling-escape";
const packages = [
    {
        title: "7-Day Central Highlands Epic",
        duration: "7 Days / 6 Nights",
        route: "Nuwara Eliya -> Horton Plains -> Haputale",
        image: "https://plus.unsplash.com/premium_photo-1670002449411-ceb00433109a?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8YmlrZSUyMHRyYXZlbHxlbnwwfHwwfHx8MA%3D%3D",
        itinerary: [
            {
                from: "Nuwara Eliya",
                to: "Horton Plains",
                description: "Highland ride through tea estates with a sunrise hike to World's End.",
                image: "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=800&auto=format&fit=crop&q=60",
                rideKm: 40,
                driveKm: 20,
                order: 0
            },
            {
                from: "Haputale",
                to: "Lipton's Seat",
                description: "Scenic climb with panoramic views and a descent through misty hills.",
                image: "https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?w=800&auto=format&fit=crop&q=60",
                rideKm: 32,
                driveKm: 55,
                order: 1
            }
        ],
        order: 0
    },
    {
        title: "3-Day Cultural Triangle Cruise",
        duration: "3 Days / 2 Nights",
        route: "Sigiriya -> Polonnaruwa -> Dambulla",
        image: "https://plus.unsplash.com/premium_photo-1663099817484-f4308cb1fd10?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8OXx8YmlrZSUyMHRyYXZlbHxlbnwwfHwwfHx8MA%3D%3D",
        itinerary: [
            {
                from: "Sigiriya",
                to: "Habarana",
                description: "Ride through village roads and paddy fields with an evening rock climb.",
                image: "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=800&auto=format&fit=crop&q=60",
                rideKm: 28,
                driveKm: 10,
                order: 0
            },
            {
                from: "Polonnaruwa",
                to: "Dambulla",
                description: "Ancient ruins loop and transfer to the cave temple district.",
                image: "https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=800&auto=format&fit=crop&q=60",
                rideKm: 36,
                driveKm: 40,
                order: 1
            }
        ],
        order: 1
    },
    {
        title: "6-Day Jaffna Peninsula Tour",
        duration: "6 Days / 5 Nights",
        route: "Jaffna -> Point Pedro -> Delft Island",
        image: "https://plus.unsplash.com/premium_photo-1732538262917-2e8706c0cf03?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTd8fGJpa2UlMjB0cmF2ZWx8ZW58MHx8MHx8fDA%3D",
        itinerary: [
            {
                from: "Jaffna",
                to: "Point Pedro",
                description: "Coastal spin to the northernmost point with quiet village stops.",
                image: "https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=800&auto=format&fit=crop&q=60",
                rideKm: 45,
                driveKm: 0,
                order: 0
            },
            {
                from: "Kayts",
                to: "Delft Island",
                description: "Ferry transfer and island loop with coral walls and wild ponies.",
                image: "https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=800&auto=format&fit=crop&q=60",
                rideKm: 22,
                driveKm: 35,
                order: 1
            }
        ],
        order: 2
    },
    {
        title: "4-Day Southern Wildlife Trail",
        duration: "4 Days / 3 Nights",
        route: "Udawalawe -> Yala -> Kataragama",
        image: "https://images.unsplash.com/photo-1772439783106-dff24711a71b?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mzl8fGJpa2UlMjB0cmF2ZWx8ZW58MHx8MHx8fDA%3D",
        itinerary: [
            {
                from: "Udawalawe",
                to: "Yala",
                description: "Gravel ride with a mid-day transfer to the park edge.",
                image: "https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=800&auto=format&fit=crop&q=60",
                rideKm: 38,
                driveKm: 120,
                order: 0
            },
            {
                from: "Yala",
                to: "Kataragama",
                description: "Temple district ride followed by safari drive at golden hour.",
                image: "https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=800&auto=format&fit=crop&q=60",
                rideKm: 25,
                driveKm: 60,
                order: 1
            }
        ],
        order: 3
    },
    {
        title: "5-Day Southern Coastal Ride",
        duration: "5 Days / 4 Nights",
        route: "Galle -> Mirissa -> Tangalle",
        image: "https://plus.unsplash.com/premium_photo-1673483274179-fa70dd117310?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NXx8YmlrZSUyMHRyYXZlbHxlbnwwfHwwfHx8MA%3D%3D",
        itinerary: [
            {
                from: "Galle",
                to: "Mirissa",
                description: "Coastal ride past stilt fishermen and beach markets.",
                image: "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=800&auto=format&fit=crop&q=60",
                rideKm: 42,
                driveKm: 0,
                order: 0
            },
            {
                from: "Mirissa",
                to: "Tangalle",
                description: "Lagoon roads and palm-lined stretches with a sunset swim.",
                image: "https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=800&auto=format&fit=crop&q=60",
                rideKm: 48,
                driveKm: 15,
                order: 1
            }
        ],
        order: 4
    }
];
async function seed() {
    try {
        await mongoose_1.default.connect(DB_URL);
        console.log("Connected to DB");
        // Delete all existing packages
        await Package_1.default.deleteMany({});
        console.log("Deleted all existing packages");
        // Insert new packages
        for (const pkg of packages) {
            await Package_1.default.create(pkg);
        }
        console.log("Package seeding finished");
        process.exit(0);
    }
    catch (error) {
        console.error("Package seeding failed", error);
        process.exit(1);
    }
}
seed();
