constec 0.6.0__py3-none-any.whl → 0.7.0__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.
@@ -0,0 +1,40 @@
1
+ # Generated manually - Rename User to CompanyUser for clarity and consistency
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('constec_db', '0008_refactor_creator_fields'),
10
+ ]
11
+
12
+ operations = [
13
+ # Rename tables
14
+ migrations.RenameModel(
15
+ old_name='User',
16
+ new_name='CompanyUser',
17
+ ),
18
+ migrations.RenameModel(
19
+ old_name='UserRole',
20
+ new_name='CompanyUserRole',
21
+ ),
22
+ migrations.RenameModel(
23
+ old_name='UserCompanyAccess',
24
+ new_name='CompanyUserAccess',
25
+ ),
26
+
27
+ # Update table names
28
+ migrations.AlterModelTable(
29
+ name='companyuser',
30
+ table='core"."company_users',
31
+ ),
32
+ migrations.AlterModelTable(
33
+ name='companyuserrole',
34
+ table='core"."company_user_roles',
35
+ ),
36
+ migrations.AlterModelTable(
37
+ name='companyuseraccess',
38
+ table='core"."company_user_access',
39
+ ),
40
+ ]
@@ -19,9 +19,14 @@ from .base import UUIDModel
19
19
  # Core models (core schema)
20
20
  from .organization import Organization, OrganizationRole, OrganizationUser
21
21
  from .company import Company
22
- from .user import User, UserRole, UserCompanyAccess
22
+ from .user import CompanyUser, CompanyUserRole, CompanyUserAccess
23
23
  from .person import Person
24
24
  from .group import UserGroup
25
+
26
+ # Backward compatibility aliases
27
+ User = CompanyUser
28
+ UserRole = CompanyUserRole
29
+ UserCompanyAccess = CompanyUserAccess
25
30
  from .contact import ContactType, Contact, PersonContact
26
31
  from .tag import TagCategory, PersonTag, PersonTagged
27
32
  from .module import Module, CompanyModule, OrganizationModule
