import { vi } from 'vitest'
import { PrismaClient } from '@prisma/client'
import { mockDeep, mockReset, DeepMockProxy } from 'vitest-mock-extended'

// Create a deep mock of PrismaClient
export const prismaMock = mockDeep<PrismaClient>()

// Reset mock between tests
export function resetPrismaMock() {
  mockReset(prismaMock)
}

// Mock the prisma module
vi.mock('@/lib/prisma', () => ({
  prisma: prismaMock,
}))

export type MockPrismaClient = DeepMockProxy<PrismaClient>
