コード例 #1
0
 class Meta:
     model = ResultaatType
     fields = (
         "url",
         "zaaktype",
         "omschrijving",
         "resultaattypeomschrijving",
         "omschrijving_generiek",
         "selectielijstklasse",
         "toelichting",
         "archiefnominatie",
         "archiefactietermijn",
         "brondatum_archiefprocedure",
     )
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "resultaattypeomschrijving": {
             "validators": [
                 ResourceValidator(
                     "ResultaattypeOmschrijvingGeneriek",
                     settings.REFERENTIELIJSTEN_API_SPEC,
                 )
             ]
         },
         "omschrijving_generiek": {
             "read_only":
             True,
             "help_text":
             _("Waarde van de omschrijving-generiek referentie (attribuut `omschrijving`)"
               ),
         },
         "zaaktype": {
             "lookup_field": "uuid",
             "label": _("is van")
         },
         "selectielijstklasse": {
             "validators": [
                 ResourceValidator("Resultaat",
                                   settings.REFERENTIELIJSTEN_API_SPEC)
             ]
         },
     }
     validators = [
         UniqueTogetherValidator(
             queryset=ResultaatType.objects.all(),
             fields=["zaaktype", "omschrijving"],
         ),
         ProcesTypeValidator("selectielijstklasse"),
         ProcestermijnAfleidingswijzeValidator("selectielijstklasse"),
         BrondatumArchiefprocedureValidator(),
         ZaakTypeConceptValidator(),
     ]
コード例 #2
0
 class Meta:
     model = ResultaatType
     fields = (
         'url',
         'zaaktype',
         'omschrijving',
         'resultaattypeomschrijving',
         'omschrijving_generiek',
         'selectielijstklasse',
         'toelichting',
         'archiefnominatie',
         'archiefactietermijn',
         'brondatum_archiefprocedure',
     )
     extra_kwargs = {
         'url': {
             'lookup_field': 'uuid',
         },
         'resultaattypeomschrijving': {
             'validators': [
                 ResourceValidator('ResultaattypeOmschrijvingGeneriek',
                                   settings.REFERENTIELIJSTEN_API_SPEC)
             ],
         },
         'omschrijving_generiek': {
             'read_only':
             True,
             'help_text':
             _("Waarde van de omschrijving-generiek referentie (attribuut `omschrijving`)"
               ),
         },
         'zaaktype': {
             'lookup_field': 'uuid',
             'label': _('is van'),
         },
         'selectielijstklasse': {
             'validators': [
                 ResourceValidator('Resultaat',
                                   settings.REFERENTIELIJSTEN_API_SPEC)
             ],
         },
     }
     validators = [
         UniqueTogetherValidator(
             queryset=ResultaatType.objects.all(),
             fields=['zaaktype', 'omschrijving'],
         ),
         ProcesTypeValidator('selectielijstklasse'),
         ProcestermijnAfleidingswijzeValidator('selectielijstklasse'),
     ]
コード例 #3
0
 class Meta:
     model = VerzoekInformatieObject
     fields = ("url", "informatieobject", "verzoek")
     validators = [
         UniqueTogetherValidator(
             queryset=VerzoekInformatieObject.objects.all(),
             fields=["verzoek", "informatieobject"],
         ),
     ]
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "informatieobject": {
             "validators": [
                 ResourceValidator(
                     "EnkelvoudigInformatieObject",
                     settings.DRC_API_SPEC,
                     get_auth=get_auth,
                 ),
                 IsImmutableValidator(),
             ]
         },
         "verzoek": {
             "lookup_field": "uuid",
             "validators": [IsImmutableValidator()]
         },
     }
