import { prismaClient } from '../database/prismaClient.js';
export async function createChat(data) {
    console.log(`Creating chat with title: ${data.title}`);
    return prismaClient.chat.create({
        data,
    });
}
export async function getChat(id) {
    console.log(`Getting chat with ID: ${id}`);
    return prismaClient.chat.findUnique({
        where: { id },
    });
}
export async function listChats() {
    console.log('Listing all chats');
    return prismaClient.chat.findMany();
}
export async function updateChat(id, data) {
    console.log(`Updating chat with ID: ${id}`);
    return prismaClient.chat.update({
        where: { id },
        data,
    });
}
export async function deleteChat(id) {
    console.log(`Deleting chat with ID: ${id}`);
    return prismaClient.chat.delete({
        where: { id },
    });
}
