From ec2d286ed3443c250a49e7b76fed38a1c6e063fe Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 5 Oct 2021 11:56:19 +0200 Subject: [PATCH] adding action delete --- ereuse_devicehub/resources/action/__init__.py | 5 +++++ ereuse_devicehub/resources/action/models.py | 6 ++++++ ereuse_devicehub/resources/action/schemas.py | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/ereuse_devicehub/resources/action/__init__.py b/ereuse_devicehub/resources/action/__init__.py index 0c3d3e9c..b7405368 100644 --- a/ereuse_devicehub/resources/action/__init__.py +++ b/ereuse_devicehub/resources/action/__init__.py @@ -255,6 +255,11 @@ class MakeAvailable(ActionDef): SCHEMA = schemas.MakeAvailable +class Delete(ActionDef): + VIEW = None + SCHEMA = schemas.Delete + + class ConfirmDef(ActionDef): VIEW = None SCHEMA = schemas.Confirm diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index 603462b8..c1cade90 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1680,6 +1680,12 @@ class MoveOnDocument(JoinedTableMixin, ActionWithMultipleTradeDocuments): container_to_id.comment = """This is the trade document used as container in a outgoing lot""" +class Delete(JoinedTableMixin, ActionWithMultipleDevices): + """The act save in device who and why this devices was delete. + We never delete one device, but we can deactivate.""" + pass + + class Migrate(JoinedTableMixin, ActionWithMultipleDevices): """Moves the devices to a new database/inventory. Devices cannot be modified anymore at the previous database. diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index ec11dd8f..8671b5a8 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -830,6 +830,10 @@ class TransferOwnershipBlockchain(Trade): __doc__ = m.TransferOwnershipBlockchain.__doc__ +class Delete(ActionWithMultipleDevices): + __doc__ = m.Delete.__doc__ + + class Migrate(ActionWithMultipleDevices): __doc__ = m.Migrate.__doc__ other = URL()