-
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.
🗃️ [#62] changed models file into folder and added klantcontacten
- Loading branch information
1 parent
e8514ad
commit 5b57914
Showing
9 changed files
with
258 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [] | ||
|
124 changes: 124 additions & 0 deletions
124
src/openklant/components/klantinteracties/migrations/0002_klantcontact.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,124 @@ | ||
# Generated by Django 3.2.18 on 2023-10-10 17:54 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("klantinteracties", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Klantcontact", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
help_text="Unieke (technische) identificatiecode van de betrokkene bij klantcontact.", | ||
primary_key=True, | ||
serialize=False, | ||
unique=True, | ||
), | ||
), | ||
( | ||
"nummer", | ||
models.PositiveIntegerField( | ||
help_text="Uniek identificerend nummer dat tijdens communicatie tussen mensen kan worden gebruikt om de specifieke partij aan te duiden.", | ||
validators=[ | ||
django.core.validators.MaxValueValidator(9999999999) | ||
], | ||
verbose_name="Nummer", | ||
), | ||
), | ||
( | ||
"kanaal", | ||
models.CharField( | ||
help_text="Communicatiekanaal dat bij het klantcontact werd gebruikt.", | ||
max_length=50, | ||
verbose_name="Kanaal", | ||
), | ||
), | ||
( | ||
"onderwerp", | ||
models.CharField( | ||
help_text="Datgene waarover het klantcontact ging.", | ||
max_length=200, | ||
verbose_name="Onderwerp", | ||
), | ||
), | ||
( | ||
"inhoud", | ||
models.CharField( | ||
blank=True, | ||
help_text="Informatie die tijdens het klantcontact werd overgebracht of uitgewisseld, voor zover die voor betrokkenen of actoren relevant is.", | ||
max_length=1000, | ||
verbose_name="Inhoud", | ||
), | ||
), | ||
( | ||
"initiator", | ||
models.CharField( | ||
choices=[ | ||
("gemeente", "Gemeente"), | ||
("klant", "Klant"), | ||
("vertegenwoordiger", "Vertegenwoordiger"), | ||
], | ||
help_text="Degene die het klantcontact initieerde.", | ||
max_length=17, | ||
verbose_name="Initiator", | ||
), | ||
), | ||
( | ||
"indicatie_contact_gelukt", | ||
models.BooleanField( | ||
help_text="Geeft, indien bekend, aan of de poging contact tussen de gemeente en inwoner(s) of organisatie(s) tot stand te brengen succesvol was.", | ||
null=True, | ||
verbose_name="Indicatie contact gelukt", | ||
), | ||
), | ||
( | ||
"taal", | ||
models.CharField( | ||
help_text="Taal die bij het klantcontact werd gesproken of geschreven.", | ||
max_length=3, | ||
verbose_name="Taal", | ||
), | ||
), | ||
( | ||
"vertrouwelijk", | ||
models.BooleanField( | ||
help_text="Geeft aan of onderwerp, inhoud en kenmerken van het klantcontact vertrouwelijk moeten worden behandeld.", | ||
verbose_name="Vertrouwelijk", | ||
), | ||
), | ||
( | ||
"plaatsgevonden_op", | ||
models.DateTimeField( | ||
help_text="Datum en tijdstip waarop het klantontact plaatsvond. Als het klantcontact een gesprek betrof, is dit het moment waarop het gesprek begon. Als het klantcontact verzending of ontvangst van informatie betrof, is dit bij benadering het moment waarop informatie door gemeente verzonden of ontvangen werd.", | ||
verbose_name="Plaatsgevonden op", | ||
), | ||
), | ||
( | ||
"klantcontact", | ||
models.ForeignKey( | ||
blank=True, | ||
help_text="De persoon of organisatie die betrokken was bij een klantcontact.", | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="klantcontacten", | ||
to="klantinteracties.klantcontact", | ||
verbose_name="Klant contact", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "klantcontact", | ||
"verbose_name_plural": "klantcontacten", | ||
}, | ||
), | ||
] |
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,2 @@ | ||
from .klantcontacten import * # noqa | ||
from .partijen import * # noqa |
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
110 changes: 110 additions & 0 deletions
110
src/openklant/components/klantinteracties/models/klantcontacten.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,110 @@ | ||
import uuid | ||
|
||
from django.core.validators import MaxValueValidator | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .constants import Initiator | ||
|
||
|
||
class Klantcontact(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." | ||
), | ||
) | ||
klantcontact = models.ForeignKey( | ||
"self", | ||
on_delete=models.SET_NULL, | ||
related_name="klantcontacten", | ||
verbose_name=_("Klant contact"), | ||
help_text=_( | ||
"De persoon of organisatie die betrokken was bij een klantcontact." | ||
), | ||
blank=True, | ||
null=True, | ||
) | ||
# TODO: add fk to Actor | ||
# TODO: add fk to Onderwerpobject | ||
# TODO: add fk to Inhoudsobject | ||
nummer = models.PositiveIntegerField( | ||
_("Nummer"), | ||
help_text=_( | ||
"Uniek identificerend nummer dat tijdens communicatie tussen mensen kan " | ||
"worden gebruikt om de specifieke partij aan te duiden." | ||
), | ||
validators=[MaxValueValidator(9999999999)], | ||
blank=False, | ||
) | ||
kanaal = models.CharField( | ||
_("Kanaal"), | ||
help_text=_("Communicatiekanaal dat bij het klantcontact werd gebruikt."), | ||
max_length=50, | ||
blank=False, | ||
) | ||
onderwerp = models.CharField( | ||
_("Onderwerp"), | ||
help_text=_("Datgene waarover het klantcontact ging."), | ||
max_length=200, | ||
blank=False, | ||
) | ||
inhoud = models.CharField( | ||
_("Inhoud"), | ||
help_text=_( | ||
"Informatie die tijdens het klantcontact werd overgebracht of uitgewisseld, " | ||
"voor zover die voor betrokkenen of actoren relevant is." | ||
), | ||
max_length=1000, | ||
blank=True, | ||
) | ||
initiator = models.CharField( | ||
_("Initiator"), | ||
help_text=_("Degene die het klantcontact initieerde."), | ||
choices=Initiator.choices, | ||
max_length=17, | ||
blank=False, | ||
) | ||
indicatie_contact_gelukt = models.BooleanField( | ||
_("Indicatie contact gelukt"), | ||
help_text=( | ||
"Geeft, indien bekend, aan of de poging contact tussen de gemeente " | ||
"en inwoner(s) of organisatie(s) tot stand te brengen succesvol was." | ||
), | ||
blank=False, | ||
null=True, | ||
) | ||
taal = models.CharField( | ||
_("Taal"), | ||
help_text=_("Taal die bij het klantcontact werd gesproken of geschreven."), | ||
max_length=3, | ||
blank=False, | ||
) | ||
vertrouwelijk = models.BooleanField( | ||
_("Vertrouwelijk"), | ||
help_text=_( | ||
"Geeft aan of onderwerp, inhoud en kenmerken van het klantcontact vertrouwelijk moeten worden behandeld." | ||
), | ||
blank=False, | ||
) | ||
# TODO: does this field require auto_now? | ||
plaatsgevonden_op = models.DateTimeField( | ||
_("Plaatsgevonden op"), | ||
help_text=_( | ||
"Datum en tijdstip waarop het klantontact plaatsvond. Als het klantcontact " | ||
"een gesprek betrof, is dit het moment waarop het gesprek begon. " | ||
"Als het klantcontact verzending of ontvangst van informatie betrof, " | ||
"is dit bij benadering het moment waarop informatie door gemeente verzonden of ontvangen werd." | ||
), | ||
blank=False, | ||
) | ||
|
||
class Meta: | ||
verbose_name = "klantcontact" | ||
verbose_name_plural = "klantcontacten" | ||
|
||
def __str__(self) -> str: | ||
return self.nummer |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.