コード例 #4
0
    def _clean_selectielijstklasse(self):
        """
        Validate that the selectielijstklasse is relevant for the zaaktype.procestype
        """
        selectielijstklasse = self.cleaned_data.get("selectielijstklasse")
        zaaktype = self.cleaned_data.get("zaaktype")

        if not selectielijstklasse or not zaaktype:
            # nothing to do
            return

        response = requests.get(selectielijstklasse)
        try:
            response.raise_for_status()
        except requests.HTTPError as exc:
            msg = (_("URL %s for selectielijstklasse did not resolve") %
                   selectielijstklasse)
            err = forms.ValidationError(msg, code="invalid")
            raise forms.ValidationError({"selectielijstklasse": err}) from exc

        try:
            # Check whether the url points to a Resultaat
            ResourceValidator("Resultaat", API_SPEC)(selectielijstklasse)
        except ValidationError as exc:
            err = forms.ValidationError(exc.detail[0], code=exc.detail[0].code)
            raise forms.ValidationError({"selectielijstklasse": err}) from exc

        procestype = response.json()["procesType"]
        if procestype != zaaktype.selectielijst_procestype:
            msg = _(
                "De selectielijstklasse hoort niet bij het selectielijst procestype van het zaaktype"
            )
            self.add_error("selectielijstklasse",
                           forms.ValidationError(msg, code="invalid"))
コード例 #5
0
ファイル: forms.py プロジェクト: tiltshiftnl/open-zaak
    def _clean_selectielijstklasse(self):
        """
        Validate that the selectielijstklasse is relevant for the zaaktype.procestype
        """
        selectielijstklasse = self.cleaned_data.get("selectielijstklasse")
        zaaktype = self.cleaned_data.get("zaaktype")

        if not selectielijstklasse or not zaaktype:
            # nothing to do
            return

        response = requests.get(selectielijstklasse)
        try:
            response.raise_for_status()
        except requests.HTTPError as exc:
            msg = (
                _("URL %s for selectielijstklasse did not resolve")
                % selectielijstklasse
            )
            err = forms.ValidationError(msg, code="invalid")
            raise forms.ValidationError({"selectielijstklasse": err}) from exc

        validator = ResourceValidator("Resultaat", settings.VRL_API_SPEC)
        try:
            # Check whether the url points to a Resultaat
            validator(selectielijstklasse)
        except ValidationError as exc:
            err = forms.ValidationError(exc.detail[0], code=exc.detail[0].code)
            raise forms.ValidationError({"selectielijstklasse": err}) from exc

        procestype = response.json()["procesType"]
        if procestype != zaaktype.selectielijst_procestype:
            if not zaaktype.selectielijst_procestype:
                edit_zaaktype = reverse(
                    "admin:catalogi_zaaktype_change", args=(zaaktype.pk,)
                )
                err = format_html(
                    '{msg} <a href="{url}#id_selectielijst_procestype">{url_text}</a>',
                    msg=_(
                        "Er is geen Selectielijst-procestype gedefinieerd op het zaaktype!"
                    ),
                    url=edit_zaaktype,
                    url_text=_("Zaaktype bewerken"),
                )

                self.add_error("selectielijstklasse", err)
            else:
                msg = _(
                    "De selectielijstklasse hoort niet bij het selectielijst "
                    "procestype van het zaaktype"
                )
                self.add_error(
                    "selectielijstklasse", forms.ValidationError(msg, code="invalid")
                )
コード例 #6
0
    def __call__(self, context: OrderedDict):
        object_url = context["object"]
        informatieobject_uuid = str(
            context["informatieobject"].latest_version.uuid)
        object_type = context["object_type"]

        informatieobject_url = get_absolute_url(
            "enkelvoudiginformatieobject-detail", uuid=informatieobject_uuid)

        # dynamic so that it can be mocked in tests easily
        Client = import_string(settings.ZDS_CLIENT_CLASS)
        client = Client.from_url(object_url)
        client.auth = APICredential.get_auth(object_url)
        try:
            if object_type == "zaak":
                resource = "zaakinformatieobject"
                component = "ZRC"
                oas_schema = settings.ZRC_API_SPEC
            elif object_type == "besluit":
                resource = "besluitinformatieobject"
                component = "BRC"
                oas_schema = settings.BRC_API_SPEC

            try:
                ResourceValidator(
                    object_type.capitalize(),
                    oas_schema,
                    get_auth=get_zrc_auth,
                    headers={"Accept-Crs": "EPSG:4326"},
                )(object_url)
            except exceptions.ValidationError as exc:
                raise serializers.ValidationError({"object": exc.detail},
                                                  code=ResourceValidator.code)

            oios = client.list(
                resource,
                query_params={
                    object_type: object_url,
                    "informatieobject": informatieobject_url,
                },
            )

        except ClientError as exc:
            raise serializers.ValidationError(
                exc.args[0], code="relation-validation-error") from exc

        if len(oios) == 0:
            raise serializers.ValidationError(
                self.message.format(component=component), code=self.code)
