documente_shared 0.1.17__py3-none-any.whl → 0.1.19__py3-none-any.whl
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/domain/entities.py +24 -6
- documente_shared/domain/repositories.py +1 -1
- documente_shared/infrastructure/dynamo_repositories.py +3 -1
- {documente_shared-0.1.17.dist-info → documente_shared-0.1.19.dist-info}/METADATA +1 -1
- {documente_shared-0.1.17.dist-info → documente_shared-0.1.19.dist-info}/RECORD +6 -6
- {documente_shared-0.1.17.dist-info → documente_shared-0.1.19.dist-info}/WHEEL +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from decimal import Decimal
|
|
4
|
-
from typing import Optional
|
|
4
|
+
from typing import Optional, List
|
|
5
5
|
|
|
6
6
|
from documente_shared.domain.enums import (
|
|
7
7
|
DocumentProcessStatus,
|
|
@@ -23,7 +23,7 @@ class DocumentProcess(object):
|
|
|
23
23
|
processed_xlsx_path: Optional[str] = None
|
|
24
24
|
processed_xlsx_bytes: Optional[bytes] = None
|
|
25
25
|
processing_time: Optional[Decimal] = None
|
|
26
|
-
|
|
26
|
+
uploaded_at: Optional[datetime] = None
|
|
27
27
|
enqueued_at: Optional[datetime] = None
|
|
28
28
|
started_at: Optional[datetime] = None
|
|
29
29
|
failed_at: Optional[datetime] = None
|
|
@@ -101,13 +101,31 @@ class DocumentProcess(object):
|
|
|
101
101
|
str(self.processing_time)
|
|
102
102
|
if self.processing_time else None
|
|
103
103
|
),
|
|
104
|
-
'
|
|
104
|
+
'uploaded_at': self.uploaded_at.isoformat() if self.uploaded_at else None,
|
|
105
105
|
'enqueued_at': self.enqueued_at.isoformat() if self.enqueued_at else None,
|
|
106
106
|
'started_at': self.started_at.isoformat() if self.started_at else None,
|
|
107
107
|
'failed_at': self.failed_at.isoformat() if self.failed_at else None,
|
|
108
108
|
'completed_at': self.completed_at.isoformat() if self.completed_at else None,
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
def overload(
|
|
112
|
+
self,
|
|
113
|
+
new_instance: 'DocumentProcess',
|
|
114
|
+
properties: List[str] = None,
|
|
115
|
+
):
|
|
116
|
+
instance_properties = properties or [
|
|
117
|
+
'status', 'file_path', 'file_bytes', 'category', 'sub_category',
|
|
118
|
+
'processed_csv_path', 'processed_csv_bytes', 'processed_xlsx_path',
|
|
119
|
+
'processed_xlsx_bytes', 'processing_time', 'uploaded_at',
|
|
120
|
+
'enqueued_at', 'started_at', 'failed_at', 'completed_at',
|
|
121
|
+
]
|
|
122
|
+
for _property in instance_properties:
|
|
123
|
+
property_value = getattr(new_instance, _property)
|
|
124
|
+
if not hasattr(self, _property):
|
|
125
|
+
continue
|
|
126
|
+
setattr(self, _property, property_value)
|
|
127
|
+
return self
|
|
128
|
+
|
|
111
129
|
@classmethod
|
|
112
130
|
def from_dict(cls, data: dict) -> 'DocumentProcess':
|
|
113
131
|
return cls(
|
|
@@ -128,9 +146,9 @@ class DocumentProcess(object):
|
|
|
128
146
|
Decimal(data.get('processing_time'))
|
|
129
147
|
if data.get('processing_time') else None
|
|
130
148
|
),
|
|
131
|
-
|
|
132
|
-
datetime.fromisoformat(data.get('
|
|
133
|
-
if data.get('
|
|
149
|
+
uploaded_at=(
|
|
150
|
+
datetime.fromisoformat(data.get('uploaded_at'))
|
|
151
|
+
if data.get('uploaded_at') else None
|
|
134
152
|
),
|
|
135
153
|
enqueued_at=(
|
|
136
154
|
datetime.fromisoformat(data.get('enqueued_at'))
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from documente_shared.domain.entities import DocumentProcess
|
|
2
4
|
from documente_shared.domain.repositories import DocumentProcessRepository
|
|
3
5
|
from documente_shared.infrastructure.dynamo_table import DynamoDBTable
|
|
4
|
-
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
class DynamoDocumentProcessRepository(
|
|
@@ -3,14 +3,14 @@ documente_shared/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
3
3
|
documente_shared/application/digest.py,sha256=Um6E8WfFri2_lly4RFWydJyvSfPZGFcOX-opEOzDCWc,172
|
|
4
4
|
documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
|
|
6
|
-
documente_shared/domain/entities.py,sha256=
|
|
6
|
+
documente_shared/domain/entities.py,sha256=q3e4FU-SD8gKjvOpdYfoTO6Wpk7-30TEcrMt1nVVt3I,5924
|
|
7
7
|
documente_shared/domain/enums.py,sha256=wrMpM-1KgXFkd-He-3onNcqR3Zf53Q-_axjXGjx7MIY,435
|
|
8
|
-
documente_shared/domain/repositories.py,sha256=
|
|
8
|
+
documente_shared/domain/repositories.py,sha256=EekvB2BE4AnT5myEhU3DfwHfF9MkNJZRbqRVGFxCEWM,509
|
|
9
9
|
documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
documente_shared/infrastructure/dynamo_repositories.py,sha256=
|
|
10
|
+
documente_shared/infrastructure/dynamo_repositories.py,sha256=A26S6ghyAsjKk8ySXIsR8_MDE8vbp7ZmNg7hqTOtMy0,748
|
|
11
11
|
documente_shared/infrastructure/dynamo_table.py,sha256=5yF5EVQkHTZe4tLYZsfEDS8tp_iorMlMjNu-qn3Oj9E,2095
|
|
12
12
|
documente_shared/infrastructure/s3_bucket.py,sha256=s4VWcl0HK6uhjjZmKefOYW5A3Dx74R9KCuMmXQKUXnQ,1582
|
|
13
13
|
documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
|
|
14
|
-
documente_shared-0.1.
|
|
15
|
-
documente_shared-0.1.
|
|
16
|
-
documente_shared-0.1.
|
|
14
|
+
documente_shared-0.1.19.dist-info/METADATA,sha256=b-LCIGttWHOKUFaZ1UA6BieOyyxNTvUnUsVAZh5vDVM,640
|
|
15
|
+
documente_shared-0.1.19.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
16
|
+
documente_shared-0.1.19.dist-info/RECORD,,
|
|
File without changes
|