feat(api): POST /billing/quota/check endpoint

Pre-flight quota check for folder_index. Returns 402 with reason
when file cap or monthly token budget would be exceeded; 200 {"ok": true}
otherwise. Also adds auth_headers_free fixture to conftest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Roberto
2026-05-12 09:14:56 +02:00
parent a98e99f7a2
commit ab24fc4c91
3 changed files with 62 additions and 1 deletions

View File

@@ -162,6 +162,12 @@ async def test_user_power(db_session: AsyncSession):
return result.scalar_one()
@pytest.fixture
def auth_headers_free() -> dict[str, str]:
"""Authorization header for the seeded free-tier user."""
return auth_header("free")
# ── CLI options ───────────────────────────────────────────────────────
def pytest_addoption(parser):