amsdal_crm 0.1.3__tar.gz → 0.1.4__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.
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/PKG-INFO +1 -1
- amsdal_crm-0.1.4/amsdal_crm/__about__.py +1 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/lifecycle/consumer.py +38 -3
- amsdal_crm-0.1.3/amsdal_crm/__about__.py +0 -1
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/.amsdal/.environment +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/.amsdal-cli +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/.github/workflows/ci.yml +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/.github/workflows/release.yml +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/.github/workflows/tag_check.yml +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/.gitignore +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/CLAUDE.md +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/README.md +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/RELEASE.md +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/Third-Party Materials - AMSDAL Dependencies - License Notices.md +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/app.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/constants.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/errors.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/fixtures/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/fixtures/permissions.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/fixtures/pipelines.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/lifecycle/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/migrations/0000_initial.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/account.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/activity.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/attachment.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/contact.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/custom_field_definition.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/deal.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/pipeline.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/stage.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/models/workflow_rule.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/services/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/services/activity_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/services/custom_field_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/services/deal_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/services/email_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/services/workflow_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/amsdal_crm/settings.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/config.yml +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/license_check.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/pyproject.toml +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/scripts/release.sh +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/scripts/tag_check.sh +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/conftest.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/integration/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/integration/conftest.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/integration/services/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/integration/services/test_deal_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/integration/services/test_email_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/integration/services/test_workflow_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/conftest.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/lifecycle/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/lifecycle/test_consumer.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_account.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_activity.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_contact.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_deal.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_pipeline.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_remaining.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/models/test_stage.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/services/__init__.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/services/test_activity_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/services/test_custom_field_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/services/test_deal_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/services/test_email_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/services/test_workflow_service.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/test_app.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/test_constants.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/test_errors.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/tests/unit/test_settings.py +0 -0
- {amsdal_crm-0.1.3 → amsdal_crm-0.1.4}/uv.lock +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.1.4'
|
|
@@ -50,7 +50,7 @@ class DealWonNotificationConsumer(LifecycleConsumer):
|
|
|
50
50
|
pass
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
def _custom_field_def_to_control(field_def: Any) -> dict[str, Any]:
|
|
53
|
+
def _custom_field_def_to_control(field_def: Any, values: dict[str, Any]) -> dict[str, Any]:
|
|
54
54
|
"""Convert a CustomFieldDefinition to a frontend control config.
|
|
55
55
|
|
|
56
56
|
Args:
|
|
@@ -82,6 +82,9 @@ def _custom_field_def_to_control(field_def: Any) -> dict[str, Any]:
|
|
|
82
82
|
if field_def.choices:
|
|
83
83
|
control['options'] = [{'label': choice, 'value': choice} for choice in field_def.choices]
|
|
84
84
|
|
|
85
|
+
if values and field_def.field_name in values:
|
|
86
|
+
control['value'] = values[field_def.field_name]
|
|
87
|
+
|
|
85
88
|
return control
|
|
86
89
|
|
|
87
90
|
|
|
@@ -123,6 +126,30 @@ def _add_custom_fields_to_control(control: dict[str, Any], custom_field_controls
|
|
|
123
126
|
)
|
|
124
127
|
|
|
125
128
|
|
|
129
|
+
def get_values_from_response(response: dict[str, Any] | list[dict[str, Any]]) -> dict[str, Any]:
|
|
130
|
+
"""
|
|
131
|
+
Extracts values from a response dictionary or list of dictionaries.
|
|
132
|
+
|
|
133
|
+
This function processes a response to extract the relevant values. It checks if the response
|
|
134
|
+
is a dictionary containing a 'rows' key and processes the rows to find the appropriate values.
|
|
135
|
+
If the response is not in the expected format, it returns an empty dictionary.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
response (dict[str, Any] | list[dict[str, Any]]): The response to extract values from.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
dict[str, Any]: A dictionary containing the extracted values.
|
|
142
|
+
"""
|
|
143
|
+
if not isinstance(response, dict) or 'rows' not in response or not response['rows']:
|
|
144
|
+
return {}
|
|
145
|
+
|
|
146
|
+
for row in response['rows']:
|
|
147
|
+
if '_metadata' in row and row['_metadata'].get('next_version') is None:
|
|
148
|
+
return row
|
|
149
|
+
|
|
150
|
+
return response['rows'][0]
|
|
151
|
+
|
|
152
|
+
|
|
126
153
|
class CustomAttributesFrontendConfigConsumer(LifecycleConsumer):
|
|
127
154
|
"""Consumer that propagates custom attributes into frontend config.
|
|
128
155
|
|
|
@@ -151,6 +178,8 @@ class CustomAttributesFrontendConfigConsumer(LifecycleConsumer):
|
|
|
151
178
|
if not isinstance(response, dict) or 'control' not in response:
|
|
152
179
|
return
|
|
153
180
|
|
|
181
|
+
values = get_values_from_response(response)
|
|
182
|
+
|
|
154
183
|
custom_field_defs = list(
|
|
155
184
|
CustomFieldDefinition.objects.filter(
|
|
156
185
|
entity_type=class_name,
|
|
@@ -165,7 +194,9 @@ class CustomAttributesFrontendConfigConsumer(LifecycleConsumer):
|
|
|
165
194
|
# Sort by display_order
|
|
166
195
|
custom_field_defs.sort(key=lambda x: x.display_order)
|
|
167
196
|
|
|
168
|
-
custom_field_controls = [
|
|
197
|
+
custom_field_controls = [
|
|
198
|
+
_custom_field_def_to_control(field_def, values=values) for field_def in custom_field_defs
|
|
199
|
+
]
|
|
169
200
|
|
|
170
201
|
_add_custom_fields_to_control(response['control'], custom_field_controls)
|
|
171
202
|
|
|
@@ -190,6 +221,8 @@ class CustomAttributesFrontendConfigConsumer(LifecycleConsumer):
|
|
|
190
221
|
if not isinstance(response, dict) or 'control' not in response:
|
|
191
222
|
return
|
|
192
223
|
|
|
224
|
+
values = get_values_from_response(response)
|
|
225
|
+
|
|
193
226
|
custom_field_defs = list(
|
|
194
227
|
await CustomFieldDefinition.objects.filter(
|
|
195
228
|
entity_type=class_name,
|
|
@@ -204,7 +237,9 @@ class CustomAttributesFrontendConfigConsumer(LifecycleConsumer):
|
|
|
204
237
|
# Sort by display_order
|
|
205
238
|
custom_field_defs.sort(key=lambda x: x.display_order)
|
|
206
239
|
|
|
207
|
-
custom_field_controls = [
|
|
240
|
+
custom_field_controls = [
|
|
241
|
+
_custom_field_def_to_control(field_def, values=values) for field_def in custom_field_defs
|
|
242
|
+
]
|
|
208
243
|
|
|
209
244
|
_add_custom_fields_to_control(response['control'], custom_field_controls)
|
|
210
245
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.1.3'
|
|
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
|
|
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
|