From b708f9ba4e3a94fb69005797c63d2196cafca37f Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 18 Nov 2024 08:29:29 +0100 Subject: [PATCH] feat: Add `BOneyComb` Type (in bo4e lib instead of each client/server on their own) (#586) * feat: Add `BOneyComb` Type * enable strict nullability --------- Co-authored-by: Konstantin --- BO4E/Marktkommunikation/BOneyComb.cs | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 BO4E/Marktkommunikation/BOneyComb.cs diff --git a/BO4E/Marktkommunikation/BOneyComb.cs b/BO4E/Marktkommunikation/BOneyComb.cs new file mode 100644 index 00000000..13453a93 --- /dev/null +++ b/BO4E/Marktkommunikation/BOneyComb.cs @@ -0,0 +1,46 @@ +#nullable enable +using System.Collections.Generic; +using System.Text.Json.Serialization; +using BO4E.BO; +using BO4E.meta; + +namespace BO4E.Marktkommunikation; + +/// +/// BOneyComb is a structure that is used when dealing with business objects that are embedded into market communication messages. +/// It combines an array of business objects named with a key value dict of process data named . +/// A BOneyComb is used to represent the payload of a market communication message and its metadata. +/// BOneyComb is the result structure of the Hochfrequenz edifact-bo4e-converter aka transformer.bee. +/// +public class BOneyComb +{ + /// + /// A list of Business objects. + /// + /// + /// E.g. if you market communication message contained the "Anmeldung", it'd contain something like a , and a . + /// + [JsonPropertyName("stammdaten")] + [JsonPropertyOrder(1)] + [Newtonsoft.Json.JsonProperty(PropertyName = "stammdaten", Order = 1)] + public List? Stammdaten { get; set; } + + /// + /// Transaktionsdaten are data relevant only in the context of this market communication message. + /// This may include Nachrichtendatum, Prüfidentifikator, etc. + /// + [JsonPropertyName("transaktionsdaten")] + [JsonPropertyOrder(2)] + [Newtonsoft.Json.JsonProperty(PropertyName = "transaktionsdaten", Order = 2)] + public Dictionary? Transaktionsdaten { get; set; } + + /// + /// Links describes relations between different BusinessObjects in Stammdaten. + /// e.g. if there are two Zaehlers in , you could model in the links, to which Messlokation they belong. + /// Often we use the as key. + /// + [JsonPropertyName("links")] + [JsonPropertyOrder(3)] + [Newtonsoft.Json.JsonProperty(PropertyName = "links", Order = 3)] + public Dictionary>? Links { get; set; } +}