package handlers

import (
	"github.com/gofiber/fiber/v2"

	"wucher/internal/buildinfo"
)

type BuildInfoHandler struct{}

func NewBuildInfoHandler() *BuildInfoHandler {
	return &BuildInfoHandler{}
}

func (h *BuildInfoHandler) Handle(c *fiber.Ctx) error {
	return c.Status(fiber.StatusOK).JSON(fiber.Map{
		"version":   buildinfo.Version,
		"commit":    buildinfo.Commit,
		"buildTime": buildinfo.BuildTime,
	})
}
