mbu-dev-shared-components 0.4.4__tar.gz → 1.0.0__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.
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/PKG-INFO +1 -1
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/getorganized/cases.py +20 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/getorganized/documents.py +52 -1
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/getorganized/objects.py +66 -18
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components.egg-info/PKG-INFO +1 -1
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/pyproject.toml +1 -1
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/LICENSE +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/README.md +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/database/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/database/constants.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/database/logging.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/database/utility.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/getorganized/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/getorganized/auth.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/getorganized/contacts.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/google/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/google/api/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/google/api/auth.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/google/workspace/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/google/workspace/alerts.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/msoffice365/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/msoffice365/excel/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/msoffice365/excel/excel_reader.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/msoffice365/sharepoint_api/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/msoffice365/sharepoint_api/files.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/os2forms/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/os2forms/documents.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/os2forms/forms.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/romexis/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/romexis/db_handler.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/sap/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/sap/create_invoice.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/solteqtand/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/solteqtand/app_handler.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/solteqtand/db_handler.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/solteqtand/helper_functions.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/utils/__init__.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/utils/db_stored_procedure_executor.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/utils/fernet_encryptor.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/utils/file_handler.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components/utils/json_handler.py +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components.egg-info/requires.txt +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/mbu_dev_shared_components.egg-info/top_level.txt +0 -0
- {mbu_dev_shared_components-0.4.4 → mbu_dev_shared_components-1.0.0}/setup.cfg +0 -0
|
@@ -4,6 +4,26 @@ import requests
|
|
|
4
4
|
from mbu_dev_shared_components.getorganized.auth import get_ntlm_go_api_credentials
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
def get_case_metadata(api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
8
|
+
"""
|
|
9
|
+
Sends a GET request to fetch metadata for a given case in GO
|
|
10
|
+
|
|
11
|
+
Parameters:
|
|
12
|
+
api_endpoint (str): GetOrganized API endpoint.
|
|
13
|
+
api_username (str): The API username for GetOrganized API.
|
|
14
|
+
api_password (str): The API password for GetOrganized API.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
requests.Response: The response object from the API.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
headers = {"Content-Type": "application/json"}
|
|
21
|
+
|
|
22
|
+
response = requests.request(method='GET', url=api_endpoint, headers=headers, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
23
|
+
|
|
24
|
+
return response
|
|
25
|
+
|
|
26
|
+
|
|
7
27
|
def find_case_by_case_properties(case_data: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
8
28
|
"""
|
|
9
29
|
Sends a POST request to search for cases based on specific case properties provided in `case_data`.
|
|
@@ -3,6 +3,26 @@ import requests
|
|
|
3
3
|
from mbu_dev_shared_components.getorganized.auth import get_ntlm_go_api_credentials
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
def get_document_metadata(api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
7
|
+
"""
|
|
8
|
+
Sends a GET request to fetch metadata for a given document in GO
|
|
9
|
+
|
|
10
|
+
Parameters:
|
|
11
|
+
api_endpoint (str): GetOrganized API endpoint.
|
|
12
|
+
api_username (str): The API username for GetOrganized API.
|
|
13
|
+
api_password (str): The API password for GetOrganized API.
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
requests.Response: The response object from the API.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
headers = {"Content-Type": "application/json"}
|
|
20
|
+
|
|
21
|
+
response = requests.request(method='GET', url=api_endpoint, headers=headers, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
22
|
+
|
|
23
|
+
return response
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
def upload_file_to_case(file_data: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
7
27
|
"""
|
|
8
28
|
Uploads a file to a case by sending file data as a JSON payload to a specific API endpoint.
|
|
@@ -75,9 +95,40 @@ def finalize_file(documents_id: list, api_endpoint: str, api_username: str, api_
|
|
|
75
95
|
payload = {
|
|
76
96
|
"DocumentIds": documents_id,
|
|
77
97
|
"ShouldCloseOpenTasks": False
|
|
78
|
-
|
|
98
|
+
}
|
|
79
99
|
|
|
80
100
|
response = requests.request(method='POST', url=api_endpoint, headers=headers, json=payload, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
81
101
|
response.raise_for_status()
|
|
82
102
|
|
|
83
103
|
return response
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def search_documents(search_term: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
107
|
+
"""
|
|
108
|
+
Looks for documents in GetOrganized related to the specified search term
|
|
109
|
+
|
|
110
|
+
Parameters:
|
|
111
|
+
search_term (str): The phrase/term to be searched for in GetOrganized.
|
|
112
|
+
api_endpoint (str): GetOrganized API endpoint.
|
|
113
|
+
api_username (str): The API username for GetOrganized API.
|
|
114
|
+
api_password (str): The API password for GetOrganized API.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
requests.Response: The response object from the API.
|
|
118
|
+
|
|
119
|
+
Raises:
|
|
120
|
+
requests.RequestException: If the HTTP request fails for any reason.
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
payload = {
|
|
124
|
+
"SearchPhrase": search_term,
|
|
125
|
+
"AdditionalColumns": [],
|
|
126
|
+
"ResultLimit": 25,
|
|
127
|
+
"StartRow": 1
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
headers = {'Content-Type': 'application/json'}
|
|
131
|
+
|
|
132
|
+
response = requests.request(method='POST', url=api_endpoint, headers=headers, json=payload, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
133
|
+
|
|
134
|
+
return response
|
|
@@ -34,9 +34,74 @@ class CaseDataJson:
|
|
|
34
34
|
}
|
|
35
35
|
return case_data
|
|
36
36
|
|
|
37
|
-
def
|
|
37
|
+
def generic_search_case_data_json(self, case_type_prefix: CaseTypePrefix, person_full_name: str, person_id: str, person_ssn: str, include_name: bool = True, returned_cases_number: str = "1", field_properties: dict = None) -> str:
|
|
38
38
|
"""
|
|
39
39
|
Creates a JSON string representing a search string for case folder with the provided attributes.
|
|
40
|
+
It is possible to provide a field_properties list, which can contain additional properties for the search.
|
|
41
|
+
|
|
42
|
+
Parameters:
|
|
43
|
+
case_type_prefix (CaseTypePrefix): The prefix indicating the type of the case. Must be one of the predefined literal values.
|
|
44
|
+
person_full_name (str): The full name of the person associated with the case.
|
|
45
|
+
person_id (str): The ID of the person associated with the case.
|
|
46
|
+
person_ssn (str): The Social Security Number of the person associated with the case.
|
|
47
|
+
include_name (str): Whether or not, the person_full_name should be included in the contact_data for the search
|
|
48
|
+
returned_cases_number (str): The number of returned results
|
|
49
|
+
field_properties: A list of desired field properties to add, in order to specify the search
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
dict: A dictionary representing the search criteria for the case folder in JSON format.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
search_case_folder_data = {
|
|
56
|
+
"FieldProperties": [],
|
|
57
|
+
"CaseTypePrefixes": [
|
|
58
|
+
f"{case_type_prefix}"
|
|
59
|
+
],
|
|
60
|
+
"LogicalOperator": "AND",
|
|
61
|
+
"ExcludeDeletedCases": "True",
|
|
62
|
+
"ReturnCasesNumber": returned_cases_number
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if include_name:
|
|
66
|
+
search_case_folder_data["FieldProperties"].append(
|
|
67
|
+
{
|
|
68
|
+
"InternalName": "ows_CCMContactData",
|
|
69
|
+
"Value": f"{person_full_name};#{person_id};#{person_ssn};#;#",
|
|
70
|
+
"DataType": "Text",
|
|
71
|
+
"ComparisonType": "Equal",
|
|
72
|
+
"IsMultiValue": "False"
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
else:
|
|
77
|
+
search_case_folder_data["FieldProperties"].append(
|
|
78
|
+
{
|
|
79
|
+
"InternalName": "ows_CCMContactData",
|
|
80
|
+
"Value": f";#{person_id};#{person_ssn};#;#",
|
|
81
|
+
"DataType": "Text",
|
|
82
|
+
"ComparisonType": "Equal",
|
|
83
|
+
"IsMultiValue": "False"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Could be CaseTitle, CaseCategory, CaseProfile etc.
|
|
88
|
+
if len(field_properties) != 0:
|
|
89
|
+
for field_property_key, field_property_value in field_properties.items():
|
|
90
|
+
search_case_folder_data["FieldProperties"].append(
|
|
91
|
+
{
|
|
92
|
+
"InternalName": str(field_property_key),
|
|
93
|
+
"Value": field_property_value,
|
|
94
|
+
"DataType": "Text",
|
|
95
|
+
"ComparisonType": "Equal",
|
|
96
|
+
"IsMultiValue": "False"
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
return search_case_folder_data
|
|
101
|
+
|
|
102
|
+
def search_citizen_folder_data_json(self, case_type_prefix: CaseTypePrefix, person_full_name: str, person_id: str, person_ssn: str) -> str:
|
|
103
|
+
"""
|
|
104
|
+
Creates a JSON string, representing a search string, used to retrieve a GetOrganized citizen folder, leveraging provided citizen data
|
|
40
105
|
|
|
41
106
|
Parameters:
|
|
42
107
|
case_type_prefix (CaseTypePrefix): The prefix indicating the type of the case. Must be one of the predefined literal values.
|
|
@@ -72,23 +137,6 @@ class CaseDataJson:
|
|
|
72
137
|
"ReturnCasesNumber": "1"
|
|
73
138
|
}
|
|
74
139
|
|
|
75
|
-
if case_title is not None:
|
|
76
|
-
# Change the value of the existing case category to "Standard"
|
|
77
|
-
for field in search_case_folder_data["FieldProperties"]:
|
|
78
|
-
if field["InternalName"] == "ows_CaseCategory":
|
|
79
|
-
field["Value"] = "Standard"
|
|
80
|
-
|
|
81
|
-
break
|
|
82
|
-
|
|
83
|
-
# Optionally add the case title property
|
|
84
|
-
search_case_folder_data["FieldProperties"].append({
|
|
85
|
-
"InternalName": "ows_CaseTitle",
|
|
86
|
-
"Value": case_title,
|
|
87
|
-
"DataType": "Text",
|
|
88
|
-
"ComparisonType": "Equal",
|
|
89
|
-
"IsMultiValue": "False"
|
|
90
|
-
})
|
|
91
|
-
|
|
92
140
|
return search_case_folder_data
|
|
93
141
|
|
|
94
142
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|