From 86ceda63126dc7a12f469d2c203980cbffc84027 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Thu, 30 Sep 2021 10:38:52 +0200 Subject: [PATCH] Add `Dispatchnotification` capabilities --- .../Dispatchnotification.cs | 29 ++++++++++ .../DispatchnotificationHeader.cs | 11 ++++ .../DispatchnotificationInfo.cs | 57 ++++++++++++++++++ .../DispatchnotificationItem.cs | 58 +++++++++++++++++++ .../DispatchnotificationSummary.cs | 15 +++++ openTRANS/SHARED/Components.cs | 6 -- .../SHARED/__delete_after_merging_pulls.cs | 23 ++++++++ .../SHARED/delete_after_merge_invoice.cs | 4 ++ openTRANS/openTRANS.csproj | 1 - 9 files changed, 197 insertions(+), 7 deletions(-) create mode 100644 openTRANS/DISPATCHNOTIFICATION/Dispatchnotification.cs create mode 100644 openTRANS/DISPATCHNOTIFICATION/DispatchnotificationHeader.cs create mode 100644 openTRANS/DISPATCHNOTIFICATION/DispatchnotificationInfo.cs create mode 100644 openTRANS/DISPATCHNOTIFICATION/DispatchnotificationItem.cs create mode 100644 openTRANS/DISPATCHNOTIFICATION/DispatchnotificationSummary.cs delete mode 100644 openTRANS/SHARED/Components.cs create mode 100644 openTRANS/SHARED/__delete_after_merging_pulls.cs create mode 100644 openTRANS/SHARED/delete_after_merge_invoice.cs diff --git a/openTRANS/DISPATCHNOTIFICATION/Dispatchnotification.cs b/openTRANS/DISPATCHNOTIFICATION/Dispatchnotification.cs new file mode 100644 index 0000000..81f583a --- /dev/null +++ b/openTRANS/DISPATCHNOTIFICATION/Dispatchnotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml.Schema; +using System.Xml.Serialization; + +namespace openTRANS { + [XmlRoot("DISPATCHNOTIFICATION", Namespace = "http://www.opentrans.org/XMLSchema/2.1", IsNullable = false)] + public class Dispatchnotification { + [XmlAttribute("schemaLocation", Namespace = XmlSchema.InstanceNamespace)] + public string xsiSchemaLocation => "http://www.opentrans.org/XMLSchema/2.1%20opentrans_2_1.xsd"; + + [XmlAttribute("version")] + public string Version => "2.1"; + + [XmlElement("DISPATCHNOTIFICATION_HEADER")] + public DispatchnotificationHeader DispatchnotificationHeader { get; set; } + + [XmlArray("DISPATCHNOTIFICATION_ITEM_LIST")] + [XmlArrayItem("DISPATCHNOTIFICATION_ITEM")] + public List DispatchnotificationItemList { get; set; } + + [XmlElement("DISPATCHNOTIFICATION_SUMMARY")] + public DispatchnotificationSummary DispatchnotificationSummary { + get => new DispatchnotificationSummary(this); + set { } + } + } +} diff --git a/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationHeader.cs b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationHeader.cs new file mode 100644 index 0000000..1f14f0f --- /dev/null +++ b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationHeader.cs @@ -0,0 +1,11 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class DispatchnotificationHeader { + [XmlElement("CONTROL_INFO")] + public ControlInfo ControlInfo { get; set; } + + [XmlElement("DISPATCHNOTIFICATION_INFO")] + public DispatchnotificationInfo DispatchnotificationInfo { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationInfo.cs b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationInfo.cs new file mode 100644 index 0000000..637f5b5 --- /dev/null +++ b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationInfo.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using static openTRANS.Common; + +namespace openTRANS { + public class DispatchnotificationInfo { + [XmlElement("DISPATCHNOTIFICATION_ID")] + public string DispatchnotificationId { get; set; } + + [XmlElement("DISPATCHNOTIFICATION_DATE")] + public DateTime DispatchnotificationDate { get; set; } + + [XmlElement("LANGUAGE")] + public Language Language { get; set; } + + [XmlElement("MIME_ROOT")] + public string MimeRoot { get; set; } + + [XmlElement("DELIVERY_DATE")] + public DeliveryDate DeliveryDate { get; set; } + + [XmlArray("PARTIES")] + [XmlArrayItem("PARTY")] + public List Parties { get; set; } + + [XmlElement("SUPPLIER_IDREF")] + public TypedItem SupplierIdref { get; set; } + + [XmlElement("BUYER_IDREF")] + public TypedItem BuyerIdref { get; set; } + + [XmlElement("SHIPMENT_PARTIES_REFERENCE")] + public ShipmentPartiesReference ShipmentPartiesReference { get; set; } + + [XmlElement("SHIPMENT_ID")] + public string ShipmentId { get; set; } + + [XmlElement("TRACKING_TRACING_URL")] + public string TrackingTracingUrl { get; set; } + + [XmlElement("DOCEXCHANGE_PARTIES_REFERENCE")] + public DocExchangePartiesReference DocExchangePartiesReference { get; set; } + + [XmlElement("LOGISTC_DETAILS_INFO")] + public LogisticDetailsInfo LogisticDetailsInfo { get; set; } + + [XmlElement("INTERNATIONAL_RESTRICTIONS")] + public TypedItem InternationalRestrictions { get; set; } + + [XmlElement("MIMEN_INFO")] + public MimeInfo MimeInfo { get; set; } + + [XmlElement("REMARKS")] + public List Remarks { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationItem.cs b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationItem.cs new file mode 100644 index 0000000..98b2439 --- /dev/null +++ b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationItem.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using System.Xml.Serialization; +using static openTRANS.Common; + +namespace openTRANS { + public class DispatchnotificationItem { + [XmlElement("LINE_ITEM_ID")] + public string LineItemId { get; set; } + + [XmlElement("PRODUCT_ID")] + public ProductId ProductId { get; set; } + + [XmlElement("PRODUCT_FEATURES")] + public ProductFeatures ProductFeatures { get; set; } + + [XmlElement("PRODUCT_COMPONENTS")] + public ProductComponents ProductComponents { get; set; } + + [XmlElement("QUANTITY")] + public decimal Quantity { get; set; } + + [XmlElement("ORDER_UNIT", Namespace = Namespace.bmecat)] + public string OrderUnit { get; set; } + + [XmlElement("PARTIAL_DELIVERY_LIST")] + public List PartialDeliveryList { get; set; } + + [XmlElement("DELIVERY_COMPLETED")] + public bool DeliveryCompleted { get; set; } + + [XmlElement("DELIVERY_REFERNCE")] + public DeliveryReference DeliveryReference { get; set; } + + [XmlElement("SUPPLIER_IDREF", Namespace = Namespace.bmecat)] + public TypedItem SupplierIdref { get; set; } + + [XmlElement("ORDER_REFERENCE")] + public OrderReference OrderReference { get; set; } + + [XmlElement("SUPPLIER_ORDER_REFERENCE")] + public SupplierOrderReference SupplierOrderReference { get; set; } + + [XmlElement("CUSTOMER_ORDER_REFERENCE")] + public CustomerOrderReference CustomerOrderReference { get; set; } + + [XmlElement("SHIPMENT_PARTIES_REFERENCE")] + public ShipmentPartiesReference ShipmentPartiesReference { get; set; } + + [XmlElement("LOGISTIC_DETAILS")] + public LogisticDetails LogisticDetails { get; set; } + + [XmlElement("MIME_INFO")] + public MimeInfo MimeInfo { get; set; } + + [XmlElement("REMARKS")] + public List Remarks { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationSummary.cs b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationSummary.cs new file mode 100644 index 0000000..ff575dc --- /dev/null +++ b/openTRANS/DISPATCHNOTIFICATION/DispatchnotificationSummary.cs @@ -0,0 +1,15 @@ +using System.Xml.Serialization; + +namespace openTRANS { + public class DispatchnotificationSummary { + public DispatchnotificationSummary() { + + } + public DispatchnotificationSummary(Dispatchnotification dispatchnotification) { + TotalItemNum = dispatchnotification.DispatchnotificationItemList.Count; + } + + [XmlElement("TOTAL_ITEM_NUM")] + public int TotalItemNum { get; set; } + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/Components.cs b/openTRANS/SHARED/Components.cs deleted file mode 100644 index 8a849da..0000000 --- a/openTRANS/SHARED/Components.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace openTRANS -{ - public class Components - { - } -} \ No newline at end of file diff --git a/openTRANS/SHARED/__delete_after_merging_pulls.cs b/openTRANS/SHARED/__delete_after_merging_pulls.cs new file mode 100644 index 0000000..ed56043 --- /dev/null +++ b/openTRANS/SHARED/__delete_after_merging_pulls.cs @@ -0,0 +1,23 @@ +using System; + +namespace openTRANS { + [Obsolete("This class is implemented in one of the open pull requests on github! Merge first", true)] + public class PartialDelivery { + } + + [Obsolete("This class is implemented in one of the open pull requests on github! Merge first", true)] + public class DeliveryReference { + } + + [Obsolete("This class is implemented in one of the open pull requests on github! Merge first", true)] + public class OrderReference { + } + + [Obsolete("This class is implemented in one of the open pull requests on github! Merge first", true)] + public class SupplierOrderReference { + } + + [Obsolete("This class is implemented in one of the open pull requests on github! Merge first", true)] + public class LogisticDetails { + } +} \ No newline at end of file diff --git a/openTRANS/SHARED/delete_after_merge_invoice.cs b/openTRANS/SHARED/delete_after_merge_invoice.cs new file mode 100644 index 0000000..08f0a9d --- /dev/null +++ b/openTRANS/SHARED/delete_after_merge_invoice.cs @@ -0,0 +1,4 @@ +namespace openTRANS { + public class LogisticDetailsInfo { + } +} \ No newline at end of file diff --git a/openTRANS/openTRANS.csproj b/openTRANS/openTRANS.csproj index af412ab..66f0653 100644 --- a/openTRANS/openTRANS.csproj +++ b/openTRANS/openTRANS.csproj @@ -15,7 +15,6 @@ -