コード例 #7
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = RelevanteZaakRelatie
     fields = ("url", "aard_relatie")
     extra_kwargs = {
         "url": {
             "validators": [
                 ResourceValidator(
                     "Zaak",
                     settings.ZRC_API_SPEC,
                     get_auth=get_auth,
                     headers={"Accept-Crs": "EPSG:4326"},
                 )
             ]
         }
     }
コード例 #8
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = Rol
     fields = (
         "url",
         "uuid",
         "zaak",
         "betrokkene",
         "betrokkene_type",
         "roltype",
         "omschrijving",
         "omschrijving_generiek",
         "roltoelichting",
         "registratiedatum",
         "indicatie_machtiging",
     )
     validators = [
         RolOccurenceValidator(RolOmschrijving.initiator, max_amount=1),
         RolOccurenceValidator(RolOmschrijving.zaakcoordinator,
                               max_amount=1),
         CorrectZaaktypeValidator("roltype"),
     ]
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "zaak": {
             "lookup_field": "uuid"
         },
         "betrokkene": {
             "required": False
         },
         "roltype": {
             "validators": [
                 IsImmutableValidator(),
                 ResourceValidator("RolType",
                                   settings.ZTC_API_SPEC,
                                   get_auth=get_auth),
             ]
         },
     }
コード例 #9
0
    def __call__(self, attrs: OrderedDict):
        object_url = attrs["object"]
        object_type = attrs["object_type"]
        klantinteractie_url = get_absolute_url(
            f"{self.resource_name}-detail",
            uuid=attrs[self.resource_name].uuid)

        # dynamic so that it can be mocked in tests easily
        Client = import_string(settings.ZDS_CLIENT_CLASS)
        client = Client.from_url(object_url)
        client.auth = APICredential.get_auth(object_url)

        resource = f"{object_type}{self.resource_name}"
        oas_schema = settings.ZRC_API_SPEC

        try:
            ResourceValidator(
                object_type.capitalize(),
                oas_schema,
                get_auth=get_auth,
                headers={"Accept-Crs": "EPSG:4326"},
            )(object_url)
        except exceptions.ValidationError as exc:
            raise serializers.ValidationError({"object": exc.detail},
                                              code=ResourceValidator.code)

        try:
            relations = client.list(
                resource,
                query_params={
                    object_type: object_url,
                    f"{self.resource_name}": klantinteractie_url,
                },
            )

        except ClientError as exc:
            raise serializers.ValidationError(
                exc.args[0], code="relation-validation-error") from exc

        if len(relations) == 0:
            raise serializers.ValidationError(
                self.message.format(object=object_type), code=self.code)
コード例 #10
0
ファイル: forms.py プロジェクト: tiltshiftnl/open-zaak
    def _validate_external_types(self, component):
        _field_info = COMPONENT_TO_FIELDS_MAP.get(component)
        if _field_info is None:
            return

        external_typen = self.cleaned_data.get("externe_typen")

        if not external_typen:
            return

        validator = ResourceValidator(_field_info["resource_name"],
                                      settings.ZTC_API_SPEC,
                                      get_auth=get_auth)
        for _type in external_typen:
            try:
                validator(_type)
            except exceptions.ValidationError as exc:
                error = forms.ValidationError(str(exc.detail[0]),
                                              code=exc.detail[0].code)
                self.add_error("externe_typen", error)
コード例 #11
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = ZaakInformatieObject
     fields = (
         "url",
         "uuid",
         "informatieobject",
         "zaak",
         "aard_relatie_weergave",
         "titel",
         "beschrijving",
         "registratiedatum",
     )
     validators = [
         UniqueTogetherValidator(
             queryset=ZaakInformatieObject.objects.all(),
             fields=["zaak", "informatieobject"],
         ),
         ZaaktypeInformatieobjecttypeRelationValidator("informatieobject"),
     ]
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "informatieobject": {
             "validators": [
                 ResourceValidator(
                     "EnkelvoudigInformatieObject",
                     settings.DRC_API_SPEC,
                     get_auth=get_auth,
                 ),
                 IsImmutableValidator(),
             ]
         },
         "zaak": {
             "lookup_field": "uuid",
             "validators": [IsImmutableValidator()]
         },
     }
