package routes

import (
	"github.com/gofiber/fiber/v2"
	apiControllers "github.com/sujit-baniya/fiber-boilerplate/rest/controllers/api"
)

func ApiRoutes(api fiber.Router) {
	v1Routes(api)
}

func v1AuthRoutes(api fiber.Router) {
	api.Post("/oauth/token", apiControllers.OAuthToken)
	api.Post("/generate-qr-tmp", apiControllers.CreateQrTmp)
	api.Post("/generate-qr", apiControllers.CreateQr)
	api.Post("/generate-vcf", apiControllers.CreateVcf)
	api.Post("/dlocal/subscription/crear-plan", apiControllers.CreatePlan)
	api.Get("/dlocal/subscription/ver-plan/:planID", apiControllers.SeePlan)
	api.Patch("/dlocal/subscription/actualizar-plan/:planID", apiControllers.UpdatedPlan)
	api.Patch("/dlocal/subscription/plan/:planId/subscription/:subscriptionId/deactivate", apiControllers.DeactivatePlan)
	api.Get("/dlocal/subscription/plan/all", apiControllers.SeePlanes)
	api.Get("/dlocal/subscription/:subscriptionId/execution/:invoiceId", apiControllers.SeeSubscription)
	api.Post("/dlocal/payment/crear-pago", apiControllers.CreatePago)
	api.Post("/rapyd/wallet/create", apiControllers.MakeWallet)
	api.Post("/generate-url-qr", apiControllers.CreateUrlQr)
	api.Post("/ia/ollama-generate", apiControllers.GeneraTextoStream)
}

func v1Routes(api fiber.Router) {
	v1 := api.Group("v1")
	v1AuthRoutes(v1)
}
