feat(#17): CRUD de categorias — API Go + tela Vue + testes unitários

API REST /api/categories (GET/POST/PUT/DELETE) com regras de negócio:
categorias padrão não podem ser excluídas; categorias com transações vinculadas
também bloqueadas. Tela Vue com formulário inline de criação/edição, indicador
visual de categorias padrão e botão de exclusão condicional.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-26 20:11:54 -03:00
co-authored by Claude Sonnet 4.6
parent a3d8f363a5
commit d6782d51a5
12 changed files with 720 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
package handler
import (
"encoding/json"
"net/http"
)
func respondJSON(w http.ResponseWriter, status int, data any) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status)
json.NewEncoder(w).Encode(data)
}
func respondError(w http.ResponseWriter, status int, msg string) {
respondJSON(w, status, map[string]string{"error": msg})
}