-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗃️ [#64] added digitaal adres model field
- Loading branch information
1 parent
28b47db
commit 51210c4
Showing
4 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
src/openklant/components/klantinteracties/migrations/0004_digitaaladres.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,78 @@ | ||
# Generated by Django 3.2.18 on 2023-10-11 15:47 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("klantinteracties", "0003_betrokkene"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="DigitaalAdres", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
help_text="Unieke (technische) identificatiecode van de betrokkene bij klantcontact.", | ||
primary_key=True, | ||
serialize=False, | ||
unique=True, | ||
), | ||
), | ||
( | ||
"soort_digitaal_adres", | ||
models.CharField( | ||
help_text="Typering van het digitale adres die aangeeft via welk(e) kanaal of kanalen met dit adres contact kan worden opgenomen.", | ||
max_length=254, | ||
verbose_name="Soort digitaal adres", | ||
), | ||
), | ||
( | ||
"adres", | ||
models.CharField( | ||
help_text="Digitaal adres waarmee een persoon of organisatie bereikt kan worden.", | ||
max_length=80, | ||
verbose_name="Adres", | ||
), | ||
), | ||
( | ||
"omschrijving", | ||
models.CharField( | ||
help_text="Omschrijving van het digitaal adres.", | ||
max_length=40, | ||
verbose_name="Omschrijving", | ||
), | ||
), | ||
( | ||
"betrokkene", | ||
models.ForeignKey( | ||
help_text="Het digitale adres dat de betrokkene bij klantcontact opgaf voor gebruik bij opvolging van het klantcontact.", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="digitale_adressen", | ||
to="klantinteracties.betrokkene", | ||
verbose_name="Betrokkene bij klantcontact", | ||
), | ||
), | ||
( | ||
"partij", | ||
models.ForeignKey( | ||
help_text="Het digitale adres dat de partij voor gebruik bij toekomstig contact met de gemeente verstrekte.", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="digitale_adressen", | ||
to="klantinteracties.partij", | ||
verbose_name="Digitaal adres", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "digitaal Adres", | ||
}, | ||
), | ||
] |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .digitaal_adres import * # noqa | ||
from .klantcontacten import * # noqa | ||
from .partijen import * # noqa |
69 changes: 69 additions & 0 deletions
69
src/openklant/components/klantinteracties/models/digitaal_adres.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,69 @@ | ||
import uuid | ||
|
||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .klantcontacten import Betrokkene | ||
from .partijen import Partij | ||
|
||
|
||
class DigitaalAdres(models.Model): | ||
id = models.UUIDField( | ||
primary_key=True, | ||
unique=True, | ||
default=uuid.uuid4, | ||
max_length=40, | ||
help_text=_( | ||
"Unieke (technische) identificatiecode van de betrokkene bij klantcontact." | ||
), | ||
) | ||
partij = models.ForeignKey( | ||
Partij, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("Digitaal adres"), | ||
related_name="digitale_adressen", | ||
help_text=_( | ||
"Het digitale adres dat de partij voor gebruik bij toekomstig contact met de gemeente verstrekte." | ||
), | ||
null=True, | ||
) | ||
betrokkene = models.ForeignKey( | ||
Betrokkene, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("Betrokkene bij klantcontact"), | ||
related_name="digitale_adressen", | ||
help_text=_( | ||
"Het digitale adres dat de betrokkene bij klantcontact opgaf voor gebruik bij opvolging van het " | ||
"klantcontact." | ||
), | ||
null=True, | ||
) | ||
soort_digitaal_adres = models.CharField( | ||
_("Soort digitaal adres"), | ||
help_text=_( | ||
"Typering van het digitale adres die aangeeft via welk(e) kanaal of kanalen " | ||
"met dit adres contact kan worden opgenomen." | ||
), | ||
max_length=254, | ||
blank=False, | ||
) | ||
adres = models.CharField( | ||
_("Adres"), | ||
help_text=_( | ||
"Digitaal adres waarmee een persoon of organisatie bereikt kan worden." | ||
), | ||
max_length=80, | ||
blank=False, | ||
) | ||
omschrijving = models.CharField( | ||
_("Omschrijving"), | ||
help_text=_("Omschrijving van het digitaal adres."), | ||
max_length=40, | ||
blank=False, | ||
) | ||
|
||
class Meta: | ||
verbose_name = "digitaal Adres" | ||
|
||
def __str__(self): | ||
return self.adres |
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