constec 0.6.0__tar.gz → 0.7.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.
- {constec-0.6.0 → constec-0.7.0}/PKG-INFO +1 -1
- constec-0.7.0/constec/db/migrations/0009_rename_user_to_companyuser.py +40 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/__init__.py +11 -2
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/automation.py +7 -7
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/group.py +2 -2
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/user.py +11 -11
- {constec-0.6.0 → constec-0.7.0}/constec.egg-info/PKG-INFO +1 -1
- {constec-0.6.0 → constec-0.7.0}/constec.egg-info/SOURCES.txt +1 -0
- {constec-0.6.0 → constec-0.7.0}/pyproject.toml +1 -1
- {constec-0.6.0 → constec-0.7.0}/LICENSE +0 -0
- {constec-0.6.0 → constec-0.7.0}/README.md +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/__init__.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/apps.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0001_initial.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0002_module_level.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0003_remove_module_level.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0004_rename_entities_company_cuit_idx_entities_company_e2c50f_idx_and_more.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0005_event.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0006_automation_trigger_action_executionlog_notificationtemplate.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0007_add_organization_to_automations.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0008_refactor_creator_fields.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/migrations/__init__.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/base.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/company.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/contact.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/erp.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/erp_entity.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/flow.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/module.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/organization.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/person.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/session.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/db/models/tag.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/py.typed +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/services/__init__.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/services/encryption.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/shared/__init__.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/shared/exceptions.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/utils/__init__.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/utils/cuit.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec/utils/password.py +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec.egg-info/dependency_links.txt +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec.egg-info/requires.txt +0 -0
- {constec-0.6.0 → constec-0.7.0}/constec.egg-info/top_level.txt +0 -0
- {constec-0.6.0 → constec-0.7.0}/setup.cfg +0 -0
|
@@ -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
|
|
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
|
-
#
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
26
|
+
CompanyUser,
|
|
27
27
|
related_name="groups"
|
|
28
28
|
)
|
|
29
29
|
|
|
@@ -3,7 +3,7 @@ from .base import UUIDModel
|
|
|
3
3
|
from .company import Company
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class
|
|
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"."
|
|
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
|
|
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"."
|
|
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
|
|
49
|
-
"""Cross-company access: one
|
|
48
|
+
class CompanyUserAccess(UUIDModel):
|
|
49
|
+
"""Cross-company access: one CompanyUser can access multiple Companies."""
|
|
50
50
|
user = models.ForeignKey(
|
|
51
|
-
|
|
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
|
-
|
|
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"."
|
|
69
|
-
verbose_name = '
|
|
70
|
-
verbose_name_plural = '
|
|
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):
|
|
@@ -17,6 +17,7 @@ constec/db/migrations/0005_event.py
|
|
|
17
17
|
constec/db/migrations/0006_automation_trigger_action_executionlog_notificationtemplate.py
|
|
18
18
|
constec/db/migrations/0007_add_organization_to_automations.py
|
|
19
19
|
constec/db/migrations/0008_refactor_creator_fields.py
|
|
20
|
+
constec/db/migrations/0009_rename_user_to_companyuser.py
|
|
20
21
|
constec/db/migrations/__init__.py
|
|
21
22
|
constec/db/models/__init__.py
|
|
22
23
|
constec/db/models/automation.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "constec"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.7.0"
|
|
8
8
|
description = "Base library for the Constec ecosystem - shared utilities, models, and namespace foundation"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
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
|
{constec-0.6.0 → constec-0.7.0}/constec/db/migrations/0007_add_organization_to_automations.py
RENAMED
|
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
|