amsdal_crm 0.2.0__py3-none-any.whl → 0.2.2__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.2.0'
1
+ __version__ = '0.2.2'
@@ -92,6 +92,32 @@ class Migration(migrations.Migration):
92
92
  "description": "Entity (Person/Organization/Trust) model.\n\nRepresents a company or organization in the CRM system.\nOwned by individual users with permission controls.",
93
93
  },
94
94
  ),
95
+ migrations.CreateClass(
96
+ module_type=ModuleType.CONTRIB,
97
+ class_name="EntityAddress",
98
+ new_schema={
99
+ "title": "EntityAddress",
100
+ "properties": {
101
+ "created_at": {"type": "datetime", "title": "Created At", "format": "date-time"},
102
+ "updated_at": {"type": "datetime", "title": "Updated At", "format": "date-time"},
103
+ "line1": {"type": "string", "title": "Address Line 1"},
104
+ "line2": {"type": "string", "title": "Address Line 2"},
105
+ "city": {"type": "string", "title": "City"},
106
+ "region": {"type": "string", "title": "Region/State"},
107
+ "postal_code": {"type": "string", "title": "Postal Code"},
108
+ "country": {"type": "string", "title": "Country"},
109
+ "is_primary": {"type": "boolean", "default": False, "title": "Is Primary"},
110
+ "custom_fields": {"type": "anything", "title": "Custom Fields"},
111
+ },
112
+ "custom_code": 'async 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(\'EntityAddress\', 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(\'EntityAddress\', self.custom_fields)\n await super().apre_update()\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(\'EntityAddress\', 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(\'EntityAddress\', self.custom_fields)\n super().pre_update()',
113
+ "storage_metadata": {
114
+ "table_name": "EntityAddress",
115
+ "db_fields": {},
116
+ "primary_key": ["partition_key"],
117
+ "foreign_keys": {},
118
+ },
119
+ },
120
+ ),
95
121
  migrations.CreateClass(
96
122
  module_type=ModuleType.CONTRIB,
97
123
  class_name="Pipeline",
@@ -338,6 +364,101 @@ class Migration(migrations.Migration):
338
364
  "description": "Task activity with priority and status.",
339
365
  },
340
366
  ),
