import AppError from "../../errors/AppError";
import Position from "../../models/Position";

const ShowPositionService = async (
  id: string, 
): Promise<Position> => {
  const position = await Position.findByPk(id);

  if (!position) {
    throw new AppError("ERR_NO_POSITION_FOUND", 404);
  }

  return position;
};

export default ShowPositionService;
