constec 0.3.0__tar.gz → 0.3.2__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.
Files changed (37) hide show
  1. {constec-0.3.0 → constec-0.3.2}/PKG-INFO +1 -1
  2. {constec-0.3.0 → constec-0.3.2}/constec/db/migrations/0001_initial.py +7 -0
  3. constec-0.3.2/constec/db/migrations/0002_module_level.py +38 -0
  4. {constec-0.3.0 → constec-0.3.2}/constec/db/models/__init__.py +3 -1
  5. {constec-0.3.0 → constec-0.3.2}/constec/db/models/contact.py +3 -0
  6. {constec-0.3.0 → constec-0.3.2}/constec/db/models/module.py +35 -0
  7. {constec-0.3.0 → constec-0.3.2}/constec.egg-info/PKG-INFO +1 -1
  8. {constec-0.3.0 → constec-0.3.2}/constec.egg-info/SOURCES.txt +1 -0
  9. {constec-0.3.0 → constec-0.3.2}/pyproject.toml +1 -1
  10. {constec-0.3.0 → constec-0.3.2}/LICENSE +0 -0
  11. {constec-0.3.0 → constec-0.3.2}/README.md +0 -0
  12. {constec-0.3.0 → constec-0.3.2}/constec/db/__init__.py +0 -0
  13. {constec-0.3.0 → constec-0.3.2}/constec/db/apps.py +0 -0
  14. {constec-0.3.0 → constec-0.3.2}/constec/db/migrations/__init__.py +0 -0
  15. {constec-0.3.0 → constec-0.3.2}/constec/db/models/base.py +0 -0
  16. {constec-0.3.0 → constec-0.3.2}/constec/db/models/company.py +0 -0
  17. {constec-0.3.0 → constec-0.3.2}/constec/db/models/erp.py +0 -0
  18. {constec-0.3.0 → constec-0.3.2}/constec/db/models/erp_entity.py +0 -0
  19. {constec-0.3.0 → constec-0.3.2}/constec/db/models/flow.py +0 -0
  20. {constec-0.3.0 → constec-0.3.2}/constec/db/models/group.py +0 -0
  21. {constec-0.3.0 → constec-0.3.2}/constec/db/models/organization.py +0 -0
  22. {constec-0.3.0 → constec-0.3.2}/constec/db/models/person.py +0 -0
  23. {constec-0.3.0 → constec-0.3.2}/constec/db/models/session.py +0 -0
  24. {constec-0.3.0 → constec-0.3.2}/constec/db/models/tag.py +0 -0
  25. {constec-0.3.0 → constec-0.3.2}/constec/db/models/user.py +0 -0
  26. {constec-0.3.0 → constec-0.3.2}/constec/py.typed +0 -0
  27. {constec-0.3.0 → constec-0.3.2}/constec/services/__init__.py +0 -0
  28. {constec-0.3.0 → constec-0.3.2}/constec/services/encryption.py +0 -0
  29. {constec-0.3.0 → constec-0.3.2}/constec/shared/__init__.py +0 -0
  30. {constec-0.3.0 → constec-0.3.2}/constec/shared/exceptions.py +0 -0
  31. {constec-0.3.0 → constec-0.3.2}/constec/utils/__init__.py +0 -0
  32. {constec-0.3.0 → constec-0.3.2}/constec/utils/cuit.py +0 -0
  33. {constec-0.3.0 → constec-0.3.2}/constec/utils/password.py +0 -0
  34. {constec-0.3.0 → constec-0.3.2}/constec.egg-info/dependency_links.txt +0 -0
  35. {constec-0.3.0 → constec-0.3.2}/constec.egg-info/requires.txt +0 -0
  36. {constec-0.3.0 → constec-0.3.2}/constec.egg-info/top_level.txt +0 -0
  37. {constec-0.3.0 → constec-0.3.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: constec
3
- Version: 0.3.0
3
+ Version: 0.3.2
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
@@ -34,6 +34,7 @@ class Migration(migrations.Migration):
34
34
  ],
35
35
  options={
36
36
  'db_table': 'erp"."entities',
37
+ 'verbose_name_plural': 'Entities',
37
38
  },
38
39
  ),
39
40
  migrations.CreateModel(
@@ -121,12 +122,14 @@ class Migration(migrations.Migration):
121
122
  ],
122
123
  options={
123
124
  'db_table': 'core"."companies',
125
+ 'verbose_name_plural': 'Companies',
124
126
  },
125
127
  ),
126
128
  migrations.CreateModel(
127
129
  name='Contact',
128
130
  fields=[
129
131
  ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
132
+ ('label', models.CharField(blank=True, help_text="Optional label (e.g. 'Personal', 'Work')", max_length=100)),
130
133
  ('value', models.CharField(max_length=255)),
131
134
  ('metadata', models.JSONField(blank=True, default=dict)),
132
135
  ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contacts', to='constec_db.contacttype')),
@@ -377,6 +380,8 @@ class Migration(migrations.Migration):
377
380
  ],
378
381
  options={
379
382
  'db_table': 'core"."tag_categories',
383
+ 'verbose_name': 'Tag category',
384
+ 'verbose_name_plural': 'Tag categories',
380
385
  },
381
386
  ),
382
387
  migrations.AddField(
@@ -435,6 +440,8 @@ class Migration(migrations.Migration):
435
440
  ],
