"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 Review_1 = __importDefault(require("./models/Review"));
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 reviews = [
    {
        name: "Oliver Thompson",
        country: "United Kingdom",
        comment: "Cycling the southern coast of Sri Lanka was the highlight of our holiday! The bikes were in excellent condition, and our guide knew all the best hidden beaches and local roti shops. Gliding past the stilt fishermen at sunset is a memory I'll never forget. Highly recommend this experience!",
        rating: 5,
        order: 0
    },
    {
        name: "Chloe Davies",
        country: "Australia",
        comment: "We took on the Central Highlands package and it was wonderfully challenging. The climbs up to Nuwara Eliya are tough, but the endless green tea plantations and the misty mountain air make it entirely worth it. The support vehicle was always exactly where we needed it. A truly epic way to see Sri Lanka.",
        rating: 5,
        order: 1
    },
    {
        name: "Lukas Weber",
        country: "Germany",
        comment: "Exploring the Cultural Triangle by bicycle is an absolute must. Riding through the ancient ruins of Polonnaruwa gave us so much freedom to explore at our own pace, far away from the big tour bus crowds. The team organized everything perfectly, from the temple tickets to the fantastic local lunches.",
        rating: 5,
        order: 2
    },
    {
        name: "Sofia Rossi",
        country: "Italy",
        comment: "I wasn't sure what to expect from a cycling safari, but the wildlife tour exceeded all expectations. After a great morning ride on quiet gravel roads, swapping the bikes for a jeep in Yala National Park to see elephants was incredible. The perfect balance of active travel and nature!",
        rating: 5,
        order: 3
    },
    {
        name: "Ethan Tremblay",
        country: "Canada",
        comment: "From the initial booking to the final day, the service was flawless. Cycling in Sri Lanka can seem daunting with the traffic, but our guide made us feel completely safe and showed us the most beautiful, quiet backroads. The Sri Lankan hospitality we experienced along the way was just the cherry on top.",
        rating: 5,
        order: 4
    }
];
async function seedReviews() {
    try {
        await mongoose_1.default.connect(DB_URL);
        console.log("Connected to DB for review seeding");
        for (const review of reviews) {
            await Review_1.default.findOneAndUpdate({ order: review.order }, review, { upsert: true, new: true, setDefaultsOnInsert: true });
        }
        console.log("Review seeding finished");
        process.exit(0);
    }
    catch (error) {
        console.error("Review seeding failed", error);
        process.exit(1);
    }
}
seedReviews();
