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

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

export default registerRoutes
