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 21, 2025
1 parent e3e39bf commit d6cc0c9
Show file tree
Hide file tree
Showing 6 changed files with 574 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
# Generated by Django 5.1.5 on 2025-01-21 14:17

import apps.core.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="administration_address_1",
field=models.CharField(
blank=True,
max_length=255,
null=True,
verbose_name="administration address",
),
),
migrations.AddField(
model_name="consent",
name="administration_address_2",
field=models.CharField(
blank=True,
max_length=255,
null=True,
verbose_name="administration address complement",
),
),
migrations.AddField(
model_name="consent",
name="administration_email",
field=models.EmailField(
blank=True,
max_length=254,
null=True,
verbose_name="administration email",
),
),
migrations.AddField(
model_name="consent",
name="administration_name",
field=models.CharField(
blank=True,
max_length=255,
null=True,
verbose_name="administration name",
),
),
migrations.AddField(
model_name="consent",
name="administration_represented_by",
field=models.CharField(
blank=True,
max_length=255,
null=True,
verbose_name="administration represented by",
),
),
migrations.AddField(
model_name="consent",
name="administration_town",
field=models.CharField(
blank=True,
max_length=255,
null=True,
verbose_name="administration town",
),
),
migrations.AddField(
model_name="consent",
name="administration_zip_code",
field=models.CharField(
blank=True,
max_length=5,
null=True,
validators=[apps.core.validators.validate_zip_code],
verbose_name="administration zip code",
),
),
migrations.AddField(
model_name="consent",
name="allows_daily_index_readings",
field=models.BooleanField(
blank=True,
null=True,
verbose_name="allow history of daily index readings in kWh",
),
),
migrations.AddField(
model_name="consent",
name="allows_load_curve",
field=models.BooleanField(
blank=True,
null=True,
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(
blank=True,
null=True,
verbose_name="allows historical maximum daily power in kVa or kWh ",
),
),
migrations.AddField(
model_name="consent",
name="allows_measurements",
field=models.BooleanField(
blank=True,
null=True,
verbose_name="allows historical measurements in kWh",
),
),
migrations.AddField(
model_name="consent",
name="allows_technical_contractual_data",
field=models.BooleanField(
blank=True,
null=True,
verbose_name="allows the technical and contractual data available",
),
),
migrations.AddField(
model_name="consent",
name="company_address_1",
field=models.CharField(
blank=True, max_length=255, null=True, verbose_name="company address"
),
),
migrations.AddField(
model_name="consent",
name="company_address_2",
field=models.CharField(
blank=True,
max_length=255,
null=True,
verbose_name="company address complement",
),
),
migrations.AddField(
model_name="consent",
name="company_legal_form",
field=models.CharField(
blank=True,
help_text="SA, SARL …",
max_length=50,
null=True,
verbose_name="company legal form",
),
),
migrations.AddField(
model_name="consent",
name="company_naf",
field=models.CharField(
blank=True,
max_length=5,
null=True,
validators=[apps.core.validators.validate_naf_code],
verbose_name="company NAF code",
),
),
migrations.AddField(
model_name="consent",
name="company_name",
field=models.CharField(
blank=True, max_length=255, null=True, verbose_name="company name"
),
),
migrations.AddField(
model_name="consent",
name="company_siret",
field=models.CharField(
blank=True,
max_length=14,
null=True,
validators=[apps.core.validators.validate_siret],
verbose_name="company SIRET",
),
),
migrations.AddField(
model_name="consent",
name="company_town",
field=models.CharField(
blank=True, max_length=255, null=True, verbose_name="company town"
),
),
migrations.AddField(
model_name="consent",
name="company_trade_name",
field=models.CharField(
blank=True, max_length=255, null=True, verbose_name="company trade name"
),
),
migrations.AddField(
model_name="consent",
name="company_type",
field=models.CharField(
blank=True,
help_text="entreprise/ collectivité locale, ECPI, Association, copropriété, ...",
max_length=255,
null=True,
verbose_name="company type",
),
),
migrations.AddField(
model_name="consent",
name="company_zip_code",
field=models.CharField(
blank=True,
max_length=5,
null=True,
validators=[apps.core.validators.validate_zip_code],
verbose_name="company zip code",
),
),
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(
blank=True, null=True, verbose_name="the signatory is authorized"
),
),
migrations.AddField(
model_name="consent",
name="representative_email",
field=models.EmailField(
blank=True,
max_length=254,
null=True,
verbose_name="representative email",
),
),
migrations.AddField(
model_name="consent",
name="representative_firstname",
field=models.CharField(
blank=True,
max_length=150,
null=True,
verbose_name="representative firstname",
),
),
migrations.AddField(
model_name="consent",
name="representative_lastname",
field=models.CharField(
blank=True,
max_length=150,
null=True,
verbose_name="representative lastname",
),
),
migrations.AddField(
model_name="consent",
name="representative_phone",
field=models.CharField(
blank=True,
max_length=20,
null=True,
verbose_name="representative phone",
),
),
migrations.AddField(
model_name="consent",
name="signature_date",
field=models.DateTimeField(
blank=True, null=True, verbose_name="signature date"
),
),
]
Loading

0 comments on commit d6cc0c9

Please sign in to comment.