Remove Stripe pricing table integration#479
Conversation
The pricing dashboard is being retired — self-serve onboarding will move to my.amazee.io. This removes all pricing table UI, API endpoints, and supporting code. Removed: - Frontend: /upgrade page, /team-admin/pricing page, pricing table admin components (dialog + list), use-upgrade store + tests, pricing-table types - Backend: /pricing-tables API (pricing_tables.py), pricing-table-session endpoint from billing, get_pricing_table_secret from stripe service, PricingTable* schemas - Infra: pricing table migration call from initialise_resources.py - Sidebar 'Pricing' link, /upgrade public path in middleware Kept (for engineering to decide on separately): - DBPricingTable model + migration (needs a proper migration to drop) - scripts/migrate_pricing_tables.py (dead, no longer called) - generate_pricing_url() — still used by always-free email and auth re-validation flow
❌ Critical Issues (Blocking Merge)The PR is currently failing the
|
There was a problem hiding this comment.
Pull request overview
Removes the retired Stripe Pricing Table–based pricing dashboard across frontend and backend, including UI pages/components, API endpoints, schemas, and initialization hooks.
Changes:
- Frontend: delete
/upgradeand/team-admin/pricingpages plus admin pricing-table management UI/state/types. - Backend: delete pricing tables CRUD API and the
/billing/teams/{id}/pricing-table-sessionendpoint, along with associated Stripe helper + schemas. - Init script: stop running the historical pricing-table data migration during resource initialization.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/initialise_resources.py | Removes pricing-table migration import and execution from initialization flow. |
| frontend/src/types/pricing-table.ts | Deletes shared pricing-table type definitions. |
| frontend/src/stores/use-upgrade.ts | Deletes Zustand store for tokenized /upgrade pricing flow. |
| frontend/src/stores/use-upgrade.test.ts | Removes tests for the deleted use-upgrade store. |
| frontend/src/middleware.ts | Removes /upgrade from public paths in Next.js middleware. |
| frontend/src/components/sidebar-layout.tsx | Removes “Pricing” navigation entry and related /upgrade sidebar suppression. |
| frontend/src/app/upgrade/page.tsx | Deletes token-auth pricing page that rendered Stripe pricing table. |
| frontend/src/app/team-admin/pricing/page.tsx | Deletes team-admin pricing page that rendered Stripe pricing table. |
| frontend/src/app/admin/products/page.tsx | Removes Pricing Tables tab and related queries/dialog wiring from admin products page. |
| frontend/src/app/admin/products/_components/pricing-tables-list.tsx | Deletes admin pricing tables list component. |
| frontend/src/app/admin/products/_components/pricing-table-dialog.tsx | Deletes admin pricing table create/update dialog component. |
| app/services/stripe.py | Removes get_pricing_table_secret() Stripe customer-session helper. |
| app/schemas/models.py | Removes pricing-table-related Pydantic schemas. |
| app/main.py | Removes inclusion of the /pricing-tables router. |
| app/api/pricing_tables.py | Deletes pricing tables CRUD API router. |
| app/api/billing.py | Removes GET /billing/teams/{team_id}/pricing-table-session endpoint and related imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| app.include_router(teams.router, prefix="/teams", tags=["teams"]) | ||
| app.include_router(billing.router, prefix="/billing", tags=["billing"]) | ||
| app.include_router(products.router, prefix="/products", tags=["products"]) | ||
| app.include_router( | ||
| pricing_tables.router, prefix="/pricing-tables", tags=["pricing-tables"] | ||
| ) | ||
| app.include_router(limits.router, prefix="/limits", tags=["limits"]) | ||
| app.include_router(budgets.router, prefix="/budgets", tags=["budgets"]) | ||
| app.include_router(spend.router, prefix="/spend", tags=["spend"]) |
There was a problem hiding this comment.
Already implemented in commit 45f20c4: deleted tests/test_pricing_tables.py entirely (777 lines) which tested the removed /pricing-tables router.
|
|
||
|
|
||
| @router.get( | ||
| "/teams/{team_id}/pricing-table-session", | ||
| dependencies=[Depends(get_role_min_specific_team_admin)], | ||
| response_model=PricingTableSession, | ||
| ) | ||
| async def get_pricing_table_session(team_id: int, db: Session = Depends(get_db)): | ||
| """ | ||
| Create a Stripe Customer Session client secret for team subscription management. | ||
| If the team doesn't have a Stripe customer ID, one will be created first. | ||
|
|
||
| Args: | ||
| team_id: The ID of the team to create the customer session for | ||
|
|
||
| Returns: | ||
| JSON response containing the client secret | ||
| """ | ||
| # Get the team | ||
| team = db.query(DBTeam).filter(DBTeam.id == team_id).first() | ||
| if not team: | ||
| raise HTTPException( | ||
| status_code=status.HTTP_404_NOT_FOUND, detail="Team not found" | ||
| ) | ||
|
|
||
| try: | ||
| # Create Stripe customer if one doesn't exist | ||
| if not team.stripe_customer_id: | ||
| logger.info(f"Creating Stripe customer for team {team.id}") | ||
| team.stripe_customer_id = await create_stripe_customer(team) | ||
| db.add(team) | ||
| db.commit() | ||
|
|
||
| logger.info(f"Stripe ID is {team.stripe_customer_id}") | ||
| # Create customer session using the service | ||
| client_secret = await get_pricing_table_secret(team.stripe_customer_id) | ||
|
|
||
| return PricingTableSession(client_secret=client_secret) | ||
| except Exception as e: | ||
| logger.error(f"Error creating customer session: {str(e)}") | ||
| raise HTTPException( | ||
| status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, | ||
| detail="Error creating customer session", | ||
| ) | ||
|
|
||
|
|
||
| @router.post( | ||
| "/teams/{team_id}/subscriptions", | ||
| dependencies=[Depends(get_role_min_system_admin)], |
There was a problem hiding this comment.
Implemented in commit 45f20c4: removed the obsolete /billing/teams/{id}/pricing-table-session tests from tests/test_billing.py and deleted tests/test_pricing_tables.py.
|
@dspachos yes, go ahead. thank you! |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/amazeeio/amazee.ai/sessions/2645d932-bf74-4781-afff-5f7344505fe4 Co-authored-by: dan2k3k4 <158704+dan2k3k4@users.noreply.github.com>
Addressed in commit |
dspachos
left a comment
There was a problem hiding this comment.
Perhaps this should me merged to dev? (I see base branch is main now)
What
The pricing dashboard is being retired. Self-serve onboarding will move to my.amazee.io. This removes the entire Stripe pricing table integration — UI, API, and supporting code.
Removed (16 files, -1,762 lines)
Frontend
/upgradepage — the email-linked pricing page with JWT token auth/team-admin/pricingpage — logged-in team admin pricing view/admin/productsuse-upgradestore + testspricing-tabletypes/upgradefrom public paths in middlewareBackend
app/api/pricing_tables.py— full CRUD API for pricing table recordsGET /billing/teams/{id}/pricing-table-sessionendpointget_pricing_table_secret()from stripe servicePricingTableSession,PricingTableCreate,PricingTableResponse,PricingTablesResponseschemasinitialise_resources.pyKept for engineering to decide on
DBPricingTablemodel + DB migration — thepricing_tablestable still exists in the DB. Dropping it needs a proper Alembic migration. Leaving for you to decide timing.scripts/migrate_pricing_tables.py— dead script, no longer called from init. Can be deleted alongside the DB table drop.generate_pricing_url()— still used by thealways-freeemail and the auth re-validation flow (returning-user-url). Separate concern.Also: deactivate the pricing table in Stripe Dashboard
This has already been completed
Related