refactor: rename public routes and templates to platform
Complete the public -> platform naming migration across the codebase. This aligns with the naming convention where "platform" refers to the marketing/public-facing pages of the platform itself. Changes: - Update all imports from public to platform modules - Update template references from public/ to platform/ - Update route registrations to use platform prefix - Update documentation to reflect new naming - Update test files for platform API endpoints Files affected: - app/api/main.py - router imports - app/modules/*/routes/*/platform.py - route definitions - app/modules/*/templates/*/platform/ - template files - app/modules/routes.py - route discovery - docs/* - documentation updates - tests/integration/api/v1/platform/ - test files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# tests/integration/api/v1/public/test_pricing.py
|
||||
# tests/integration/api/v1/platform/test_pricing.py
|
||||
"""Integration tests for platform pricing API endpoints.
|
||||
|
||||
Tests the /api/v1/public/pricing/* endpoints.
|
||||
Tests the /api/v1/platform/pricing/* endpoints.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
@@ -18,15 +18,15 @@ from app.modules.billing.models import (
|
||||
@pytest.mark.api
|
||||
@pytest.mark.platform
|
||||
class TestPlatformPricingAPI:
|
||||
"""Test platform pricing endpoints at /api/v1/public/*."""
|
||||
"""Test platform pricing endpoints at /api/v1/platform/*."""
|
||||
|
||||
# =========================================================================
|
||||
# GET /api/v1/public/tiers
|
||||
# GET /api/v1/platform/pricing/tiers
|
||||
# =========================================================================
|
||||
|
||||
def test_get_tiers_returns_all_public_tiers(self, client):
|
||||
"""Test getting all subscription tiers."""
|
||||
response = client.get("/api/v1/public/tiers")
|
||||
response = client.get("/api/v1/platform/pricing/tiers")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -35,7 +35,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_tiers_has_expected_fields(self, client):
|
||||
"""Test that tier response has all expected fields."""
|
||||
response = client.get("/api/v1/public/tiers")
|
||||
response = client.get("/api/v1/platform/pricing/tiers")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -55,7 +55,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_tiers_includes_essential(self, client):
|
||||
"""Test that Essential tier is included."""
|
||||
response = client.get("/api/v1/public/tiers")
|
||||
response = client.get("/api/v1/platform/pricing/tiers")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -64,7 +64,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_tiers_includes_professional(self, client):
|
||||
"""Test that Professional tier is included and marked as popular."""
|
||||
response = client.get("/api/v1/public/tiers")
|
||||
response = client.get("/api/v1/platform/pricing/tiers")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -77,7 +77,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_tiers_includes_enterprise(self, client):
|
||||
"""Test that Enterprise tier is included and marked appropriately."""
|
||||
response = client.get("/api/v1/public/tiers")
|
||||
response = client.get("/api/v1/platform/pricing/tiers")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -108,7 +108,7 @@ class TestPlatformPricingAPI:
|
||||
db.add(tier)
|
||||
db.commit()
|
||||
|
||||
response = client.get("/api/v1/public/tiers")
|
||||
response = client.get("/api/v1/platform/pricing/tiers")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -116,12 +116,12 @@ class TestPlatformPricingAPI:
|
||||
assert "test_tier" in tier_codes
|
||||
|
||||
# =========================================================================
|
||||
# GET /api/v1/public/tiers/{tier_code}
|
||||
# GET /api/v1/platform/pricing/tiers/{tier_code}
|
||||
# =========================================================================
|
||||
|
||||
def test_get_tier_by_code_success(self, client):
|
||||
"""Test getting a specific tier by code."""
|
||||
response = client.get(f"/api/v1/public/tiers/{TierCode.PROFESSIONAL.value}")
|
||||
response = client.get(f"/api/v1/platform/pricing/tiers/{TierCode.PROFESSIONAL.value}")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -130,7 +130,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_tier_by_code_essential(self, client):
|
||||
"""Test getting Essential tier details."""
|
||||
response = client.get(f"/api/v1/public/tiers/{TierCode.ESSENTIAL.value}")
|
||||
response = client.get(f"/api/v1/platform/pricing/tiers/{TierCode.ESSENTIAL.value}")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -139,19 +139,19 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_tier_by_code_not_found(self, client):
|
||||
"""Test getting a non-existent tier returns 404."""
|
||||
response = client.get("/api/v1/public/tiers/nonexistent_tier")
|
||||
response = client.get("/api/v1/platform/pricing/tiers/nonexistent_tier")
|
||||
|
||||
assert response.status_code == 404
|
||||
data = response.json()
|
||||
assert "not found" in data["message"].lower()
|
||||
|
||||
# =========================================================================
|
||||
# GET /api/v1/public/addons
|
||||
# GET /api/v1/platform/pricing/addons
|
||||
# =========================================================================
|
||||
|
||||
def test_get_addons_empty_when_none_configured(self, client):
|
||||
"""Test getting add-ons when none are configured."""
|
||||
response = client.get("/api/v1/public/addons")
|
||||
response = client.get("/api/v1/platform/pricing/addons")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -173,7 +173,7 @@ class TestPlatformPricingAPI:
|
||||
db.add(addon)
|
||||
db.commit()
|
||||
|
||||
response = client.get("/api/v1/public/addons")
|
||||
response = client.get("/api/v1/platform/pricing/addons")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -197,7 +197,7 @@ class TestPlatformPricingAPI:
|
||||
db.add(addon)
|
||||
db.commit()
|
||||
|
||||
response = client.get("/api/v1/public/addons")
|
||||
response = client.get("/api/v1/platform/pricing/addons")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -236,7 +236,7 @@ class TestPlatformPricingAPI:
|
||||
db.add_all([active_addon, inactive_addon])
|
||||
db.commit()
|
||||
|
||||
response = client.get("/api/v1/public/addons")
|
||||
response = client.get("/api/v1/platform/pricing/addons")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -245,12 +245,12 @@ class TestPlatformPricingAPI:
|
||||
assert "inactive_addon" not in addon_codes
|
||||
|
||||
# =========================================================================
|
||||
# GET /api/v1/public/pricing
|
||||
# GET /api/v1/platform/pricing
|
||||
# =========================================================================
|
||||
|
||||
def test_get_pricing_returns_complete_info(self, client):
|
||||
"""Test getting complete pricing information."""
|
||||
response = client.get("/api/v1/public/pricing")
|
||||
response = client.get("/api/v1/platform/pricing")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -262,7 +262,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_pricing_includes_trial_days(self, client):
|
||||
"""Test that pricing includes correct trial period."""
|
||||
response = client.get("/api/v1/public/pricing")
|
||||
response = client.get("/api/v1/platform/pricing")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -270,7 +270,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_pricing_includes_annual_discount(self, client):
|
||||
"""Test that pricing includes annual discount info."""
|
||||
response = client.get("/api/v1/public/pricing")
|
||||
response = client.get("/api/v1/platform/pricing")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -278,7 +278,7 @@ class TestPlatformPricingAPI:
|
||||
|
||||
def test_get_pricing_tiers_not_empty(self, client):
|
||||
"""Test that pricing always includes tiers."""
|
||||
response = client.get("/api/v1/public/pricing")
|
||||
response = client.get("/api/v1/platform/pricing")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
|
||||
Reference in New Issue
Block a user