import { Prisma } from '@prisma/client';
import { prisma } from '../db/prisma';

export type PosteAvecSalle = Prisma.PosteEmpruntGetPayload<{ include: { sallePret: true } }>;

export function findById(id: number): Promise<PosteAvecSalle | null> {
  return prisma.posteEmprunt.findUnique({
    where: { id },
    include: { sallePret: true },
  });
}