コード例 #12
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = ZaakVerzoek
     fields = ("url", "uuid", "zaak", "verzoek")
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "zaak": {
             "lookup_field": "uuid"
         },
         "verzoek": {
             "validators": [
                 ResourceValidator("Verzoek",
                                   settings.VRC_API_SPEC,
                                   get_auth=get_auth)
             ]
         },
     }
コード例 #13
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = ZaakContactMoment
     fields = ("url", "uuid", "zaak", "contactmoment")
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "zaak": {
             "lookup_field": "uuid"
         },
         "contactmoment": {
             "validators": [
                 ResourceValidator("ContactMoment",
                                   settings.CMC_API_SPEC,
                                   get_auth=get_auth)
             ]
         },
     }
コード例 #14
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = Resultaat
     fields = ("url", "uuid", "zaak", "resultaattype", "toelichting")
     validators = [CorrectZaaktypeValidator("resultaattype")]
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "zaak": {
             "lookup_field": "uuid"
         },
         "resultaattype": {
             "validators": [
                 IsImmutableValidator(),
                 ResourceValidator("ResultaatType",
                                   settings.ZTC_API_SPEC,
                                   get_auth=get_auth),
             ]
         },
     }
コード例 #15
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = ZaakEigenschap
     fields = ("url", "uuid", "zaak", "eigenschap", "naam", "waarde")
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "eigenschap": {
             "validators": [
                 ResourceValidator("Eigenschap",
                                   settings.ZTC_API_SPEC,
                                   get_auth=get_auth),
                 IsImmutableValidator(),
             ]
         },
         "naam": {
             "source": "_naam",
             "read_only": True
         },
     }
     validators = [CorrectZaaktypeValidator("eigenschap")]
コード例 #16
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = Status
     fields = (
         "url",
         "uuid",
         "zaak",
         "statustype",
         "datum_status_gezet",
         "statustoelichting",
     )
     validators = [
         CorrectZaaktypeValidator("statustype"),
         UniqueTogetherValidator(queryset=Status.objects.all(),
                                 fields=["zaak", "datum_status_gezet"]),
     ]
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "zaak": {
             "lookup_field": "uuid"
         },
         "statustype": {
             "validators": [
                 ResourceValidator("StatusType",
                                   settings.ZTC_API_SPEC,
                                   get_auth=get_auth)
             ]
         },
         "datum_status_gezet": {
             "validators": [DateNotInFutureValidator()]
         },
     }
コード例 #17
0
    class Meta:
        model = ZaakType
        fields = (
            "url",
            "identificatie",
            "omschrijving",
            "omschrijving_generiek",
            "vertrouwelijkheidaanduiding",
            "doel",
            "aanleiding",
            "toelichting",
            "indicatie_intern_of_extern",
            "handeling_initiator",
            "onderwerp",
            "handeling_behandelaar",
            "doorlooptijd",
            "servicenorm",
            "opschorting_en_aanhouding_mogelijk",
            "verlenging_mogelijk",
            "verlengingstermijn",
            "trefwoorden",
            "publicatie_indicatie",
            "publicatietekst",
            "verantwoordingsrelatie",
            "producten_of_diensten",
            "selectielijst_procestype",
            "referentieproces",
            "catalogus",
            "statustypen",
            "resultaattypen",
            "eigenschappen",
            "informatieobjecttypen",
            "roltypen",
            "besluittypen",
            "deelzaaktypen",
            "gerelateerde_zaaktypen",
            "begin_geldigheid",
            "einde_geldigheid",
            "versiedatum",
            "concept",
        )
        extra_kwargs = {
            "url": {"lookup_field": "uuid"},
            "omschrijving": {"source": "zaaktype_omschrijving"},
            "omschrijving_generiek": {"source": "zaaktype_omschrijving_generiek"},
            "catalogus": {"lookup_field": "uuid"},
            "doorlooptijd": {"source": "doorlooptijd_behandeling"},
            "servicenorm": {"source": "servicenorm_behandeling"},
            "begin_geldigheid": {"source": "datum_begin_geldigheid"},
            "einde_geldigheid": {"source": "datum_einde_geldigheid"},
            "concept": {"read_only": True},
            "selectielijst_procestype": {
                "validators": [
                    ResourceValidator("ProcesType", settings.REFERENTIELIJSTEN_API_SPEC)
                ]
            },
            "deelzaaktypen": {"lookup_field": "uuid"},
        }

        validators = [
            ZaaktypeGeldigheidValidator(),
            RelationCatalogValidator("besluittypen"),
            ConceptUpdateValidator(),
            M2MConceptCreateValidator(["besluittypen", "informatieobjecttypen"]),
            M2MConceptUpdateValidator(["besluittypen", "informatieobjecttypen"]),
            DeelzaaktypeCatalogusValidator(),
        ]
