-
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 company-related fields to the Entity model
New fields include company_type, legal_form, trade_name, siret, naf, and address fields. Validators for SIRET, NAF, and zip code have been integrated. Factory methods and migrations are updated to support these additions.
- Loading branch information
Showing
3 changed files
with
170 additions
and
0 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
105 changes: 105 additions & 0 deletions
105
src/dashboard/apps/core/migrations/0004_entity_company_informations.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,105 @@ | ||
# Generated by Django 5.1.5 on 2025-01-30 08:24 | ||
|
||
import apps.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"qcd_core", | ||
"0003_alter_deliverypoint_managers_alter_entity_proxy_for_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="entity", | ||
name="address_1", | ||
field=models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="address" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="address_2", | ||
field=models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="address complement" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="address_city", | ||
field=models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="city" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="address_zip_code", | ||
field=models.CharField( | ||
blank=True, | ||
max_length=5, | ||
null=True, | ||
validators=[apps.core.validators.validate_zip_code], | ||
verbose_name="zip code", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="company_type", | ||
field=models.CharField( | ||
choices=[ | ||
("ENTERPRISE", "Entreprise"), | ||
("LOCAL_COLLECTIVITY", "Collectivité locale"), | ||
("ASSOCIATION", "Association"), | ||
("EPCI", "ECPI"), | ||
("CO_OWNERSHIP", "Copropriété"), | ||
], | ||
default="ENTERPRISE", | ||
max_length=50, | ||
verbose_name="type", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="legal_form", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="SA, SARL …", | ||
max_length=50, | ||
null=True, | ||
verbose_name="legal form", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="naf", | ||
field=models.CharField( | ||
blank=True, | ||
max_length=5, | ||
null=True, | ||
validators=[apps.core.validators.validate_naf_code], | ||
verbose_name="NAF code", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="siret", | ||
field=models.CharField( | ||
blank=True, | ||
max_length=14, | ||
null=True, | ||
validators=[apps.core.validators.validate_siret], | ||
verbose_name="SIRET", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="entity", | ||
name="trade_name", | ||
field=models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="trade name" | ||
), | ||
), | ||
] |
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