import { PluginFastifyInstance } from "types"
import get from "./route.workSession.get"
import getAll from "./route.workSession.getAll"
import patch from "./route.workSession.patch"
import post from "./route.workSession.post"
import hardDelete from "./route.workSession.hardDelete"
import remove from "./route.workSession.remove"

const registerRoutes = async (fastify: PluginFastifyInstance) => {
  await fastify.get("/workSession/all", getAll(fastify))
  await fastify.get("/workSession/:_id", get(fastify))

  await fastify.post("/workSession", post(fastify))
  await fastify.patch("/workSession/:_id", patch(fastify))
  await fastify.delete("/workSession/:_id", remove(fastify))
  await fastify.delete("/workSession/:_id/hard", hardDelete(fastify))
}

export default registerRoutes