コード例 #18
0
    class Meta:
        model = ZaakType
        fields = (
            'url',
            'identificatie',
            'omschrijving',
            'omschrijving_generiek',
            'vertrouwelijkheidaanduiding',
            # 'zaakcategorie',
            'doel',
            'aanleiding',
            'toelichting',
            'indicatie_intern_of_extern',
            'handeling_initiator',
            'onderwerp',
            'handeling_behandelaar',
            'doorlooptijd',
            'servicenorm',
            'opschorting_en_aanhouding_mogelijk',
            'verlenging_mogelijk',
            'verlengingstermijn',
            'trefwoorden',
            # 'archiefclassificatiecode',
            # 'vertrouwelijkheidAanduiding',
            # 'verantwoordelijke',
            'publicatie_indicatie',
            'publicatietekst',
            'verantwoordingsrelatie',
            'producten_of_diensten',
            'selectielijst_procestype',
            # 'formulier',
            'referentieproces',
            # 'broncatalogus',
            # 'bronzaaktype',

            # 'ingangsdatumObject',
            # 'versiedatum',
            # 'einddatumObject',

            # relaties
            'catalogus',
            'statustypen',
            'resultaattypen',
            'eigenschappen',
            'informatieobjecttypen',
            'roltypen',
            'besluittypen',
            'gerelateerde_zaaktypen',
            # # 'heeftRelevantZaakObjecttype',
            # # 'isDeelzaaktypeVan',
            'begin_geldigheid',
            'einde_geldigheid',
            'versiedatum',
            'concept',
        )
        extra_kwargs = {
            'url': {
                'lookup_field': 'uuid',
            },
            'identificatie': {
                'source': 'zaaktype_identificatie',
            },
            'omschrijving': {
                'source': 'zaaktype_omschrijving',
            },
            'omschrijving_generiek': {
                'source': 'zaaktype_omschrijving_generiek',
            },
            'catalogus': {
                'lookup_field': 'uuid',
            },
            'doorlooptijd': {
                'source': 'doorlooptijd_behandeling',
            },
            'servicenorm': {
                'source': 'servicenorm_behandeling',
            },
            'begin_geldigheid': {
                'source': 'datum_begin_geldigheid'
            },
            'einde_geldigheid': {
                'source': 'datum_einde_geldigheid'
            },
            'concept': {
                'read_only': True,
            },
            'selectielijst_procestype': {
                'validators': [
                    ResourceValidator('ProcesType',
                                      settings.REFERENTIELIJSTEN_API_SPEC)
                ],
            },
        }

        # expandable_fields = {
        #     'catalogus': ('ztc.api.serializers.CatalogusSerializer', {'source': 'catalogus'}),
        # }
        validators = [
            ZaaktypeGeldigheidValidator(),
            RelationCatalogValidator('besluittype_set'),
        ]
