import { MongoClient } from "mongodb";

const mongoClient = new MongoClient("mongodb://127.0.0.1:27017/local");
await mongoClient.connect();
const database = mongoClient.db("Nucleus");
const collection = database.collection("history");

for (let i = 0; i < 100; i++) {
    // Select a type
    let type = ["join", "unban", "leave", "ban", "softban", "kick", "mute", "purge", "warn", "nickname"][
        Math.floor(Math.random() * 9)
    ];
    // Select a random date in the last year
    let date = new Date(new Date().getTime() - Math.floor(Math.random() * 31536000000));
    // Add to database
    await collection.insertOne({
        type: type,
        occurredAt: date,
        user: "438733159748599813",
        guild: "864185037078790195",
        moderator: ["unban", "ban", "softban", "kick", "mute", "purge", "warn"].includes(type)
            ? "438733159748599813"
            : null,
        reason: ["unban", "ban", "softban", "kick", "mute", "purge", "warn"].includes(type) ? "Test" : null,
        before: type === "nickname" ? "TestBefore" : null,
        after: type === "nickname" ? "TestAfter" : null,
        amount: type === "purge" ? Math.floor(Math.random() * 100) : null
    });
    console.log("Inserted document " + i);
}