436
441
  options={
437
442
  'db_table': 'core"."user_company_access',
443
+ 'verbose_name': 'User company access',
444
+ 'verbose_name_plural': 'User company access',
438
445
  },
439
446
  ),
440
447
  migrations.AddIndex(
@@ -0,0 +1,38 @@
1
+ from django.db import migrations, models
2
+ import django.db.models.deletion
3
+ import uuid
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('constec_db', '0001_initial'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name='module',
15
+ name='level',
16
+ field=models.CharField(
17
+ choices=[('organization', 'Organization Level'), ('company', 'Company Level')],
18
+ default='company',
19
+ max_length=20,
20
+ ),
21
+ ),
22
+ migrations.CreateModel(
23
+ name='OrganizationModule',
24
+ fields=[
25
+ ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
26
+ ('created_at', models.DateTimeField(auto_now_add=True)),
27
+ ('updated_at', models.DateTimeField(auto_now=True)),
28
+ ('is_enabled', models.BooleanField(default=True)),
29
+ ('settings', models.JSONField(blank=True, default=dict)),
30
+ ('module', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_modules', to='constec_db.module')),
31
+ ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_modules', to='constec_db.organization')),
32
+ ],
33
+ options={
34
+ 'db_table': 'core"."organization_modules',
35
+ 'unique_together': {('organization', 'module')},
36
+ },
37
+ ),
38
+ ]
@@ -24,7 +24,7 @@ from .person import Person
24
24
  from .group import UserGroup
25
25
  from .contact import ContactType, Contact, PersonContact
26
26
  from .tag import TagCategory, PersonTag, PersonTagged
27
- from .module import Module, CompanyModule
27
+ from .module import Module, ModuleLevel, CompanyModule, OrganizationModule
28
28
 
29
29
  # ERP models (erp schema)
30
30
  from .erp import System, CompanySystem, Connection
@@ -69,7 +69,9 @@ __all__ = [
69
69
  'PersonTagged',
70
70
  # Module
71
71
  'Module',
72
+ 'ModuleLevel',
72
73
  'CompanyModule',
74
+ 'OrganizationModule',
73
75
  # ERP (erp schema)
74
76
  'System',
75
77
  'CompanySystem',
@@ -23,6 +23,7 @@ class Contact(UUIDModel):
23
23
  on_delete=models.CASCADE,
24
24
  related_name="contacts",
25
25
  )
26
+ label = models.CharField(max_length=100, blank=True, help_text="Optional label (e.g. 'Personal', 'Work')")
26
27
  value = models.CharField(max_length=255)
27
28
  metadata = models.JSONField(default=dict, blank=True)
28
29
 
@@ -31,6 +32,8 @@ class Contact(UUIDModel):
31
32
  db_table = 'core"."contacts'
32
33
 
33
34
  def __str__(self):
35
+ if self.label:
36
+ return f"{self.label}: {self.value} ({self.type.name})"
34
37
  return f"{self.value} ({self.type.name})"
35
38
 
36
39
 
@@ -1,6 +1,12 @@
1
1
  from django.db import models
2
2
  from .base import UUIDModel
3
3
  from .company import Company
4
+ from .organization import Organization
5
+
6
+
7
+ class ModuleLevel(models.TextChoices):
8
+ ORGANIZATION = 'organization', 'Organization Level'
9
+ COMPANY = 'company', 'Company Level'
4
10
 
5
11
 
6
12
  class Module(UUIDModel):
@@ -10,6 +16,11 @@ class Module(UUIDModel):
10
16
  description = models.TextField(blank=True, null=True)
11
17
  version = models.CharField(max_length=20)
12
18
  is_active = models.BooleanField(default=True)
19
+ level = models.CharField(
20
+ max_length=20,
21
+ choices=ModuleLevel.choices,
22
+ default=ModuleLevel.COMPANY,
23
+ )
13
24
 
14
25
  class Meta:
15
26
  app_label = 'constec_db'
@@ -41,3 +52,27 @@ class CompanyModule(UUIDModel):
41
52
 
42
53
  def __str__(self):
43
54
  return f"{self.company.name} - {self.module.name}"
55
+
56
+
57
+ class OrganizationModule(UUIDModel):
58
+ """Modules enabled per organization."""
59
+ organization = models.ForeignKey(
60
+ Organization,
61
+ on_delete=models.CASCADE,
62
+ related_name="organization_modules",
63
+ )
64
+ module = models.ForeignKey(
65
+ Module,
66
+ on_delete=models.CASCADE,
67
+ related_name="organization_modules",
68
+ )
69
+ is_enabled = models.BooleanField(default=True)
70
+ settings = models.JSONField(default=dict, blank=True)
71
+
72
+ class Meta:
73
+ app_label = 'constec_db'
74
+ db_table = 'core"."organization_modules'
75
+ unique_together = [['organization', 'module']]
76
+
77
+ def __str__(self):
78
+ return f"{self.organization.name} - {self.module.name}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: constec
3
- Version: 0.3.0
3
+ Version: 0.3.2
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
@@ -10,6 +10,7 @@ constec.egg-info/top_level.txt
10
10
  constec/db/__init__.py
11
11
  constec/db/apps.py
12
12
  constec/db/migrations/0001_initial.py
13
+ constec/db/migrations/0002_module_level.py
13
14
  constec/db/migrations/__init__.py
14
15
  constec/db/models/__init__.py
15
16
  constec/db/models/base.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "constec"
7
- version = "0.3.0"
7
+ version = "0.3.2"
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