コード例 #19
0
    class Meta:
        model = Zaak
        fields = (
            'url',
            'identificatie',
            'bronorganisatie',
            'omschrijving',
            'toelichting',
            'zaaktype',
            'registratiedatum',
            'verantwoordelijke_organisatie',
            'startdatum',
            'einddatum',
            'einddatum_gepland',
            'uiterlijke_einddatum_afdoening',
            'publicatiedatum',
            'communicatiekanaal',
            # TODO: add shape validator once we know the shape
            'producten_of_diensten',
            'vertrouwelijkheidaanduiding',
            'betalingsindicatie',
            'betalingsindicatie_weergave',
            'laatste_betaaldatum',
            'zaakgeometrie',
            'verlenging',
            'opschorting',
            'selectielijstklasse',
            'hoofdzaak',
            'deelzaken',
            'relevante_andere_zaken',

            # read-only veld, on-the-fly opgevraagd
            'status',

            # Writable inline resource, as opposed to eigenschappen for demo
            # purposes. Eventually, we need to choose one form.
            'kenmerken',

            # Archiving
            'archiefnominatie',
            'archiefstatus',
            'archiefactiedatum',
            'resultaat',
        )
        extra_kwargs = {
            'url': {
                'lookup_field': 'uuid',
            },
            'zaakgeometrie': {
                'help_text':
                'Punt, lijn of (multi-)vlak geometrie-informatie, in GeoJSON.'
            },
            'zaaktype': {
                # TODO: does order matter here with the default validators?
                'validators': [URLValidator(get_auth=get_auth)],
            },
            'einddatum': {
                'read_only': True
            },
            'communicatiekanaal': {
                'validators': [
                    ResourceValidator('CommunicatieKanaal',
                                      settings.REFERENTIELIJSTEN_API_SPEC)
                ]
            },
            'vertrouwelijkheidaanduiding': {
                'required':
                False,
                'help_text':
                _("Aanduiding van de mate waarin het zaakdossier van de "
                  "ZAAK voor de openbaarheid bestemd is. Optioneel - indien "
                  "geen waarde gekozen wordt, dan wordt de waarde van het "
                  "ZAAKTYPE overgenomen. Dit betekent dat de API _altijd_ een "
                  "waarde teruggeeft.")
            },
            'hoofdzaak': {
                'lookup_field': 'uuid',
                'queryset': Zaak.objects.all(),
                'validators': [NotSelfValidator(),
                               HoofdzaakValidator()],
            },
            'relevante_andere_zaken': {
                'child':
                serializers.URLField(label=_("URL naar andere zaak"),
                                     max_length=255,
                                     validators=[
                                         URLValidator(get_auth=get_auth,
                                                      headers={
                                                          'Content-Crs':
                                                          'EPSG:4326',
                                                          'Accept-Crs':
                                                          'EPSG:4326'
                                                      })
                                     ])
            },
            'laatste_betaaldatum': {
                'validators': [UntilNowValidator()]
            }
        }
        # Replace a default "unique together" constraint.
        validators = [UniekeIdentificatieValidator()]
コード例 #20
0
ファイル: core.py プロジェクト: maykinmedia/zaken-api
 class Meta:
     model = Zaak
     fields = (
         "url",
         "uuid",
         "identificatie",
         "bronorganisatie",
         "omschrijving",
         "toelichting",
         "zaaktype",
         "registratiedatum",
         "verantwoordelijke_organisatie",
         "startdatum",
         "einddatum",
         "einddatum_gepland",
         "uiterlijke_einddatum_afdoening",
         "publicatiedatum",
         "communicatiekanaal",
         # TODO: add shape validator once we know the shape
         "producten_of_diensten",
         "vertrouwelijkheidaanduiding",
         "betalingsindicatie",
         "betalingsindicatie_weergave",
         "laatste_betaaldatum",
         "zaakgeometrie",
         "verlenging",
         "opschorting",
         "selectielijstklasse",
         "hoofdzaak",
         "deelzaken",
         "relevante_andere_zaken",
         "eigenschappen",
         # read-only veld, on-the-fly opgevraagd
         "rollen",
         "status",
         "zaakinformatieobjecten",
         "zaakobjecten",
         # Writable inline resource, as opposed to eigenschappen for demo
         # purposes. Eventually, we need to choose one form.
         "kenmerken",
         # Archiving
         "archiefnominatie",
         "archiefstatus",
         "archiefactiedatum",
         "resultaat",
         "opdrachtgevende_organisatie",
     )
     extra_kwargs = {
         "url": {
             "lookup_field": "uuid"
         },
         "uuid": {
             "read_only": True
         },
         "zaakgeometrie": {
             "help_text":
             "Punt, lijn of (multi-)vlak geometrie-informatie, in GeoJSON."
         },
         "identificatie": {
             "validators": [IsImmutableValidator()]
         },
         "zaaktype": {
             # TODO: does order matter here with the default validators?
             "validators": [
                 IsImmutableValidator(),
                 PublishValidator("ZaakType",
                                  settings.ZTC_API_SPEC,
                                  get_auth=get_auth),
             ]
         },
         "einddatum": {
             "read_only": True,
             "allow_null": True
         },
         "communicatiekanaal": {
             "validators": [
                 ResourceValidator("CommunicatieKanaal",
                                   settings.REFERENTIELIJSTEN_API_SPEC)
             ]
         },
         "vertrouwelijkheidaanduiding": {
             "required":
             False,
             "help_text":
             _("Aanduiding van de mate waarin het zaakdossier van de "
               "ZAAK voor de openbaarheid bestemd is. Optioneel - indien "
               "geen waarde gekozen wordt, dan wordt de waarde van het "
               "ZAAKTYPE overgenomen. Dit betekent dat de API _altijd_ een "
               "waarde teruggeeft."),
         },
         "selectielijstklasse": {
             "validators": [
                 ResourceValidator(
                     "Resultaat",
                     settings.REFERENTIELIJSTEN_API_SPEC,
                     get_auth=get_auth,
                 )
             ]
         },
         "hoofdzaak": {
             "lookup_field": "uuid",
             "queryset": Zaak.objects.all(),
             "validators": [NotSelfValidator(),
                            HoofdzaakValidator()],
         },
         "laatste_betaaldatum": {
             "validators": [UntilNowValidator()]
         },
     }
     # Replace a default "unique together" constraint.
     validators = [
         UniekeIdentificatieValidator(),
         HoofdZaaktypeRelationValidator()
     ]
     expandable_fields = [
         "status",
         "resultaat",
         "eigenschappen",
         "rollen",
         "zaakobjecten",
         "zaakinformatieobjecten",
     ]
