From 3bb74828768b0fd62d67e718d4f0ef77f90c10a9 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 19 Apr 2021 19:33:35 +0200 Subject: [PATCH] fixing schemas and states --- ereuse_devicehub/resources/action/schemas.py | 14 ++++++-------- ereuse_devicehub/resources/device/states.py | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index f300416c..a8956ba8 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -456,16 +456,14 @@ class CancelReservation(Organize): __doc__ = m.CancelReservation.__doc__ +class Confirm(ActionWithMultipleDevices): + __doc__ = m.Confirm.__doc__ + trade = NestedOn('Trade', dump_only=True) + user = NestedOn('User', dump_only=True) + + class Trade(ActionWithMultipleDevices): __doc__ = m.Trade.__doc__ - accepted_by_from = Boolean(missing=False, description=m.Trade.accepted_by_from.comment) - accepted_by_to = Boolean(missing=False, description=m.Trade.accepted_by_to.comment) - confirm_transfer = Boolean(missing=False, description=m.Trade.confirm_transfer.comment) - offer = NestedOn('Offer', dump_only=True) - - -class Offer(ActionWithMultipleDevices): - __doc__ = m.Offer.__doc__ document_id = SanitizedStr(validate=Length(max=STR_SIZE), data_key='documentID', required=False) date = DateTime(data_key='date', required=False) price = Float(required=False, data_key='price') diff --git a/ereuse_devicehub/resources/device/states.py b/ereuse_devicehub/resources/device/states.py index cbd4b9f4..bdfd1a03 100644 --- a/ereuse_devicehub/resources/device/states.py +++ b/ereuse_devicehub/resources/device/states.py @@ -23,7 +23,6 @@ class Trading(State): """Trading states. :cvar Reserved: The device has been reserved. - :cvar Offer: The devices has been offered for to do a Trade. :cvar Trade: The devices has been changed of owner. :cvar Cancelled: The device has been cancelled. :cvar Sold: The device has been sold. @@ -35,7 +34,6 @@ class Trading(State): from the facility. It does not mean end-of-life. """ Reserved = e.Reserve - Offer = e.Offer Trade = e.Trade Cancelled = e.CancelTrade Sold = e.Sell