import type { PluginFastifyInstance } from "@raclettejs/core"

export const registerCrud = (fastify: PluginFastifyInstance) => {
  const userService = fastify.custom.userService

  fastify.registerCrudHandlers("user", {
    create: userService.createUser,
    read: userService.readUser,
    update: userService.updateUser,
    delete: userService.removeUser,
  })
}