367
+ migrations.CreateClass(
368
+ module_type=ModuleType.CONTRIB,
369
+ class_name="EntityContactPoint",
370
+ new_schema={
371
+ "title": "EntityContactPoint",
372
+ "required": ["value", "entity"],
373
+ "properties": {
374
+ "created_at": {"type": "datetime", "title": "Created At", "format": "date-time"},
375
+ "updated_at": {"type": "datetime", "title": "Updated At", "format": "date-time"},
376
+ "value": {"type": "string", "title": "Contact Point Value"},
377
+ "is_primary": {"type": "boolean", "default": False, "title": "Is Primary"},
378
+ "can_contact": {"type": "boolean", "default": True, "title": "Can Contact"},
379
+ "custom_fields": {"type": "anything", "title": "Custom Fields"},
380
+ "entity": {
381
+ "type": "Entity",
382
+ "title": "Entity",
383
+ "description": "Entity (Person/Organization/Trust) model.\n\nRepresents a company or organization in the CRM system.\nOwned by individual users with permission controls.",
384
+ },
385
+ },
386
+ "custom_code": 'async 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(\'EntityContactPoint\', 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(\'EntityContactPoint\', self.custom_fields)\n await super().apre_update()\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(\'EntityContactPoint\', 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(\'EntityContactPoint\', self.custom_fields)\n super().pre_update()',
387
+ "storage_metadata": {
388
+ "table_name": "EntityContactPoint",
389
+ "db_fields": {"entity": ["entity_partition_key"]},
390
+ "primary_key": ["partition_key"],
391
+ "foreign_keys": {"entity": [{"entity_partition_key": "string"}, "Entity", ["partition_key"]]},
392
+ },
393
+ },
394
+ ),
395
+ migrations.CreateClass(
396
+ module_type=ModuleType.CONTRIB,
397
+ class_name="EntityIdentifier",
398
+ new_schema={
399
+ "title": "EntityIdentifier",
400
+ "required": ["value", "entity"],
401
+ "properties": {
402
+ "created_at": {"type": "datetime", "title": "Created At", "format": "date-time"},
403
+ "updated_at": {"type": "datetime", "title": "Updated At", "format": "date-time"},
404
+ "value": {"type": "string", "title": "Identifier Value"},
405
+ "country": {"type": "string", "title": "Country"},
406
+ "is_primary": {"type": "boolean", "default": False, "title": "Is Primary"},
407
+ "custom_fields": {"type": "anything", "title": "Custom Fields"},
408
+ "entity": {
409
+ "type": "Entity",
410
+ "title": "Entity",
411
+ "description": "Entity (Person/Organization/Trust) model.\n\nRepresents a company or organization in the CRM system.\nOwned by individual users with permission controls.",
412
+ },
413
+ },
414
+ "custom_code": 'async 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(\'EntityIdentifier\', 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(\'EntityIdentifier\', self.custom_fields)\n await super().apre_update()\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(\'EntityIdentifier\', 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(\'EntityIdentifier\', self.custom_fields)\n super().pre_update()',
415
+ "storage_metadata": {
416
+ "table_name": "EntityIdentifier",
417
+ "db_fields": {"entity": ["entity_partition_key"]},
418
+ "primary_key": ["partition_key"],
419
+ "foreign_keys": {"entity": [{"entity_partition_key": "string"}, "Entity", ["partition_key"]]},
420
+ },
421
+ },
422
+ ),
423
+ migrations.CreateClass(
424
+ module_type=ModuleType.CONTRIB,
425
+ class_name="EntityRelationship",
426
+ new_schema={
427
+ "title": "EntityRelationship",
428
+ "required": ["from_entity", "to_entity"],
429
+ "properties": {
430
+ "created_at": {"type": "datetime", "title": "Created At", "format": "date-time"},
431
+ "updated_at": {"type": "datetime", "title": "Updated At", "format": "date-time"},
432
+ "start_date": {"type": "string", "title": "Start Date"},
433
+ "end_date": {"type": "string", "title": "End Date"},
434
+ "relationship_group_name": {"type": "string", "title": "Relationship Group Name"},
435
+ "custom_fields": {"type": "anything", "title": "Custom Fields"},
436
+ "from_entity": {
437
+ "type": "Entity",
438
+ "title": "From Entity",
439
+ "description": "Entity (Person/Organization/Trust) model.\n\nRepresents a company or organization in the CRM system.\nOwned by individual users with permission controls.",
440
+ },
441
+ "to_entity": {
442
+ "type": "Entity",
443
+ "title": "To Entity",
444
+ "description": "Entity (Person/Organization/Trust) model.\n\nRepresents a company or organization in the CRM system.\nOwned by individual users with permission controls.",
445
+ },
446
+ },
447
+ "custom_code": 'async 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(\'EntityRelationship\', 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(\'EntityRelationship\', self.custom_fields)\n await super().apre_update()\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(\'EntityRelationship\', 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(\'EntityRelationship\', self.custom_fields)\n super().pre_update()',
448
+ "storage_metadata": {
449
+ "table_name": "EntityRelationship",
450
+ "db_fields": {
451
+ "from_entity": ["from_entity_partition_key"],
452
+ "to_entity": ["to_entity_partition_key"],
453
+ },
454
+ "primary_key": ["partition_key"],
455
+ "foreign_keys": {
456
+ "from_entity": [{"from_entity_partition_key": "string"}, "Entity", ["partition_key"]],
457
+ "to_entity": [{"to_entity_partition_key": "string"}, "Entity", ["partition_key"]],
458
+ },
459
+ },
460
+ },
461
+ ),
341
462
  migrations.CreateClass(
342
463
  module_type=ModuleType.CONTRIB,
343
464
  class_name="Stage",
@@ -117,12 +117,17 @@ class Entity(TimestampMixin, Model):
117
117
 
118
118
 
119
119
  class EntityRelationship(TimestampMixin, Model):
120
+ __module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
121
+
120
122
  from_entity: Entity = Field(title='From Entity')
121
123
  to_entity: Entity = Field(title='To Entity')
122
124
  start_date: str | None = Field(default=None, title='Start Date')
123
125
  end_date: str | None = Field(default=None, title='End Date')
124
126
  relationship_group_name: str | None = Field(default=None, title='Relationship Group Name')
125
127
 
128
+ # Custom fields (JSON)
129
+ custom_fields: dict[str, Any] | None = Field(default=None, title='Custom Fields')
130
+
126
131
  def pre_create(self) -> None:
127
132
  """Hook called before creating account."""
128
133
  if self.custom_fields:
@@ -167,6 +172,8 @@ class EntityRelationship(TimestampMixin, Model):
167
172
 
168
173
 
169
174
  class EntityIdentifier(TimestampMixin, Model):
175
+ __module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
176
+
170
177
  entity: Entity = Field(title='Entity')
171
178
  value: str = Field(title='Identifier Value')
172
179
  country: str | None = Field(default=None, title='Country')
@@ -174,6 +181,9 @@ class EntityIdentifier(TimestampMixin, Model):
174
181
  # TODO: validate one per entity
175
182
  is_primary: bool = Field(default=False, title='Is Primary')
176
183
 
184
+ # Custom fields (JSON)
185
+ custom_fields: dict[str, Any] | None = Field(default=None, title='Custom Fields')
186
+
177
187
  def pre_create(self) -> None:
178
188
  """Hook called before creating account."""
179
189
  if self.custom_fields:
@@ -218,6 +228,8 @@ class EntityIdentifier(TimestampMixin, Model):
218
228
 
219
229
 
220
230
  class EntityContactPoint(TimestampMixin, Model):
231
+ __module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
232
+
221
233
  entity: Entity = Field(title='Entity')
222
234
  value: str = Field(title='Contact Point Value')
223
235
 
@@ -225,6 +237,9 @@ class EntityContactPoint(TimestampMixin, Model):
225
237
  is_primary: bool = Field(default=False, title='Is Primary')
226
238
  can_contact: bool = Field(default=True, title='Can Contact')
227
239
 
240
+ # Custom fields (JSON)
241
+ custom_fields: dict[str, Any] | None = Field(default=None, title='Custom Fields')
242
+
228
243
  def pre_create(self) -> None:
229
244
  """Hook called before creating account."""
230
245
  if self.custom_fields:
@@ -269,6 +284,8 @@ class EntityContactPoint(TimestampMixin, Model):
269
284
 
270
285
 
271
286
  class EntityAddress(TimestampMixin, Model):
287
+ __module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
288
+
272
289
  line1: str | None = Field(title='Address Line 1')
273
290
  line2: str | None = Field(default=None, title='Address Line 2')
274
291
  city: str | None = Field(title='City')
@@ -279,6 +296,9 @@ class EntityAddress(TimestampMixin, Model):
279
296
  # TODO: validate one per entity
280
297
  is_primary: bool = Field(default=False, title='Is Primary')
281
298
 
299
+ # Custom fields (JSON)
300
+ custom_fields: dict[str, Any] | None = Field(default=None, title='Custom Fields')
301
+
282
302
  def pre_create(self) -> None:
283
303
  """Hook called before creating account."""
284
304
  if self.custom_fields:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amsdal_crm
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: amsdal-crm plugin for AMSDAL Framework
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: aiohttp==3.12.15
@@ -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=FVHPBGkfhbQDi_z3v0PiKJrXXqXOx0vGW_1VaqNJi7U,22
2
+ amsdal_crm/__about__.py,sha256=QQ0yjZQnvXM7JeLLZEZWX6NmVUPu1lSROWOXF49_gug,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,13 +10,13 @@ amsdal_crm/fixtures/permissions.py,sha256=TQEY_zX60GSudSZqmonaYqWCaod6oBsQw1NQPu
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=owS9kXKPs3Lzy7RiN_jI6hHEO6c90Tf-DT6aNqQ3uj4,8893
13
- amsdal_crm/migrations/0000_initial.py,sha256=4V7_TeFUwvTRyLMm9QFHyuab-kiMuOlQZCA3hkO_YLg,51543
13
+ amsdal_crm/migrations/0000_initial.py,sha256=uo0C4qXYVFkkM5iMAXTmsJCjducalpx9Y9Fyuuz9T1c,63814
14
14
  amsdal_crm/models/__init__.py,sha256=3c-gqBkw2PXg4rp_wH2EN6viRu7Ff926Etn_BkQa5RU,18
15
15
  amsdal_crm/models/activity.py,sha256=Hwy_Z_zhk96yopTcm4vU4-SZbPg152r7N9er96Jkdho,4732
16
16
  amsdal_crm/models/attachment.py,sha256=B-6IuPrF6-VDnsFz_Q4UCh09YcFMs4o4zyT4VpvLe3U,1513
17
17
  amsdal_crm/models/custom_field_definition.py,sha256=0IIWcetZ0vXT8lPRGahyt7phoNKuCq2MQO6C8wEGk4Q,1749
18
18
  amsdal_crm/models/deal.py,sha256=xmJOCE_fvY6asnOp2_eeWLW3clSiS-MoV9Bm-1gtEF0,6583
19
- amsdal_crm/models/entity.py,sha256=YH7qhoAndTYzo-x7faZkqgYpoHmXzUk0seORRngK3ww,12568
19
+ amsdal_crm/models/entity.py,sha256=r5_t8SSf4fneukhtFS59iLJt_yC1DIv0gyQW29Qhons,13280
20
20
  amsdal_crm/models/pipeline.py,sha256=DXJh5MbCCRctEHhDfxef5RxFWSKN0D4v6UK75q5ssL8,925
21
21
  amsdal_crm/models/stage.py,sha256=57rhfA4Oib8DKjDifWQe3EFxh-Auww3_PgOPfj4-L0E,1666
22
22
  amsdal_crm/models/workflow_rule.py,sha256=g-vAdJHKyA1PsiB3vPhd474Uvq94USHz35W1c5XyrAQ,1535
@@ -26,6 +26,6 @@ amsdal_crm/services/custom_field_service.py,sha256=r2dr2gijTbi9r56XV64bSArx0jTGw
26
26
  amsdal_crm/services/deal_service.py,sha256=PTxCQy6YqMyrtL4sRhyCU09V6OemrmZ405sQk-eBUlA,4803
27
27
  amsdal_crm/services/email_service.py,sha256=L9o-WaOET0tjo9g-zzC8GGCtfDZVheziHM_ob10jO2M,3518
28
28
  amsdal_crm/services/workflow_service.py,sha256=7m_vbk9FL_FCy9KS9LM4ueztO9ZsLwbvubdo9NA345g,7020
29
- amsdal_crm-0.2.0.dist-info/METADATA,sha256=tfgcmbT3KQyuqgaSldO2AYeRb8nhFDuISTFtHE0k7kA,1596
30
- amsdal_crm-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
31
- amsdal_crm-0.2.0.dist-info/RECORD,,
29
+ amsdal_crm-0.2.2.dist-info/METADATA,sha256=XAgx-kT5AOq9ECz512STMaPZN0e_Jx1SOvo1AgBT9Js,1596
30
+ amsdal_crm-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
31
+ amsdal_crm-0.2.2.dist-info/RECORD,,