import type { PluginFastifyInstance } from "types"

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

  fastify.registerCrudHandlers("composition", {
    create: compositionService.createComposition,
    read: compositionService.readComposition,
    readAll: compositionService.getAllCompositions,
    update: compositionService.updateComposition,
    delete: compositionService.removeComposition,
  })
}
