fix(security): JWT require env, remove *** token, WS auth disabled

fix(automation): implement all 6 actions + real cron parser
fix(db): pq.Array for TEXT[], add sqlmock tests
fix(schema): single source migrations
docs: v2 architecture + frontend refactor proposals
This commit is contained in:
Bernt (LandveX AI)
2026-07-14 11:46:06 +00:00
parent 77465ee9eb
commit 95b581e8c5
19 changed files with 1550 additions and 130 deletions
+4 -7
View File
@@ -57,10 +57,8 @@ func TestWriteError(t *testing.T) {
assert.Equal(t, "test error", response["error"])
}
func TestCRMHandler_CreateCustomer(t *testing.T) {
// This would need a real or mocked DB connection
// For now, just test the request parsing
func TestCRMHandler_CreateCustomer_RequestParsing(t *testing.T) {
// Test request parsing only — DB tests are in crm_test.go
payload := map[string]interface{}{
"name": "Test Customer",
"email": "test@example.com",
@@ -68,12 +66,11 @@ func TestCRMHandler_CreateCustomer(t *testing.T) {
"company": "Test AB",
"status": "lead",
}
body, _ := json.Marshal(payload)
req := httptest.NewRequest(http.MethodPost, "/api/v1/crm/customers", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
// Without DB, this will fail, but we test the request structure
assert.NotNil(t, req)
assert.Equal(t, "application/json", req.Header.Get("Content-Type"))
}