documente_shared 0.1.36__tar.gz → 0.1.37__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.36 → documente_shared-0.1.37}/PKG-INFO +1 -1
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/repositories.py +7 -1
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/dynamo_repositories.py +21 -2
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/dynamo_table.py +2 -2
- {documente_shared-0.1.36 → documente_shared-0.1.37}/pyproject.toml +1 -1
- {documente_shared-0.1.36 → documente_shared-0.1.37}/README.md +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/application/time_utils.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/entities/__init__.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/entities/document_process.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/entities/document_process_metadata.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/enums.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/sqs_queue.py +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Optional, List
|
|
3
3
|
|
|
4
4
|
from documente_shared.domain.entities.document_process import DocumentProcess
|
|
5
|
+
from documente_shared.domain.enums import DocumentProcessStatus
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class DocumentProcessRepository(ABC):
|
|
@@ -16,4 +17,9 @@ class DocumentProcessRepository(ABC):
|
|
|
16
17
|
|
|
17
18
|
@abstractmethod
|
|
18
19
|
def remove(self, instance: DocumentProcess):
|
|
20
|
+
raise NotImplementedError
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@abstractmethod
|
|
24
|
+
def filter(self, statuses: List[DocumentProcessStatus]) -> List[DocumentProcess]:
|
|
19
25
|
raise NotImplementedError
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
from typing import Optional
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
|
|
3
|
+
from boto3.dynamodb.conditions import Key
|
|
2
4
|
|
|
3
5
|
from documente_shared.domain.entities.document_process import DocumentProcess
|
|
6
|
+
from documente_shared.domain.enums import DocumentProcessStatus
|
|
4
7
|
from documente_shared.domain.repositories import DocumentProcessRepository
|
|
5
8
|
from documente_shared.infrastructure.dynamo_table import DynamoDBTable
|
|
6
9
|
|
|
@@ -21,4 +24,20 @@ class DynamoDocumentProcessRepository(
|
|
|
21
24
|
return instance
|
|
22
25
|
|
|
23
26
|
def remove(self, instance: DocumentProcess):
|
|
24
|
-
self.delete(key={'digest': instance.digest})
|
|
27
|
+
self.delete(key={'digest': instance.digest})
|
|
28
|
+
|
|
29
|
+
def filter(self, statuses: List[DocumentProcessStatus]) -> List[DocumentProcess]:
|
|
30
|
+
items = []
|
|
31
|
+
|
|
32
|
+
for status in statuses:
|
|
33
|
+
response = self._table.query(
|
|
34
|
+
IndexName='status',
|
|
35
|
+
KeyConditionExpression=Key('status').eq(status.value),
|
|
36
|
+
)
|
|
37
|
+
status_items = response.get('Items', [])
|
|
38
|
+
items.extend(status_items)
|
|
39
|
+
|
|
40
|
+
return [
|
|
41
|
+
DocumentProcess.from_dict(item)
|
|
42
|
+
for item in items
|
|
43
|
+
]
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
@@ -23,8 +23,8 @@ class DynamoDBTable(object):
|
|
|
23
23
|
return self.put({**key, **attributes})
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def filter_by(self, attribute, target_value):
|
|
27
|
-
return self._table(
|
|
26
|
+
def filter_by(self, attribute: str, target_value: str):
|
|
27
|
+
return self._table.query(
|
|
28
28
|
FilterExpression=Key(attribute).eq(target_value),
|
|
29
29
|
).get('Items')
|
|
30
30
|
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/application/time_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/domain/entities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.36 → documente_shared-0.1.37}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|