documente_shared 0.1.50__tar.gz → 0.1.51__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.50 → documente_shared-0.1.51}/PKG-INFO +1 -1
- documente_shared-0.1.51/documente_shared/domain/constants.py +3 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/entities/document.py +14 -9
- {documente_shared-0.1.50 → documente_shared-0.1.51}/pyproject.toml +1 -1
- {documente_shared-0.1.50 → documente_shared-0.1.51}/README.md +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/exceptions.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/time_utils.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/timezone.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/entities/__init__.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/entities/document_metadata.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/enums.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/repositories.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/dynamo_repositories.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/sqs_queue.py +0 -0
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/entities/document.py
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from datetime import datetime
|
|
2
|
+
from datetime import datetime, tzinfo
|
|
3
3
|
from decimal import Decimal
|
|
4
4
|
from typing import Optional, List
|
|
5
5
|
|
|
6
6
|
from documente_shared.application.time_utils import get_datetime_from_data
|
|
7
|
+
from documente_shared.domain.constants import la_paz_tz
|
|
7
8
|
from documente_shared.domain.entities.document_metadata import DocumentProcessingMetadata
|
|
8
9
|
from documente_shared.domain.enums import (
|
|
9
10
|
DocumentProcessingStatus,
|
|
@@ -79,22 +80,26 @@ class DocumentProcessing(object):
|
|
|
79
80
|
DocumentProcessingStatus.FAILED,
|
|
80
81
|
]
|
|
81
82
|
|
|
82
|
-
def enqueue(self):
|
|
83
|
+
def enqueue(self, timezone: tzinfo = la_paz_tz):
|
|
83
84
|
self.status = DocumentProcessingStatus.ENQUEUED
|
|
84
|
-
self.enqueued_at = datetime.now()
|
|
85
|
+
self.enqueued_at = datetime.now(tz=timezone)
|
|
85
86
|
|
|
86
|
-
def processing(self):
|
|
87
|
+
def processing(self, timezone: tzinfo = la_paz_tz):
|
|
87
88
|
self.status = DocumentProcessingStatus.PROCESSING
|
|
88
|
-
self.started_at = datetime.now()
|
|
89
|
+
self.started_at = datetime.now(tz=timezone)
|
|
89
90
|
|
|
90
|
-
def failed(
|
|
91
|
+
def failed(
|
|
92
|
+
self,
|
|
93
|
+
error_message: Optional[str] = None,
|
|
94
|
+
timezone: tzinfo = la_paz_tz,
|
|
95
|
+
):
|
|
91
96
|
self.failed_reason = error_message
|
|
92
97
|
self.status = DocumentProcessingStatus.FAILED
|
|
93
|
-
self.failed_at = datetime.now()
|
|
98
|
+
self.failed_at = datetime.now(tz=timezone)
|
|
94
99
|
|
|
95
|
-
def completed(self):
|
|
100
|
+
def completed(self, timezone: tzinfo = la_paz_tz):
|
|
96
101
|
self.status = DocumentProcessingStatus.COMPLETED
|
|
97
|
-
self.completed_at = datetime.now()
|
|
102
|
+
self.completed_at = datetime.now(tz=timezone)
|
|
98
103
|
|
|
99
104
|
def deleted(self):
|
|
100
105
|
self.status = DocumentProcessingStatus.DELETED
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/exceptions.py
RENAMED
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/time_utils.py
RENAMED
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/application/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/domain/entities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.50 → documente_shared-0.1.51}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|