Skip to content

Commit

Permalink
Merge pull request #1422 from open-zaak/feature/1421-add-catalogus
Browse files Browse the repository at this point in the history
Feature/1421 add catalogus
  • Loading branch information
annashamray committed Aug 14, 2023
2 parents 69c63cd + 451249f commit cd06259
Show file tree
Hide file tree
Showing 18 changed files with 150 additions and 7 deletions.
18 changes: 17 additions & 1 deletion src/openzaak/components/catalogi/api/serializers/eigenschap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from drf_writable_nested import NestedCreateMixin, NestedUpdateMixin
from rest_framework import serializers
from vng_api_common.serializers import add_choice_values_help_text
from vng_api_common.utils import get_help_text

from openzaak.utils.validators import UniqueTogetherValidator

Expand Down Expand Up @@ -36,10 +37,25 @@ class EigenschapSerializer(
specificatie = EigenschapSpecificatieSerializer(
source="specificatie_van_eigenschap"
)
catalogus = serializers.HyperlinkedRelatedField(
view_name="catalogus-detail",
source="zaaktype.catalogus",
read_only=True,
lookup_field="uuid",
help_text=get_help_text("catalogi.ZaakType", "catalogus"),
)

class Meta:
model = Eigenschap
fields = ("url", "naam", "definitie", "specificatie", "toelichting", "zaaktype")
fields = (
"url",
"naam",
"definitie",
"specificatie",
"toelichting",
"zaaktype",
"catalogus",
)
extra_kwargs = {
"url": {"lookup_field": "uuid"},
"naam": {"source": "eigenschapnaam"},
Expand Down
10 changes: 10 additions & 0 deletions src/openzaak/components/catalogi/api/serializers/relatieklassen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from rest_framework import serializers
from vng_api_common.serializers import add_choice_values_help_text
from vng_api_common.utils import get_help_text

from openzaak.utils.validators import UniqueTogetherValidator

Expand All @@ -19,6 +20,14 @@ class ZaakTypeInformatieObjectTypeSerializer(serializers.HyperlinkedModelSeriali
Relatie met informatieobjecttype dat relevant is voor zaaktype.
"""

catalogus = serializers.HyperlinkedRelatedField(
view_name="catalogus-detail",
source="zaaktype.catalogus",
read_only=True,
lookup_field="uuid",
help_text=get_help_text("catalogi.ZaakType", "catalogus"),
)

class Meta:
model = ZaakTypeInformatieObjectType
fields = (
Expand All @@ -28,6 +37,7 @@ class Meta:
"volgnummer",
"richting",
"statustype",
"catalogus",
)
extra_kwargs = {
"url": {"lookup_field": "uuid"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
NestedGegevensGroepMixin,
add_choice_values_help_text,
)
from vng_api_common.utils import get_help_text

from openzaak.utils.validators import ResourceValidator, UniqueTogetherValidator

Expand Down Expand Up @@ -58,6 +59,13 @@ class ResultaatTypeSerializer(
"start van de Archiefactietermijn (=brondatum) van het zaakdossier."
),
)
catalogus = serializers.HyperlinkedRelatedField(
view_name="catalogus-detail",
source="zaaktype.catalogus",
read_only=True,
lookup_field="uuid",
help_text=get_help_text("catalogi.ZaakType", "catalogus"),
)

class Meta:
model = ResultaatType
Expand All @@ -72,6 +80,7 @@ class Meta:
"archiefnominatie",
"archiefactietermijn",
"brondatum_archiefprocedure",
"catalogus",
)
extra_kwargs = {
"url": {"lookup_field": "uuid"},
Expand Down
17 changes: 16 additions & 1 deletion src/openzaak/components/catalogi/api/serializers/roltype.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,30 @@
from rest_framework import serializers
from vng_api_common.constants import RolOmschrijving
from vng_api_common.serializers import add_choice_values_help_text
from vng_api_common.utils import get_help_text

from ...models import RolType
from ..validators import ZaakTypeConceptValidator


class RolTypeSerializer(NestedCreateMixin, serializers.HyperlinkedModelSerializer):
catalogus = serializers.HyperlinkedRelatedField(
view_name="catalogus-detail",
source="zaaktype.catalogus",
read_only=True,
lookup_field="uuid",
help_text=get_help_text("catalogi.ZaakType", "catalogus"),
)

class Meta:
model = RolType
fields = ("url", "zaaktype", "omschrijving", "omschrijving_generiek")
fields = (
"url",
"zaaktype",
"omschrijving",
"omschrijving_generiek",
"catalogus",
)
extra_kwargs = {
"url": {"lookup_field": "uuid"},
"zaaktype": {"lookup_field": "uuid"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.utils.translation import ugettext_lazy as _

from rest_framework import serializers
from vng_api_common.utils import get_help_text

from ...models import StatusType
from ..validators import ZaakTypeConceptValidator
Expand All @@ -17,6 +18,13 @@ class StatusTypeSerializer(serializers.HyperlinkedModelSerializer):
"met het hoogste volgnummer."
),
)
catalogus = serializers.HyperlinkedRelatedField(
view_name="catalogus-detail",
source="zaaktype.catalogus",
read_only=True,
lookup_field="uuid",
help_text=get_help_text("catalogi.ZaakType", "catalogus"),
)

class Meta:
model = StatusType
Expand All @@ -29,6 +37,7 @@ class Meta:
"volgnummer",
"is_eindstatus",
"informeren",
"catalogus",
)
extra_kwargs = {
"url": {"lookup_field": "uuid"},
Expand Down
4 changes: 3 additions & 1 deletion src/openzaak/components/catalogi/api/viewsets/eigenschap.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class EigenschapViewSet(

queryset = (
Eigenschap.objects.all()
.select_related("specificatie_van_eigenschap", "zaaktype")
.select_related(
"specificatie_van_eigenschap", "zaaktype", "zaaktype__catalogus"
)
.order_by("-pk")
)
serializer_class = EigenschapSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ZaakTypeInformatieObjectTypeViewSet(

queryset = (
ZaakTypeInformatieObjectType.objects.all()
.select_related("zaaktype", "informatieobjecttype")
.select_related("zaaktype", "informatieobjecttype", "zaaktype__catalogus")
.order_by("-pk")
)
serializer_class = ZaakTypeInformatieObjectTypeSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ class ResultaatTypeViewSet(
een concept betreft.
"""

queryset = ResultaatType.objects.all().select_related("zaaktype").order_by("-pk")
queryset = (
ResultaatType.objects.all()
.select_related("zaaktype", "zaaktype__catalogus")
.order_by("-pk")
)
serializer_class = ResultaatTypeSerializer
filter_class = ResultaatTypeFilter
lookup_field = "uuid"
Expand Down
4 changes: 3 additions & 1 deletion src/openzaak/components/catalogi/api/viewsets/roltype.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class RolTypeViewSet(
concept betreft.
"""

queryset = RolType.objects.select_related("zaaktype").order_by("-pk")
queryset = RolType.objects.select_related(
"zaaktype", "zaaktype__catalogus"
).order_by("-pk")
serializer_class = RolTypeSerializer
filterset_class = RolTypeFilter
lookup_field = "uuid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class StatusTypeViewSet(
"""

queryset = (
StatusType.objects.select_related("zaaktype")
StatusType.objects.select_related("zaaktype", "zaaktype__catalogus")
.prefetch_related("zaaktype__statustypen")
.order_by("-pk")
.all()
Expand Down
30 changes: 30 additions & 0 deletions src/openzaak/components/catalogi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4570,6 +4570,12 @@ components:
EIGENSCHAP van belang is.
type: string
format: uri
catalogus:
title: Catalogus
description: URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.
type: string
format: uri
readOnly: true
InformatieObjectType:
required:
- catalogus
Expand Down Expand Up @@ -4924,6 +4930,12 @@ components:
nullable: true
brondatumArchiefprocedure:
$ref: '#/components/schemas/BrondatumArchiefprocedure'
catalogus:
title: Catalogus
description: URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.
type: string
format: uri
readOnly: true
RolType:
required:
- zaaktype
Expand Down Expand Up @@ -4977,6 +4989,12 @@ components:
- klantcontacter
- zaakcoordinator
- mede_initiator
catalogus:
title: Catalogus
description: URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.
type: string
format: uri
readOnly: true
StatusType:
required:
- omschrijving
Expand Down Expand Up @@ -5037,6 +5055,12 @@ components:
description: "Aanduiding die aangeeft of na het zetten van een STATUS van\
\ dit STATUSTYPE de Initiator moet worden ge\xEFnformeerd over de statusovergang."
type: boolean
catalogus:
title: Catalogus
description: URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.
type: string
format: uri
readOnly: true
ZaakTypeInformatieObjectType:
required:
- zaaktype
Expand Down Expand Up @@ -5097,6 +5121,12 @@ components:
type: string
format: uri
nullable: true
catalogus:
title: Catalogus
description: URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.
type: string
format: uri
readOnly: true
ReferentieProces:
description: Het Referentieproces dat ten grondslag ligt aan dit ZAAKTYPE.
required:
Expand Down
5 changes: 5 additions & 0 deletions src/openzaak/components/catalogi/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Objecttype op [GEMMA Online](https://www.gemmaonline.nl/index.php/Rgbz_1.0/doc/o
| definitie | De beschrijving van de betekenis van deze EIGENSCHAP | string | ja | C​R​U​D |
| toelichting | Een toelichting op deze EIGENSCHAP en het belang hiervan voor zaken van dit ZAAKTYPE. | string | nee | C​R​U​D |
| zaaktype | URL-referentie naar het ZAAKTYPE van de ZAAKen waarvoor deze EIGENSCHAP van belang is. | string | ja | C​R​U​D |
| catalogus | URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort. | string | nee | ~~C~~​R​~~U~~~~D~~ |

## InformatieObjectType

Expand Down Expand Up @@ -118,6 +119,7 @@ Uitleg bij mogelijke waarden:
* `blijvend_bewaren` - Het zaakdossier moet bewaard blijven en op de Archiefactiedatum overgedragen worden naar een archiefbewaarplaats.
* `vernietigen` - Het zaakdossier moet op of na de Archiefactiedatum vernietigd worden. | string | nee | C​R​U​D |
| archiefactietermijn | De termijn, na het vervallen van het bedrjfsvoeringsbelang, waarna het zaakdossier (de ZAAK met alle bijbehorende INFORMATIEOBJECTen) van een ZAAK met een resultaat van dit RESULTAATTYPE vernietigd of overgebracht (naar een archiefbewaarplaats) moet worden. Voor te vernietigen dossiers betreft het de in die Selectielijst genoemde bewaartermjn. Voor blijvend te bewaren zaakdossiers betreft het de termijn vanaf afronding van de zaak tot overbrenging (de procestermijn is dan nihil). | string | nee | C​R​U​D |
| catalogus | URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort. | string | nee | ~~C~~​R​~~U~~~~D~~ |

## RolType

Expand All @@ -140,6 +142,7 @@ Uitleg bij mogelijke waarden:
* `klantcontacter` - (Klantcontacter) Het eerste aanspreekpunt zijn voor vragen van burgers en bedrijven ..
* `zaakcoordinator` - (Zaakcoördinator) Er voor zorg dragen dat de behandeling van de zaak in samenhang uitgevoerd wordt conform de daarover gemaakte afspraken.
* `mede_initiator` - Mede-initiator | string | ja | C​R​U​D |
| catalogus | URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort. | string | nee | ~~C~~​R​~~U~~~~D~~ |

## StatusType

Expand All @@ -155,6 +158,7 @@ Objecttype op [GEMMA Online](https://www.gemmaonline.nl/index.php/Rgbz_1.0/doc/o
| volgnummer | Een volgnummer voor statussen van het STATUSTYPE binnen een zaak. | integer | ja | C​R​U​D |
| isEindstatus | Geeft aan dat dit STATUSTYPE een eindstatus betreft. Dit gegeven is afgeleid uit alle STATUSTYPEn van dit ZAAKTYPE met het hoogste volgnummer. | boolean | nee | ~~C~~​R​~~U~~~~D~~ |
| informeren | Aanduiding die aangeeft of na het zetten van een STATUS van dit STATUSTYPE de Initiator moet worden geïnformeerd over de statusovergang. | boolean | nee | C​R​U​D |
| catalogus | URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort. | string | nee | ~~C~~​R​~~U~~~~D~~ |

## ZaakTypeInformatieObjectType

Expand All @@ -174,6 +178,7 @@ Uitleg bij mogelijke waarden:
* `intern` - Intern
* `uitgaand` - Uitgaand | string | ja | C​R​U​D |
| statustype | URL-referentie naar het STATUSTYPE waarbij deze INFORMATIEOBJECTTYPEn verplicht aanwezig moeten zijn. | string | nee | C​R​U​D |
| catalogus | URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort. | string | nee | ~~C~~​R​~~U~~~~D~~ |

## ZaakTypenRelatie

Expand Down
35 changes: 35 additions & 0 deletions src/openzaak/components/catalogi/swagger2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -5825,6 +5825,13 @@
"description": "URL-referentie naar het ZAAKTYPE van de ZAAKen waarvoor deze EIGENSCHAP van belang is.",
"type": "string",
"format": "uri"
},
"catalogus": {
"title": "Catalogus",
"description": "URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.",
"type": "string",
"format": "uri",
"readOnly": true
}
}
},
Expand Down Expand Up @@ -6060,6 +6067,13 @@
},
"brondatumArchiefprocedure": {
"$ref": "#/definitions/BrondatumArchiefprocedure"
},
"catalogus": {
"title": "Catalogus",
"description": "URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.",
"type": "string",
"format": "uri",
"readOnly": true
}
}
},
Expand Down Expand Up @@ -6107,6 +6121,13 @@
"zaakcoordinator",
"mede_initiator"
]
},
"catalogus": {
"title": "Catalogus",
"description": "URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.",
"type": "string",
"format": "uri",
"readOnly": true
}
}
},
Expand Down Expand Up @@ -6169,6 +6190,13 @@
"title": "Informeren",
"description": "Aanduiding die aangeeft of na het zetten van een STATUS van dit STATUSTYPE de Initiator moet worden ge\u00efnformeerd over de statusovergang.",
"type": "boolean"
},
"catalogus": {
"title": "Catalogus",
"description": "URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.",
"type": "string",
"format": "uri",
"readOnly": true
}
}
},
Expand Down Expand Up @@ -6225,6 +6253,13 @@
"type": "string",
"format": "uri",
"x-nullable": true
},
"catalogus": {
"title": "Catalogus",
"description": "URL-referentie naar de CATALOGUS waartoe dit ZAAKTYPE behoort.",
"type": "string",
"format": "uri",
"readOnly": true
}
}
},
Expand Down

0 comments on commit cd06259

Please sign in to comment.