documente_shared 0.1.58__tar.gz → 0.1.59__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.58 → documente_shared-0.1.59}/PKG-INFO +1 -1
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/entities/document.py +13 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/enums.py +1 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/pyproject.toml +1 -1
- {documente_shared-0.1.58 → documente_shared-0.1.59}/README.md +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/exceptions.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/time_utils.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/timezone.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/constants.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/entities/__init__.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/entities/document_metadata.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/repositories.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/dynamo_repositories.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/sqs_queue.py +0 -0
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/entities/document.py
RENAMED
|
@@ -43,6 +43,7 @@ class DocumentProcessing(object):
|
|
|
43
43
|
started_at: Optional[datetime] = None
|
|
44
44
|
failed_at: Optional[datetime] = None
|
|
45
45
|
failed_reason: Optional[str] = None
|
|
46
|
+
feedback: Optional[list | dict] = None
|
|
46
47
|
completed_at: Optional[datetime] = None
|
|
47
48
|
metadata_items: Optional[List[DocumentProcessingMetadata]] = None
|
|
48
49
|
|
|
@@ -65,6 +66,10 @@ class DocumentProcessing(object):
|
|
|
65
66
|
def is_completed(self) -> bool:
|
|
66
67
|
return self.status == DocumentProcessingStatus.COMPLETED
|
|
67
68
|
|
|
69
|
+
@property
|
|
70
|
+
def is_incomplete(self) -> bool:
|
|
71
|
+
return self.status == DocumentProcessingStatus.INCOMPLETE
|
|
72
|
+
|
|
68
73
|
@property
|
|
69
74
|
def is_failed(self) -> bool:
|
|
70
75
|
return self.status == DocumentProcessingStatus.FAILED
|
|
@@ -113,6 +118,11 @@ class DocumentProcessing(object):
|
|
|
113
118
|
def completed(self, timezone: tzinfo = la_paz_tz):
|
|
114
119
|
self.status = DocumentProcessingStatus.COMPLETED
|
|
115
120
|
self.completed_at = datetime.now(tz=timezone)
|
|
121
|
+
self.failed_reason = None
|
|
122
|
+
|
|
123
|
+
def incomplete(self, timezone: tzinfo = la_paz_tz):
|
|
124
|
+
self.status = DocumentProcessingStatus.INCOMPLETE
|
|
125
|
+
self.completed_at = datetime.now(tz=timezone)
|
|
116
126
|
|
|
117
127
|
def deleted(self):
|
|
118
128
|
self.status = DocumentProcessingStatus.DELETED
|
|
@@ -201,6 +211,7 @@ class DocumentProcessing(object):
|
|
|
201
211
|
'started_at': self.started_at.isoformat() if self.started_at else None,
|
|
202
212
|
'failed_at': self.failed_at.isoformat() if self.failed_at else None,
|
|
203
213
|
'failed_reason': self.failed_reason,
|
|
214
|
+
'feedback': self.feedback,
|
|
204
215
|
'completed_at': self.completed_at.isoformat() if self.completed_at else None,
|
|
205
216
|
'metadata_items': [metadata.to_dict for metadata in self.metadata_items],
|
|
206
217
|
}
|
|
@@ -240,6 +251,7 @@ class DocumentProcessing(object):
|
|
|
240
251
|
'started_at',
|
|
241
252
|
'failed_at',
|
|
242
253
|
'failed_reason',
|
|
254
|
+
'feedback',
|
|
243
255
|
'completed_at',
|
|
244
256
|
]
|
|
245
257
|
for _property in instance_properties:
|
|
@@ -285,6 +297,7 @@ class DocumentProcessing(object):
|
|
|
285
297
|
started_at=get_datetime_from_data(input_datetime=data.get('started_at')),
|
|
286
298
|
failed_at=get_datetime_from_data(input_datetime=data.get('failed_at')),
|
|
287
299
|
failed_reason=data.get('failed_reason'),
|
|
300
|
+
feedback=data.get('feedback'),
|
|
288
301
|
completed_at=get_datetime_from_data(input_datetime=data.get('completed_at')),
|
|
289
302
|
metadata_items=[
|
|
290
303
|
DocumentProcessingMetadata.from_dict(metadata)
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/exceptions.py
RENAMED
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/time_utils.py
RENAMED
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/application/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/domain/entities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.58 → documente_shared-0.1.59}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|