netcop-ai/wallet/serializers.py
thecyberlearn 060c3a9c78 Initial commit: Django web app with user auth, Stripe payments, and n8n workflow integration
Features:
- Email-based user authentication with token auth
- Stripe Checkout integration for wallet top-ups
- n8n workflow triggering with automatic fee deduction ($0.10)
- Comprehensive transaction and usage logging
- Django Admin interface for monitoring
- Rate limiting and security middleware
- Production-ready deployment configuration
- Modular settings (dev/prod environments)
- UUID primary keys for enhanced security
- Comprehensive test coverage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 13:34:19 +05:30

14 lines
508 B
Python

from rest_framework import serializers
from decimal import Decimal
from .models import WalletTransaction
class WalletTransactionSerializer(serializers.ModelSerializer):
class Meta:
model = WalletTransaction
fields = ('id', 'transaction_type', 'amount', 'status', 'description', 'created_at')
read_only_fields = ('id', 'created_at')
class TopUpSerializer(serializers.Serializer):
amount = serializers.DecimalField(max_digits=10, decimal_places=2, min_value=Decimal('1.00'))