const { Order } = require('./models');

const checkDates = async () => {
    try {
        const orders = await Order.findAll({
            attributes: ['id', 'status', 'createdAt', 'created_at'] // check both camelCase and underscored just in case
        });

        console.log("Current Date:", new Date().toISOString());
        console.log("Orders found:", orders.length);
        orders.forEach(o => {
            console.log(`Order #${o.id} [${o.status}]: ${o.createdAt}`);
        });

    } catch (error) {
        console.error("Error:", error);
    } finally {
        process.exit();
    }
};

checkDates();
