-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗃️(dashboard) add administration and company fields to consent model
Introduced new fields in the Consent model to handle company and administration information, including validation for SIRET, NAF code, and zip code. Updated settings with configurable default values for these fields. Added core validators for ensuring data integrity in relevant fields.
- Loading branch information
Showing
14 changed files
with
710 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ DJANGO_SUPERUSER_PASSWORD=admin | |
DJANGO_SUPERUSER_USERNAME=admin | ||
[email protected] | ||
|
||
# Control authority contact | ||
DASHBOARD_CONTROL_AUTHORITY={"name": "QualiCharge", "address_1": "1 rue de test", "address_2": "", "zip_code": "75000", "city": "Paris", "represented_by": "John Doe", "email": "[email protected]"} | ||
DASHBOARD_CONSENT_DONE_AT=Paris |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
107 changes: 107 additions & 0 deletions
107
src/dashboard/apps/consent/migrations/0004_consent_contractual_fields.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# Generated by Django 5.1.5 on 2025-01-22 15:24 | ||
|
||
import apps.consent.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("qcd_consent", "0003_alter_consent_managers_alter_consent_end_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="consent", | ||
name="allows_daily_index_readings", | ||
field=models.BooleanField( | ||
default=False, | ||
verbose_name="allow history of daily index readings in kWh", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="allows_load_curve", | ||
field=models.BooleanField( | ||
default=False, | ||
verbose_name="allows history of load curve, at steps returned by Enedis", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="allows_max_daily_power", | ||
field=models.BooleanField( | ||
default=False, | ||
verbose_name="allows historical maximum daily power in kVa or kWh ", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="allows_measurements", | ||
field=models.BooleanField( | ||
default=False, verbose_name="allows historical measurements in kWh" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="allows_technical_contractual_data", | ||
field=models.BooleanField( | ||
default=False, | ||
verbose_name="allows the technical and contractual data available", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="company", | ||
field=models.JSONField( | ||
blank=True, | ||
default=None, | ||
null=True, | ||
validators=[apps.consent.validators.validate_company_schema], | ||
verbose_name="company informations", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="company_representative", | ||
field=models.JSONField( | ||
blank=True, | ||
default=None, | ||
null=True, | ||
validators=[apps.consent.validators.validate_representative_schema], | ||
verbose_name="company representative informations", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="control_authority", | ||
field=models.JSONField( | ||
blank=True, | ||
default=None, | ||
null=True, | ||
validators=[apps.consent.validators.validate_control_authority_schema], | ||
verbose_name="control authority informations", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="done_at", | ||
field=models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="done at" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="is_authorized_signatory", | ||
field=models.BooleanField( | ||
default=False, verbose_name="the signatory is authorized" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="consent", | ||
name="signed_at", | ||
field=models.DateTimeField( | ||
blank=True, null=True, verbose_name="signature date" | ||
), | ||
), | ||
] |
Oops, something went wrong.