documente_shared 0.1.159__tar.gz → 0.1.161b0__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.
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/PKG-INFO +1 -1
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/query_params.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_case.py +18 -12
- documente_shared-0.1.161b0/documente_shared/domain/entities/workspace_document.py +51 -0
- documente_shared-0.1.161b0/documente_shared/domain/entities/workspace_document_page.py +27 -0
- documente_shared-0.1.161b0/documente_shared/domain/enums/workspace.py +19 -0
- documente_shared-0.1.161b0/documente_shared/domain/helpers/values.py +13 -0
- documente_shared-0.1.161b0/documente_shared/domain/repositories/workspace_document.py +42 -0
- documente_shared-0.1.161b0/documente_shared/domain/repositories/workspace_document_page.py +41 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/pyproject.toml +1 -1
- documente_shared-0.1.161b0/tests/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/uv.lock +1 -1
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/.github/workflows/publish.yml +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/.gitignore +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/Dockerfile +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/Makefile +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/README.md +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/cases.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/docker-compose.yml +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/dates.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/exceptions.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/files.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/json.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/numbers.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/payloads.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/retry_utils.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/time_utils.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/timezone.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/constants.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/document_metadata.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/in_memory_document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_case_filters.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_case_item.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_case_item_filters.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_documents.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_event.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/processing_record.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/scaling.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/circular_oficio.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/common.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/document_type_record.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/processing_case.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/processing_case_validator.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/exceptions.py +0 -0
- {documente_shared-0.1.159/documente_shared/domain/interfaces → documente_shared-0.1.161b0/documente_shared/domain/helpers}/__init__.py +0 -0
- {documente_shared-0.1.159/documente_shared/domain/repositories → documente_shared-0.1.161b0/documente_shared/domain/interfaces}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/interfaces/queue.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/interfaces/scaling.py +0 -0
- {documente_shared-0.1.159/documente_shared/infrastructure → documente_shared-0.1.161b0/documente_shared/domain/repositories}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/repositories/document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/repositories/processing_case.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/repositories/processing_case_item.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/repositories/processing_record.py +0 -0
- {documente_shared-0.1.159/documente_shared/infrastructure/repositories → documente_shared-0.1.161b0/documente_shared/infrastructure}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/batch_queue.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/documente_client.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/lambdas.py +0 -0
- {documente_shared-0.1.159/documente_shared/infrastructure/services → documente_shared-0.1.161b0/documente_shared/infrastructure/repositories}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/dynamo_document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/dynamo_processing_case.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/dynamo_processing_case_item.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/http_document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/http_processing_case.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/http_processing_case_item.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/http_processing_record.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/mem_document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/mem_processing_case.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/mem_processing_case_item.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/repositories/mem_processing_record.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.159/documente_shared/presentation → documente_shared-0.1.161b0/documente_shared/infrastructure/services}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/services/http_scaling.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/sqs_queue.py +0 -0
- {documente_shared-0.1.159/tests → documente_shared-0.1.161b0/documente_shared/presentation}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/presentation/presenters.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/publish.sh +0 -0
- {documente_shared-0.1.159/tests/documente_shared → documente_shared-0.1.161b0/tests}/__init__.py +0 -0
- {documente_shared-0.1.159/tests/documente_shared/application → documente_shared-0.1.161b0/tests/documente_shared}/__init__.py +0 -0
- {documente_shared-0.1.159/tests/documente_shared/domain → documente_shared-0.1.161b0/tests/documente_shared/application}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/application/test_files.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/application/test_payloads.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/conftest.py +0 -0
- {documente_shared-0.1.159/tests/documente_shared/domain/entities → documente_shared-0.1.161b0/tests/documente_shared/domain}/__init__.py +0 -0
- {documente_shared-0.1.159/tests/documente_shared/infrastructure → documente_shared-0.1.161b0/tests/documente_shared/domain/entities}/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/domain/entities/test_in_memory_document.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/domain/entities/test_processing_case.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/domain/entities/test_processing_case_item.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/domain/entities/test_processing_record.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/domain/enums/test_processing_case_validator.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/infrastructure/repositories/__init__.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documente_shared/infrastructure/repositories/test_http_processing_record.py +0 -0
- {documente_shared-0.1.159 → documente_shared-0.1.161b0}/tests/documents.py +0 -0
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/query_params.py
RENAMED
|
File without changes
|
|
@@ -7,6 +7,7 @@ from documente_shared.domain.constants import la_paz_tz
|
|
|
7
7
|
from documente_shared.domain.entities.processing_case_item import ProcessingCaseItem
|
|
8
8
|
from documente_shared.domain.enums.common import ProcessingStatus
|
|
9
9
|
from documente_shared.domain.enums.processing_case import ProcessingCaseType
|
|
10
|
+
from documente_shared.domain.helpers.values import optional_datetime_str
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
@dataclass
|
|
@@ -21,6 +22,8 @@ class ProcessingCase(object):
|
|
|
21
22
|
failed_at: Optional[datetime] = None
|
|
22
23
|
feedback: Optional[list | dict] = None
|
|
23
24
|
completed_at: Optional[datetime] = None
|
|
25
|
+
created_at: Optional[datetime] = None
|
|
26
|
+
updated_at: Optional[datetime] = None
|
|
24
27
|
metadata: Optional[dict] = None
|
|
25
28
|
items: Optional[List[ProcessingCaseItem]] = None
|
|
26
29
|
|
|
@@ -30,10 +33,10 @@ class ProcessingCase(object):
|
|
|
30
33
|
def __eq__(self, other: 'ProcessingCase') -> bool:
|
|
31
34
|
if not other:
|
|
32
35
|
return False
|
|
33
|
-
|
|
34
36
|
return (
|
|
35
37
|
self.uuid == other.uuid
|
|
36
38
|
and self.name == other.name
|
|
39
|
+
and self.tenant_slug == other.tenant_slug
|
|
37
40
|
and self.status == other.status
|
|
38
41
|
and self.case_type == other.case_type
|
|
39
42
|
and self.enqueued_at == other.enqueued_at
|
|
@@ -41,16 +44,19 @@ class ProcessingCase(object):
|
|
|
41
44
|
and self.failed_at == other.failed_at
|
|
42
45
|
and self.feedback == other.feedback
|
|
43
46
|
and self.completed_at == other.completed_at
|
|
47
|
+
and self.created_at == other.created_at
|
|
48
|
+
and self.updated_at == other.updated_at
|
|
44
49
|
and self.metadata == other.metadata
|
|
50
|
+
and self.items == other.items
|
|
45
51
|
)
|
|
46
52
|
|
|
47
53
|
@property
|
|
48
|
-
def strategy_id(self) ->str:
|
|
54
|
+
def strategy_id(self) -> str:
|
|
49
55
|
return str(self.case_type)
|
|
50
56
|
|
|
51
57
|
@property
|
|
52
58
|
def is_procesable(self) -> bool:
|
|
53
|
-
return
|
|
59
|
+
return bool(self.items)
|
|
54
60
|
|
|
55
61
|
@property
|
|
56
62
|
def is_queue_procesable(self) -> bool:
|
|
@@ -86,18 +92,19 @@ class ProcessingCase(object):
|
|
|
86
92
|
str(self.case_type)
|
|
87
93
|
if self.case_type else None
|
|
88
94
|
),
|
|
89
|
-
'enqueued_at': self.enqueued_at
|
|
90
|
-
'started_at': self.started_at
|
|
91
|
-
'failed_at': self.failed_at
|
|
95
|
+
'enqueued_at': optional_datetime_str(self.enqueued_at),
|
|
96
|
+
'started_at': optional_datetime_str(self.started_at),
|
|
97
|
+
'failed_at': optional_datetime_str(self.failed_at),
|
|
92
98
|
'feedback': self.feedback,
|
|
93
|
-
'completed_at': self.completed_at.isoformat() if self.completed_at else None,
|
|
94
99
|
'metadata': self.metadata,
|
|
100
|
+
'completed_at': optional_datetime_str(self.completed_at),
|
|
101
|
+
'updated_at': optional_datetime_str(self.updated_at),
|
|
95
102
|
'items': [item.to_dict for item in self.items],
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
@property
|
|
99
106
|
def to_queue_dict(self) -> dict:
|
|
100
|
-
data = self.to_dict
|
|
107
|
+
data = self.to_dict.copy()
|
|
101
108
|
data["items"] = [
|
|
102
109
|
item.to_queue_dict for item in self.items
|
|
103
110
|
]
|
|
@@ -105,7 +112,7 @@ class ProcessingCase(object):
|
|
|
105
112
|
|
|
106
113
|
@property
|
|
107
114
|
def to_persist_dict(self) -> dict:
|
|
108
|
-
persist_data = self.to_dict
|
|
115
|
+
persist_data = self.to_dict.copy()
|
|
109
116
|
persist_data["items"] = [
|
|
110
117
|
item.to_dict for item in self.items
|
|
111
118
|
]
|
|
@@ -183,8 +190,6 @@ class ProcessingCase(object):
|
|
|
183
190
|
else:
|
|
184
191
|
self.status = ProcessingStatus.PENDING
|
|
185
192
|
|
|
186
|
-
|
|
187
|
-
|
|
188
193
|
@classmethod
|
|
189
194
|
def from_dict(cls, data: dict) -> 'ProcessingCase':
|
|
190
195
|
return cls(
|
|
@@ -202,6 +207,8 @@ class ProcessingCase(object):
|
|
|
202
207
|
feedback=data.get('feedback'),
|
|
203
208
|
metadata=data.get('metadata', {}),
|
|
204
209
|
completed_at=get_datetime_from_data(input_datetime=data.get('completed_at')),
|
|
210
|
+
created_at=get_datetime_from_data(input_datetime=data.get('created_at')),
|
|
211
|
+
updated_at=get_datetime_from_data(input_datetime=data.get('updated_at')),
|
|
205
212
|
items=[
|
|
206
213
|
ProcessingCaseItem.from_dict(item_dict)
|
|
207
214
|
for item_dict in data.get('items', [])
|
|
@@ -216,4 +223,3 @@ class ProcessingCase(object):
|
|
|
216
223
|
for item_dict in data.get('items', [])
|
|
217
224
|
]
|
|
218
225
|
return instance
|
|
219
|
-
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from uuid import UUID
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from decimal import Decimal
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
|
+
|
|
6
|
+
from documente_shared.domain.entities.in_memory_document import InMemoryDocument
|
|
7
|
+
from documente_shared.domain.enums.common import ProcessingStatus
|
|
8
|
+
from documente_shared.domain.enums.workspace import WorkspaceSource
|
|
9
|
+
from documente_shared.domain.helpers.values import optional_str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class WorkspaceDocument(BaseModel):
|
|
13
|
+
uuid: UUID
|
|
14
|
+
name: str
|
|
15
|
+
digest: str | None = Field(default=None)
|
|
16
|
+
status: ProcessingStatus
|
|
17
|
+
tenant_id: UUID
|
|
18
|
+
workspace_id: UUID
|
|
19
|
+
document_type_id: UUID | None = Field(default=None)
|
|
20
|
+
source: WorkspaceSource | None = Field(default=None)
|
|
21
|
+
|
|
22
|
+
document: InMemoryDocument | None = Field(default=None)
|
|
23
|
+
document_url: str | None = Field(default=None)
|
|
24
|
+
processing_time: Decimal | None = Field(default=None)
|
|
25
|
+
metadata: dict | None = Field(default=None)
|
|
26
|
+
extraction: dict | None = Field(default=None)
|
|
27
|
+
uploaded_at: datetime | None = Field(default=None)
|
|
28
|
+
created_at: datetime | None = Field(default=None)
|
|
29
|
+
updated_at: datetime | None = Field(default=None)
|
|
30
|
+
started_at: datetime | None = Field(default=None)
|
|
31
|
+
completed_at: datetime | None = Field(default=None)
|
|
32
|
+
failed_at: datetime | None = Field(default=None)
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def to_persist_dict(self) -> dict:
|
|
36
|
+
return {
|
|
37
|
+
"tenant_id": self.tenant_id,
|
|
38
|
+
"workspace_id": self.workspace_id,
|
|
39
|
+
"doctype_id": self.document_type_id,
|
|
40
|
+
"name": self.name,
|
|
41
|
+
"digest": self.digest,
|
|
42
|
+
"status": str(self.status),
|
|
43
|
+
"source": optional_str(self.source),
|
|
44
|
+
"uploaded_at": self.uploaded_at,
|
|
45
|
+
"started_at": self.started_at,
|
|
46
|
+
"completed_at": self.completed_at,
|
|
47
|
+
"failed_at": self.failed_at,
|
|
48
|
+
"processing_time": self.processing_time,
|
|
49
|
+
"metadata": self.metadata or {},
|
|
50
|
+
"extraction": self.extraction or {},
|
|
51
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from uuid import UUID
|
|
3
|
+
|
|
4
|
+
from documente_shared.domain.entities.in_memory_document import InMemoryDocument
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WorkspaceDocumentPage(BaseModel):
|
|
9
|
+
uuid: UUID
|
|
10
|
+
tenant_id: UUID
|
|
11
|
+
workspace_id: UUID
|
|
12
|
+
workspace_document_id: UUID
|
|
13
|
+
page_number: int
|
|
14
|
+
page_file: InMemoryDocument | None = Field(default=None)
|
|
15
|
+
page_file_url: str | None = Field(default=None)
|
|
16
|
+
created_at: datetime | None = Field(default=None)
|
|
17
|
+
synced_at: datetime | None = Field(default=None)
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def to_persist_dict(self) -> dict:
|
|
21
|
+
return {
|
|
22
|
+
"tenant_id": self.tenant_id,
|
|
23
|
+
"workspace_id": self.workspace_id,
|
|
24
|
+
"workspace_document_id": self.workspace_document_id,
|
|
25
|
+
"page_number": self.page_number,
|
|
26
|
+
"synced_at": self.synced_at,
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class WorkspaceSource(BaseEnum):
|
|
5
|
+
WEB = "WEB"
|
|
6
|
+
MOBILE = "MOBILE"
|
|
7
|
+
TOOLS = "TOOLS"
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def is_web(self):
|
|
11
|
+
return self == self.WEB
|
|
12
|
+
|
|
13
|
+
@property
|
|
14
|
+
def is_mobile(self):
|
|
15
|
+
return self == self.MOBILE
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def is_tools(self):
|
|
19
|
+
return self == self.TOOLS
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def optional_str(input_value: object | None = None) -> str | None:
|
|
5
|
+
if input_value is None:
|
|
6
|
+
return None
|
|
7
|
+
return str(input_value)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def optional_datetime_str(input_datetime: datetime | None = None) -> str | None:
|
|
11
|
+
if input_datetime is None:
|
|
12
|
+
return None
|
|
13
|
+
return input_datetime.isoformat()
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any, Optional
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
from documente_shared.domain.entities.workspace_document import WorkspaceDocument
|
|
6
|
+
from documente_shared.domain.enums.common import ProcessingStatus
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class WorkspaceDocumentRepository(ABC):
|
|
10
|
+
@abstractmethod
|
|
11
|
+
def find(self, uuid: UUID) -> Optional[WorkspaceDocument]:
|
|
12
|
+
raise NotImplementedError
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def find_by_digest(self, workspace_id: UUID, digest: str) -> Optional[WorkspaceDocument]:
|
|
16
|
+
raise NotImplementedError
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def filter_by_workspace(
|
|
20
|
+
self,
|
|
21
|
+
workspace_id: UUID,
|
|
22
|
+
status: Optional[ProcessingStatus] = None,
|
|
23
|
+
limit: Optional[int] = None,
|
|
24
|
+
offset: int = 0,
|
|
25
|
+
) -> list[WorkspaceDocument]:
|
|
26
|
+
raise NotImplementedError
|
|
27
|
+
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def filter(self, workspace_id: UUID) -> list[WorkspaceDocument]:
|
|
30
|
+
raise NotImplementedError
|
|
31
|
+
|
|
32
|
+
@abstractmethod
|
|
33
|
+
def filter_paginated(self, workspace_id: UUID, page_params: Any) -> Any:
|
|
34
|
+
raise NotImplementedError
|
|
35
|
+
|
|
36
|
+
@abstractmethod
|
|
37
|
+
def persist(self, instance: WorkspaceDocument) -> WorkspaceDocument:
|
|
38
|
+
raise NotImplementedError
|
|
39
|
+
|
|
40
|
+
@abstractmethod
|
|
41
|
+
def delete(self, uuid: UUID) -> None:
|
|
42
|
+
raise NotImplementedError
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any, Optional
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
from documente_shared.domain.entities.workspace_document_page import WorkspaceDocumentPage
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WorkspaceDocumentPageRepository(ABC):
|
|
9
|
+
@abstractmethod
|
|
10
|
+
def find(self, uuid: UUID) -> Optional[WorkspaceDocumentPage]:
|
|
11
|
+
raise NotImplementedError
|
|
12
|
+
|
|
13
|
+
@abstractmethod
|
|
14
|
+
def find_by_document(self, workspace_document_id: UUID) -> list[WorkspaceDocumentPage]:
|
|
15
|
+
raise NotImplementedError
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def find_by_document_and_page_number(
|
|
19
|
+
self, workspace_document_id: UUID, page_number: int
|
|
20
|
+
) -> Optional[WorkspaceDocumentPage]:
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
|
|
23
|
+
@abstractmethod
|
|
24
|
+
def filter(self, workspace_document_id: UUID) -> list[WorkspaceDocumentPage]:
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
|
|
27
|
+
@abstractmethod
|
|
28
|
+
def filter_paginated(self, workspace_document_id: UUID, page_params: Any) -> Any:
|
|
29
|
+
raise NotImplementedError
|
|
30
|
+
|
|
31
|
+
@abstractmethod
|
|
32
|
+
def persist(self, instance: WorkspaceDocumentPage) -> WorkspaceDocumentPage:
|
|
33
|
+
raise NotImplementedError
|
|
34
|
+
|
|
35
|
+
@abstractmethod
|
|
36
|
+
def delete(self, uuid: UUID) -> None:
|
|
37
|
+
raise NotImplementedError
|
|
38
|
+
|
|
39
|
+
@abstractmethod
|
|
40
|
+
def delete_by_document(self, workspace_document_id: UUID) -> None:
|
|
41
|
+
raise NotImplementedError
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/dates.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/digest.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/exceptions.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/files.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/json.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/numbers.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/payloads.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/retry_utils.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/time_utils.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/application/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/base_enum.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/constants.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/__init__.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/entities/scaling.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/common.py
RENAMED
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/enums/document.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/domain/interfaces/queue.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/lambdas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159 → documente_shared-0.1.161b0}/documente_shared/presentation/presenters.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.159/tests/documente_shared → documente_shared-0.1.161b0/tests}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|