55 lines
1.5 KiB
Python
55 lines
1.5 KiB
Python
"""
|
|
Billing API Views
|
|
Stub endpoints for billing pages
|
|
"""
|
|
from rest_framework import viewsets, status
|
|
from rest_framework.decorators import action
|
|
from rest_framework.response import Response
|
|
from rest_framework.permissions import IsAuthenticated
|
|
|
|
|
|
class BillingViewSet(viewsets.ViewSet):
|
|
"""Billing endpoints"""
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
@action(detail=False, methods=['get'], url_path='account_balance')
|
|
def account_balance(self, request):
|
|
"""Get user's credit balance"""
|
|
return Response({
|
|
'credits': 0,
|
|
'subscription_plan': 'Free',
|
|
'monthly_credits_included': 0,
|
|
'bonus_credits': 0
|
|
})
|
|
|
|
@action(detail=False, methods=['get'])
|
|
def transactions(self, request):
|
|
"""List credit transactions"""
|
|
return Response({
|
|
'results': [],
|
|
'count': 0
|
|
})
|
|
|
|
@action(detail=False, methods=['get'])
|
|
def usage(self, request):
|
|
"""List credit usage"""
|
|
return Response({
|
|
'results': [],
|
|
'count': 0
|
|
})
|
|
|
|
|
|
class AdminBillingViewSet(viewsets.ViewSet):
|
|
"""Admin billing endpoints"""
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
@action(detail=False, methods=['get'])
|
|
def stats(self, request):
|
|
"""System billing stats"""
|
|
return Response({
|
|
'total_users': 0,
|
|
'active_users': 0,
|
|
'total_credits_issued': 0,
|
|
'total_credits_used': 0
|
|
})
|