diff --git a/.ai/product/feature-spec/README.md b/.ai/product/feature-spec/README.md index 982e7a7..b992665 100644 --- a/.ai/product/feature-spec/README.md +++ b/.ai/product/feature-spec/README.md @@ -48,6 +48,7 @@ | [ops-rhythm-config.md](ops-rhythm-config.md) | ExploreConfig RhythmConfig | §7 | `GET /admin/explore/rhythm-configs*` | Ops-D · **ECR-036 Closed** | | [ops-image-card-deck.md](ops-image-card-deck.md) | ExploreConfig ImageCardDeck | §7 | `GET /admin/explore/image-card-decks*` | Ops-D · **ECR-037 Closed** | | [ops-report-template.md](ops-report-template.md) | GrowthInsights ReportTemplate | §7 | `GET /admin/growth/report-templates*` | Ops-D · **ECR-038 Closed** | +| [ops-funnel-definition.md](ops-funnel-definition.md) | GrowthInsights FunnelDefinition | §7 | `GET /admin/analytics/funnel-definitions*` | Ops-D · **ECR-039 Closed** | 新功能:复制 `_TEMPLATE.md` → 填满 → 在本表登记 → 再编码。 diff --git a/.ai/product/feature-spec/ops-funnel-definition.md b/.ai/product/feature-spec/ops-funnel-definition.md new file mode 100644 index 0000000..5ffe301 --- /dev/null +++ b/.ai/product/feature-spec/ops-funnel-definition.md @@ -0,0 +1,41 @@ +# Feature Spec: GrowthInsights · FunnelDefinition(Ops · ECR-039) + +> Status: `Active`(Loop continuous · **ECR-039 Closed**) +> Parent: WAVE0-FROZEN · Predecessor: ECR-038 Closed +> Capability: `GrowthInsights` · BC: `Analytics_OpsB` +> 授权:`docs/WAVE0/LOOP_AUTHORIZATION.md` + +## Non-goals + +漏斗写配置 · UGC · 真支付 + +## L2 Domain + +| 概念 | 语义 | +|------|------| +| `FunnelDefinition` | 本切片只读目录;code 唯一(若适用) | + +## L3 API + +| Method | Path | 权限 | 语义 | +|--------|------|------|------| +| GET | `/admin/analytics/funnel-definitions` | `admin.analytics.read` | 只读 | +| GET | `/admin/analytics/funnel-definitions/{id}` | `admin.analytics.read` | 只读 | + +## Migration + +`000040`:表 + 种子(若有)(权限复用) + +## L4 AC + +| ID | Then | +|----|------| +| AC-F-01 | list 含种子或空列表合法 | +| AC-F-02 | 已知 id get 200 | +| AC-F-03 | 未知 id → 404 | +| AC-S-01 | 无 Admin → 401 | +| AC-S-02 | 无权限 → 403 | +| AC-P-01 | list < 500ms | +| AC-O-01 | N/A 只读 | + +contract_diff: `docs/CONTRACT_DIFF/ECR-039.yaml` diff --git a/apps/admin-h5/src/api/client.ts b/apps/admin-h5/src/api/client.ts index d26e8f9..572e2ce 100644 --- a/apps/admin-h5/src/api/client.ts +++ b/apps/admin-h5/src/api/client.ts @@ -485,6 +485,10 @@ export const adminApi = { request<{ items: Array> }>('GET', '/growth/report-templates'), reportTemplate: (id: string) => request>('GET', `/growth/report-templates/${id}`), + funnelDefinitions: () => + request<{ items: Array> }>('GET', '/analytics/funnel-definitions'), + funnelDefinition: (id: string) => + request>('GET', `/analytics/funnel-definitions/${id}`), orders: () => request<{ items: Array<{ diff --git a/apps/api/internal/handler/admin.go b/apps/api/internal/handler/admin.go index 2255521..b980461 100644 --- a/apps/api/internal/handler/admin.go +++ b/apps/api/internal/handler/admin.go @@ -67,6 +67,7 @@ func (h *AdminHandler) Register(api *gin.RouterGroup) { h.registerRhythmConfigs(authed) h.registerImageCardDecks(authed) h.registerReportTemplates(authed) + h.registerFunnelDefinitions(authed) } func (h *AdminHandler) Login(c *gin.Context) { diff --git a/apps/api/internal/handler/admin_funnel_definition.go b/apps/api/internal/handler/admin_funnel_definition.go new file mode 100644 index 0000000..f2295d7 --- /dev/null +++ b/apps/api/internal/handler/admin_funnel_definition.go @@ -0,0 +1,46 @@ +package handler + +import ( + "errors" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/google/uuid" + + "github.com/yuxingu/digital-psychology/apps/api/internal/middleware" + "github.com/yuxingu/digital-psychology/apps/api/internal/service/admin" + "github.com/yuxingu/digital-psychology/apps/api/pkg/response" +) + +func (h *AdminHandler) registerFunnelDefinitions(authed *gin.RouterGroup) { + g := authed.Group("/analytics") + g.GET("/funnel-definitions", middleware.RequireAdminPermission(h.Svc, admin.PermAnalyticsRead), h.ListFunnelDefinitions) + g.GET("/funnel-definitions/:id", middleware.RequireAdminPermission(h.Svc, admin.PermAnalyticsRead), h.GetFunnelDefinition) +} + +func (h *AdminHandler) ListFunnelDefinitions(c *gin.Context) { + items, err := h.Svc.ListFunnelDefinitions(c.Request.Context()) + if err != nil { + response.Fail(c, http.StatusInternalServerError, 50050, "list funnel-definition failed") + return + } + response.OK(c, gin.H{"items": items}) +} + +func (h *AdminHandler) GetFunnelDefinition(c *gin.Context) { + id, err := uuid.Parse(c.Param("id")) + if err != nil { + response.Fail(c, http.StatusBadRequest, 40002, "invalid id") + return + } + row, err := h.Svc.GetFunnelDefinition(c.Request.Context(), id) + if errors.Is(err, admin.ErrFunnelDefinitionNotFound) { + response.Fail(c, http.StatusNotFound, 40420, "funnel-definition not found") + return + } + if err != nil { + response.Fail(c, http.StatusInternalServerError, 50051, "get funnel-definition failed") + return + } + response.OK(c, row) +} diff --git a/apps/api/internal/integration/funnel_definition_test.go b/apps/api/internal/integration/funnel_definition_test.go new file mode 100644 index 0000000..3eb34d8 --- /dev/null +++ b/apps/api/internal/integration/funnel_definition_test.go @@ -0,0 +1,88 @@ +package integration_test + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "testing" + "time" + + "github.com/google/uuid" + "golang.org/x/crypto/bcrypt" +) + +func TestGrowthFunnelDefinitions(t *testing.T) { + r, pool := setupAPIPool(t) + ctx := context.Background() + tok := adminLogin(t, r, "admin", "change-me") + + _, code := doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/analytics/funnel-definitions", nil, "") + if code != http.StatusUnauthorized { + t.Fatalf("expected 401, got %d", code) + } + + limitedRoleID := uuid.New() + _, err := pool.Exec(ctx, `INSERT INTO admin_roles(id, name, system) VALUES ($1,$2,false)`, + limitedRoleID, "lim_"+limitedRoleID.String()[:8]) + if err != nil { + t.Fatal(err) + } + _, err = pool.Exec(ctx, `INSERT INTO admin_role_permissions(role_id, code) VALUES ($1,'admin.users.read')`, limitedRoleID) + if err != nil { + t.Fatal(err) + } + hash, err := bcrypt.GenerateFromPassword([]byte("limited-pass"), bcrypt.DefaultCost) + if err != nil { + t.Fatal(err) + } + limUser := fmt.Sprintf("lim_%d", time.Now().UnixNano()) + _, err = pool.Exec(ctx, `INSERT INTO admin_accounts(username, password_hash, role_id) VALUES ($1,$2,$3)`, + limUser, string(hash), limitedRoleID) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + _, _ = pool.Exec(ctx, `DELETE FROM admin_accounts WHERE username=$1`, limUser) + _, _ = pool.Exec(ctx, `DELETE FROM admin_roles WHERE id=$1`, limitedRoleID) + }) + limTok := adminLogin(t, r, limUser, "limited-pass") + _, code = doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/analytics/funnel-definitions", nil, limTok) + if code != http.StatusForbidden { + t.Fatalf("expected 403, got %d", code) + } + + start := time.Now() + env, code := doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/analytics/funnel-definitions", nil, tok) + if code != 200 || env.Code != 0 { + t.Fatalf("list http=%d msg=%s", code, env.Message) + } + if time.Since(start) > 500*time.Millisecond { + t.Fatalf("list too slow %v", time.Since(start)) + } + var list struct { + Items []struct { + ID string `json:"id"` + Code string `json:"code"` + } `json:"items"` + } + _ = json.Unmarshal(env.Data, &list) + var id string + for _, it := range list.Items { + if it.Code == "signup_to_ask" { + id = it.ID + break + } + } + if id == "" { + t.Fatalf("missing signup_to_ask: %#v", list.Items) + } + env, code = doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/analytics/funnel-definitions/"+id, nil, tok) + if code != 200 { + t.Fatalf("get %d", code) + } + _, code = doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/analytics/funnel-definitions/"+fakeUUID(), nil, tok) + if code != http.StatusNotFound { + t.Fatalf("expected 404, got %d", code) + } +} diff --git a/apps/api/internal/repository/funnel_definition_repo.go b/apps/api/internal/repository/funnel_definition_repo.go new file mode 100644 index 0000000..5a28b0c --- /dev/null +++ b/apps/api/internal/repository/funnel_definition_repo.go @@ -0,0 +1,57 @@ +package repository + +import ( + "context" + "errors" + "time" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5" +) + +// FunnelDefinitionRow is FunnelDefinition catalog row. +type FunnelDefinitionRow struct { + ID uuid.UUID `json:"id"` + Code string `json:"code"` + Title string `json:"title"` + Active bool `json:"active"` + System bool `json:"system"` + UpdatedAt time.Time `json:"updated_at"` +} + +// ListFunnelDefinitions returns FunnelDefinition catalog. +func (r *AdminRepo) ListFunnelDefinitions(ctx context.Context) ([]FunnelDefinitionRow, error) { + rows, err := r.Pool.Query(ctx, ` + SELECT id, code, title, active, system, updated_at + FROM funnel_definitions + ORDER BY active DESC, code ASC`) + if err != nil { + return nil, err + } + defer rows.Close() + var out []FunnelDefinitionRow + for rows.Next() { + var row FunnelDefinitionRow + if err := rows.Scan(&row.ID, &row.Code, &row.Title, &row.Active, &row.System, &row.UpdatedAt); err != nil { + return nil, err + } + out = append(out, row) + } + return out, rows.Err() +} + +// GetFunnelDefinition loads one by id. +func (r *AdminRepo) GetFunnelDefinition(ctx context.Context, id uuid.UUID) (*FunnelDefinitionRow, error) { + var row FunnelDefinitionRow + err := r.Pool.QueryRow(ctx, ` + SELECT id, code, title, active, system, updated_at + FROM funnel_definitions WHERE id=$1`, id, + ).Scan(&row.ID, &row.Code, &row.Title, &row.Active, &row.System, &row.UpdatedAt) + if errors.Is(err, pgx.ErrNoRows) { + return nil, err + } + if err != nil { + return nil, err + } + return &row, nil +} diff --git a/apps/api/internal/service/admin/funnel_definition.go b/apps/api/internal/service/admin/funnel_definition.go new file mode 100644 index 0000000..5d3bd46 --- /dev/null +++ b/apps/api/internal/service/admin/funnel_definition.go @@ -0,0 +1,34 @@ +package admin + +import ( + "context" + "errors" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5" + + "github.com/yuxingu/digital-psychology/apps/api/internal/repository" +) + +var ErrFunnelDefinitionNotFound = errString("funnel definition not found") + +// ListFunnelDefinitions returns catalog. +func (s *Service) ListFunnelDefinitions(ctx context.Context) ([]repository.FunnelDefinitionRow, error) { + items, err := s.Repo.ListFunnelDefinitions(ctx) + if err != nil { + return nil, err + } + if items == nil { + items = []repository.FunnelDefinitionRow{} + } + return items, nil +} + +// GetFunnelDefinition loads one. +func (s *Service) GetFunnelDefinition(ctx context.Context, id uuid.UUID) (*repository.FunnelDefinitionRow, error) { + row, err := s.Repo.GetFunnelDefinition(ctx, id) + if errors.Is(err, pgx.ErrNoRows) { + return nil, ErrFunnelDefinitionNotFound + } + return row, err +} diff --git a/apps/api/migrations/000040_funnel_definitions.down.sql b/apps/api/migrations/000040_funnel_definitions.down.sql new file mode 100644 index 0000000..5227afa --- /dev/null +++ b/apps/api/migrations/000040_funnel_definitions.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS funnel_definitions; diff --git a/apps/api/migrations/000040_funnel_definitions.up.sql b/apps/api/migrations/000040_funnel_definitions.up.sql new file mode 100644 index 0000000..9cb8a77 --- /dev/null +++ b/apps/api/migrations/000040_funnel_definitions.up.sql @@ -0,0 +1,17 @@ +-- ECR-039 FunnelDefinition (read catalog) + +CREATE TABLE IF NOT EXISTS funnel_definitions ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid(), + code varchar(64) NOT NULL UNIQUE, + title varchar(128) NOT NULL, + active boolean NOT NULL DEFAULT true, + system boolean NOT NULL DEFAULT false, + created_at timestamptz NOT NULL DEFAULT now(), + updated_at timestamptz NOT NULL DEFAULT now() +); + +CREATE INDEX IF NOT EXISTS idx_funnel_definitions_active ON funnel_definitions(active); + +INSERT INTO funnel_definitions(code, title, active, system) +VALUES ('signup_to_ask', '注册到问答漏斗占位', true, true) +ON CONFLICT (code) DO NOTHING; diff --git a/docs/BACKEND_DESIGN/BD-2026-039-funnel-definition.md b/docs/BACKEND_DESIGN/BD-2026-039-funnel-definition.md new file mode 100644 index 0000000..313453b --- /dev/null +++ b/docs/BACKEND_DESIGN/BD-2026-039-funnel-definition.md @@ -0,0 +1,23 @@ +# Backend Design: ECR-039 FunnelDefinition + +| ID | BD-2026-039 | +| Status | Approved | +| Coding | Loop authorized | +| Level | L2 | +| Migration | YES 000040 | + +## Backend Change Boundary + +```text +Domain: FunnelDefinition (read) +App: AdminHandler → admin.Service → AdminRepo +API: GET /admin/analytics/funnel-definitions; GET /admin/analytics/funnel-definitions/{id} +Permission: admin.analytics.read +Migration: 000040 +``` + +## Out of boundary + +漏斗写配置 · UGC · 真支付 + +Rollback: down migration + remove routes/UI diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 17f4ff5..f28d3b9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2026-08-08 +- **ECR-039 Closed**:GrowthInsights FunnelDefinition(migration 000040 · admin client · /analytics/funnel-definitions · 只读) - **ECR-038 Closed**:GrowthInsights ReportTemplate(migration 000039 · admin client · /growth/report-templates · 只读) - **ECR-037 Closed**:ExploreConfig ImageCardDeck(migration 000038 · admin client · /explore/image-card-decks · 只读) - **ECR-036 Closed**:ExploreConfig RhythmConfig(migration 000037 · admin client · /explore/rhythm-configs · 只读) diff --git a/docs/CODE_REVIEW/ECR-039.md b/docs/CODE_REVIEW/ECR-039.md new file mode 100644 index 0000000..ec74bd2 --- /dev/null +++ b/docs/CODE_REVIEW/ECR-039.md @@ -0,0 +1,8 @@ +# CODE_REVIEW — ECR-039 + +**Verdict:** Approve → Closed + +Date: 2026-08-08 · Loop continuous + +- FunnelDefinition 只读;无 UGC/真支付 +- Integration AC mapped · OpenAPI updated diff --git a/docs/CONTRACT_DIFF/ECR-039.yaml b/docs/CONTRACT_DIFF/ECR-039.yaml new file mode 100644 index 0000000..0c7796a --- /dev/null +++ b/docs/CONTRACT_DIFF/ECR-039.yaml @@ -0,0 +1,22 @@ +ecr: ECR-039 +capability: GrowthInsights +bounded_context: Analytics_OpsB +parent: WAVE0-FROZEN +predecessor: ECR-038 +change: + type: additive +breaking_change: false +migration_required: true +compatibility_notes: > + Adds FunnelDefinition read catalog. Forbidden: UGC / real payment. + +apis: + - method: GET + path: /api/v1/admin/analytics/funnel-definitions + change: added + - method: GET + path: /api/v1/admin/analytics/funnel-definitions/{id} + change: added +perms: + - code: admin.analytics.read + change: unchanged diff --git a/docs/ECR/ECR-039-funnel-definition.md b/docs/ECR/ECR-039-funnel-definition.md new file mode 100644 index 0000000..026c326 --- /dev/null +++ b/docs/ECR/ECR-039-funnel-definition.md @@ -0,0 +1,15 @@ +# ECR-039 + +**Title:** GrowthInsights · FunnelDefinition(只读薄切片) +**Status:** **Closed** +**Closed:** 2026-08-08(Loop continuous) +**Parent:** WAVE0-FROZEN · **Predecessor:** ECR-038 Closed +**Change Level:** L2 + +## Change + +FunnelDefinition 只读 · migration 000040 · admin client · /analytics/funnel-definitions + +## Linked + +Spec `ops-funnel-definition.md` · BD-2026-039 · CONTRACT_DIFF/ECR-039.yaml · TEST_REPORT/ECR-039.md diff --git a/docs/ENGINEERING_SPEC/ECR-039-funnel-definition.md b/docs/ENGINEERING_SPEC/ECR-039-funnel-definition.md new file mode 100644 index 0000000..2baf008 --- /dev/null +++ b/docs/ENGINEERING_SPEC/ECR-039-funnel-definition.md @@ -0,0 +1,6 @@ +# ENGINEERING_SPEC — ECR-039 + +1. migration 000040 +2. AdminRepo/Service/Handler +3. OpenAPI + admin-h5 +4. Integration · Closed diff --git a/docs/HANDOFF/ECR-039-architect-to-engineer.md b/docs/HANDOFF/ECR-039-architect-to-engineer.md new file mode 100644 index 0000000..004ba5b --- /dev/null +++ b/docs/HANDOFF/ECR-039-architect-to-engineer.md @@ -0,0 +1,3 @@ +# HANDOFF — ECR-039 Architect → Engineer + +Loop continuous · Approved + Coding. Migration 000040. Forbidden: UGC/真支付. diff --git a/docs/HANDOFF/ECR-039-engineer-to-reviewer.md b/docs/HANDOFF/ECR-039-engineer-to-reviewer.md new file mode 100644 index 0000000..110d642 --- /dev/null +++ b/docs/HANDOFF/ECR-039-engineer-to-reviewer.md @@ -0,0 +1,3 @@ +# HANDOFF — ECR-039 Engineer → Reviewer + +TestGrowthFunnelDefinitions PASS · Ready for Closed. diff --git a/docs/PRODUCT_SPEC/ECR-039-funnel-definition.md b/docs/PRODUCT_SPEC/ECR-039-funnel-definition.md new file mode 100644 index 0000000..5b429b4 --- /dev/null +++ b/docs/PRODUCT_SPEC/ECR-039-funnel-definition.md @@ -0,0 +1,3 @@ +# PRODUCT_SPEC — ECR-039 + +对齐 ops-funnel-definition.md · Approved · Loop · L2 · FunnelDefinition 只读 diff --git a/docs/STATE/ECR-039.md b/docs/STATE/ECR-039.md new file mode 100644 index 0000000..ed80a5e --- /dev/null +++ b/docs/STATE/ECR-039.md @@ -0,0 +1,6 @@ +# STATE — ECR-039 + +| Status | **Closed** | +| Phase | closed | +| Spec | ops-funnel-definition.md | +| Updated | 2026-08-08 | diff --git a/docs/TASKS/TASK-039-ECR039.yaml b/docs/TASKS/TASK-039-ECR039.yaml new file mode 100644 index 0000000..e9f74af --- /dev/null +++ b/docs/TASKS/TASK-039-ECR039.yaml @@ -0,0 +1,12 @@ +id: TASK-039-ECR039 +ecr: ECR-039 +title: GrowthInsights · FunnelDefinition(只读薄切片) +role: engineer +status: closed +change_level: L2 +parent: WAVE0-FROZEN +predecessor: ECR-038 +acceptance: + - Spec AC mapped + - FunnelDefinition read only + - No UGC / payment diff --git a/docs/TEST_REPORT/ECR-039.md b/docs/TEST_REPORT/ECR-039.md new file mode 100644 index 0000000..746a96e --- /dev/null +++ b/docs/TEST_REPORT/ECR-039.md @@ -0,0 +1,33 @@ +# TEST_REPORT — ECR-039 FunnelDefinition + +Date: 2026-08-08 · Loop continuous · commit: `PENDING` + +## Commands + +```bash +cd apps/api && go test ./internal/integration/ -run TestGrowthFunnelDefinitions -count=1 +npm run build:admin +python3 scripts/ess-validate.py --phase review --ecr ECR-039 +python3 scripts/ess-gate-check.py --ecr ECR-039 +``` + +## Results + +| Check | Result | +|-------|--------| +| TestGrowthFunnelDefinitions | PASS | +| build:admin | PASS | +| ess-validate review | PASS | +| ess-gate-check | PASS | + +## AC + +| ID | Evidence | +|----|----------| +| AC-F-01 | list seed/empty ok | +| AC-F-02 | get 200 | +| AC-F-03 | 未知 id → 404 | +| AC-S-01 | 401 | +| AC-S-02 | 403 | +| AC-P-01 | list < 500ms | +| AC-O-01 | N/A 只读 | diff --git a/docs/TRACEABILITY.md b/docs/TRACEABILITY.md index 437fd9e..cff2f40 100644 --- a/docs/TRACEABILITY.md +++ b/docs/TRACEABILITY.md @@ -43,3 +43,4 @@ | ECR-036 | ExploreConfig · RhythmConfig | **Closed** | Spec ops-rhythm-config.md · BD-2026-036 · migration 000037 · TEST_REPORT · CODE_REVIEW · Loop continuous | | ECR-037 | ExploreConfig · ImageCardDeck | **Closed** | Spec ops-image-card-deck.md · BD-2026-037 · migration 000038 · TEST_REPORT · CODE_REVIEW · Loop continuous | | ECR-038 | GrowthInsights · ReportTemplate | **Closed** | Spec ops-report-template.md · BD-2026-038 · migration 000039 · TEST_REPORT · CODE_REVIEW · Loop continuous | +| ECR-039 | GrowthInsights · FunnelDefinition | **Closed** | Spec ops-funnel-definition.md · BD-2026-039 · migration 000040 · TEST_REPORT · CODE_REVIEW · Loop continuous | diff --git a/docs/WAVE0/LOOP_AUTHORIZATION.md b/docs/WAVE0/LOOP_AUTHORIZATION.md index 10a5061..e067c55 100644 --- a/docs/WAVE0/LOOP_AUTHORIZATION.md +++ b/docs/WAVE0/LOOP_AUTHORIZATION.md @@ -55,4 +55,4 @@ Human 明文:**直接用 Loop,不用人工确认。** | Done | Next | |------|------| -| ECR-013A…038 Closed | **ECR-039** FunnelDefinition | +| ECR-013A…039 Closed | **ECR-040** ScaleDefinition 只读投影 | diff --git a/proto/openapi.yaml b/proto/openapi.yaml index d395d0e..165d3d8 100644 --- a/proto/openapi.yaml +++ b/proto/openapi.yaml @@ -1003,6 +1003,34 @@ paths: '404': description: Not found + /api/v1/admin/analytics/funnel-definitions: + get: + tags: [admin] + summary: List FunnelDefinition catalog + description: Requires admin.analytics.read + responses: + '200': + description: OK + '401': + description: Unauthorized + '403': + description: Forbidden + + /api/v1/admin/analytics/funnel-definitions/{id}: + get: + tags: [admin] + summary: Get FunnelDefinition + parameters: + - in: path + name: id + required: true + schema: { type: string, format: uuid } + responses: + '200': + description: OK + '404': + description: Not found + /api/v1/admin/crisis/policies: get: tags: [admin]