const prisma = require('../../prisma/PrismaClient.js');

const LogRepository = {
    findAll: async ({ skip, take, where, orderBy }) => {
        return prisma.activityLog.findMany({
            where,
            skip,
            take,
            orderBy,
            select: {
                id: true,
                username: true,
                action: true,
                createdAt: true,
            },
        });
    },

    countAll: async (where) => {
        return prisma.activityLog.count({ where });
    },
}

module.exports = LogRepository;