using BigRegister.Api.Contracts; using BigRegister.Domain.Authorization; namespace BigRegister.Api.Data; /// /// The cases (zaken) READ seam (WP-49). A "zaak" in ZGW terms is an /// here; this interface is the one injection point that lets a real ZGW backend (OpenZaak) /// replace the local SQLite store behind the same /// contract — so the frontend never changes (BFF-lite anti-corruption, ADR-0001). /// /// Default binding is (offline). Setting Zgw:Enabled=true /// swaps in OpenZaakZaakSource. Slice 1 (WP-49) was read-only; /// (WP-50) is the first write. The interface returns the wire DTO (not the domain /// ) precisely so each source owns its own mapping — the OpenZaak /// source maps a ZGW Zaak into this shape, the local source maps the stored aanvraag. /// public interface IZaakSource { /// Every case across every owner, newest-first (the admin cross-owner list, /// WP-36) — cases:manage only, deliberately NOT citizen-scoped. IReadOnlyList ListCases(DateTimeOffset now); /// /// Only 's own cases (WP-53) — the citizen-scoped counterpart of /// , backing the citizen's own dashboard. The local source filters /// ApplicationStore by owner (unchanged behaviour); the OpenZaak source adds ZGW's /// rol__betrokkeneIdentificatie__natuurlijkPersoon__inpBsn query filter so a citizen /// can never see another citizen's zaken. /// IReadOnlyList ListMyCases(ZorgverlenerCaller caller, DateTimeOffset now); /// /// Register a just-submitted as a zaak (WP-50). The aanvraag is /// already persisted locally (ApplicationStore.Submit already ran) — this is the /// integration side-effect, and (Referentie, Status) is what the submit endpoint hands back /// to the FE (ADR-0001: route the create through the existing submit response DTO, don't add /// a second one). The local source is a pure passthrough of the already-computed local /// reference/status (ZaakUrl null — nothing to persist); the OpenZaak source creates a Zaak /// (+ status + rol) and maps the result back into the same shape, returning the zaak's URL /// so the endpoint can persist it (, WP-51 needs it /// to later link documents to this zaak). (WP-53) is the acting /// citizen — the ZGW JWT's audit claims reflect them, not a static config identity. /// (string Referentie, AanvraagStatusDto Status, string? ZaakUrl) CreateZaak(Aanvraag aanvraag, DateTimeOffset now, CallerIdentity caller); }