Include created_at

This commit is contained in:
koalasat
2024-07-09 21:50:48 +02:00
parent adbaa60da2
commit 6885a24f59
2 changed files with 5 additions and 2 deletions

View File

@ -494,15 +494,15 @@ class ListNotificationSerializer(serializers.ModelSerializer):
status = serializers.SerializerMethodField( status = serializers.SerializerMethodField(
help_text="The `status` of the order when the notification was trigered", help_text="The `status` of the order when the notification was trigered",
) )
class Meta: class Meta:
model = Notification model = Notification
fields = ("title", "description", "order_id", "status") fields = ("title", "description", "order_id", "status", "created_at")
def get_status(self, notification) -> int: def get_status(self, notification) -> int:
return notification.order.status return notification.order.status
class OrderPublicSerializer(serializers.ModelSerializer): class OrderPublicSerializer(serializers.ModelSerializer):
maker_nick = serializers.CharField(required=False) maker_nick = serializers.CharField(required=False)
maker_hash_id = serializers.CharField(required=False) maker_hash_id = serializers.CharField(required=False)

View File

@ -1110,6 +1110,9 @@ components:
type: integer type: integer
readOnly: true readOnly: true
description: The `status` of the order when the notification was trigered description: The `status` of the order when the notification was trigered
created_at:
type: string
format: date-time
required: required:
- order_id - order_id
- status - status