documente_shared 0.1.109__py3-none-any.whl → 0.1.111__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/infrastructure/repositories/http_document.py +12 -11
- documente_shared/infrastructure/repositories/http_processing_case.py +10 -10
- documente_shared/infrastructure/repositories/http_processing_case_item.py +25 -24
- {documente_shared-0.1.109.dist-info → documente_shared-0.1.111.dist-info}/METADATA +1 -1
- {documente_shared-0.1.109.dist-info → documente_shared-0.1.111.dist-info}/RECORD +6 -6
- {documente_shared-0.1.109.dist-info → documente_shared-0.1.111.dist-info}/WHEEL +0 -0
|
@@ -18,9 +18,9 @@ class HttpDocumentProcessingRepository(
|
|
|
18
18
|
):
|
|
19
19
|
def find(self, digest: str) -> Optional[DocumentProcessing]:
|
|
20
20
|
response = self.session.get(f"{self.api_url}/v1/documents/{digest}/")
|
|
21
|
-
if response.status_code
|
|
22
|
-
return
|
|
23
|
-
return
|
|
21
|
+
if response.status_code not in [200, 201]:
|
|
22
|
+
return None
|
|
23
|
+
return self._build_document_processing(response)
|
|
24
24
|
|
|
25
25
|
def persist(self, instance: DocumentProcessing) -> DocumentProcessing:
|
|
26
26
|
logger.info(f"PERSISTING_DOCUMENT: data={instance.to_simple_dict}")
|
|
@@ -28,7 +28,7 @@ class HttpDocumentProcessingRepository(
|
|
|
28
28
|
url=f"{self.api_url}/v1/documents/{instance.digest}/",
|
|
29
29
|
json=instance.to_simple_dict,
|
|
30
30
|
)
|
|
31
|
-
if response.status_code in [200, 201]:
|
|
31
|
+
if response.status_code not in [200, 201]:
|
|
32
32
|
raise Exception(f'Error persisting document processing: {response.text}')
|
|
33
33
|
return self._build_document_processing(response)
|
|
34
34
|
|
|
@@ -37,13 +37,14 @@ class HttpDocumentProcessingRepository(
|
|
|
37
37
|
|
|
38
38
|
def filter(self, statuses: List[DocumentProcessingStatus]) -> List[DocumentProcessing]:
|
|
39
39
|
response = self.session.get(f"{self.api_url}/v1/documents/?statuses={statuses}")
|
|
40
|
-
if response.status_code
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]
|
|
46
|
-
|
|
40
|
+
if response.status_code not in [200, 201]:
|
|
41
|
+
return []
|
|
42
|
+
raw_response = response.json()
|
|
43
|
+
return [
|
|
44
|
+
DocumentProcessing.from_dict(camel_to_snake(item['documentProcessing']))
|
|
45
|
+
for item in raw_response.get('data', [])
|
|
46
|
+
]
|
|
47
|
+
|
|
47
48
|
|
|
48
49
|
@classmethod
|
|
49
50
|
def _build_document_processing(cls, response: Response) -> DocumentProcessing:
|
|
@@ -18,9 +18,9 @@ class HttpProcessingCaseRepository(
|
|
|
18
18
|
):
|
|
19
19
|
def find(self, uuid: str, include_items: bool = False) -> Optional[ProcessingCase]:
|
|
20
20
|
response = self.session.get(f"{self.api_url}/v1/processing-cases/{uuid}/")
|
|
21
|
-
if response.status_code
|
|
22
|
-
return
|
|
23
|
-
return
|
|
21
|
+
if response.status_code not in [200, 201]:
|
|
22
|
+
return None
|
|
23
|
+
return self._build_processing_case(response)
|
|
24
24
|
|
|
25
25
|
def persist(self, instance: ProcessingCase) -> ProcessingCase:
|
|
26
26
|
logger.info(f"PERSISTING_PROCESSING_CASE: data={instance.to_dict}")
|
|
@@ -42,13 +42,13 @@ class HttpProcessingCaseRepository(
|
|
|
42
42
|
"X-Tenant": filters.tenant_slug,
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
|
-
if response.status_code
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]
|
|
51
|
-
|
|
45
|
+
if response.status_code not in [200, 201]:
|
|
46
|
+
return []
|
|
47
|
+
raw_response = response.json()
|
|
48
|
+
return [
|
|
49
|
+
ProcessingCase.from_persist_dict(camel_to_snake(item_data))
|
|
50
|
+
for item_data in raw_response.get('data', [])
|
|
51
|
+
]
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
@classmethod
|
|
@@ -18,15 +18,15 @@ class HttpProcessingCaseItemRepository(
|
|
|
18
18
|
):
|
|
19
19
|
def find(self, uuid: str) -> Optional[ProcessingCaseItem]:
|
|
20
20
|
response = self.session.get(f"{self.api_url}/v1/processing-case-items/{uuid}/")
|
|
21
|
-
if response.status_code
|
|
22
|
-
return
|
|
23
|
-
return
|
|
21
|
+
if response.status_code not in [200, 201]:
|
|
22
|
+
return None
|
|
23
|
+
return self._build_processing_case_item(response)
|
|
24
24
|
|
|
25
25
|
def find_by_digest(self, digest: str) -> Optional[ProcessingCaseItem]:
|
|
26
26
|
response = self.session.get(f"{self.api_url}/v1/processing-case-items/{digest}/")
|
|
27
|
-
if response.status_code
|
|
28
|
-
return
|
|
29
|
-
return
|
|
27
|
+
if response.status_code not in [200, 201]:
|
|
28
|
+
return None
|
|
29
|
+
return self._build_processing_case_item(response)
|
|
30
30
|
|
|
31
31
|
def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
|
|
32
32
|
logger.info(f"PERSISTING_PROCESSING_CASE_ITEM: data={instance.to_simple_dict}")
|
|
@@ -34,9 +34,10 @@ class HttpProcessingCaseItemRepository(
|
|
|
34
34
|
url=f"{self.api_url}/v1/processing-case-items/{instance.uuid}/",
|
|
35
35
|
json=instance.to_persist_dict,
|
|
36
36
|
)
|
|
37
|
-
if response.status_code in [200, 201]:
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if response.status_code not in [200, 201]:
|
|
38
|
+
logger.info(f"PERSISTING_PROCESSING_CASE_ITEM ERROR: data={response.text}")
|
|
39
|
+
return instance
|
|
40
|
+
return self._build_processing_case_item(response)
|
|
40
41
|
|
|
41
42
|
def remove(self, instance: ProcessingCaseItem):
|
|
42
43
|
self.session.delete(f"{self.api_url}/v1/processing-case-items/{instance.uuid}/")
|
|
@@ -46,27 +47,27 @@ class HttpProcessingCaseItemRepository(
|
|
|
46
47
|
filters: ProcessingCaseItemFilters,
|
|
47
48
|
) -> List[ProcessingCaseItem]:
|
|
48
49
|
response = self.session.get(f"{self.api_url}/v1/processing-case-items/")
|
|
49
|
-
if response.status_code
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
]
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
if response.status_code not in [200, 201]:
|
|
51
|
+
return []
|
|
52
|
+
raw_response = response.json()
|
|
53
|
+
return [
|
|
54
|
+
ProcessingCaseItem.from_dict(camel_to_snake(item_data))
|
|
55
|
+
for item_data in raw_response.get('data', [])
|
|
56
|
+
]
|
|
57
|
+
|
|
57
58
|
def filter_with_tenant(
|
|
58
59
|
self,
|
|
59
60
|
tenant_slug: str,
|
|
60
61
|
filters: ProcessingCaseItemFilters,
|
|
61
62
|
) -> List[ProcessingCaseItem]:
|
|
62
63
|
response = self.session.get(f"{self.api_url}/v1/processing-case-items/")
|
|
63
|
-
if response.status_code
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
]
|
|
69
|
-
|
|
64
|
+
if response.status_code not in [200, 201]:
|
|
65
|
+
return []
|
|
66
|
+
raw_response = response.json()
|
|
67
|
+
return [
|
|
68
|
+
ProcessingCaseItem.from_dict(camel_to_snake(item_data))
|
|
69
|
+
for item_data in raw_response.get('data', [])
|
|
70
|
+
]
|
|
70
71
|
|
|
71
72
|
@classmethod
|
|
72
73
|
def _build_processing_case_item(cls, response: Response) -> ProcessingCaseItem:
|
|
@@ -43,9 +43,9 @@ documente_shared/infrastructure/repositories/__init__.py,sha256=47DEQpj8HBSa-_TI
|
|
|
43
43
|
documente_shared/infrastructure/repositories/dynamo_document.py,sha256=_Yp4gtA-n-hJ2w2wAM5BMCs2Mf46Q2Kq3eHqlxudkL4,1443
|
|
44
44
|
documente_shared/infrastructure/repositories/dynamo_processing_case.py,sha256=jkTVHThKHshLI53OV7ivK-WchFoAZTnaXlgh_1OX52k,1446
|
|
45
45
|
documente_shared/infrastructure/repositories/dynamo_processing_case_item.py,sha256=B2ElsASpXNRkwwjdCqXyvDU-LBrLNdwPfHLMvvG9c-Y,1729
|
|
46
|
-
documente_shared/infrastructure/repositories/http_document.py,sha256=
|
|
47
|
-
documente_shared/infrastructure/repositories/http_processing_case.py,sha256=
|
|
48
|
-
documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=
|
|
46
|
+
documente_shared/infrastructure/repositories/http_document.py,sha256=TQdjKmly1m0L26_ksq9ce0_jv5NxtXvN8AT3Zd06yCE,2289
|
|
47
|
+
documente_shared/infrastructure/repositories/http_processing_case.py,sha256=a6JcICOCjce3WV-nXA2Fz7amU7wivBK-PkYwo6MGwa4,2356
|
|
48
|
+
documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=rztS_5oE2VDN9LOUATrjCuiKBkxmIwKAakp9AFo8Obc,3185
|
|
49
49
|
documente_shared/infrastructure/repositories/mem_document.py,sha256=jg4rIjgSZijymjY9o7Q1lLcaiW9h-O8j6XljO1bJI7c,1299
|
|
50
50
|
documente_shared/infrastructure/repositories/mem_processing_case.py,sha256=ZAQwp4j0DXQMt92Z-ZR4h9MtbUp9IYy0OHz_sHgkZxY,1147
|
|
51
51
|
documente_shared/infrastructure/repositories/mem_processing_case_item.py,sha256=kQufzDTouu3agIXpEzRPdjltjTUFExrFbKkAZarGrUg,1419
|
|
@@ -55,6 +55,6 @@ documente_shared/infrastructure/services/http_scaling.py,sha256=cIo-61nfIwbtO86E
|
|
|
55
55
|
documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
|
|
56
56
|
documente_shared/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
documente_shared/presentation/presenters.py,sha256=GGAEwefmjCIVepsUA2oZOVLxXbhhiISPM0Jgt6dT6O0,423
|
|
58
|
-
documente_shared-0.1.
|
|
59
|
-
documente_shared-0.1.
|
|
60
|
-
documente_shared-0.1.
|
|
58
|
+
documente_shared-0.1.111.dist-info/METADATA,sha256=WnELXs565Kcc2wY1MbiwCSLsO5Nbe9oZ1-BSIgQxzjo,963
|
|
59
|
+
documente_shared-0.1.111.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
60
|
+
documente_shared-0.1.111.dist-info/RECORD,,
|
|
File without changes
|