Skip to content

Commit

Permalink
🗃️(dashboard) add administration and company fields to consent model
Browse files Browse the repository at this point in the history
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
ssorin committed Jan 23, 2025
1 parent dc41d4c commit 31b4db1
Show file tree
Hide file tree
Showing 14 changed files with 710 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ jobs:
DASHBOARD_DB_NAME: test-qualicharge-dashboard
DASHBOARD_DATABASE_URL: psql://qualicharge:pass@localhost:5432/test-qualicharge-dashboard
DASHBOARD_SECRET_KEY: the_secret_key
DASHBOARD_CONTROL_AUTHORITY: null
DASHBOARD_CONSENT_DONE_AT: Paris
3 changes: 3 additions & 0 deletions env.d/dashboard
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to
- add consent form to manage consents of one or many entities
- add admin integration for Entity, DeliveryPoint and Consent
- add mass admin action (make revoked) for consents
- add validators for SIRET, NAF code and Zip code
- disallow mass action "delete" for consents in admin
- block the updates of all new data if a consent has the status `REVOKED`
- block the updates of all new data if a consent has the status `VALIDATED`
Expand Down
1 change: 1 addition & 0 deletions src/dashboard/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ django-environ = "==0.12.0"
django-extensions = "==3.2.3"
django-stubs = {extras = ["compatible-mypy"], version = "==5.1.2"}
gunicorn = "==23.0.0"
jsonschema = "==4.23.0"
psycopg = {extras = ["pool", "binary"], version = "==3.2.4"}
sentry-sdk = {extras = ["django"], version = "==2.20.0"}
whitenoise = "==6.8.2"
Expand Down
144 changes: 143 additions & 1 deletion src/dashboard/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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"
),
),
]
Loading

0 comments on commit 31b4db1

Please sign in to comment.