コード例 #21
0
    class Meta:
        model = ZaakType
        fields = (
            "url",
            "identificatie",
            "omschrijving",
            "omschrijving_generiek",
            "vertrouwelijkheidaanduiding",
            # 'zaakcategorie',
            "doel",
            "aanleiding",
            "toelichting",
            "indicatie_intern_of_extern",
            "handeling_initiator",
            "onderwerp",
            "handeling_behandelaar",
            "doorlooptijd",
            "servicenorm",
            "opschorting_en_aanhouding_mogelijk",
            "verlenging_mogelijk",
            "verlengingstermijn",
            "trefwoorden",
            # 'archiefclassificatiecode',
            # 'vertrouwelijkheidAanduiding',
            # 'verantwoordelijke',
            "publicatie_indicatie",
            "publicatietekst",
            "verantwoordingsrelatie",
            "producten_of_diensten",
            "selectielijst_procestype",
            # 'formulier',
            "referentieproces",
            # 'broncatalogus',
            # 'bronzaaktype',
            # 'ingangsdatumObject',
            # 'versiedatum',
            # 'einddatumObject',
            # relaties
            "catalogus",
            "statustypen",
            "resultaattypen",
            "eigenschappen",
            "informatieobjecttypen",
            "roltypen",
            "besluittypen",
            "gerelateerde_zaaktypen",
            # # 'heeftRelevantZaakObjecttype',
            # # 'isDeelzaaktypeVan',
            "begin_geldigheid",
            "einde_geldigheid",
            "versiedatum",
            "concept",
        )
        extra_kwargs = {
            "url": {
                "lookup_field": "uuid"
            },
            "identificatie": {
                "source": "zaaktype_identificatie"
            },
            "omschrijving": {
                "source": "zaaktype_omschrijving"
            },
            "omschrijving_generiek": {
                "source": "zaaktype_omschrijving_generiek"
            },
            "catalogus": {
                "lookup_field": "uuid"
            },
            "doorlooptijd": {
                "source": "doorlooptijd_behandeling"
            },
            "servicenorm": {
                "source": "servicenorm_behandeling"
            },
            "begin_geldigheid": {
                "source": "datum_begin_geldigheid"
            },
            "einde_geldigheid": {
                "source": "datum_einde_geldigheid"
            },
            "concept": {
                "read_only": True
            },
            "selectielijst_procestype": {
                "validators": [
                    ResourceValidator("ProcesType",
                                      settings.REFERENTIELIJSTEN_API_SPEC)
                ]
            },
        }

        # expandable_fields = {
        #     'catalogus': ('openzaak.components.catalogi.api.serializers.CatalogusSerializer', {'source': 'catalogus'}),
        # }
        validators = [
            ZaaktypeGeldigheidValidator(),
            RelationCatalogValidator("besluittype_set"),
        ]
