documente_shared 0.1.20__tar.gz → 0.1.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of documente_shared might be problematic. Click here for more details.
- {documente_shared-0.1.20 → documente_shared-0.1.21}/PKG-INFO +1 -1
- documente_shared-0.1.21/documente_shared/application/time_utils.py +10 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/domain/entities.py +6 -20
- {documente_shared-0.1.20 → documente_shared-0.1.21}/pyproject.toml +1 -1
- {documente_shared-0.1.20 → documente_shared-0.1.21}/README.md +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/domain/enums.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/domain/repositories.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/dynamo_repositories.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/sqs_queue.py +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Union
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_datetime_from_data(input_datetime: Union[datetime, str]):
|
|
6
|
+
if isinstance(input_datetime, datetime):
|
|
7
|
+
return input_datetime
|
|
8
|
+
elif isinstance(input_datetime, str):
|
|
9
|
+
return datetime.fromisoformat(input_datetime)
|
|
10
|
+
return None
|
|
@@ -3,6 +3,7 @@ from datetime import datetime
|
|
|
3
3
|
from decimal import Decimal
|
|
4
4
|
from typing import Optional, List
|
|
5
5
|
|
|
6
|
+
from documente_shared.application.time_utils import get_datetime_from_data
|
|
6
7
|
from documente_shared.domain.enums import (
|
|
7
8
|
DocumentProcessStatus,
|
|
8
9
|
DocumentProcessSubCategory,
|
|
@@ -146,24 +147,9 @@ class DocumentProcess(object):
|
|
|
146
147
|
Decimal(data.get('processing_time'))
|
|
147
148
|
if data.get('processing_time') else None
|
|
148
149
|
),
|
|
149
|
-
uploaded_at=(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
),
|
|
153
|
-
|
|
154
|
-
datetime.fromisoformat(data.get('enqueued_at'))
|
|
155
|
-
if data.get('enqueued_at') else None
|
|
156
|
-
),
|
|
157
|
-
started_at=(
|
|
158
|
-
datetime.fromisoformat(data.get('started_at'))
|
|
159
|
-
if data.get('started_at') else None
|
|
160
|
-
),
|
|
161
|
-
failed_at=(
|
|
162
|
-
datetime.fromisoformat(data.get('failed_at'))
|
|
163
|
-
if data.get('failed_at') else None
|
|
164
|
-
),
|
|
165
|
-
completed_at=(
|
|
166
|
-
datetime.fromisoformat(data.get('completed_at'))
|
|
167
|
-
if data.get('processed_at') else None
|
|
168
|
-
),
|
|
150
|
+
uploaded_at=get_datetime_from_data(input_datetime=data.get('uploaded_at')),
|
|
151
|
+
enqueued_at=get_datetime_from_data(input_datetime=data.get('enqueued_at')),
|
|
152
|
+
started_at=get_datetime_from_data(input_datetime=data.get('started_at')),
|
|
153
|
+
failed_at=get_datetime_from_data(input_datetime=data.get('failed_at')),
|
|
154
|
+
completed_at=get_datetime_from_data(input_datetime=data.get('completed_at')),
|
|
169
155
|
)
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
File without changes
|
{documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.20 → documente_shared-0.1.21}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|