import { PluginFastifyInstance } from "types"
import get from "./route.tag.get"
import getAll from "./route.tag.getAll"
import hardDelete from "./route.tag.hardDelete"
import patch from "./route.tag.patch"
import post from "./route.tag.post"
import postBulk from "./route.tag.post.bulk"
import remove from "./route.tag.remove"
import restore from "./route.tag.restore"

const registerRoutes = async (fastify: PluginFastifyInstance) => {
  await fastify.get("/tag/all", getAll(fastify))
  await fastify.get("/tag/:_id", get(fastify))
  await fastify.patch("/tag/:_id", patch(fastify))
  await fastify.patch("/tag/:_id/restore", restore(fastify))
  await fastify.post("/tag/:project/:_id", post(fastify))
  await fastify.post("/tag/bulk", postBulk(fastify))
  await fastify.delete("/tag/:_id", remove(fastify))
  await fastify.delete("/tag/:_id/hard", hardDelete(fastify))
}

export default registerRoutes