コード例 #22
0
    class Meta:
        model = ZaakType
        fields = (
            "url",
            "identificatie",
            "omschrijving",
            "omschrijving_generiek",
            "vertrouwelijkheidaanduiding",
            "doel",
            "aanleiding",
            "toelichting",
            "indicatie_intern_of_extern",
            "handeling_initiator",
            "onderwerp",
            "handeling_behandelaar",
            "doorlooptijd",
            "servicenorm",
            "opschorting_en_aanhouding_mogelijk",
            "verlenging_mogelijk",
            "verlengingstermijn",
            "trefwoorden",
            "publicatie_indicatie",
            "publicatietekst",
            "verantwoordingsrelatie",
            "producten_of_diensten",
            "selectielijst_procestype",
            "referentieproces",
            # relaties
            "catalogus",
            "statustypen",
            "resultaattypen",
            "eigenschappen",
            "informatieobjecttypen",
            "roltypen",
            "besluittypen",
            "deelzaaktypen",
            "gerelateerde_zaaktypen",
            "begin_geldigheid",
            "einde_geldigheid",
            "versiedatum",
            "concept",
        )
        extra_kwargs = {
            "url": {
                "lookup_field": "uuid"
            },
            "omschrijving": {
                "source": "zaaktype_omschrijving"
            },
            "omschrijving_generiek": {
                "source": "zaaktype_omschrijving_generiek"
            },
            "catalogus": {
                "lookup_field": "uuid"
            },
            "doorlooptijd": {
                "source": "doorlooptijd_behandeling"
            },
            "servicenorm": {
                "source": "servicenorm_behandeling"
            },
            "begin_geldigheid": {
                "source": "datum_begin_geldigheid"
            },
            "einde_geldigheid": {
                "source": "datum_einde_geldigheid"
            },
            "concept": {
                "read_only": True
            },
            "selectielijst_procestype": {
                "validators": [
                    ResourceValidator("ProcesType",
                                      settings.REFERENTIELIJSTEN_API_SPEC)
                ]
            },
            "informatieobjecttypen": {
                "read_only":
                True,
                "lookup_field":
                "uuid",
                "help_text":
                _("URL-referenties naar de INFORMATIEOBJECTTYPEN die mogelijk zijn binnen dit ZAAKTYPE."
                  ),
            },
            "statustypen": {
                "read_only":
                True,
                "lookup_field":
                "uuid",
                "help_text":
                _("URL-referenties naar de STATUSTYPEN die mogelijk zijn binnen dit ZAAKTYPE."
                  ),
            },
            "resultaattypen": {
                "read_only":
                True,
                "lookup_field":
                "uuid",
                "help_text":
                _("URL-referenties naar de RESULTAATTYPEN die mogelijk zijn binnen dit ZAAKTYPE."
                  ),
            },
            "eigenschappen": {
                "read_only":
                True,
                "source":
                "eigenschap_set",
                "lookup_field":
                "uuid",
                "help_text":
                _("URL-referenties naar de EIGENSCHAPPEN die aanwezig moeten zijn in ZAKEN van dit ZAAKTYPE."
                  ),
            },
            "roltypen": {
                "read_only":
                True,
                "source":
                "roltype_set",
                "lookup_field":
                "uuid",
                "help_text":
                _("URL-referenties naar de ROLTYPEN die mogelijk zijn binnen dit ZAAKTYPE."
                  ),
            },
            "besluittypen": {
                "label":
                _("heeft relevante besluittypen"),
                "lookup_field":
                "uuid",
                "help_text":
                _("URL-referenties naar de BESLUITTYPEN die mogelijk zijn binnen dit ZAAKTYPE."
                  ),
            },
            "deelzaaktypen": {
                "lookup_field": "uuid"
            },
        }

        validators = [
            ZaaktypeGeldigheidValidator(),
            RelationCatalogValidator("besluittypen"),
            ConceptUpdateValidator(),
            M2MConceptCreateValidator(
                ["besluittypen", "informatieobjecttypen"]),
            M2MConceptUpdateValidator(
                ["besluittypen", "informatieobjecttypen"]),
            DeelzaaktypeCatalogusValidator(),
        ]