amsdal_crm 0.1.4__py3-none-any.whl → 0.1.5__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.
amsdal_crm/__about__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.1.
|
|
1
|
+
__version__ = '0.1.5'
|
|
@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
|
|
|
25
25
|
"owner_email": {"type": "string", "title": "Owner Email"},
|
|
26
26
|
"custom_fields": {"type": "anything", "title": "Custom Fields"},
|
|
27
27
|
},
|
|
28
|
-
"custom_code": 'from amsdal.contrib.auth.models.user import User\n\n\n@property\ndef display_name(self) -> str:\n """Return display name for the account."""\n return self.name\n\nasync def apost_update(self) -> None:\n """Async hook called after updating account."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.
|
|
28
|
+
"custom_code": 'from amsdal.contrib.auth.models.user import User\n\n\n@property\ndef display_name(self) -> str:\n """Return display name for the account."""\n return self.name\n\nasync def apost_update(self) -> None:\n """Async hook called after updating account."""\n from amsdal_crm.services.workflow_service import WorkflowService\n await WorkflowService.aexecute_rules(\'Account\', \'update\', self)\n\nasync def apre_create(self) -> None:\n """Async hook called before creating account."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = await CustomFieldService.avalidate_custom_fields(\'Account\', self.custom_fields)\n await super().apre_create()\n\nasync def apre_update(self) -> None:\n """Async hook called before updating account."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = await CustomFieldService.avalidate_custom_fields(\'Account\', self.custom_fields)\n await super().apre_update()\n\ndef has_object_permission(self, user: \'User\', action: str) -> bool:\n """Check if user has permission to perform action on this account.\n\n Args:\n user: The user attempting the action\n action: The action being attempted (read, create, update, delete)\n\n Returns:\n True if user has permission, False otherwise\n """\n if self.owner_email == user.email:\n return True\n if user.permissions:\n for permission in user.permissions:\n if permission.model == \'*\' and permission.action in (\'*\', action):\n return True\n if permission.model == \'Account\' and permission.action in (\'*\', action):\n return True\n return False\n\ndef post_update(self) -> None:\n """Hook called after updating account."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.execute_rules(\'Account\', \'update\', self)\n\ndef pre_create(self) -> None:\n """Hook called before creating account."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.validate_custom_fields(\'Account\', self.custom_fields)\n super().pre_create()\n\ndef pre_update(self) -> None:\n """Hook called before updating account."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.validate_custom_fields(\'Account\', self.custom_fields)\n super().pre_update()',
|
|
29
29
|
"storage_metadata": {
|
|
30
30
|
"table_name": "Account",
|
|
31
31
|
"db_fields": {},
|
|
@@ -136,7 +136,7 @@ class Migration(migrations.Migration):
|
|
|
136
136
|
"owner_email": {"type": "string", "title": "Owner Email"},
|
|
137
137
|
"custom_fields": {"type": "anything", "title": "Custom Fields"},
|
|
138
138
|
},
|
|
139
|
-
"custom_code": 'from amsdal.contrib.auth.models.user import User\n\n\n@property\ndef display_name(self) -> str:\n """Return display name for the contact."""\n return f\'{self.first_name} {self.last_name}\'\n\n@property\ndef full_name(self) -> str:\n """Return full name of the contact."""\n return f\'{self.first_name} {self.last_name}\'\n\nasync def apost_update(self) -> None:\n """Async hook called after updating contact."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.
|
|
139
|
+
"custom_code": 'from amsdal.contrib.auth.models.user import User\n\n\n@property\ndef display_name(self) -> str:\n """Return display name for the contact."""\n return f\'{self.first_name} {self.last_name}\'\n\n@property\ndef full_name(self) -> str:\n """Return full name of the contact."""\n return f\'{self.first_name} {self.last_name}\'\n\nasync def apost_update(self) -> None:\n """Async hook called after updating contact."""\n from amsdal_crm.services.workflow_service import WorkflowService\n await WorkflowService.aexecute_rules(\'Contact\', \'update\', self)\n\nasync def apre_create(self) -> None:\n """Async hook called before creating contact."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = await CustomFieldService.avalidate_custom_fields(\'Contact\', self.custom_fields)\n await super().apre_create()\n\nasync def apre_update(self) -> None:\n """Async hook called before updating contact."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = await CustomFieldService.avalidate_custom_fields(\'Contact\', self.custom_fields)\n await super().apre_update()\n\ndef has_object_permission(self, user: \'User\', action: str) -> bool:\n """Check if user has permission to perform action on this contact.\n\n Args:\n user: The user attempting the action\n action: The action being attempted (read, create, update, delete)\n\n Returns:\n True if user has permission, False otherwise\n """\n if self.owner_email == user.email:\n return True\n if user.permissions:\n for permission in user.permissions:\n if permission.model == \'*\' and permission.action in (\'*\', action):\n return True\n if permission.model == \'Contact\' and permission.action in (\'*\', action):\n return True\n return False\n\ndef post_update(self) -> None:\n """Hook called after updating contact."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.execute_rules(\'Contact\', \'update\', self)\n\ndef pre_create(self) -> None:\n """Hook called before creating contact."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.validate_custom_fields(\'Contact\', self.custom_fields)\n super().pre_create()\n\ndef pre_update(self) -> None:\n """Hook called before updating contact."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.validate_custom_fields(\'Contact\', self.custom_fields)\n super().pre_update()',
|
|
140
140
|
"storage_metadata": {
|
|
141
141
|
"table_name": "Contact",
|
|
142
142
|
"db_fields": {"account": ["account_partition_key"]},
|
|
@@ -470,7 +470,7 @@ class Migration(migrations.Migration):
|
|
|
470
470
|
"is_won": {"type": "boolean", "default": False, "title": "Is Won"},
|
|
471
471
|
"custom_fields": {"type": "anything", "title": "Custom Fields"},
|
|
472
472
|
},
|
|
473
|
-
"custom_code": 'import datetime as _dt\n\nfrom amsdal.contrib.auth.models.user import User\nfrom amsdal_utils.models.data_models.reference import Reference\n\n\n@property\ndef display_name(self) -> str:\n """Return display name for the deal."""\n return self.name\n\n@property\ndef stage_name(self) -> str:\n """Returns stage name for display."""\n if hasattr(self.stage, \'name\'):\n return self.stage.name\n return str(self.stage)\n\nasync def apost_update(self) -> None:\n """Async hook called after updating deal."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.execute_rules(\'Deal\', \'update\', self)\n\nasync def apre_create(self) -> None:\n """Async hook called before creating deal."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.
|
|
473
|
+
"custom_code": 'import datetime as _dt\n\nfrom amsdal.contrib.auth.models.user import User\nfrom amsdal_utils.models.data_models.reference import Reference\n\n\n@property\ndef display_name(self) -> str:\n """Return display name for the deal."""\n return self.name\n\n@property\ndef stage_name(self) -> str:\n """Returns stage name for display."""\n if hasattr(self.stage, \'name\'):\n return self.stage.name\n return str(self.stage)\n\nasync def apost_update(self) -> None:\n """Async hook called after updating deal."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.execute_rules(\'Deal\', \'update\', self)\n\nasync def apre_create(self) -> None:\n """Async hook called before creating deal."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = await CustomFieldService.avalidate_custom_fields(\'Deal\', self.custom_fields)\n await super().apre_create()\n\nasync def apre_update(self) -> None:\n """Async hook called before updating deal.\n\n Automatically syncs is_closed and is_won status with stage,\n and sets closed_date when deal is closed.\n """\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = await CustomFieldService.avalidate_custom_fields(\'Deal\', self.custom_fields)\n from amsdal_models.classes.helpers.reference_loader import ReferenceLoader\n stage = await ReferenceLoader(self.stage).aload_reference() if isinstance(self.stage, Reference) else self.stage\n self.is_closed = stage.is_closed_won or stage.is_closed_lost\n self.is_won = stage.is_closed_won\n if self.is_closed and (not self.closed_date):\n self.closed_date = _dt.datetime.now(_dt.UTC)\n await super().apre_update()\n\ndef has_object_permission(self, user: \'User\', action: str) -> bool:\n """Check if user has permission to perform action on this deal.\n\n Args:\n user: The user attempting the action\n action: The action being attempted (read, create, update, delete)\n\n Returns:\n True if user has permission, False otherwise\n """\n if self.owner_email == user.email:\n return True\n if user.permissions:\n for permission in user.permissions:\n if permission.model == \'*\' and permission.action in (\'*\', action):\n return True\n if permission.model == \'Deal\' and permission.action in (\'*\', action):\n return True\n return False\n\ndef post_update(self) -> None:\n """Hook called after updating deal."""\n from amsdal_crm.services.workflow_service import WorkflowService\n WorkflowService.execute_rules(\'Deal\', \'update\', self)\n\ndef pre_create(self) -> None:\n """Hook called before creating deal."""\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.validate_custom_fields(\'Deal\', self.custom_fields)\n super().pre_create()\n\ndef pre_update(self) -> None:\n """Hook called before updating deal.\n\n Automatically syncs is_closed and is_won status with stage,\n and sets closed_date when deal is closed.\n """\n if self.custom_fields:\n from amsdal_crm.services.custom_field_service import CustomFieldService\n self.custom_fields = CustomFieldService.validate_custom_fields(\'Deal\', self.custom_fields)\n from amsdal_models.classes.helpers.reference_loader import ReferenceLoader\n stage = ReferenceLoader(self.stage).load_reference() if isinstance(self.stage, Reference) else self.stage\n self.is_closed = stage.is_closed_won or stage.is_closed_lost\n self.is_won = stage.is_closed_won\n if self.is_closed and (not self.closed_date):\n self.closed_date = _dt.datetime.now(_dt.UTC)\n super().pre_update()',
|
|
474
474
|
"storage_metadata": {
|
|
475
475
|
"table_name": "Deal",
|
|
476
476
|
"db_fields": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
amsdal_crm/Third-Party Materials - AMSDAL Dependencies - License Notices.md,sha256=ML7PqsHrTMNNZn8E_rA-LzDCAafMSxMcrmSg8YOi-wo,113896
|
|
2
|
-
amsdal_crm/__about__.py,sha256=
|
|
2
|
+
amsdal_crm/__about__.py,sha256=DQiXHqQ3C29f_--ye7aVMDPnITrl9M0zMU42LYY48zE,22
|
|
3
3
|
amsdal_crm/__init__.py,sha256=b4wxJYesA5Ctk1IrAvlw64i_0EU3SiK1Tw6sUYakd18,303
|
|
4
4
|
amsdal_crm/app.py,sha256=JLvueh_2KURQLDWMQlq4Z6gAFsqBDTRf6pK095ehp14,1373
|
|
5
5
|
amsdal_crm/constants.py,sha256=5Ga7q9zEKcQZnAoKv_SE_7w8WxvhPFkM9gY9NruOEaA,347
|
|
@@ -10,7 +10,7 @@ amsdal_crm/fixtures/permissions.py,sha256=cYA-gWkKQdoN79GymQVHtT0GyFXMzaskwp13Ie
|
|
|
10
10
|
amsdal_crm/fixtures/pipelines.py,sha256=ZCLmgrA700Sl7Oy7l4IQ8FbIbC1378OkcJTrZe5701o,2064
|
|
11
11
|
amsdal_crm/lifecycle/__init__.py,sha256=B8nw19lEIr7U15Lnu6jh7yzZwF9LWWh4-p3X63sAicQ,31
|
|
12
12
|
amsdal_crm/lifecycle/consumer.py,sha256=YKBkQjaqW7Vz8s3oJrIG9_7i65IVkz-qvDJrZsiEIBQ,8585
|
|
13
|
-
amsdal_crm/migrations/0000_initial.py,sha256=
|
|
13
|
+
amsdal_crm/migrations/0000_initial.py,sha256=12-oowQi6e1yRKe9VMMnpD3gyIMKhOvkzFsO7ZeumFA,57084
|
|
14
14
|
amsdal_crm/models/__init__.py,sha256=DSuGeLKPNL_EUGohWtrH6Eof6Nk--dHyZpfqbGWmYIY,1350
|
|
15
15
|
amsdal_crm/models/account.py,sha256=prb8Tl0nYyObTeql1fLX1cVRszauzPRSN7xv-H26hRg,4918
|
|
16
16
|
amsdal_crm/models/activity.py,sha256=UtO1--oSPfrQCfQwWfIlEkjdXuaRG9znesPrGe1JqGM,4775
|
|
@@ -27,6 +27,6 @@ amsdal_crm/services/custom_field_service.py,sha256=rqTlzcmjc-tqc3nuo2m0cMFdMgo1l
|
|
|
27
27
|
amsdal_crm/services/deal_service.py,sha256=ZF7cAc6r10xgXZ8D8Oy3hnE-6GgAXq8fuG_Y4QerRGw,4839
|
|
28
28
|
amsdal_crm/services/email_service.py,sha256=kung83otZAzm5MjezbWFP_Bp9CJ2NXLlDdjMX9MvNIc,3788
|
|
29
29
|
amsdal_crm/services/workflow_service.py,sha256=oKOFJrwnMZxAiHuScs63tZxL801z-6ryrUuPMC7OXlE,7036
|
|
30
|
-
amsdal_crm-0.1.
|
|
31
|
-
amsdal_crm-0.1.
|
|
32
|
-
amsdal_crm-0.1.
|
|
30
|
+
amsdal_crm-0.1.5.dist-info/METADATA,sha256=HXSFbUjQHL78XlgXIutZ6KX2udYirSvew_LutGsuivk,1596
|
|
31
|
+
amsdal_crm-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
32
|
+
amsdal_crm-0.1.5.dist-info/RECORD,,
|
|
File without changes
|