Skip to content

Commit

Permalink
Add Produktpaket and Produktkonfiguration (#542)
Browse files Browse the repository at this point in the history
* Add Produktpaket and Produktkonfiguration

* Fix typos and add comments
  • Loading branch information
JoschaMetze authored Oct 2, 2024
1 parent 3dce2fe commit 25c7f7b
Show file tree
Hide file tree
Showing 5 changed files with 421 additions and 0 deletions.
1 change: 1 addition & 0 deletions BO4E/BO/BusinessObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ namespace BO4E.BO;
[ProtoInclude(33, typeof(Summenzeitreihe))]
[ProtoInclude(34, typeof(Lokationszuordnung))]
[ProtoInclude(35, typeof(Einspeisung))]
[ProtoInclude(36, typeof(Produktpaket))]
public abstract class BusinessObject : IUserProperties, IOptionalGuid
{
/// <summary>
Expand Down
52 changes: 52 additions & 0 deletions BO4E/BO/Produktpaket.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
using BO4E.COM;
using BO4E.meta;
using Newtonsoft.Json;
using ProtoBuf;

namespace BO4E.BO;

/// <summary>
/// Sammlung von Produktkonfigurationen im Rahmen der Marktkommunikation.
/// </summary>
[ProtoContract]
public class Produktpaket : BusinessObject
{
/// <summary>
/// Paket-Identifikation (Durchnummerierung).
/// </summary>
[JsonProperty(Required = Required.Always, Order = 8, PropertyName = "paketId")]
[JsonPropertyName("paketId")]
[ProtoMember(8)]
[JsonPropertyOrder(8)]
[BoKey]
public int PaketId { get; set; }

/// <summary>
/// Liste an Produktkonfigurationen
/// </summary>
[JsonProperty(Required = Required.Default, Order = 9, PropertyName = "konfigurationen")]
[JsonPropertyName("konfigurationen")]
[ProtoMember(9)]
[JsonPropertyOrder(9)]
public List<Produktkonfiguration>? Konfigurationen { get; set; }

/// <summary>
/// Prioritaet des Pakets (1-5, 1 ist die hoechste Prioritaet)
/// </summary>
[JsonProperty(Required = Required.Default, Order = 10, PropertyName = "prioritaet")]
[JsonPropertyName("prioritaet")]
[ProtoMember(10)]
[JsonPropertyOrder(10)]
public int? Prioritaet { get; set; }

/// <summary>
/// Muss das Paket vollstaendig umgesetzt werden?
/// </summary>
[JsonProperty(Required = Required.Default, Order = 11, PropertyName = "mussVollstaendigSein")]
[JsonPropertyName("mussVollstaendigSein")]
[ProtoMember(11)]
[JsonPropertyOrder(11)]
public bool? MussVollstaendigSein { get; set; }
}
34 changes: 34 additions & 0 deletions BO4E/COM/Produktkonfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Text.Json.Serialization;
using BO4E.ENUM;
using BO4E.meta;
using Newtonsoft.Json;
using ProtoBuf;

namespace BO4E.COM;

/// <summary>Einzelne Produktkonfiguration in einem Produktpaket.</summary>
[ProtoContract]
public class Produktkonfiguration : COM
{
/// <summary>Eindeutiger Code der Konfiguration</summary>
[JsonProperty(PropertyName = "code", Order = 3, Required = Required.Default)]
[JsonPropertyName("code")]
[ProtoMember(3)]
[JsonPropertyOrder(3)]
public Produktcode? Code { get; set; }

/// <summary>Eigenschaftswert zur Konfiguration (als Code)</summary>
[JsonProperty(PropertyName = "eigenschaft", Order = 4, Required = Required.Default)]
[JsonPropertyName("eigenschaft")]
[ProtoMember(4)]
[JsonPropertyOrder(4)]
public Produktcode? Eigenschaft { get; set; }

/// <summary>Zusätzlicher Eigenschaftswert, z.B. Angabe der Jahresverbrauchsprognose (4000).
/// Im Allgemeinen zur Angabe von Werten, die nicht als Produktcode definiert sind</summary>
[JsonProperty(PropertyName = "zusatzeigenschaft", Order = 5, Required = Required.Default)]
[JsonPropertyName("zusatzeigenschaft")]
[ProtoMember(5)]
[JsonPropertyOrder(5)]
public string? Zusatzeigenschaft { get; set; }
}
Loading

0 comments on commit 25c7f7b

Please sign in to comment.