Zum Inhalt

Behördenseite mit dem SDK

Die Aufrufe der Behördenseite über AuthorityNotificationDocumentHandler und das Behördenverzeichnis.

Die fachlichen Hintergründe stehen in der Anleitung Behördenseite (Authority).

Zwei Handler

Factory-Methode Handler-Klasse Dokumenttyp
client.DocumentHandler.CreateAuthorityNotificationHandler() AuthorityNotificationDocumentHandler Notifizierung
client.DocumentHandler.CreateAuthorityMovementHandler() AuthorityMovementDocumentHandler Movement

Der Ablauf ist derselbe wie auf der Company-Seite: laden → Vorgang setzen → SaveToZedal() → SendToDiwass(). Auch die asynchrone Rückkopplung ist dieselbe — das fachliche Ergebnis erscheint als neue Version desselben Dokuments, nicht als Rückgabewert. Siehe Versandverfahren.

Die Authority-Handler laden nur über die ZEDAL-DocumentId

LoadFromZedalByNotificationId(string) und LoadFromZedalByMovementId(string) sind nur auf den Company-Handlern definiert. Auf den Authority-Handlern gibt es ausschließlich

await handler.LoadFromZedal(zedalDocumentId);   // DocumentId, not string

Wer hier eine fachliche Nummer als String übergibt, findet keine passende Überladung. Den Weg von der fachlichen Nummer zur DocumentId beschreibt Aufrufe und Synchronisation.

Notifizierung: die Vorgänge im Detail

Entscheidung (SetDecision)

using Infotech.Zedal.Documents.V1.Diwass.Waste.Notification.V1;  // DecisionDocumentType, NotificationDocumentIdentifierType
using Zedal.Sdk.Apis.Diwass.Enums;                                // CompetentAuthorityDomain, ToWire()
using static Zedal.Sdk.Protobuf.ProtoFields;                      // Sf, DateUtc
// The decision enum and the message DecisionType share a name: aliases keep them apart.
using DecisionType = Infotech.Zedal.Documents.V1.Diwass.Waste.Model.V1.DecisionType;
using DiwassDecisionType = Zedal.Sdk.Apis.Diwass.Enums.DecisionType;

var handler = client.DocumentHandler.CreateAuthorityNotificationHandler();
await handler.LoadFromZedal(notificationZedalDocumentId);

await handler.SetDecision(new DecisionDocumentType
{
    UserCompetentAuthorityDomainId = Sf(CompetentAuthorityDomain.WsrDispatch.ToWire()),
    NotificationDocumentId = new NotificationDocumentIdentifierType
    {
        NotificationId = Sf(notificationId),
        DocumentId     = Sf(documentId)
    },
    Decision = new DecisionType
    {
        DecisionDate          = DateUtc(2026, 9, 1),
        DecisionType_         = Sf(DiwassDecisionType.Consent.ToWire()),
        DecisionJustification = /* DescriptionType, at least one language version */
    },
    CompetentAuthoritySignature = /* SignatureType: Name, OrganizationRole, Timestamp */
});

await handler.SaveToZedal();
await handler.SendToDiwass();

Wie eine Behörde identifiziert wird

Behörden suchen lässt sich über das Verzeichnis:

// (Code, Name) per WSR authority of a country — for selection lists
var authorities = await client.DiwassApi.AuthorityDirectoryApi.ListAuthorities("BE");

// full result list with filters; countryId is required
var activities = await client.DiwassApi.AuthorityDirectoryApi.FindActivities(
    countryId: "BE", code: "DE014");