Skip to content

Commit

Permalink
feat: Add BOneyComb Type (in bo4e lib instead of each client/server…
Browse files Browse the repository at this point in the history
… on their own) (#586)

* feat: Add `BOneyComb` Type

* enable strict nullability

---------

Co-authored-by: Konstantin <[email protected]>
  • Loading branch information
hf-kklein and Konstantin authored Nov 18, 2024
1 parent a367fbd commit b708f9b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions BO4E/Marktkommunikation/BOneyComb.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#nullable enable
using System.Collections.Generic;
using System.Text.Json.Serialization;
using BO4E.BO;
using BO4E.meta;

namespace BO4E.Marktkommunikation;

/// <summary>
/// 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 <see cref="Stammdaten"/> with a key value dict of process data named <see cred="Transaktionsdaten"/>.
/// 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.
/// </summary>
public class BOneyComb
{
/// <summary>
/// A list of Business objects.
/// </summary>
/// <remarks>
/// E.g. if you market communication message contained the "Anmeldung", it'd contain something like a <see cref="BO4E.BO.Zaehler"/>, <see cref="BO4E.BO.Vertrag"/> and a <see cref="BO4E.BO.Marktlokation"/>.
/// </remarks>
[JsonPropertyName("stammdaten")]
[JsonPropertyOrder(1)]
[Newtonsoft.Json.JsonProperty(PropertyName = "stammdaten", Order = 1)]
public List<BusinessObject>? Stammdaten { get; set; }

/// <summary>
/// Transaktionsdaten are data relevant only in the context of this market communication message.
/// This may include Nachrichtendatum, Prüfidentifikator, etc.
/// </summary>
[JsonPropertyName("transaktionsdaten")]
[JsonPropertyOrder(2)]
[Newtonsoft.Json.JsonProperty(PropertyName = "transaktionsdaten", Order = 2)]
public Dictionary<string, string>? Transaktionsdaten { get; set; }

/// <summary>
/// Links describes relations between different BusinessObjects in Stammdaten.
/// e.g. if there are two Zaehlers in <see cref="Stammdaten"/>, you could model in the links, to which Messlokation they belong.
/// Often we use the <see cref="Bo4eUri"/> as key.
/// </summary>
[JsonPropertyName("links")]
[JsonPropertyOrder(3)]
[Newtonsoft.Json.JsonProperty(PropertyName = "links", Order = 3)]
public Dictionary<string, List<string>>? Links { get; set; }
}

0 comments on commit b708f9b

Please sign in to comment.