-
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.
Merge pull request #90 from maykinmedia/feature/61-66-new-api
Models for the new version of the api
- Loading branch information
Showing
13 changed files
with
1,936 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class KlantinteractiesConfig(AppConfig): | ||
name = "openklant.components.klantinteracties" |
1,089 changes: 1,089 additions & 0 deletions
1,089
src/openklant/components/klantinteracties/migrations/0001_initial.py
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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,5 @@ | ||
from .actoren import * # noqa | ||
from .digitaal_adres import * # noqa | ||
from .internetaken import * # noqa | ||
from .klantcontacten import * # noqa | ||
from .partijen import * # noqa |
150 changes: 150 additions & 0 deletions
150
src/openklant/components/klantinteracties/models/actoren.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,150 @@ | ||
import uuid | ||
|
||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .constants import SoortActor | ||
from .mixins import IdentificatorMixin | ||
|
||
|
||
class Actor(IdentificatorMixin): | ||
uuid = models.UUIDField( | ||
unique=True, | ||
default=uuid.uuid4, | ||
help_text=_("Unieke (technische) identificatiecode van de actor."), | ||
) | ||
naam = models.CharField( | ||
_("naam"), | ||
help_text=_("Naam van de actor."), | ||
max_length=200, | ||
) | ||
soort_actor = models.CharField( | ||
_("soort actor"), | ||
help_text=_("Geeft aan van welke specifieke soort actor sprake is."), | ||
choices=SoortActor.choices, | ||
max_length=24, | ||
) | ||
indicatie_actief = models.BooleanField( | ||
_("indicatie actief"), | ||
help_text=_( | ||
"Geeft aan of aan de actor nog betrokken mag worden bij nieuwe klantcontacten. " | ||
"Voor niet-actieve is dit niet toegestaan." | ||
), | ||
default=True, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("actor") | ||
verbose_name_plural = _("actoren") | ||
|
||
def __str__(self): | ||
return self.naam | ||
|
||
|
||
class GeautomatiseerdeActor(models.Model): | ||
actor = models.ForeignKey( | ||
Actor, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("Actor"), | ||
help_text=_("'GeautomatiseerdeActor' was 'Actor'"), | ||
) | ||
functie = models.CharField( | ||
_("functie"), | ||
help_text=_( | ||
"Functie van de geautomatiseerde actor of beschrijving van de werkzaamheden die deze uitvoert." | ||
), | ||
max_length=40, | ||
) | ||
omschrijving = models.CharField( | ||
_("omschrijving"), | ||
help_text=_("Omschrijving van de geautomatiseerde actor."), | ||
max_length=200, | ||
blank=True, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("geautomatiseerde actor") | ||
verbose_name_plural = _("geautomatiseerde actoren") | ||
|
||
def __str__(self): | ||
return self.functie | ||
|
||
|
||
class Medewerker(models.Model): | ||
actor = models.ForeignKey( | ||
Actor, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("actor"), | ||
help_text=_("'GeautomatiseerdeActor' was 'Actor'"), | ||
) | ||
functie = models.CharField( | ||
_("functie"), | ||
help_text=_( | ||
"Functie van de geautomatiseerde actor of beschrijving van de werkzaamheden die deze uitvoert." | ||
), | ||
max_length=40, | ||
) | ||
emailadres = models.EmailField( | ||
_("e-mailadres"), | ||
help_text=_( | ||
"Elektronisch postadres waaronder de MEDEWERKER in de regel bereikbaar is." | ||
), | ||
blank=True, | ||
) | ||
telefoonnummer = models.CharField( | ||
_("telefoonnummer"), | ||
help_text=_( | ||
"Telefoonnummer waaronder de MEDEWERKER in de regel bereikbaar is." | ||
), | ||
max_length=20, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("medewerker") | ||
verbose_name_plural = _("mederwerkers") | ||
|
||
def __str__(self): | ||
return self.functie | ||
|
||
|
||
class OrganisatorischeEenheid(models.Model): | ||
actor = models.ForeignKey( | ||
Actor, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("actor"), | ||
help_text=_("'GeautomatiseerdeActor' was 'Actor'"), | ||
unique=True, | ||
) | ||
omschrijving = models.CharField( | ||
_("omschrijving"), | ||
help_text=_("Omschrijving van de geautomatiseerde actor."), | ||
max_length=200, | ||
blank=True, | ||
) | ||
emailadres = models.EmailField( | ||
_("e-mailadres"), | ||
help_text=_( | ||
"Elektronisch postadres waaronder de MEDEWERKER in de regel bereikbaar is." | ||
), | ||
blank=True, | ||
) | ||
faxnummer = models.CharField( | ||
_("faxnummer"), | ||
help_text=_( | ||
"Faxnummer waaronder de organisatorische eenheid in de regel bereikbaar is." | ||
), | ||
max_length=20, | ||
) | ||
telefoonnummer = models.CharField( | ||
_("telefoonnummer"), | ||
help_text=_( | ||
"Telefoonnummer waaronder de MEDEWERKER in de regel bereikbaar is." | ||
), | ||
max_length=20, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("organisatorische eenheid") | ||
|
||
def __str__(self): | ||
return self.omschrijving |
52 changes: 52 additions & 0 deletions
52
src/openklant/components/klantinteracties/models/constants.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,52 @@ | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from djchoices import ChoiceItem, DjangoChoices | ||
|
||
|
||
class Taakstatus(DjangoChoices): | ||
te_verwerken = ChoiceItem("te_verwerken", _("Het verzoek is afgehandeld.")) | ||
verwerkt = ChoiceItem("verwerkt", _("Het verzoek id buiten behandeling gesteld.")) | ||
|
||
|
||
class SoortBezoekadres(DjangoChoices): | ||
binnenlands_adres = ChoiceItem("binnenlands_adres", _("Binnenlands adres")) | ||
buitenlands_adres = ChoiceItem("binnenlands_adres", _("Buitenlands adres")) | ||
|
||
|
||
class AanduidingBijHuisnummer(DjangoChoices): | ||
bij = ChoiceItem("bij", _("Bij")) | ||
tegenover = ChoiceItem("tegenover", _("Tegenover")) | ||
|
||
|
||
class SoortCorrespondentieadres(DjangoChoices): | ||
postbusnummer = ChoiceItem("postbusnummer", _("Postbusnummer")) | ||
antwoordnummer = ChoiceItem("antwoordnummer", _("Antwoordnummer")) | ||
binnenlands_adres = ChoiceItem("binnenlands_adres", _("Binnenlands adres")) | ||
buitenlands_adres = ChoiceItem("buitenlands_adres", _("Buitenlands adres")) | ||
|
||
|
||
class SoortActor(DjangoChoices): | ||
medewerker = ChoiceItem("medewerker", _("Medewerker")) | ||
geautomatiseerde_actor = ChoiceItem( | ||
"geautomatiseerde_actor", _("Geautomatiseerde actor") | ||
) | ||
organisatorische_eenheid = ChoiceItem( | ||
"organisatorische_eenheid", _("Organisatorische eenheid") | ||
) | ||
|
||
|
||
class SoortInhoudsdeel(DjangoChoices): | ||
informatieobject = ChoiceItem("informatieobject", _("Informatieobject")) | ||
overig_object = ChoiceItem("overig_object", _("Overig object")) | ||
tekst = ChoiceItem("tekst", _("Tekst")) | ||
|
||
|
||
class SoortPartij(DjangoChoices): | ||
persoon = ChoiceItem("persoon", _("Persoon")) | ||
organisatie = ChoiceItem("organisatie", _("Organisatie")) | ||
contactpersoon = ChoiceItem("contactpersoon", _("Contactpersoon")) | ||
|
||
|
||
class Klantcontrol(DjangoChoices): | ||
vertegenwoordiger = ChoiceItem("vertegenwoordiger", _("Vertegenwoordiger")) | ||
klant = ChoiceItem("klant", _("Klant")) |
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
import uuid | ||
|
||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class DigitaalAdres(models.Model): | ||
uuid = models.UUIDField( | ||
unique=True, | ||
default=uuid.uuid4, | ||
help_text=_("Unieke (technische) identificatiecode van het digitaal adres."), | ||
) | ||
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=255, | ||
) | ||
adres = models.CharField( | ||
_("adres"), | ||
help_text=_( | ||
"Digitaal adres waarmee een persoon of organisatie bereikt kan worden." | ||
), | ||
max_length=80, | ||
) | ||
omschrijving = models.CharField( | ||
_("omschrijving"), | ||
help_text=_("Omschrijving van het digitaal adres."), | ||
max_length=40, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("digitaal adres") | ||
|
||
def __str__(self): | ||
return self.adres |
72 changes: 72 additions & 0 deletions
72
src/openklant/components/klantinteracties/models/internetaken.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,72 @@ | ||
import uuid | ||
|
||
from django.core.validators import validate_integer | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .actoren import Actor | ||
from .constants import Taakstatus | ||
from .klantcontacten import Klantcontact | ||
|
||
|
||
class InterneTaak(models.Model): | ||
uuid = models.UUIDField( | ||
unique=True, | ||
default=uuid.uuid4, | ||
help_text=_("Unieke (technische) identificatiecode van de interne taak."), | ||
) | ||
actor = models.ForeignKey( | ||
Actor, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("actor"), | ||
help_text=_("De actor aan wie de interne taak werd toegewezen."), | ||
) | ||
klantcontact = models.ForeignKey( | ||
Klantcontact, | ||
on_delete=models.CASCADE, | ||
verbose_name=_("klantcontact"), | ||
help_text=_( | ||
"Het klantcontact dat aanleiding gaf tot het ontstaan van een interne taak." | ||
), | ||
) | ||
nummer = models.CharField( | ||
_("nummer"), | ||
help_text=_( | ||
"Uniek identificerend nummer dat tijdens communicatie tussen mensen kan " | ||
"worden gebruikt om de specifieke interne taak aan te duiden." | ||
), | ||
validators=[validate_integer], | ||
max_length=10, | ||
) | ||
gevraagde_handeling = models.CharField( | ||
_("gevraagde handeling"), | ||
help_text=_("Handeling die moet worden uitgevoerd om de taak af te ronden."), | ||
max_length=200, | ||
) | ||
toelichting = models.TextField( | ||
_("toelichting"), | ||
help_text=_( | ||
"Toelichting die, aanvullend bij de inhoud van het klantcontact dat " | ||
"aanleiding gaf tot de taak en de gevraagde handeling, " | ||
"bijdraagt aan het kunnen afhandelen van de taak." | ||
), | ||
max_length=400, | ||
) | ||
status = models.CharField( | ||
_("status"), | ||
help_text=_("Aanduiding van de vordering bij afhandeling van de interne taak."), | ||
choices=Taakstatus.choices, | ||
max_length=12, | ||
) | ||
toegewezen_op = models.DateTimeField( | ||
_("toegewezen op"), | ||
help_text=_( | ||
"Datum en tijdstip waarop de interne taak aan een actor werd toegewezen." | ||
), | ||
auto_now_add=True, | ||
blank=False, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("interne taak") | ||
verbose_name_plural = _("interne taken") |
Oops, something went wrong.