@@ -54,7 +59,11 @@ __all__ = [
54
59
  'OrganizationUser',
55
60
  # Company
56
61
  'Company',
57
- # User
62
+ # CompanyUser
63
+ 'CompanyUser',
64
+ 'CompanyUserRole',
65
+ 'CompanyUserAccess',
66
+ # Backward compatibility aliases
58
67
  'User',
59
68
  'UserRole',
60
69
  'UserCompanyAccess',
@@ -7,7 +7,7 @@ from django.core.exceptions import ValidationError
7
7
  from .base import UUIDModel
8
8
  from .company import Company
9
9
  from .organization import Organization, OrganizationUser
10
- from .user import User
10
+ from .user import CompanyUser
11
11
 
12
12
 
13
13
  class Automation(UUIDModel):
@@ -56,7 +56,7 @@ class Automation(UUIDModel):
56
56
 
57
57
  # Creator - only ONE of these should be filled (XOR)
58
58
  created_by_user = models.ForeignKey(
59
- User,
59
+ CompanyUser,
60
60
  on_delete=models.CASCADE,
61
61
  null=True,
62
62
  blank=True,
@@ -64,7 +64,7 @@ class Automation(UUIDModel):
64
64
  help_text="User creator (company-level)"
65
65
  )
66
66
  created_by_org_user = models.ForeignKey(
67
- OrganizationUser,
67
+ OrganizationCompanyUser,
68
68
  on_delete=models.CASCADE,
69
69
  null=True,
70
70
  blank=True,
@@ -317,7 +317,7 @@ class ExecutionLog(UUIDModel):
317
317
  related_name='execution_logs'
318
318
  )
319
319
  triggered_by_user = models.ForeignKey(
320
- User,
320
+ CompanyUser,
321
321
  on_delete=models.SET_NULL,
322
322
  null=True,
323
323
  blank=True,
@@ -325,7 +325,7 @@ class ExecutionLog(UUIDModel):
325
325
  help_text="User who triggered execution (company-level)"
326
326
  )
327
327
  triggered_by_org_user = models.ForeignKey(
328
- OrganizationUser,
328
+ OrganizationCompanyUser,
329
329
  on_delete=models.SET_NULL,
330
330
  null=True,
331
331
  blank=True,
@@ -418,7 +418,7 @@ class NotificationTemplate(UUIDModel):
418
418
 
419
419
  # Creator - only ONE of these should be filled (XOR)
420
420
  created_by_user = models.ForeignKey(
421
- User,
421
+ CompanyUser,
422
422
  on_delete=models.CASCADE,
423
423
  null=True,
424
424
  blank=True,
@@ -426,7 +426,7 @@ class NotificationTemplate(UUIDModel):
426
426
  help_text="User creator (company-level)"
427
427
  )
428
428
  created_by_org_user = models.ForeignKey(
429
- OrganizationUser,
429
+ OrganizationCompanyUser,
430
430
  on_delete=models.CASCADE,
431
431
  null=True,
432
432
  blank=True,
@@ -1,7 +1,7 @@
1
1
  from django.db import models
2
2
  from .base import UUIDModel
3
3
  from .company import Company
4
- from .user import User
4
+ from .user import CompanyUser
5
5
 
6
6
 
7
7
  class UserGroup(UUIDModel):
@@ -23,7 +23,7 @@ class UserGroup(UUIDModel):
23
23
  blank=True
24
24
  )
25
25
  users = models.ManyToManyField(
26
- User,
26
+ CompanyUser,
27
27
  related_name="groups"
28
28
  )
29
29
 
constec/db/models/user.py CHANGED
@@ -3,7 +3,7 @@ from .base import UUIDModel
3
3
  from .company import Company
4
4
 
5
5
 
6
- class User(UUIDModel):
6
+ class CompanyUser(UUIDModel):
7
7
  """User belonging to a company."""
8
8
  company = models.ForeignKey(
9
9
  Company,
@@ -16,13 +16,13 @@ class User(UUIDModel):
16
16
 
17
17
  class Meta:
18
18
  app_label = 'constec_db'
19
- db_table = 'core"."users'
19
+ db_table = 'core"."company_users'
20
20
 
21
21
  def __str__(self):
22
22
  return f"{self.name} ({self.email})"
23
23
 
24
24
 
25
- class UserRole(UUIDModel):
25
+ class CompanyUserRole(UUIDModel):
26
26
  """Role within a company."""
27
27
  company = models.ForeignKey(
28
28
  Company,
@@ -38,17 +38,17 @@ class UserRole(UUIDModel):
38
38
 
39
39
  class Meta:
40
40
  app_label = 'constec_db'
41
- db_table = 'core"."user_roles'
41
+ db_table = 'core"."company_user_roles'
42
42
  unique_together = [['company', 'name']]
43
43
 
44
44
  def __str__(self):
45
45
  return f"{self.name}"
46
46
 
47
47
 
48
- class UserCompanyAccess(UUIDModel):
49
- """Cross-company access: one User can access multiple Companies."""
48
+ class CompanyUserAccess(UUIDModel):
49
+ """Cross-company access: one CompanyUser can access multiple Companies."""
50
50
  user = models.ForeignKey(
51
- User,
51
+ CompanyUser,
52
52
  on_delete=models.CASCADE,
53
53
  related_name="company_accesses",
54
54
  )
@@ -58,16 +58,16 @@ class UserCompanyAccess(UUIDModel):
58
58
  related_name="user_accesses",
59
59
  )
60
60
  role = models.ForeignKey(
61
- UserRole,
61
+ CompanyUserRole,
62
62
  on_delete=models.PROTECT,
63
63
  related_name="user_accesses",
64
64
  )
65
65
 
66
66
  class Meta:
67
67
  app_label = 'constec_db'
68
- db_table = 'core"."user_company_access'
69
- verbose_name = 'User company access'
70
- verbose_name_plural = 'User company access'
68
+ db_table = 'core"."company_user_access'
69
+ verbose_name = 'Company user access'
70
+ verbose_name_plural = 'Company user access'
71
71
  unique_together = [['user', 'company']]
72
72
 
73
73
  def __str__(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: constec
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Base library for the Constec ecosystem - shared utilities, models, and namespace foundation
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/TpmyCT/constec-python
@@ -9,22 +9,23 @@ constec/db/migrations/0005_event.py,sha256=kyvEFOAbOJj3daDzOWcIhfXD8gl5EpIHYvRy3
9
9
  constec/db/migrations/0006_automation_trigger_action_executionlog_notificationtemplate.py,sha256=sfh1YTRPqUiBb5FIxRNJm_BnlYkDonwm7FEEihgtSe0,13628
10
10
  constec/db/migrations/0007_add_organization_to_automations.py,sha256=08yDuetrA4WWwqNriyewr0qCpesLo_9x5YD36CDScj4,3467
11
11
  constec/db/migrations/0008_refactor_creator_fields.py,sha256=O_bcChxFR_IPw1BV_1NDbsIdrzhlj4MfpdhPXnhdau4,6381
12
+ constec/db/migrations/0009_rename_user_to_companyuser.py,sha256=2UvFpelG88s1NRKQ-Q3-Uz9Cmp5D_HdLHrLGElwq5_c,1052
12
13
  constec/db/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- constec/db/models/__init__.py,sha256=4ZU-4bnCxQrTMWKkt5e97lthHS0wQ0EWIy8GUOYBeqw,2443
14
- constec/db/models/automation.py,sha256=4llvmthh5OzbUXue3pC_QlptfFNIGXC1LEpqRtIVSXU,14999
14
+ constec/db/models/__init__.py,sha256=zEUX56xTEGi09ZVcRwDzSnPeKPv1Dl7pIZdAzlLhD-U,2686
15
+ constec/db/models/automation.py,sha256=StCWqWv-wq5kF6ziZQJ1zwATFVc5eFNXEF9GxvGqOLc,15048
15
16
  constec/db/models/base.py,sha256=Urbz9iyOtSxdTfgtEYbtBLmTiea2QAcLq0L40tAzEq8,736
16
17
  constec/db/models/company.py,sha256=APYsbiNoqQ-73wxFP0jq3AByHNHn3Jjbe_J_iwpD9gM,1047
17
18
  constec/db/models/contact.py,sha256=VJ66YgzCqp09dzYM5IK9rZZV1jqBepJQO8YK28gA98k,2106
18
19
  constec/db/models/erp.py,sha256=kTh_MYVwuxS32li2YTCTOgygEVc0UE9CTqnKbfkSkvQ,3060
19
20
  constec/db/models/erp_entity.py,sha256=1bV5vhPz89aThKf_YP3YW-baQhSsER04byXnZkwMJd0,3715
20
21
  constec/db/models/flow.py,sha256=AdWRCvDo2ZRK_uRbSf-VLZQZ1aVJ-u8X1Ohe9cg3S2M,4093
21
- constec/db/models/group.py,sha256=ueCOIfpmzR683ojWf5vLb6IG_jawfVRM7IJcGK05I3Y,897
22
+ constec/db/models/group.py,sha256=RllL0pV5jHreeZF17ycFUJdXBxpQG_n_VFCBsQglcz8,911
22
23
  constec/db/models/module.py,sha256=z3TYqk0-9VhCYB9eYz-AH1FRSyKnv6aUbnCM6pjGrdA,1919
23
24
  constec/db/models/organization.py,sha256=9dbsh5UBShtDRAeyMqqQEPEaflhzS3aiZpRWUiEluBU,1731
24
25
  constec/db/models/person.py,sha256=B4BNdy2AgqmxrZrkWWvqnFxFHs4uO1n61Y_5sP6MsUo,848
25
26
  constec/db/models/session.py,sha256=CSWiC2Jo2SZnXocy4fQci5qcfLTyaLM2H381iOr6yzg,2477
26
27
  constec/db/models/tag.py,sha256=VlddQW8MLDtYmtt6wp7kC6MsT6SQ6odiJX8mUK8FP3o,1815
27
- constec/db/models/user.py,sha256=QHA-BzJ0F1xaeaUfJbuDlmvLDFclSnVrzqN1n4BCumk,2018
28
+ constec/db/models/user.py,sha256=UvQ6iLCp2ZBuYddV9YFuJ-v8GTmMh84wO7zN3SSadSA,2069
28
29
  constec/services/__init__.py,sha256=LXGKIzaRf1gVG2y7oUc18EulUsJXHVs8-oz0nY2h7WA,312
29
30
  constec/services/encryption.py,sha256=rwfAGUC7kDy1bhezHPoZG1hTjajpEB6l3AgcfGtmdvg,2368
30
31
  constec/shared/__init__.py,sha256=Qe99OxBfwg3_4i4zyCQR20vCcyyaIULpLzUa0XfwBPg,435
@@ -32,8 +33,8 @@ constec/shared/exceptions.py,sha256=8Bih40RWoH0gVhto09mH2ppSQV_drHPnGWITcoD-0J0,
32
33
  constec/utils/__init__.py,sha256=brf-G4UvU-3CK_rKNPTaHwsVsxnoJSbml_QTZJSM7d0,458
33
34
  constec/utils/cuit.py,sha256=dQKGlA4pRQ5DyR-N4BiV8ZsvAle2Vgjif7PU72zHx_A,2753
34
35
  constec/utils/password.py,sha256=XNpTJ9xZQSoZNjXEAnexAEZuYkwW1dFgX4AY-B5Q0gA,1462
35
- constec-0.6.0.dist-info/licenses/LICENSE,sha256=a1R51ONDGq0UQfV-n3ybsNL7EGhcC2sQ1sXvRANaFVI,1064
36
- constec-0.6.0.dist-info/METADATA,sha256=E559HBZj2gR3sB4FRynHSDs-SmBqv-hgu_eLBKB_aMs,2954
37
- constec-0.6.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
38
- constec-0.6.0.dist-info/top_level.txt,sha256=bQ9AydOLlthShsr7tA7t7ivbLvlLPdhHOo0BdWgnh_Y,8
39
- constec-0.6.0.dist-info/RECORD,,
36
+ constec-0.7.0.dist-info/licenses/LICENSE,sha256=a1R51ONDGq0UQfV-n3ybsNL7EGhcC2sQ1sXvRANaFVI,1064
37
+ constec-0.7.0.dist-info/METADATA,sha256=uUqCPj4PKWKwPqOw_kZ01w0-y4OT0gtuXgA4MBAIb5E,2954
38
+ constec-0.7.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
39
+ constec-0.7.0.dist-info/top_level.txt,sha256=bQ9AydOLlthShsr7tA7t7ivbLvlLPdhHOo0BdWgnh_Y,8
40
+ constec-0.7.0.dist-info/RECORD,,