feat(backend): implement HTTP API, auth, chat, and admin surfaces

Expose learning, registration controls, mentor chat, realtime WebSocket, and staff administration.
This commit is contained in:
ahp
2026-10-07 19:40:26 +03:30
parent 3ee609337c
commit 422e6ed289
58 changed files with 11756 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package api_test
import (
"net/http"
"testing"
)
func TestCommunityEndpointPublic(t *testing.T) {
e := setup(t)
code, body := e.do(t, "GET", "/api/community", "", nil)
if code != http.StatusOK {
t.Fatalf("community: %d %v", code, body)
}
don, ok := body["donation"].(map[string]any)
if !ok {
t.Fatalf("missing donation: %v", body)
}
if _, ok := don["enabled"]; !ok {
t.Fatalf("missing donation.enabled: %v", don)
}
if don["mode"] != "chat" {
t.Fatalf("donation.mode want chat, got %v", don["mode"])
}
if _, hasCard := don["cardNumber"]; hasCard {
t.Fatal("public card number must not be exposed")
}
// Telegram channel surface was removed from the product.
if _, hasChannel := body["channel"]; hasChannel {
t.Fatal("legacy channel field must not be exposed")
}
}