diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 3737fe68..a91beb5f 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -335,6 +335,7 @@ class Device(Thing): if act.type == 'Allocate': allo = {'type': 'Allocate', + 'systemId': self.id, 'finalUserCode': act.final_user_code, 'numEndUsers': act.end_users, 'hid': self.hid, @@ -353,6 +354,7 @@ class Device(Thing): if act.type == 'Deallocate': deallo = {'type': 'Deallocate', + 'systemId': self.id, 'finalUserCode': '', 'numEndUsers': '', 'hid': self.hid, diff --git a/ereuse_devicehub/resources/documents/device_row.py b/ereuse_devicehub/resources/documents/device_row.py index 7e5da1b4..5744bbc7 100644 --- a/ereuse_devicehub/resources/documents/device_row.py +++ b/ereuse_devicehub/resources/documents/device_row.py @@ -368,11 +368,12 @@ class ActionRow(OrderedDict): def __init__(self, allocate): super().__init__() # General information about allocates, deallocate and lives + self['SystemId'] = allocate['systemId'] self['Hid'] = allocate['hid'] self['Start'] = allocate['start'] - self['finalUserCode'] = allocate['finalUserCode'] - self['numEndUsers'] = allocate['numEndUsers'] - self['usageTimeAllocate'] = allocate['usageTimeAllocate'] + self['FinalUserCode'] = allocate['finalUserCode'] + self['NumEndUsers'] = allocate['numEndUsers'] + self['UsageTimeAllocate'] = allocate['usageTimeAllocate'] self['Type'] = allocate['type'] self['LiveCreate'] = allocate['liveCreate'] - self['usageTimeHdd'] = allocate['usageTimeHdd'] + self['UsageTimeHdd'] = allocate['usageTimeHdd'] diff --git a/tests/test_documents.py b/tests/test_documents.py index 8b79354c..dee1bd1b 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -173,6 +173,7 @@ def test_live_export_csv2(user: UserClient, client: Client, app: Devicehub): assert "4692" in csv_user assert "8692" in csv_user + assert "SystemId" in csv_user @pytest.mark.mvp @pytest.mark.usefixtures(conftest.app_context.__name__)