documente_shared 0.1.72__py3-none-any.whl → 0.1.72b0__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/__init__.py +0 -0
- documente_shared/application/__init__.py +0 -0
- documente_shared/application/digest.py +7 -7
- documente_shared/application/exceptions.py +23 -23
- documente_shared/application/files.py +22 -22
- documente_shared/application/time_utils.py +13 -13
- documente_shared/application/timezone.py +7 -7
- documente_shared/domain/__init__.py +0 -0
- documente_shared/domain/base_enum.py +53 -53
- documente_shared/domain/constants.py +2 -2
- documente_shared/domain/entities/__init__.py +0 -0
- documente_shared/domain/entities/document.py +348 -348
- documente_shared/domain/entities/document_metadata.py +63 -63
- documente_shared/domain/entities/in_memory_result.py +51 -51
- documente_shared/domain/entities/processing_case.py +144 -144
- documente_shared/domain/entities/processing_case_item.py +216 -216
- documente_shared/domain/entities/processing_event.py +49 -49
- documente_shared/domain/enums/__init__.py +0 -0
- documente_shared/domain/enums/common.py +95 -95
- documente_shared/domain/enums/document.py +71 -71
- documente_shared/domain/enums/processing_case.py +54 -54
- documente_shared/domain/repositories/__init__.py +0 -0
- documente_shared/domain/repositories/document.py +24 -24
- documente_shared/domain/repositories/processing_case.py +24 -24
- documente_shared/domain/repositories/processing_case_item.py +29 -29
- documente_shared/infrastructure/__init__.py +0 -0
- documente_shared/infrastructure/documente_client.py +21 -0
- documente_shared/infrastructure/dynamo_table.py +75 -75
- documente_shared/infrastructure/repositories/__init__.py +0 -0
- documente_shared/infrastructure/repositories/dynamo_document.py +43 -43
- documente_shared/infrastructure/repositories/dynamo_processing_case.py +43 -43
- documente_shared/infrastructure/repositories/dynamo_processing_case_item.py +53 -53
- documente_shared/infrastructure/repositories/http_document_processing.py +41 -0
- documente_shared/infrastructure/repositories/http_processing_case.py +41 -0
- documente_shared/infrastructure/repositories/http_processing_case_item.py +53 -0
- documente_shared/infrastructure/s3_bucket.py +57 -57
- documente_shared/infrastructure/sqs_queue.py +47 -47
- {documente_shared-0.1.72.dist-info → documente_shared-0.1.72b0.dist-info}/METADATA +2 -1
- documente_shared-0.1.72b0.dist-info/RECORD +40 -0
- documente_shared-0.1.72.dist-info/RECORD +0 -36
- {documente_shared-0.1.72.dist-info → documente_shared-0.1.72b0.dist-info}/WHEEL +0 -0
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class ProcessingSource(BaseEnum):
|
|
5
|
-
AGENT_UI = 'AGENT_UI'
|
|
6
|
-
AGENT_CRAWLER = 'AGENT_CRAWLER'
|
|
7
|
-
PLATFORM_UI = 'PLATFORM_UI'
|
|
8
|
-
PLATFORM_API = 'PLATFORM_API'
|
|
9
|
-
AWS_CONSOLE = 'AWS_CONSOLE'
|
|
10
|
-
LOCAL_MANUAL = 'LOCAL_MANUAL'
|
|
11
|
-
|
|
12
|
-
@property
|
|
13
|
-
def is_agent_ui(self):
|
|
14
|
-
return self == ProcessingSource.AGENT_UI
|
|
15
|
-
|
|
16
|
-
@property
|
|
17
|
-
def is_agent_crawler(self):
|
|
18
|
-
return self == ProcessingSource.AGENT_CRAWLER
|
|
19
|
-
|
|
20
|
-
@property
|
|
21
|
-
def is_platform_ui(self):
|
|
22
|
-
return self == ProcessingSource.PLATFORM_UI
|
|
23
|
-
|
|
24
|
-
@property
|
|
25
|
-
def is_platform_api(self):
|
|
26
|
-
return self == ProcessingSource.PLATFORM_API
|
|
27
|
-
|
|
28
|
-
@property
|
|
29
|
-
def is_aws_console(self):
|
|
30
|
-
return self == ProcessingSource.AWS_CONSOLE
|
|
31
|
-
|
|
32
|
-
@property
|
|
33
|
-
def is_local_manual(self):
|
|
34
|
-
return self == ProcessingSource.LOCAL_MANUAL
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class ProcessingStatus(BaseEnum):
|
|
38
|
-
PENDING = 'PENDING'
|
|
39
|
-
ENQUEUED = 'ENQUEUED'
|
|
40
|
-
PROCESSING = 'PROCESSING'
|
|
41
|
-
COMPLETED = 'COMPLETED'
|
|
42
|
-
INCOMPLETE = 'INCOMPLETE'
|
|
43
|
-
FAILED = 'FAILED'
|
|
44
|
-
DELETED = 'DELETED'
|
|
45
|
-
CANCELLED = 'CANCELLED'
|
|
46
|
-
IN_REVIEW = 'IN_REVIEW'
|
|
47
|
-
|
|
48
|
-
@property
|
|
49
|
-
def is_pending(self):
|
|
50
|
-
return self == ProcessingStatus.PENDING
|
|
51
|
-
|
|
52
|
-
@property
|
|
53
|
-
def is_enqueued(self):
|
|
54
|
-
return self == ProcessingStatus.ENQUEUED
|
|
55
|
-
|
|
56
|
-
@property
|
|
57
|
-
def is_processing(self):
|
|
58
|
-
return self == ProcessingStatus.PROCESSING
|
|
59
|
-
|
|
60
|
-
@property
|
|
61
|
-
def is_completed(self):
|
|
62
|
-
return self == ProcessingStatus.COMPLETED
|
|
63
|
-
|
|
64
|
-
@property
|
|
65
|
-
def is_incomplete(self):
|
|
66
|
-
return self == ProcessingStatus.INCOMPLETE
|
|
67
|
-
|
|
68
|
-
@property
|
|
69
|
-
def is_failed(self):
|
|
70
|
-
return self == ProcessingStatus.FAILED
|
|
71
|
-
|
|
72
|
-
@property
|
|
73
|
-
def is_deleted(self):
|
|
74
|
-
return self == ProcessingStatus.DELETED
|
|
75
|
-
|
|
76
|
-
@property
|
|
77
|
-
def is_cancelled(self):
|
|
78
|
-
return self == ProcessingStatus.CANCELLED
|
|
79
|
-
|
|
80
|
-
@property
|
|
81
|
-
def is_in_review(self):
|
|
82
|
-
return self == ProcessingStatus.IN_REVIEW
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class ProcessingType(BaseEnum):
|
|
86
|
-
DOCUMENT = 'DOCUMENT'
|
|
87
|
-
PROCESSING_CASE = 'PROCESSING_CASE'
|
|
88
|
-
|
|
89
|
-
@property
|
|
90
|
-
def is_document(self):
|
|
91
|
-
return self == ProcessingType.DOCUMENT
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def is_processing_case(self):
|
|
95
|
-
return self == ProcessingType.PROCESSING_CASE
|
|
1
|
+
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ProcessingSource(BaseEnum):
|
|
5
|
+
AGENT_UI = 'AGENT_UI'
|
|
6
|
+
AGENT_CRAWLER = 'AGENT_CRAWLER'
|
|
7
|
+
PLATFORM_UI = 'PLATFORM_UI'
|
|
8
|
+
PLATFORM_API = 'PLATFORM_API'
|
|
9
|
+
AWS_CONSOLE = 'AWS_CONSOLE'
|
|
10
|
+
LOCAL_MANUAL = 'LOCAL_MANUAL'
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def is_agent_ui(self):
|
|
14
|
+
return self == ProcessingSource.AGENT_UI
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def is_agent_crawler(self):
|
|
18
|
+
return self == ProcessingSource.AGENT_CRAWLER
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def is_platform_ui(self):
|
|
22
|
+
return self == ProcessingSource.PLATFORM_UI
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def is_platform_api(self):
|
|
26
|
+
return self == ProcessingSource.PLATFORM_API
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def is_aws_console(self):
|
|
30
|
+
return self == ProcessingSource.AWS_CONSOLE
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def is_local_manual(self):
|
|
34
|
+
return self == ProcessingSource.LOCAL_MANUAL
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ProcessingStatus(BaseEnum):
|
|
38
|
+
PENDING = 'PENDING'
|
|
39
|
+
ENQUEUED = 'ENQUEUED'
|
|
40
|
+
PROCESSING = 'PROCESSING'
|
|
41
|
+
COMPLETED = 'COMPLETED'
|
|
42
|
+
INCOMPLETE = 'INCOMPLETE'
|
|
43
|
+
FAILED = 'FAILED'
|
|
44
|
+
DELETED = 'DELETED'
|
|
45
|
+
CANCELLED = 'CANCELLED'
|
|
46
|
+
IN_REVIEW = 'IN_REVIEW'
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def is_pending(self):
|
|
50
|
+
return self == ProcessingStatus.PENDING
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def is_enqueued(self):
|
|
54
|
+
return self == ProcessingStatus.ENQUEUED
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def is_processing(self):
|
|
58
|
+
return self == ProcessingStatus.PROCESSING
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def is_completed(self):
|
|
62
|
+
return self == ProcessingStatus.COMPLETED
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def is_incomplete(self):
|
|
66
|
+
return self == ProcessingStatus.INCOMPLETE
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def is_failed(self):
|
|
70
|
+
return self == ProcessingStatus.FAILED
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def is_deleted(self):
|
|
74
|
+
return self == ProcessingStatus.DELETED
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def is_cancelled(self):
|
|
78
|
+
return self == ProcessingStatus.CANCELLED
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def is_in_review(self):
|
|
82
|
+
return self == ProcessingStatus.IN_REVIEW
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class ProcessingType(BaseEnum):
|
|
86
|
+
DOCUMENT = 'DOCUMENT'
|
|
87
|
+
PROCESSING_CASE = 'PROCESSING_CASE'
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def is_document(self):
|
|
91
|
+
return self == ProcessingType.DOCUMENT
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def is_processing_case(self):
|
|
95
|
+
return self == ProcessingType.PROCESSING_CASE
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class DocumentProcessingStatus(BaseEnum):
|
|
5
|
-
PENDING = 'PENDING'
|
|
6
|
-
ENQUEUED = 'ENQUEUED'
|
|
7
|
-
PROCESSING = 'PROCESSING'
|
|
8
|
-
COMPLETED = 'COMPLETED'
|
|
9
|
-
INCOMPLETE = 'INCOMPLETE'
|
|
10
|
-
FAILED = 'FAILED'
|
|
11
|
-
DELETED = 'DELETED'
|
|
12
|
-
CANCELLED = 'CANCELLED'
|
|
13
|
-
IN_REVIEW = 'IN_REVIEW'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class DocumentProcessingCategory(BaseEnum):
|
|
17
|
-
CIRCULAR = 'CIRCULAR'
|
|
18
|
-
DESGRAVAMEN = 'DESGRAVAMEN'
|
|
19
|
-
|
|
20
|
-
@property
|
|
21
|
-
def is_circular(self):
|
|
22
|
-
return self == DocumentProcessingCategory.CIRCULAR
|
|
23
|
-
|
|
24
|
-
@property
|
|
25
|
-
def is_desgravamen(self):
|
|
26
|
-
return self == DocumentProcessingCategory.DESGRAVAMEN
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class DocumentProcessingSource(BaseEnum):
|
|
30
|
-
AGENT_UI = 'AGENT_UI'
|
|
31
|
-
AGENT_CRAWLER = 'AGENT_CRAWLER'
|
|
32
|
-
PLATFORM_UI = 'PLATFORM_UI'
|
|
33
|
-
PLATFORM_API = 'PLATFORM_API'
|
|
34
|
-
AWS_CONSOLE = 'AWS_CONSOLE'
|
|
35
|
-
LOCAL_MANUAL = 'LOCAL_MANUAL'
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def is_agent_ui(self):
|
|
39
|
-
return self == DocumentProcessingSource.AGENT_UI
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def is_agent_crawler(self):
|
|
43
|
-
return self == DocumentProcessingSource.AGENT_CRAWLER
|
|
44
|
-
|
|
45
|
-
@property
|
|
46
|
-
def is_platform_ui(self):
|
|
47
|
-
return self == DocumentProcessingSource.PLATFORM_UI
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def is_platform_api(self):
|
|
51
|
-
return self == DocumentProcessingSource.PLATFORM_API
|
|
52
|
-
|
|
53
|
-
@property
|
|
54
|
-
def is_aws_console(self):
|
|
55
|
-
return self == DocumentProcessingSource.AWS_CONSOLE
|
|
56
|
-
|
|
57
|
-
@property
|
|
58
|
-
def is_local_manual(self):
|
|
59
|
-
return self == DocumentProcessingSource.LOCAL_MANUAL
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class DocumentProcessingSubCategory(BaseEnum):
|
|
63
|
-
# Circulares
|
|
64
|
-
CC_COMBINADA = 'CC_COMBINADA'
|
|
65
|
-
CC_NORMATIVA = 'CC_NORMATIVA'
|
|
66
|
-
CC_INFORMATIVA = 'CC_INFORMATIVA'
|
|
67
|
-
CC_RETENCION_SUSPENSION_REMISION = 'CC_RETENCION_SUSPENSION_REMISION'
|
|
68
|
-
|
|
69
|
-
# Desgravamenes
|
|
70
|
-
DS_CREDISEGURO = 'DS_CREDISEGURO'
|
|
71
|
-
|
|
1
|
+
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DocumentProcessingStatus(BaseEnum):
|
|
5
|
+
PENDING = 'PENDING'
|
|
6
|
+
ENQUEUED = 'ENQUEUED'
|
|
7
|
+
PROCESSING = 'PROCESSING'
|
|
8
|
+
COMPLETED = 'COMPLETED'
|
|
9
|
+
INCOMPLETE = 'INCOMPLETE'
|
|
10
|
+
FAILED = 'FAILED'
|
|
11
|
+
DELETED = 'DELETED'
|
|
12
|
+
CANCELLED = 'CANCELLED'
|
|
13
|
+
IN_REVIEW = 'IN_REVIEW'
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class DocumentProcessingCategory(BaseEnum):
|
|
17
|
+
CIRCULAR = 'CIRCULAR'
|
|
18
|
+
DESGRAVAMEN = 'DESGRAVAMEN'
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def is_circular(self):
|
|
22
|
+
return self == DocumentProcessingCategory.CIRCULAR
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def is_desgravamen(self):
|
|
26
|
+
return self == DocumentProcessingCategory.DESGRAVAMEN
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class DocumentProcessingSource(BaseEnum):
|
|
30
|
+
AGENT_UI = 'AGENT_UI'
|
|
31
|
+
AGENT_CRAWLER = 'AGENT_CRAWLER'
|
|
32
|
+
PLATFORM_UI = 'PLATFORM_UI'
|
|
33
|
+
PLATFORM_API = 'PLATFORM_API'
|
|
34
|
+
AWS_CONSOLE = 'AWS_CONSOLE'
|
|
35
|
+
LOCAL_MANUAL = 'LOCAL_MANUAL'
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def is_agent_ui(self):
|
|
39
|
+
return self == DocumentProcessingSource.AGENT_UI
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def is_agent_crawler(self):
|
|
43
|
+
return self == DocumentProcessingSource.AGENT_CRAWLER
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def is_platform_ui(self):
|
|
47
|
+
return self == DocumentProcessingSource.PLATFORM_UI
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def is_platform_api(self):
|
|
51
|
+
return self == DocumentProcessingSource.PLATFORM_API
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def is_aws_console(self):
|
|
55
|
+
return self == DocumentProcessingSource.AWS_CONSOLE
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def is_local_manual(self):
|
|
59
|
+
return self == DocumentProcessingSource.LOCAL_MANUAL
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class DocumentProcessingSubCategory(BaseEnum):
|
|
63
|
+
# Circulares
|
|
64
|
+
CC_COMBINADA = 'CC_COMBINADA'
|
|
65
|
+
CC_NORMATIVA = 'CC_NORMATIVA'
|
|
66
|
+
CC_INFORMATIVA = 'CC_INFORMATIVA'
|
|
67
|
+
CC_RETENCION_SUSPENSION_REMISION = 'CC_RETENCION_SUSPENSION_REMISION'
|
|
68
|
+
|
|
69
|
+
# Desgravamenes
|
|
70
|
+
DS_CREDISEGURO = 'DS_CREDISEGURO'
|
|
71
|
+
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class ProcessingCaseCategory(BaseEnum):
|
|
5
|
-
BCP_MICROCREDITO = 'BCP_MICROCREDITO'
|
|
6
|
-
|
|
7
|
-
@property
|
|
8
|
-
def is_bcp_microcredito(self):
|
|
9
|
-
return self == ProcessingCaseCategory.BCP_MICROCREDITO
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ProcessingDocumentType(BaseEnum):
|
|
13
|
-
REVIEW_CHECKLIST = 'REVISION_CHECKLIST'
|
|
14
|
-
SOLICITUD_DE_CREDITO = 'SOLICITUD_DE_CREDITO'
|
|
15
|
-
RESOLUCION_DE_CREDITO = 'RESOLUCION_DE_CREDITO'
|
|
16
|
-
CEDULA_DE_IDENTIDAD = 'CEDULA_DE_IDENTIDAD'
|
|
17
|
-
NIT = 'NIT'
|
|
18
|
-
FICHA_VERIFICACION = 'FICHA_VERIFICACION'
|
|
19
|
-
FACTURA_ELECTRICIDAD = 'FACTURA_ELECTRICIDAD'
|
|
20
|
-
CARTA_CLIENTE = 'CARTA_CLIENTE'
|
|
21
|
-
|
|
22
|
-
@property
|
|
23
|
-
def is_review_checklist(self):
|
|
24
|
-
return self == ProcessingDocumentType.REVIEW_CHECKLIST
|
|
25
|
-
|
|
26
|
-
@property
|
|
27
|
-
def is_solicitud_de_credito(self):
|
|
28
|
-
return self == ProcessingDocumentType.SOLICITUD_DE_CREDITO
|
|
29
|
-
|
|
30
|
-
@property
|
|
31
|
-
def is_resolucion_de_credito(self):
|
|
32
|
-
return self == ProcessingDocumentType.RESOLUCION_DE_CREDITO
|
|
33
|
-
|
|
34
|
-
@property
|
|
35
|
-
def is_cedula_de_identidad(self):
|
|
36
|
-
return self == ProcessingDocumentType.CEDULA_DE_IDENTIDAD
|
|
37
|
-
|
|
38
|
-
@property
|
|
39
|
-
def is_nit(self):
|
|
40
|
-
return self == ProcessingDocumentType.NIT
|
|
41
|
-
|
|
42
|
-
@property
|
|
43
|
-
def is_ficha_verificacion(self):
|
|
44
|
-
return self == ProcessingDocumentType.FICHA_VERIFICACION
|
|
45
|
-
|
|
46
|
-
@property
|
|
47
|
-
def is_factura_electricidad(self):
|
|
48
|
-
return self == ProcessingDocumentType.FACTURA_ELECTRICIDAD
|
|
49
|
-
|
|
50
|
-
@property
|
|
51
|
-
def is_carta_cliente(self):
|
|
52
|
-
return self == ProcessingDocumentType.CARTA_CLIENTE
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
from documente_shared.domain.base_enum import BaseEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ProcessingCaseCategory(BaseEnum):
|
|
5
|
+
BCP_MICROCREDITO = 'BCP_MICROCREDITO'
|
|
6
|
+
|
|
7
|
+
@property
|
|
8
|
+
def is_bcp_microcredito(self):
|
|
9
|
+
return self == ProcessingCaseCategory.BCP_MICROCREDITO
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ProcessingDocumentType(BaseEnum):
|
|
13
|
+
REVIEW_CHECKLIST = 'REVISION_CHECKLIST'
|
|
14
|
+
SOLICITUD_DE_CREDITO = 'SOLICITUD_DE_CREDITO'
|
|
15
|
+
RESOLUCION_DE_CREDITO = 'RESOLUCION_DE_CREDITO'
|
|
16
|
+
CEDULA_DE_IDENTIDAD = 'CEDULA_DE_IDENTIDAD'
|
|
17
|
+
NIT = 'NIT'
|
|
18
|
+
FICHA_VERIFICACION = 'FICHA_VERIFICACION'
|
|
19
|
+
FACTURA_ELECTRICIDAD = 'FACTURA_ELECTRICIDAD'
|
|
20
|
+
CARTA_CLIENTE = 'CARTA_CLIENTE'
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def is_review_checklist(self):
|
|
24
|
+
return self == ProcessingDocumentType.REVIEW_CHECKLIST
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def is_solicitud_de_credito(self):
|
|
28
|
+
return self == ProcessingDocumentType.SOLICITUD_DE_CREDITO
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def is_resolucion_de_credito(self):
|
|
32
|
+
return self == ProcessingDocumentType.RESOLUCION_DE_CREDITO
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def is_cedula_de_identidad(self):
|
|
36
|
+
return self == ProcessingDocumentType.CEDULA_DE_IDENTIDAD
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def is_nit(self):
|
|
40
|
+
return self == ProcessingDocumentType.NIT
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def is_ficha_verificacion(self):
|
|
44
|
+
return self == ProcessingDocumentType.FICHA_VERIFICACION
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def is_factura_electricidad(self):
|
|
48
|
+
return self == ProcessingDocumentType.FACTURA_ELECTRICIDAD
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def is_carta_cliente(self):
|
|
52
|
+
return self == ProcessingDocumentType.CARTA_CLIENTE
|
|
53
|
+
|
|
54
|
+
|
|
File without changes
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Optional, List
|
|
3
|
-
|
|
4
|
-
from documente_shared.domain.entities.document import DocumentProcessing
|
|
5
|
-
from documente_shared.domain.enums.document import DocumentProcessingStatus
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class DocumentProcessingRepository(ABC):
|
|
9
|
-
|
|
10
|
-
@abstractmethod
|
|
11
|
-
def find(self, digest: str) -> Optional[DocumentProcessing]:
|
|
12
|
-
raise NotImplementedError
|
|
13
|
-
|
|
14
|
-
@abstractmethod
|
|
15
|
-
def persist(self, instance: DocumentProcessing) -> DocumentProcessing:
|
|
16
|
-
raise NotImplementedError
|
|
17
|
-
|
|
18
|
-
@abstractmethod
|
|
19
|
-
def remove(self, instance: DocumentProcessing):
|
|
20
|
-
raise NotImplementedError
|
|
21
|
-
|
|
22
|
-
@abstractmethod
|
|
23
|
-
def filter(self, statuses: List[DocumentProcessingStatus]) -> List[DocumentProcessing]:
|
|
24
|
-
raise NotImplementedError
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from documente_shared.domain.entities.document import DocumentProcessing
|
|
5
|
+
from documente_shared.domain.enums.document import DocumentProcessingStatus
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DocumentProcessingRepository(ABC):
|
|
9
|
+
|
|
10
|
+
@abstractmethod
|
|
11
|
+
def find(self, digest: str) -> Optional[DocumentProcessing]:
|
|
12
|
+
raise NotImplementedError
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def persist(self, instance: DocumentProcessing) -> DocumentProcessing:
|
|
16
|
+
raise NotImplementedError
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def remove(self, instance: DocumentProcessing):
|
|
20
|
+
raise NotImplementedError
|
|
21
|
+
|
|
22
|
+
@abstractmethod
|
|
23
|
+
def filter(self, statuses: List[DocumentProcessingStatus]) -> List[DocumentProcessing]:
|
|
24
|
+
raise NotImplementedError
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Optional, List
|
|
3
|
-
|
|
4
|
-
from documente_shared.domain.entities.processing_case import ProcessingCase
|
|
5
|
-
from documente_shared.domain.enums.common import ProcessingStatus
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ProcessingCaseRepository(ABC):
|
|
9
|
-
|
|
10
|
-
@abstractmethod
|
|
11
|
-
def find(self, case_id: str) -> Optional[ProcessingCase]:
|
|
12
|
-
raise NotImplementedError
|
|
13
|
-
|
|
14
|
-
@abstractmethod
|
|
15
|
-
def persist(self, instance: ProcessingCase) -> ProcessingCase:
|
|
16
|
-
raise NotImplementedError
|
|
17
|
-
|
|
18
|
-
@abstractmethod
|
|
19
|
-
def remove(self, instance: ProcessingCase):
|
|
20
|
-
raise NotImplementedError
|
|
21
|
-
|
|
22
|
-
@abstractmethod
|
|
23
|
-
def filter(self, statuses: List[ProcessingStatus]) -> List[ProcessingCase]:
|
|
24
|
-
raise NotImplementedError
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from documente_shared.domain.entities.processing_case import ProcessingCase
|
|
5
|
+
from documente_shared.domain.enums.common import ProcessingStatus
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ProcessingCaseRepository(ABC):
|
|
9
|
+
|
|
10
|
+
@abstractmethod
|
|
11
|
+
def find(self, case_id: str) -> Optional[ProcessingCase]:
|
|
12
|
+
raise NotImplementedError
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def persist(self, instance: ProcessingCase) -> ProcessingCase:
|
|
16
|
+
raise NotImplementedError
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def remove(self, instance: ProcessingCase):
|
|
20
|
+
raise NotImplementedError
|
|
21
|
+
|
|
22
|
+
@abstractmethod
|
|
23
|
+
def filter(self, statuses: List[ProcessingStatus]) -> List[ProcessingCase]:
|
|
24
|
+
raise NotImplementedError
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Optional, List
|
|
3
|
-
|
|
4
|
-
from documente_shared.domain.entities.processing_case import ProcessingCase
|
|
5
|
-
from documente_shared.domain.entities.processing_case_item import ProcessingCaseItem
|
|
6
|
-
from documente_shared.domain.enums.common import ProcessingStatus
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ProcessingCaseItemRepository(ABC):
|
|
10
|
-
|
|
11
|
-
@abstractmethod
|
|
12
|
-
def find(self,
|
|
13
|
-
raise NotImplementedError
|
|
14
|
-
|
|
15
|
-
@abstractmethod
|
|
16
|
-
def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
|
|
17
|
-
raise NotImplementedError
|
|
18
|
-
|
|
19
|
-
@abstractmethod
|
|
20
|
-
def remove(self, instance: ProcessingCaseItem):
|
|
21
|
-
raise NotImplementedError
|
|
22
|
-
|
|
23
|
-
@abstractmethod
|
|
24
|
-
def filter(self, statuses: List[ProcessingStatus]) -> List[ProcessingCase]:
|
|
25
|
-
raise NotImplementedError
|
|
26
|
-
|
|
27
|
-
@abstractmethod
|
|
28
|
-
def filter_by_case_id(self, case_id: str) -> List[ProcessingCase]:
|
|
29
|
-
raise NotImplementedError
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from documente_shared.domain.entities.processing_case import ProcessingCase
|
|
5
|
+
from documente_shared.domain.entities.processing_case_item import ProcessingCaseItem
|
|
6
|
+
from documente_shared.domain.enums.common import ProcessingStatus
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ProcessingCaseItemRepository(ABC):
|
|
10
|
+
|
|
11
|
+
@abstractmethod
|
|
12
|
+
def find(self, uuid: str) -> Optional[ProcessingCaseItem]:
|
|
13
|
+
raise NotImplementedError
|
|
14
|
+
|
|
15
|
+
@abstractmethod
|
|
16
|
+
def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
|
|
17
|
+
raise NotImplementedError
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def remove(self, instance: ProcessingCaseItem):
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
|
|
23
|
+
@abstractmethod
|
|
24
|
+
def filter(self, statuses: List[ProcessingStatus]) -> List[ProcessingCase]:
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
|
|
27
|
+
@abstractmethod
|
|
28
|
+
def filter_by_case_id(self, case_id: str) -> List[ProcessingCase]:
|
|
29
|
+
raise NotImplementedError
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from requests import Session
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class DocumenteClientMixin(object):
|
|
8
|
+
base_url: str
|
|
9
|
+
api_key: str
|
|
10
|
+
session: Optional[Session] = None
|
|
11
|
+
|
|
12
|
+
def __post_init__(self):
|
|
13
|
+
self.session = Session()
|
|
14
|
+
self.session.headers.update(self.get_common_headers())
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def get_common_headers(self) -> dict:
|
|
18
|
+
return {
|
|
19
|
+
"X-Api-Key": self.api_key,
|
|
20
|
+
"Content-Type": "application/json"
|
|
21
|
+
}
|