Skip to content

feat(routes): register tenants and feature-flag routers in the app - #1478

Closed
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feat/1216-register-tenants-and-feature-flags-routers
Closed

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feat/1216-register-tenants-and-feature-flags-routers

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1216

Summary

Registers createTenantsRouter at /tenants (/api/tenants) and createFeatureFlagsRouter at /feature-flags (/api/feature-flags) inside createApiRouter (src/routes/index.ts), allows app.locals.tenantRepository overrides in src/routes/tenants.ts, updates src/routes/tenants.openapi.test.ts to run against createApp(), and documents the app registration in docs/tenants-api.md.

Acceptance Criteria Mapping

  • POST /api/tenants, GET /api/tenants, and PATCH /api/tenants/:tenantId are reachable on createApp() and enforce authentication + Zod validation: Verified in src/routes/tenants.openapi.test.ts.
  • GET /api/feature-flags is reachable on createApp() and returns the enveloped flag map with an ETag header and 304 support: Verified in src/routes/tenants.openapi.test.ts.
  • src/routes/tenants.openapi.test.ts runs against createApp(): Updated buildApp to use createApp().

Validation

  • npx jest src/routes/tenants.openapi.test.ts --no-cache (all 23 tests pass).

Payout Wallet (Base Mainnet USDC / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register tenants and feature-flag routers in the app

2 participants