feat(l1): account L1 category settings API (owner/admin write)

GET /accounts/me/l1-categories (require_l1_or_above) returns enabled + available
+ hard_floor; PATCH (require_account_owner_or_admin) sets the enabled set, dropping
unknown/hard-floored keys via l1_category_service. New L1CategoriesResponse/Update
schemas. 6 API tests green (incl. engineer + l1_tech write both 403); test_accounts
regression 36 passed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 20:01:32 -04:00
parent 04d2cfb9a5
commit 1d3f9d0a8a
3 changed files with 181 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
"""Schemas for the account L1 AI-build category settings surface (Phase 2A)."""
from pydantic import BaseModel
class L1CategoriesResponse(BaseModel):
"""Current enabled set + the full available list + the read-only hard floor."""
enabled: list[str]
available: list[str]
hard_floor: list[str]
class L1CategoriesUpdate(BaseModel):
"""Owner/admin write: the new enabled set (unknown/hard-floored keys dropped)."""
enabled: list[str]