import { create } from 'domain'; import prisma from '../../prisma/PrismaClient'; import { Prisma } from '@prisma/client'; interface FindAllParams { skip?: number; take?: number; where?: Prisma.UserKeycloakWhereInput; orderBy?: Prisma.UserKeycloakOrderByWithRelationInput; } const SalesRepository = { findAll: async ({ skip, take, where = {} }: FindAllParams) => { return prisma.userKeycloak.findMany({ where: { ...where, role: 'sales', }, skip, take, select: { id: true, fullname: true, phone: true, role: true, }, }); }, countAll: async (where: Prisma.UserKeycloakWhereInput = {}): Promise => { return prisma.userKeycloak.count({ where: { ...where, role: 'sales', } }); }, }; export default SalesRepository;