Skip to content

Commit

Permalink
[#232] use an enum for soortDigitaalAdres
Browse files Browse the repository at this point in the history
  • Loading branch information
SonnyBA committed Oct 18, 2024
1 parent cd377ad commit e878b59
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/openklant/components/klantinteracties/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.db.models import TextChoices
from django.utils.translation import gettext_lazy as _


class SoortDigitaalAdres(TextChoices):
email = "email", _("Man")
telefoonnummer = "telefoonnummer", _("Telefoonnummer")
overig = "overig", _("Overig")
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.15 on 2024-10-18 10:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("klantinteracties", "0019_alter_partij_indicatie_geheimhouding"),
]

operations = [
migrations.AlterField(
model_name="digitaaladres",
name="soort_digitaal_adres",
field=models.CharField(
choices=[
("email", "Man"),
("telefoonnummer", "Telefoonnummer"),
("overig", "Overig"),
],
help_text="Typering van het digitale adres die aangeeft via welk(e) kanaal of kanalen met dit adres contact kan worden opgenomen.",
max_length=255,
verbose_name="soort digitaal adres",
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.db import models
from django.utils.translation import gettext_lazy as _

from openklant.components.klantinteracties.constants import SoortDigitaalAdres
from openklant.components.klantinteracties.models.klantcontacten import Betrokkene
from openklant.components.klantinteracties.models.partijen import Partij
from openklant.components.utils.mixins import APIMixin
Expand Down Expand Up @@ -36,6 +37,7 @@ class DigitaalAdres(APIMixin, models.Model):
"met dit adres contact kan worden opgenomen."
),
max_length=255,
choices=SoortDigitaalAdres.choices
)
adres = models.CharField(
_("adres"),
Expand Down

0 comments on commit e878b59

Please sign in to comment.