documente_shared 0.1.76__tar.gz → 0.1.78__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.76 → documente_shared-0.1.78}/PKG-INFO +1 -1
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/processing_case_filters.py +7 -5
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/processing_case_item_filters.py +6 -4
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/repositories/processing_case_item.py +4 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/repositories/dynamo_processing_case_item.py +14 -4
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/repositories/http_processing_case_item.py +6 -2
- {documente_shared-0.1.76 → documente_shared-0.1.78}/pyproject.toml +1 -1
- {documente_shared-0.1.76 → documente_shared-0.1.78}/README.md +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/exceptions.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/files.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/query_params.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/time_utils.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/timezone.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/constants.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/document.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/document_metadata.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/in_memory_result.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/processing_case.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/processing_case_item.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/processing_event.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/common.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/document.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/processing_case.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/repositories/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/repositories/document.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/repositories/processing_case.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/documente_client.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/repositories/__init__.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/repositories/dynamo_document.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/repositories/dynamo_processing_case.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/repositories/http_processing_case.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/sqs_queue.py +0 -0
|
@@ -9,18 +9,20 @@ from documente_shared.application.query_params import QueryParams
|
|
|
9
9
|
|
|
10
10
|
@dataclass
|
|
11
11
|
class ProcessingCaseFilters(object):
|
|
12
|
-
case_ids: Optional[List[str]]
|
|
13
|
-
sort_order: Optional[str]
|
|
14
|
-
search: Optional[str]
|
|
15
|
-
init_date: Optional[datetime]
|
|
16
|
-
end_date: Optional[datetime]
|
|
12
|
+
case_ids: Optional[List[str]] = None
|
|
13
|
+
sort_order: Optional[str] = None
|
|
14
|
+
search: Optional[str] = None
|
|
15
|
+
init_date: Optional[datetime] = None
|
|
16
|
+
end_date: Optional[datetime] = None
|
|
17
17
|
statuses: List[ProcessingStatus] = None
|
|
18
18
|
case_types: List[ProcessingCaseType] = None
|
|
19
19
|
include_archived: bool = False
|
|
20
20
|
|
|
21
21
|
def __post_init__(self):
|
|
22
|
+
self.case_ids = self.case_ids or []
|
|
22
23
|
self.statuses = self.statuses or []
|
|
23
24
|
self.case_types = self.case_types or []
|
|
25
|
+
self.sort_order = self.sort_order or "desc"
|
|
24
26
|
|
|
25
27
|
@classmethod
|
|
26
28
|
def from_params(cls, params: QueryParams) -> "ProcessingCaseFilters":
|
|
@@ -12,10 +12,10 @@ from documente_shared.domain.enums.processing_case import ProcessingDocumentType
|
|
|
12
12
|
|
|
13
13
|
@dataclass
|
|
14
14
|
class ProcessingCaseItemFilters(object):
|
|
15
|
-
sort_order: Optional[str]
|
|
16
|
-
search: Optional[str]
|
|
17
|
-
init_date: Optional[datetime]
|
|
18
|
-
end_date: Optional[datetime]
|
|
15
|
+
sort_order: Optional[str] = None
|
|
16
|
+
search: Optional[str] = None
|
|
17
|
+
init_date: Optional[datetime] = None
|
|
18
|
+
end_date: Optional[datetime]= None
|
|
19
19
|
case_id: Optional[str] = None
|
|
20
20
|
statuses: List[ProcessingStatus] = None
|
|
21
21
|
document_types: List[ProcessingDocumentType] = None
|
|
@@ -24,6 +24,8 @@ class ProcessingCaseItemFilters(object):
|
|
|
24
24
|
def __post_init__(self):
|
|
25
25
|
self.statuses = self.statuses or []
|
|
26
26
|
self.document_types = self.document_types or []
|
|
27
|
+
self.sort_order = self.sort_order or "desc"
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
@classmethod
|
|
29
31
|
def from_params(cls, params: QueryParams) -> "ProcessingCaseItemFilters":
|
|
@@ -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}/",
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/query_params.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/time_utils.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/application/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/__init__.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/entities/document.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/document.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/enums/processing_case.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/repositories/__init__.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/domain/repositories/document.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.76 → documente_shared-0.1.78}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|