Enhance API structure and documentation: Added new tags for Account, Integration, Automation, Linker, Optimizer, and Publisher; updated billing endpoints for admin and customer; improved API reference documentation; fixed endpoint paths in frontend services.
This commit is contained in:
@@ -10,6 +10,7 @@ from django.contrib.auth import get_user_model
|
||||
from django.db.models import Q, Count, Sum
|
||||
from django.utils import timezone
|
||||
from datetime import timedelta
|
||||
from drf_spectacular.utils import extend_schema, extend_schema_view
|
||||
|
||||
from igny8_core.auth.models import Account
|
||||
from igny8_core.business.billing.models import CreditTransaction
|
||||
@@ -17,6 +18,10 @@ from igny8_core.business.billing.models import CreditTransaction
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
retrieve=extend_schema(tags=['Account']),
|
||||
partial_update=extend_schema(tags=['Account']),
|
||||
)
|
||||
class AccountSettingsViewSet(viewsets.ViewSet):
|
||||
"""Account settings management"""
|
||||
permission_classes = [IsAuthenticated]
|
||||
@@ -77,6 +82,11 @@ class AccountSettingsViewSet(viewsets.ViewSet):
|
||||
})
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
list=extend_schema(tags=['Account']),
|
||||
create=extend_schema(tags=['Account']),
|
||||
destroy=extend_schema(tags=['Account']),
|
||||
)
|
||||
class TeamManagementViewSet(viewsets.ViewSet):
|
||||
"""Team members management"""
|
||||
permission_classes = [IsAuthenticated]
|
||||
@@ -166,6 +176,9 @@ class TeamManagementViewSet(viewsets.ViewSet):
|
||||
)
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
overview=extend_schema(tags=['Account']),
|
||||
)
|
||||
class UsageAnalyticsViewSet(viewsets.ViewSet):
|
||||
"""Usage analytics and statistics"""
|
||||
permission_classes = [IsAuthenticated]
|
||||
|
||||
@@ -8,7 +8,20 @@ from drf_spectacular.utils import extend_schema, OpenApiResponse
|
||||
from rest_framework import status
|
||||
|
||||
# Explicit tags we want to keep (from SPECTACULAR_SETTINGS)
|
||||
EXPLICIT_TAGS = {'Authentication', 'Planner', 'Writer', 'System', 'Billing'}
|
||||
EXPLICIT_TAGS = {
|
||||
'Authentication',
|
||||
'Planner',
|
||||
'Writer',
|
||||
'System',
|
||||
'Billing',
|
||||
'Account',
|
||||
'Automation',
|
||||
'Linker',
|
||||
'Optimizer',
|
||||
'Publisher',
|
||||
'Integration',
|
||||
'Admin Billing',
|
||||
}
|
||||
|
||||
|
||||
def postprocess_schema_filter_tags(result, generator, request, public):
|
||||
@@ -41,6 +54,20 @@ def postprocess_schema_filter_tags(result, generator, request, public):
|
||||
filtered_tags = ['System']
|
||||
elif '/billing/' in path or '/api/v1/billing/' in path:
|
||||
filtered_tags = ['Billing']
|
||||
elif '/account/' in path or '/api/v1/account/' in path:
|
||||
filtered_tags = ['Account']
|
||||
elif '/automation/' in path or '/api/v1/automation/' in path:
|
||||
filtered_tags = ['Automation']
|
||||
elif '/linker/' in path or '/api/v1/linker/' in path:
|
||||
filtered_tags = ['Linker']
|
||||
elif '/optimizer/' in path or '/api/v1/optimizer/' in path:
|
||||
filtered_tags = ['Optimizer']
|
||||
elif '/publisher/' in path or '/api/v1/publisher/' in path:
|
||||
filtered_tags = ['Publisher']
|
||||
elif '/integration/' in path or '/api/v1/integration/' in path:
|
||||
filtered_tags = ['Integration']
|
||||
elif '/admin/' in path or '/api/v1/admin/' in path:
|
||||
filtered_tags = ['Admin Billing']
|
||||
|
||||
operation['tags'] = filtered_tags
|
||||
|
||||
|
||||
Reference in New Issue
Block a user