robosats/api/serializers.py

22 lines
786 B
Python
Raw Normal View History

from rest_framework import serializers
2022-01-06 12:32:17 +00:00
from .models import Order, LNPayment
class ListOrderSerializer(serializers.ModelSerializer):
class Meta:
model = Order
fields = ('id','status','created_at','expires_at','type','currency','amount','payment_method','is_explicit','premium','satoshis','maker','taker')
class MakeOrderSerializer(serializers.ModelSerializer):
class Meta:
model = Order
fields = ('type','currency','amount','payment_method','is_explicit','premium','satoshis')
class UpdateOrderSerializer(serializers.ModelSerializer):
class Meta:
model = Order
2022-01-06 12:32:17 +00:00
fields = ('id','buyer_invoice')
class UpdateInvoiceSerializer(serializers.ModelSerializer):
class Meta:
model = LNPayment
fields = ['invoice']