import { FastifyReply, FastifyRequest } from "fastify";
import prisma from "../../utils/prisma";

export async function turnovers(req: FastifyRequest, reply: FastifyReply) {
  const turnovers = await prisma.turnover.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(turnovers);
}

export async function nEmployees(req: FastifyRequest, reply: FastifyReply) {
  const nEmployees = await prisma.nEmployees.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(nEmployees);
}

export async function cities(req: FastifyRequest, reply: FastifyReply) {
  const cities = await prisma.city.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(cities);
}

export async function positions(req: FastifyRequest, reply: FastifyReply) {
  const positions = await prisma.position.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(positions);
}

export async function activitiesFamilies(
  req: FastifyRequest,
  reply: FastifyReply
) {
  const activitiesFamilies = await prisma.activityFamily.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(activitiesFamilies);
}

export async function activities(req: FastifyRequest, reply: FastifyReply) {
  const activities = await prisma.activity.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(activities);
}

export async function expertiseAreas(req: FastifyRequest, reply: FastifyReply) {
  const expertiseAreas = await prisma.expertiseArea.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(expertiseAreas);
}

export async function interestAreas(req: FastifyRequest, reply: FastifyReply) {
  const interestArea = await prisma.interestArea.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(interestArea);
}

export async function categories(req: FastifyRequest, reply: FastifyReply) {
  const categories = await prisma.category.findMany({
    orderBy: { name: "asc" },
  });
  return reply.code(200).send(categories);
}
