Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/91 partijidentificator #94

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Generated by Django 3.2.18 on 2023-10-19 14:41

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):
dependencies = [
("klantinteracties", "0001_initial"),
]

operations = [
migrations.RenameField(
model_name="actor",
old_name="identificator_object_id",
new_name="objectidentificator_object_id",
),
migrations.RenameField(
model_name="actor",
old_name="identificator_objecttype",
new_name="objectidentificator_objecttype",
),
migrations.RenameField(
model_name="actor",
old_name="identificator_register",
new_name="objectidentificator_register",
),
migrations.RenameField(
model_name="actor",
old_name="identificator_soort_object_id",
new_name="objectidentificator_soort_object_id",
),
migrations.CreateModel(
name="Onderwerpobject",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"objectidentificator_objecttype",
models.CharField(
help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.",
max_length=200,
verbose_name="objecttype",
),
),
(
"objectidentificator_soort_object_id",
models.CharField(
help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.",
max_length=200,
verbose_name="soort object id",
),
),
(
"objectidentificator_object_id",
models.CharField(
help_text="Waarde van de eigenschap die het object identificeert, bijvoorbeeld: '123456788'.",
max_length=200,
verbose_name="object id",
),
),
(
"objectidentificator_register",
models.CharField(
help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.",
max_length=200,
verbose_name="register",
),
),
(
"uuid",
models.UUIDField(
default=uuid.uuid4,
help_text="Unieke (technische) identificatiecode van het onderwerpdeel.",
unique=True,
),
),
(
"klantcontact",
models.ForeignKey(
help_text="'Klantcontact' ging over 'Onderwerpobject'",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="klantinteracties.klantcontact",
verbose_name="klantcontact",
),
),
(
"was_klantcontact",
models.ForeignKey(
help_text="'Onderwerpobject' was 'Klantcontact'",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="was_onderwerpobject",
to="klantinteracties.klantcontact",
verbose_name="was klantcontact",
),
),
],
options={
"verbose_name": "onderwerpobject",
"verbose_name_plural": "onderwerpobjecten",
},
),
migrations.CreateModel(
name="Bijlage",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"objectidentificator_objecttype",
models.CharField(
help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.",
max_length=200,
verbose_name="objecttype",
),
),
(
"objectidentificator_soort_object_id",
models.CharField(
help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.",
max_length=200,
verbose_name="soort object id",
),
),
(
"objectidentificator_object_id",
models.CharField(
help_text="Waarde van de eigenschap die het object identificeert, bijvoorbeeld: '123456788'.",
max_length=200,
verbose_name="object id",
),
),
(
"objectidentificator_register",
models.CharField(
help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.",
max_length=200,
verbose_name="register",
),
),
(
"uuid",
models.UUIDField(
default=uuid.uuid4,
help_text="Unieke (technische) identificatiecode van het inhoudsdeel.",
unique=True,
),
),
(
"klantcontact",
models.ForeignKey(
help_text="'Klantcontact' omvatte 'Bijlage'",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="klantinteracties.klantcontact",
verbose_name="klantcontact",
),
),
],
options={
"verbose_name": "bijlage",
"verbose_name_plural": "bijlagen",
},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Generated by Django 3.2.18 on 2023-10-19 15:29

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):
dependencies = [
("klantinteracties", "0002_auto_20231019_1441"),
]

