package api

import (
	"net/http"
)

func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
	mux.HandleFunc("/api/v1/auth/public-key", h.GetPublicKey)
	mux.HandleFunc("/api/v1/auth/register", h.RegisterCert)
	mux.HandleFunc("/api/v1/facturas", h.HandleFacturas)
	mux.HandleFunc("/api/v1/facturas/anular", h.HandleFacturasAnular)
	mux.HandleFunc("/api/v1/formats", h.ListFormats)
	mux.HandleFunc("/api/v1/health", h.HealthCheck)
}

func (h *Handler) HealthCheck(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json")
	w.Write([]byte(`{"status":"ok"}`))
}
