Skip to content

Commit

Permalink
[#233] Fix models
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Nov 18, 2024
1 parent 8d7f179 commit 968bcc6
Showing 1 changed file with 87 additions and 14 deletions.
101 changes: 87 additions & 14 deletions src/openklant/components/klantinteracties/models/partijen.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,77 @@ def __str__(self):
return self.get_full_name()


class PartijIdentificatorCodeRegister(models.Model):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
help_text=_(""),
)
register = models.CharField(
_("register"),
help_text=_(""),
max_length=50,
blank=True,
)
naam = models.CharField(
_("naam"),
help_text=_("Naam register"),
max_length=80,
blank=True,
)

def __str__(self):
return f"{self.naam} ({self.register})"


class PartijIdentificatorCodeObjectType(models.Model):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
help_text=_(""),
)
register = models.ForeignKey(
PartijIdentificatorCodeRegister,
on_delete=models.CASCADE,
help_text=_(""),
null=True,
blank=True,
)
object_type = models.CharField(
_("Object type"),
help_text=_("Object type"),
max_length=255,
blank=True,
)

def __str__(self):
return f"{self.object_type}"


class PartijIdentificatorCodeSoortObjectId(models.Model):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
help_text=_(""),
)
object_type = models.ForeignKey(
PartijIdentificatorCodeObjectType,
on_delete=models.CASCADE,
help_text=_(""),
null=True,
blank=True,
)
soort_object_id = models.CharField(
_("Soort object id"),
help_text=_("Soort object id"),
max_length=255,
blank=True,
)

def __str__(self):
return f"{self.soort_object_id}"


class PartijIdentificator(models.Model):
uuid = models.UUIDField(
unique=True,
Expand All @@ -347,38 +418,40 @@ class PartijIdentificator(models.Model):
)

# Partij-identificator fields
partij_identificator_code_objecttype = models.CharField(
_("objecttype"),
partij_identificator_code_objecttype = models.ForeignKey(
PartijIdentificatorCodeObjectType,
on_delete=models.SET_NULL,
verbose_name=_("objecttype"),
help_text=_(
"Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'."
),
max_length=200,
blank=True,
null=True,
)
partij_identificator_code_soort_object_id = models.CharField(
_("soort object ID"),
partij_identificator_code_soort_object_id = models.ForeignKey(
PartijIdentificatorCodeSoortObjectId,
on_delete=models.SET_NULL,
verbose_name=_("soort object id"),
help_text=_(
"Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'."
),
max_length=200,
blank=True,
null=True,
)
partij_identificator_object_id = models.CharField(
_("object ID"),
help_text=_(
"Waarde van de eigenschap die het object identificeert, bijvoorbeeld: '123456788'."
),
max_length=200,
blank=True,
null=True,
)
partij_identificator_code_register = models.CharField(
_("register"),
partij_identificator_code_register = models.ForeignKey(
PartijIdentificatorCodeRegister,
on_delete=models.SET_NULL,
verbose_name=_("code register"),
help_text=_(
"Binnen het landschap van registers unieke omschrijving van het register waarin "
"het object is geregistreerd, bijvoorbeeld: 'BRP'."
),
max_length=200,
blank=True,
null=True,
)

partij_identificator = GegevensGroepType(
Expand Down

0 comments on commit 968bcc6

Please sign in to comment.