documente_shared 0.1.77__py3-none-any.whl → 0.1.78__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/repositories/processing_case_item.py +4 -0
- documente_shared/infrastructure/repositories/dynamo_processing_case_item.py +14 -4
- documente_shared/infrastructure/repositories/http_processing_case_item.py +6 -2
- {documente_shared-0.1.77.dist-info → documente_shared-0.1.78.dist-info}/METADATA +1 -1
- {documente_shared-0.1.77.dist-info → documente_shared-0.1.78.dist-info}/RECORD +6 -6
- {documente_shared-0.1.77.dist-info → documente_shared-0.1.78.dist-info}/WHEEL +0 -0
|
@@ -11,6 +11,10 @@ class ProcessingCaseItemRepository(ABC):
|
|
|
11
11
|
def find(self, uuid: str) -> Optional[ProcessingCaseItem]:
|
|
12
12
|
raise NotImplementedError
|
|
13
13
|
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def find_by_digest(self, digest: str) -> Optional[ProcessingCaseItem]:
|
|
16
|
+
raise NotImplementedError
|
|
17
|
+
|
|
14
18
|
@abstractmethod
|
|
15
19
|
def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
|
|
16
20
|
raise NotImplementedError
|
|
@@ -3,7 +3,7 @@ from typing import Optional, List
|
|
|
3
3
|
from boto3.dynamodb.conditions import Key
|
|
4
4
|
|
|
5
5
|
from documente_shared.domain.entities.processing_case_item import ProcessingCaseItem
|
|
6
|
-
from documente_shared.domain.
|
|
6
|
+
from documente_shared.domain.entities.processing_case_item_filters import ProcessingCaseItemFilters
|
|
7
7
|
from documente_shared.domain.repositories.processing_case_item import ProcessingCaseItemRepository
|
|
8
8
|
|
|
9
9
|
from documente_shared.infrastructure.dynamo_table import DynamoDBTable
|
|
@@ -19,6 +19,12 @@ class DynamoProcessingCaseItemRepository(
|
|
|
19
19
|
return ProcessingCaseItem.from_dict(item)
|
|
20
20
|
return None
|
|
21
21
|
|
|
22
|
+
def find_by_digest(self, digest: str) -> Optional[ProcessingCaseItem]:
|
|
23
|
+
item = self.get(key={'digest': digest})
|
|
24
|
+
if item:
|
|
25
|
+
return ProcessingCaseItem.from_dict(item)
|
|
26
|
+
return None
|
|
27
|
+
|
|
22
28
|
def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
|
|
23
29
|
self.put(instance.to_simple_dict)
|
|
24
30
|
return instance
|
|
@@ -26,10 +32,14 @@ class DynamoProcessingCaseItemRepository(
|
|
|
26
32
|
def remove(self, instance: ProcessingCaseItem):
|
|
27
33
|
self.delete(key={'case_id': instance.case_id})
|
|
28
34
|
|
|
29
|
-
def filter(
|
|
35
|
+
def filter(
|
|
36
|
+
self,
|
|
37
|
+
tenant_slug: str,
|
|
38
|
+
filters: ProcessingCaseItemFilters,
|
|
39
|
+
) -> List[ProcessingCaseItem]:
|
|
30
40
|
items = []
|
|
31
41
|
|
|
32
|
-
for status in statuses:
|
|
42
|
+
for status in filters.statuses:
|
|
33
43
|
response = self._table.query(
|
|
34
44
|
IndexName='status',
|
|
35
45
|
KeyConditionExpression=Key('status').eq(status.value),
|
|
@@ -40,4 +50,4 @@ class DynamoProcessingCaseItemRepository(
|
|
|
40
50
|
return [
|
|
41
51
|
ProcessingCaseItem.from_dict(item)
|
|
42
52
|
for item in items
|
|
43
|
-
]
|
|
53
|
+
]
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import List, Optional
|
|
3
3
|
|
|
4
|
-
from documente_shared.domain.entities.processing_case import ProcessingCase
|
|
5
4
|
from documente_shared.domain.entities.processing_case_item import ProcessingCaseItem
|
|
6
5
|
from documente_shared.domain.entities.processing_case_item_filters import ProcessingCaseItemFilters
|
|
7
|
-
from documente_shared.domain.enums.common import ProcessingStatus
|
|
8
6
|
from documente_shared.domain.repositories.processing_case_item import ProcessingCaseItemRepository
|
|
9
7
|
from documente_shared.infrastructure.documente_client import DocumenteClientMixin
|
|
10
8
|
|
|
@@ -21,6 +19,12 @@ class HttpProcessingCaseItemRepository(
|
|
|
21
19
|
return ProcessingCaseItem.from_dict(response.json())
|
|
22
20
|
return None
|
|
23
21
|
|
|
22
|
+
def find_by_digest(self, digest: str) -> Optional[ProcessingCaseItem]:
|
|
23
|
+
response = self.session.get(f"{self.api_url}/processing-case-items/{digest}/")
|
|
24
|
+
if response.status_code == 200:
|
|
25
|
+
return ProcessingCaseItem.from_dict(response.json())
|
|
26
|
+
return None
|
|
27
|
+
|
|
24
28
|
def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
|
|
25
29
|
response = self.session.put(
|
|
26
30
|
url=f"{self.api_url}/processing-case-items/{instance.uuid}/",
|
|
@@ -25,18 +25,18 @@ documente_shared/domain/enums/processing_case.py,sha256=LhFhcoWlockxcpplsVdC6M2k
|
|
|
25
25
|
documente_shared/domain/repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
26
|
documente_shared/domain/repositories/document.py,sha256=vJzr6c92gqBzyhaEdjrvnoneKRrWmJ0AsvocPnhxiLU,767
|
|
27
27
|
documente_shared/domain/repositories/processing_case.py,sha256=bpks3SAM_L4wx29P29iFo5g-oi4fxSXQEzhveARjo3c,767
|
|
28
|
-
documente_shared/domain/repositories/processing_case_item.py,sha256=
|
|
28
|
+
documente_shared/domain/repositories/processing_case_item.py,sha256=gPZaQCMYlD6vlnEt6cVIqRmi1K-JWvmDx1f74nd97Cs,974
|
|
29
29
|
documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
documente_shared/infrastructure/documente_client.py,sha256=UjVWs9DKa-yhw5DVbcEs8iJxalHOarusVayi_ob6QhE,494
|
|
31
31
|
documente_shared/infrastructure/dynamo_table.py,sha256=TMQbcuty7wjDMbuhI8PbT0IGXelgELsNTtqTEQeZ824,2112
|
|
32
32
|
documente_shared/infrastructure/repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
documente_shared/infrastructure/repositories/dynamo_document.py,sha256=_Yp4gtA-n-hJ2w2wAM5BMCs2Mf46Q2Kq3eHqlxudkL4,1443
|
|
34
34
|
documente_shared/infrastructure/repositories/dynamo_processing_case.py,sha256=UJcROnmfKvE5k_GZOHvaYDvnNSX4Rm22xCB7tUaUUEU,1386
|
|
35
|
-
documente_shared/infrastructure/repositories/dynamo_processing_case_item.py,sha256=
|
|
35
|
+
documente_shared/infrastructure/repositories/dynamo_processing_case_item.py,sha256=4guM8V3YfP7kzYcuVWunGJGmXi0kSSUW8otks39g1vs,1754
|
|
36
36
|
documente_shared/infrastructure/repositories/http_processing_case.py,sha256=4PHNqbzDlt8Bicv3IUwJ58e4WNlIU_Hxq0cPuaLFgtw,1724
|
|
37
|
-
documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=
|
|
37
|
+
documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=FfKHLPir5uXsVu8WVqEbzcbsO9uzNLvbwDiw-Up1Ddo,2085
|
|
38
38
|
documente_shared/infrastructure/s3_bucket.py,sha256=vT_yN42RFQXubtUn8ln-j13Os_-25UGClVtXg5Bkv6I,1932
|
|
39
39
|
documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
|
|
40
|
-
documente_shared-0.1.
|
|
41
|
-
documente_shared-0.1.
|
|
42
|
-
documente_shared-0.1.
|
|
40
|
+
documente_shared-0.1.78.dist-info/METADATA,sha256=sHypOM9x1ydabbuwQ5qUZE4zZwn3-_dsX-kutHVNPVI,881
|
|
41
|
+
documente_shared-0.1.78.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
42
|
+
documente_shared-0.1.78.dist-info/RECORD,,
|
|
File without changes
|