From af4a00a223f97b305b96ad7d83be39e090d9a0ff Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Thu, 14 Nov 2024 19:40:01 +0100 Subject: [PATCH 1/2] removed errored DokumentType --- crates/derive/src/lib.rs | 2 -- src/model/vorgang.rs | 34 ++-------------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/crates/derive/src/lib.rs b/crates/derive/src/lib.rs index 8e6ba80..a514e11 100644 --- a/crates/derive/src/lib.rs +++ b/crates/derive/src/lib.rs @@ -1,5 +1,3 @@ -use std::borrow::Cow; - use proc_macro::TokenStream; use quote::quote; diff --git a/src/model/vorgang.rs b/src/model/vorgang.rs index 8e67228..4c3d342 100644 --- a/src/model/vorgang.rs +++ b/src/model/vorgang.rs @@ -14,9 +14,8 @@ use wasm_bindgen::prelude::*; use typed_builder::TypedBuilder; use super::{ - codes::CodeDokumenttypType, pruefbericht::PruefberichtType, - shared::dokument::DokumentRepraesentationType, - shared::untersuchungsplan::UntersuchungsplanType, + pruefbericht::PruefberichtType, + shared::{dokument::DokumentType, untersuchungsplan::UntersuchungsplanType}, }; #[derive( @@ -59,35 +58,6 @@ pub struct Vorgang { pub anlage: Vec, } -/// Eine zum Antrag gehörige Unterlage in verschiedenen Dokumentendarstellungen, z. B. PDF oder eine Datendarstellung. Es muss immer das komplette Dokument mit allen Darstellungen übertragen werden. -#[derive( - Clone, Default, Debug, XmlSerialize, XmlDeserialize, XWasserValidate, Serialize, Deserialize, -)] -#[cfg_attr(feature = "wasm", derive(Tsify))] -#[cfg_attr(feature = "wasm", tsify(into_wasm_abi, from_wasm_abi))] -#[cfg_attr(feature = "builder", derive(TypedBuilder))] -#[xml(tns( - b"xwas", - b"https://gitlab.opencode.de/akdb/xoev/xwasser/-/raw/main/V0_7_0/" -))] -pub struct DokumentType { - #[xml(ns = b"xwas", name = b"dokumentTyp", ty = "child")] - pub dokument_typ: CodeDokumenttypType, - #[xml(ns = b"xwas", name = b"name", ty = "child")] - pub name: String, - #[xml(ns = b"xwas", name = b"aktuelleVersion", ty = "child")] - pub aktuelle_version: Option, - #[xml(ns = b"xwas", name = b"letzteVersion", ty = "child")] - pub letzte_version: Option, - #[xml(ns = b"xwas", name = b"dokumentRepraesentation", ty = "child")] - pub dokument_repraesentation: DokumentRepraesentationType, - #[xml(ns = b"xwas", name = b"personReferenzID", ty = "child")] - #[serde(default)] - pub person_referenz_id: Vec, - #[xml(name = b"dokumentID", ty = "attr")] - pub dokument_id: String, -} - // TODO: implement Box, Arc, Rc for raxb #[allow(clippy::large_enum_variant)] #[derive( From a769399acbf77da50345de30f2044759ec110cf7 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Thu, 14 Nov 2024 19:49:27 +0100 Subject: [PATCH 2/2] updated tests --- tests/monitoring_plan_builder.json | 50 +++++++++---------- tests/monitoring_plan_builder_test_result.xml | 50 +++++++++---------- tests/olb_report_minimal.json | 24 +++++---- tests/olb_report_minimal_test_result.xml | 2 +- tests/quality_report_builder.json | 36 ++++++------- tests/quality_report_builder_test_result.xml | 36 ++++++------- tests/quality_report_maximal.json | 24 +++++---- tests/quality_report_maximal_test_result.xml | 2 +- tests/quality_report_minimal.json | 24 +++++---- tests/quality_report_minimal_test_result.xml | 2 +- 10 files changed, 128 insertions(+), 122 deletions(-) diff --git a/tests/monitoring_plan_builder.json b/tests/monitoring_plan_builder.json index e281c85..4dc7d95 100644 --- a/tests/monitoring_plan_builder.json +++ b/tests/monitoring_plan_builder.json @@ -5,13 +5,13 @@ "test": true, "nachrichtenkopf_g2g": { "identifikation_nachricht": { - "nachrichten_uuid": "6d3a4092-41c8-43dc-89ac-52c03745f2c0", + "nachrichten_uuid": "1197f404-21e5-4c54-b841-88a387dcd33e", "nachrichten_typ": { "code": { "code": "2010" } }, - "erstellungszeitpunkt": "2024-11-11T12:54:26" + "erstellungszeitpunkt": "2024-11-14T19:49:13" }, "leser": { "verzeichnisdienst": { @@ -36,14 +36,14 @@ }, "vorgang": { "identifikation_vorgang": { - "vorgangs_id": "11f50808-6822-43a9-8e37-14fd47bb027c" + "vorgangs_id": "21e6385b-263f-44a4-a124-c30e2bb945ed" }, "vorgang_type": { "t": "Untersuchungsplan", "c": { - "untersuchungsplan_id": "8c09eeae-e06e-40ab-bd3c-11fb6f0c2421", + "untersuchungsplan_id": "40309517-af87-40aa-b9b1-5e180b3d4f65", "wasserversorgungsgebiet": [ - "wvg-BbIAjk9G" + "wvg-kzisVqC5" ], "titel_untersuchungsplan": null, "jahr": [ @@ -95,10 +95,10 @@ "kommentar": [], "terminplan": [ { - "terminplan_id": "ea3943ab-4aaf-4214-b9ac-aa900172bc4f", + "terminplan_id": "0e616c34-0134-4661-ae36-a0046b8db0ef", "probennahmestelle": null, "datum_zeitraum": [ - "2024-11-11T12:54:26" + "2024-11-14T19:49:13" ], "probennahmestelle_kategorie": { "code": "L", @@ -131,12 +131,12 @@ "probennahmeverfahren": [], "ersatz_fuer_terminplan_mit_der_id": null, "kommentar": null, - "id": "terminplan-zjlgQtAH" + "id": "terminplan-ipod42t8" } ], "anlage_nach_trinkw_v": { "anlage_nach_trinkw_v_id": "", - "zustaendige_behoerde_id": "behoerde-yVlllozr", + "zustaendige_behoerde_id": "behoerde-hn4D2Aiz", "untersuchungsplan_id": [], "art_anlage": { "code": "1010", @@ -149,7 +149,7 @@ "kommentar": null, "wasserversorgungsgebiet": [ { - "wasserversorgungsgebiet_id": "1506d398-6588-46e6-b594-10928adb8589", + "wasserversorgungsgebiet_id": "93c8ae08-5e2e-40cf-9ed8-ee7ba489d62a", "name_wasserversorgungsgebiet": { "code": "", "name": null @@ -157,7 +157,7 @@ "lau2_code": null, "zustaendige_behoerde": [ { - "id": "behoerde-AJ6abzMZ", + "id": "behoerde-jtMrgxx2", "typ": { "code": "", "name": null, @@ -197,7 +197,7 @@ } ], "geokoordinaten_shapth": null, - "datum_der_einrichtung": "2024-11-11", + "datum_der_einrichtung": "2024-11-14", "datum_der_schliessung": null, "grund_der_schliessung": null, "nachfolger_wvg_bei_schliessung": [], @@ -221,12 +221,12 @@ "derogation": [], "exceedance": [], "incident": [], - "id": "wvg-BbIAjk9G" + "id": "wvg-kzisVqC5" } ], "anlage_nach_trinkw_v_objekt": [ { - "objekt_id": "b1d78e44-4571-4b3b-a87f-357af19f8bbc", + "objekt_id": "1fcfdf15-ec12-4494-b777-6b05b0333044", "wasserversorgungsgebiet": null, "anschrift_objekt": [], "art_objekt": { @@ -250,11 +250,11 @@ "kommentar": null, "betreiber": [ { - "betreiber_id": "09154441-fcd8-46fb-937c-6f5df9f643da", + "betreiber_id": "9136bb0d-fda1-457e-9fbc-405ac1f989cb", "art_der_person": { "t": "Organisation", "c": { - "id": "organisation-DbHSznZh", + "id": "organisation-mRYXmeOf", "rechtsform": null, "branche": [], "zweck": [], @@ -268,15 +268,15 @@ } }, "objekt_id": [ - "obj-CFdejm26" + "obj-lH0vBEui" ], "kommentar": null, - "id": "betreiber-EJcu9WYn" + "id": "betreiber-n3hn4lhQ" } ], "objekt_probennahmestelle": [ { - "probennahmestelle_id": "a615bb7e-edd9-4905-a576-760728e99f8b", + "probennahmestelle_id": "f9b6ec3c-c021-4aa9-ac8e-661707b6a65f", "objekt_id": "", "probe": [], "terminplan_id": [], @@ -304,13 +304,13 @@ "alt_id": null, "berichtspflichtig": null, "kommentar": null, - "id": "probennahmestelle-FjO6WD5t" + "id": "probennahmestelle-ohXmAQXm" } ], - "id": "obj-CFdejm26" + "id": "obj-lH0vBEui" } ], - "id": "antv-GVzWXUBL" + "id": "antv-px5J5oFg" }, "auftraggeber": { "auftraggeber_id": "", @@ -321,7 +321,7 @@ "auftraggeber": { "t": "Organisation", "c": { - "id": "organisation-HzzjFfG6", + "id": "organisation-qPJljWrz", "rechtsform": null, "branche": [], "zweck": [], @@ -336,7 +336,7 @@ } }, "zustaendige_behoerde": { - "id": "behoerde-yVlllozr", + "id": "behoerde-hn4D2Aiz", "typ": { "code": "", "name": null, @@ -382,7 +382,7 @@ }, "aenderungshistorie": null, "erweiterung": null, - "id": "untersuchungsplan-IfRF6ZpA" + "id": "untersuchungsplan-r9YgMVkr" } }, "bemerkung": null, diff --git a/tests/monitoring_plan_builder_test_result.xml b/tests/monitoring_plan_builder_test_result.xml index b41914e..1adcf1b 100644 --- a/tests/monitoring_plan_builder_test_result.xml +++ b/tests/monitoring_plan_builder_test_result.xml @@ -2,11 +2,11 @@ - 6d3a4092-41c8-43dc-89ac-52c03745f2c0 + 1197f404-21e5-4c54-b841-88a387dcd33e 2010 - 2024-11-11T12:54:26 + 2024-11-14T19:49:13 @@ -26,12 +26,12 @@ - 11f50808-6822-43a9-8e37-14fd47bb027c + 21e6385b-263f-44a4-a124-c30e2bb945ed - - 8c09eeae-e06e-40ab-bd3c-11fb6f0c2421 - wvg-BbIAjk9G + + 40309517-af87-40aa-b9b1-5e180b3d4f65 + wvg-kzisVqC5 2024 2025 0 @@ -66,9 +66,9 @@ 1010 - - ea3943ab-4aaf-4214-b9ac-aa900172bc4f - 2024-11-11T12:54:26 + + 0e616c34-0134-4661-ae36-a0046b8db0ef + 2024-11-14T19:49:13 L @@ -87,20 +87,20 @@ false - + - behoerde-yVlllozr + behoerde-hn4D2Aiz 1010 - - 1506d398-6588-46e6-b594-10928adb8589 + + 93c8ae08-5e2e-40cf-9ed8-ee7ba489d62a - behoerde-AJ6abzMZ + behoerde-jtMrgxx2 @@ -120,7 +120,7 @@ - 2024-11-11 + 2024-11-14 0 0 0 @@ -131,24 +131,24 @@ 0 0 - - b1d78e44-4571-4b3b-a87f-357af19f8bbc + + 1fcfdf15-ec12-4494-b777-6b05b0333044 1010 - - 09154441-fcd8-46fb-937c-6f5df9f643da + + 9136bb0d-fda1-457e-9fbc-405ac1f989cb - + - obj-CFdejm26 + obj-lH0vBEui - - a615bb7e-edd9-4905-a576-760728e99f8b + + f9b6ec3c-c021-4aa9-ac8e-661707b6a65f Probennahmestelle 1 @@ -173,12 +173,12 @@ 1010 - + - behoerde-yVlllozr + behoerde-hn4D2Aiz diff --git a/tests/olb_report_minimal.json b/tests/olb_report_minimal.json index 579e9e0..969e33b 100644 --- a/tests/olb_report_minimal.json +++ b/tests/olb_report_minimal.json @@ -48,17 +48,19 @@ "name": "Anlage 1", "aktuelle_version": null, "letzte_version": null, - "dokument_repraesentation": { - "referenz": null, - "mime_type": "application/pdf", - "inhalt": "PERVTU1ZIC8+", - "externer_referenz_typ": null, - "externer_referenz_index": null, - "dateiname": "Test.pdf", - "inhalt_typ": "pdf", - "signaturen": null, - "dokument_repraesentation_id": "doc1" - }, + "dokument_repraesentation": [ + { + "referenz": null, + "mime_type": "application/pdf", + "inhalt": "PERVTU1ZIC8+", + "externer_referenz_typ": null, + "externer_referenz_index": null, + "dateiname": "Test.pdf", + "inhalt_typ": "pdf", + "signaturen": null, + "dokument_repraesentation_id": "doc1" + } + ], "person_referenz_id": [], "dokument_id": "anhang1" } diff --git a/tests/olb_report_minimal_test_result.xml b/tests/olb_report_minimal_test_result.xml index 506588c..8a1f61e 100644 --- a/tests/olb_report_minimal_test_result.xml +++ b/tests/olb_report_minimal_test_result.xml @@ -29,7 +29,7 @@ 5e08e073-4e06-438d-9444-1275f6cbf061 - + 1010 diff --git a/tests/quality_report_builder.json b/tests/quality_report_builder.json index e3399de..df02e07 100644 --- a/tests/quality_report_builder.json +++ b/tests/quality_report_builder.json @@ -5,13 +5,13 @@ "test": true, "nachrichtenkopf_g2g": { "identifikation_nachricht": { - "nachrichten_uuid": "84b267bd-0467-4a85-a009-fe8fb25d6c4a", + "nachrichten_uuid": "f2f3f0e2-cc21-40c3-838e-ca698e69eac4", "nachrichten_typ": { "code": { "code": "2010" } }, - "erstellungszeitpunkt": "2024-11-11T12:54:28" + "erstellungszeitpunkt": "2024-11-14T19:49:15" }, "leser": { "verzeichnisdienst": { @@ -36,17 +36,17 @@ }, "vorgang": { "identifikation_vorgang": { - "vorgangs_id": "e6a2dd27-04b2-4d4c-84eb-cf1d4f210cf9" + "vorgangs_id": "f6cbcbcf-a11b-4386-92cd-2e39fce77f50" }, "vorgang_type": { "t": "Pruefbericht", "c": { - "pruefbericht_uuid": "c26d6d33-0dd4-4394-8aae-dcccc67c2d66", + "pruefbericht_uuid": "cd9ed35e-1386-4f3f-b5d6-fa4f2d47eab2", "vorgaenger_pruefbericht_id": null, - "auftragsnummer": "b094297f-222a-48bb-b4f7-8e66ea161268", + "auftragsnummer": "d7afb7a8-9de8-4ee1-ae91-54fc82afae73", "probennahmestelle": [ { - "probennahmestelle_id": "id-0b53224f-2aa4-4418-a81f-e07ed27c7f10", + "probennahmestelle_id": "id-651c5574-f8f2-479c-bf77-a0f7ef489692", "objekt_id": "none", "probe": [], "terminplan_id": [], @@ -74,20 +74,20 @@ "alt_id": null, "berichtspflichtig": null, "kommentar": null, - "id": "id-0b53224f-2aa4-4418-a81f-e07ed27c7f10" + "id": "id-651c5574-f8f2-479c-bf77-a0f7ef489692" } ], "probe": [ { - "probe_id": "72315acc-41dd-43bd-9273-84bc90503f91", - "probennahmestelle": "id-0b53224f-2aa4-4418-a81f-e07ed27c7f10", + "probe_id": "7234bb7f-a601-45ce-963a-6a79ce9f7809", + "probennahmestelle": "id-651c5574-f8f2-479c-bf77-a0f7ef489692", "untersuchungsplan_id": null, "probennehmer": null, "titel_probe": null, "analyseergebnis_parameter": [ { - "analyseergebnis_parameter_id": "21b5021c-26f6-432d-b7b9-372d6461b1da", - "anschrift_id": "anschrift-grcPZA6p", + "analyseergebnis_parameter_id": "b2b74d34-b624-4958-9d8b-1dc259d5cd7e", + "anschrift_id": "anschrift-sDr6wG1c", "zugelassene_untersuchungsstelle": "wsu-1", "akkreditierte_durchfuehrung_analyse": false, "untersuchungsverfahren": [ @@ -140,7 +140,7 @@ }, "akkreditierte_durchfuehrung_der_probennahme": false, "ergaenzung_zum_medium": null, - "zeitpunkt_probennahme": "2024-11-11T12:54:28", + "zeitpunkt_probennahme": "2024-11-14T19:49:15", "probennahmeverfahren": [ { "code": "1010", @@ -162,9 +162,9 @@ ], "kommentar_zur_probennahme": null, "informationen_zum_probentransport": null, - "eingang_probe_bei_untersuchungsstelle": "2024-11-11T12:54:28", - "beginn_labortaetigkeit_analytik": "2024-11-11T12:54:28", - "abschluss_labortaetigkeit_analytik": "2024-11-11T12:54:28", + "eingang_probe_bei_untersuchungsstelle": "2024-11-14T19:49:15", + "beginn_labortaetigkeit_analytik": "2024-11-14T19:49:15", + "abschluss_labortaetigkeit_analytik": "2024-11-14T19:49:15", "konformitaetsbewertung_der_probe": { "code": "1010", "name": null @@ -185,7 +185,7 @@ }, "probennehmer": [ { - "probennehmer_id": "d044f8bb-e6ce-4fde-b375-ff036ccfee56", + "probennehmer_id": "00f9afc5-39b1-4502-9aff-99a9d600d63d", "probennehmer": { "t": "NatuerlichePerson", "c": { @@ -220,7 +220,7 @@ "name": null }, "auffaelligkeiten": [], - "zeitpunkt_validierung_pruefbericht": "2024-11-11T12:54:28", + "zeitpunkt_validierung_pruefbericht": "2024-11-14T19:49:15", "fuer_validierung_verantwortliche_person": [ { "auskunftssperre": [], @@ -334,7 +334,7 @@ "typ": [], "staat": null, "verwaltungspolitische_kodierung": null, - "id": "anschrift-grcPZA6p" + "id": "anschrift-sDr6wG1c" } ], "anhang": [], diff --git a/tests/quality_report_builder_test_result.xml b/tests/quality_report_builder_test_result.xml index d0e89cf..d50eb25 100644 --- a/tests/quality_report_builder_test_result.xml +++ b/tests/quality_report_builder_test_result.xml @@ -2,11 +2,11 @@ - 84b267bd-0467-4a85-a009-fe8fb25d6c4a + f2f3f0e2-cc21-40c3-838e-ca698e69eac4 2010 - 2024-11-11T12:54:28 + 2024-11-14T19:49:15 @@ -26,14 +26,14 @@ - e6a2dd27-04b2-4d4c-84eb-cf1d4f210cf9 + f6cbcbcf-a11b-4386-92cd-2e39fce77f50 - c26d6d33-0dd4-4394-8aae-dcccc67c2d66 - b094297f-222a-48bb-b4f7-8e66ea161268 - - id-0b53224f-2aa4-4418-a81f-e07ed27c7f10 + cd9ed35e-1386-4f3f-b5d6-fa4f2d47eab2 + d7afb7a8-9de8-4ee1-ae91-54fc82afae73 + + id-651c5574-f8f2-479c-bf77-a0f7ef489692 none @@ -51,11 +51,11 @@ - 72315acc-41dd-43bd-9273-84bc90503f91 - id-0b53224f-2aa4-4418-a81f-e07ed27c7f10 + 7234bb7f-a601-45ce-963a-6a79ce9f7809 + id-651c5574-f8f2-479c-bf77-a0f7ef489692 - 21b5021c-26f6-432d-b7b9-372d6461b1da - anschrift-grcPZA6p + b2b74d34-b624-4958-9d8b-1dc259d5cd7e + anschrift-sDr6wG1c wsu-1 false @@ -85,7 +85,7 @@ 1010 false - 2024-11-11T12:54:28 + 2024-11-14T19:49:15 1010 @@ -95,9 +95,9 @@ 1020 - 2024-11-11T12:54:28 - 2024-11-11T12:54:28 - 2024-11-11T12:54:28 + 2024-11-14T19:49:15 + 2024-11-14T19:49:15 + 2024-11-14T19:49:15 1010 @@ -108,7 +108,7 @@ 09010 - d044f8bb-e6ce-4fde-b375-ff036ccfee56 + 00f9afc5-39b1-4502-9aff-99a9d600d63d @@ -120,7 +120,7 @@ 1010 - 2024-11-11T12:54:28 + 2024-11-14T19:49:15 false @@ -151,7 +151,7 @@ 09010 - + strasse hausnummer postleitzahl diff --git a/tests/quality_report_maximal.json b/tests/quality_report_maximal.json index 74e263c..83b5f54 100644 --- a/tests/quality_report_maximal.json +++ b/tests/quality_report_maximal.json @@ -6064,17 +6064,19 @@ "name": "Anlage 1", "aktuelle_version": null, "letzte_version": null, - "dokument_repraesentation": { - "referenz": null, - "mime_type": "application/pdf", - "inhalt": null, - "externer_referenz_typ": null, - "externer_referenz_index": null, - "dateiname": "Test.pdf", - "inhalt_typ": "pdf", - "signaturen": null, - "dokument_repraesentation_id": "doc1" - }, + "dokument_repraesentation": [ + { + "referenz": null, + "mime_type": "application/pdf", + "inhalt": null, + "externer_referenz_typ": null, + "externer_referenz_index": null, + "dateiname": "Test.pdf", + "inhalt_typ": "pdf", + "signaturen": null, + "dokument_repraesentation_id": "doc1" + } + ], "person_referenz_id": [], "dokument_id": "anhang1" } diff --git a/tests/quality_report_maximal_test_result.xml b/tests/quality_report_maximal_test_result.xml index afe03ad..a6847f9 100644 --- a/tests/quality_report_maximal_test_result.xml +++ b/tests/quality_report_maximal_test_result.xml @@ -4703,7 +4703,7 @@ Bemerkung - + 1010 diff --git a/tests/quality_report_minimal.json b/tests/quality_report_minimal.json index 265b215..162c45a 100644 --- a/tests/quality_report_minimal.json +++ b/tests/quality_report_minimal.json @@ -550,17 +550,19 @@ "name": "Anlage 1", "aktuelle_version": null, "letzte_version": null, - "dokument_repraesentation": { - "referenz": null, - "mime_type": "application/pdf", - "inhalt": null, - "externer_referenz_typ": null, - "externer_referenz_index": null, - "dateiname": "Test.pdf", - "inhalt_typ": "pdf", - "signaturen": null, - "dokument_repraesentation_id": "doc1" - }, + "dokument_repraesentation": [ + { + "referenz": null, + "mime_type": "application/pdf", + "inhalt": null, + "externer_referenz_typ": null, + "externer_referenz_index": null, + "dateiname": "Test.pdf", + "inhalt_typ": "pdf", + "signaturen": null, + "dokument_repraesentation_id": "doc1" + } + ], "person_referenz_id": [], "dokument_id": "anhang1" } diff --git a/tests/quality_report_minimal_test_result.xml b/tests/quality_report_minimal_test_result.xml index 08fddf9..e4f9ad9 100644 --- a/tests/quality_report_minimal_test_result.xml +++ b/tests/quality_report_minimal_test_result.xml @@ -274,7 +274,7 @@ Bemerkung - + 1010