operations = [
migrations.CreateModel(
name="PartijIdentificator",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"uuid",
models.UUIDField(
default=uuid.uuid4,
help_text="Unieke (technische) identificatiecode van de partij-identificator.",
unique=True,
),
),
(
"andere_partij_identificator",
models.CharField(
blank=True,
help_text="Vrij tekstveld om de verwijzing naar een niet-voorgedefinieerd objecttype, soort objectID of Register vast te leggen. ",
max_length=200,
verbose_name="andere partij indetificator",
),
),
(
"partij_identificator_objecttype",
models.CharField(
help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.",
max_length=200,
verbose_name="objecttype",
),
),
(
"partij_identificator_soort_object_id",
models.CharField(
help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.",
max_length=200,
verbose_name="soort object id",
),
),
(
"partij_identificator_object_id",
models.CharField(
help_text="Waarde van de eigenschap die het object identificeert, bijvoorbeeld: '123456788'.",
max_length=200,
verbose_name="object id",
),
),
(
"partij_identificator_register",
models.CharField(
help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.",
max_length=200,
verbose_name="register",
),
),
(
"partij",
models.ForeignKey(
help_text="'Partij' had 'PartijIdentificator'",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="klantinteracties.partij",
verbose_name="partij",
),
),
],
options={
"verbose_name": "partij identificator",
"verbose_name_plural": "partij identificatoren",
},
),
]
4 changes: 2 additions & 2 deletions src/openklant/components/klantinteracties/models/actoren.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from django.utils.translation import gettext_lazy as _

from .constants import SoortActor
from .mixins import IdentificatorMixin
from .mixins import ObjectidentificatorMixin


class Actor(IdentificatorMixin):
class Actor(ObjectidentificatorMixin):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
Expand Down
58 changes: 53 additions & 5 deletions src/openklant/components/klantinteracties/models/klantcontacten.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
from .actoren import Actor
from .constants import Klantcontrol
from .digitaal_adres import DigitaalAdres
from .mixins import BezoekAdresMixin, ContactNaamMixin, CorrespondentieAdresMixin
from .mixins import (
BezoekadresMixin,
ContactnaamMixin,
CorrespondentieadresMixin,
ObjectidentificatorMixin,
)


class Klantcontact(models.Model):
Expand All @@ -28,8 +33,6 @@ class Klantcontact(models.Model):
),
blank=False,
)
# TODO: add fk to Onderwerpobject
# TODO: add fk to Inhoudsobject
nummer = models.CharField(
_("nummer"),
help_text=_(
Expand Down Expand Up @@ -77,7 +80,6 @@ class Klantcontact(models.Model):
"Geeft aan of onderwerp, inhoud en kenmerken van het klantcontact vertrouwelijk moeten worden behandeld."
),
)
# TODO: does this field require auto_now?
plaatsgevonden_op = models.DateTimeField(
_("plaatsgevonden op"),
help_text=_(
Expand All @@ -95,7 +97,7 @@ class Meta:
verbose_name_plural = _("klantcontacten")


class Betrokkene(BezoekAdresMixin, CorrespondentieAdresMixin, ContactNaamMixin):
class Betrokkene(BezoekadresMixin, CorrespondentieadresMixin, ContactnaamMixin):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
Expand Down Expand Up @@ -139,3 +141,49 @@ class Betrokkene(BezoekAdresMixin, CorrespondentieAdresMixin, ContactNaamMixin):

class Meta:
verbose_name = _("betrokkene bij klantcontact")


class Onderwerpobject(ObjectidentificatorMixin):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
help_text=_("Unieke (technische) identificatiecode van het onderwerpdeel."),
)
klantcontact = models.ForeignKey(
Klantcontact,
on_delete=models.CASCADE,
verbose_name=_("klantcontact"),
help_text=_("'Klantcontact' ging over 'Onderwerpobject'"),
null=True,
)
was_klantcontact = models.ForeignKey(
Klantcontact,
on_delete=models.CASCADE,
verbose_name=_("was klantcontact"),
related_name="was_onderwerpobject",
help_text=_("'Onderwerpobject' was 'Klantcontact'"),
null=True,
)

class Meta:
verbose_name = _("onderwerpobject")
verbose_name_plural = _("onderwerpobjecten")


class Bijlage(ObjectidentificatorMixin):
uuid = models.UUIDField(
unique=True,
default=uuid.uuid4,
help_text=_("Unieke (technische) identificatiecode van het inhoudsdeel."),
)
klantcontact = models.ForeignKey(
Klantcontact,
on_delete=models.CASCADE,
verbose_name=_("klantcontact"),
help_text=_("'Klantcontact' omvatte 'Bijlage'"),
null=True,
)

class Meta:
verbose_name = _("bijlage")
verbose_name_plural = _("bijlagen")
Loading
Loading