From b195e380a9700978843545fbcfefb9ea384b7ef4 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 22 Sep 2021 14:01:49 +0200 Subject: [PATCH] adding basic action reuse and recycling --- CHANGELOG.md | 1 + ereuse_devicehub/__init__.py | 2 +- ereuse_devicehub/resources/action/__init__.py | 10 ++++++++++ ereuse_devicehub/resources/action/models.py | 8 ++++++++ ereuse_devicehub/resources/action/schemas.py | 8 ++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 298f5c8a..b5709f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ml). ## testing [1.0.10-beta] +- [addend] #166 new action recycling and reuse ## [1.0.10-beta] diff --git a/ereuse_devicehub/__init__.py b/ereuse_devicehub/__init__.py index d44f1a11..7a5be26c 100644 --- a/ereuse_devicehub/__init__.py +++ b/ereuse_devicehub/__init__.py @@ -1 +1 @@ -__version__ = "1.0.9-beta" +__version__ = "1.0.10-beta" diff --git a/ereuse_devicehub/resources/action/__init__.py b/ereuse_devicehub/resources/action/__init__.py index bdc55014..341d5640 100644 --- a/ereuse_devicehub/resources/action/__init__.py +++ b/ereuse_devicehub/resources/action/__init__.py @@ -194,6 +194,16 @@ class ReadyDef(ActionDef): SCHEMA = schemas.Ready +class RecyclingDef(ActionDef): + VIEW = None + SCHEMA = schemas.Recycling + + +class ReuseDef(ActionDef): + VIEW = None + SCHEMA = schemas.Reuse + + class ToPrepareDef(ActionDef): VIEW = None SCHEMA = schemas.ToPrepare diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index fdbdf1fa..7529b513 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1341,6 +1341,14 @@ class DataWipe(JoinedTableMixin, ActionWithMultipleDevices): primaryjoin='DataWipe.document_id == DataWipeDocument.id') +class Recycling(ActionWithMultipleDevices): + """This action mark one devices or container as recycled""" + + +class Reuse(ActionWithMultipleDevices): + """This action mark one devices or container as reuse""" + + class Prepare(ActionWithMultipleDevices): """Work has been performed to the device to a defined point of acceptance. diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index 3232f11b..22ff595c 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -423,6 +423,14 @@ class Ready(ActionWithMultipleDevices): __doc__ = m.Ready.__doc__ +class Recycling(ActionWithMultipleDevices): + __doc__ = m.Recycling.__doc__ + + +class Reuse(ActionWithMultipleDevices): + __doc__ = m.Reuse.__doc__ + + class ToPrepare(ActionWithMultipleDevices): __doc__ = m.ToPrepare.__doc__