2022-01-01 22:34:23 +00:00
|
|
|
from rest_framework import serializers
|
2022-01-06 12:32:17 +00:00
|
|
|
from .models import Order, LNPayment
|
2022-01-01 22:34:23 +00:00
|
|
|
|
2022-01-05 00:13:08 +00:00
|
|
|
class ListOrderSerializer(serializers.ModelSerializer):
|
2022-01-01 22:34:23 +00:00
|
|
|
class Meta:
|
|
|
|
model = Order
|
2022-01-04 10:21:45 +00:00
|
|
|
fields = ('id','status','created_at','expires_at','type','currency','amount','payment_method','is_explicit','premium','satoshis','maker','taker')
|
2022-01-01 22:34:23 +00:00
|
|
|
|
|
|
|
class MakeOrderSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = Order
|
2022-01-05 00:13:08 +00:00
|
|
|
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']
|