import { prismaClient } from '../database/prismaClient.js';
export async function createTransaction(data) {
    return prismaClient.transaction.create({
        data,
    });
}
export async function getTransaction(chatId, messageId) {
    return prismaClient.transaction.findUnique({
        where: {
            chatId_messageId: {
                chatId: chatId,
                messageId: messageId,
            },
        },
    });
}
export async function getTransactionsByChatId(chatId) {
    return prismaClient.transaction.findMany({
        where: {
            chatId: chatId,
        },
    });
}
export async function listTransactions() {
    return prismaClient.transaction.findMany();
}
export async function updateTransaction(chatId, messageId, data) {
    return prismaClient.transaction.update({
        where: {
            chatId_messageId: {
                chatId: chatId,
                messageId: messageId,
            },
        },
        data,
    });
}
export async function deleteTransaction(chatId, messageId) {
    return prismaClient.transaction.delete({
        where: {
            chatId_messageId: {
                chatId: chatId,
                messageId: messageId,
            },
        },
    });
}
