Skip to content

Commit

Permalink
Additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanstapel committed Sep 21, 2020
1 parent 14ee96f commit a77ba46
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 3 deletions.
9 changes: 8 additions & 1 deletion OpenTrans.net/BuyerProductId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ namespace OpenTrans.net
/// <summary>
/// Identifier of the product from the perspective of the buyer. The included elements ensure the capability of a unique identification of a product.
/// </summary>
public class BuyerProductId
public class BuyerProductId
{
/// <summary>
/// The actual Id that is assigned from the perspective of the buyer
/// </summary>
public string Id { get; set; }

/// <summary>
/// This attribute specifies the type of ID, i.e. indicates the organization that has issued the ID.
/// </summary>
public BuyerProductIdTypes Type { get; set; }
}
}
3 changes: 3 additions & 0 deletions OpenTrans.net/BuyerProductIdTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/
namespace OpenTrans.net
{
/// <summary>
/// Types for the product number used by the buying company.
/// </summary>
public enum BuyerProductIdTypes
{
/// <summary> Artikelnummer des einkaufenden Unternehmens </summary>
Expand Down
4 changes: 2 additions & 2 deletions OpenTrans.net/OpenTrans.net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>netstandard2.0</TargetFramework>
<PackageLicenseExpression>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseExpression>
<Authors>Stephan Stapel, [email protected]</Authors>
<Version>4.0.1</Version>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<Version>4.0.2</Version>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<FileVersion>4.0.1.0</FileVersion>
</PropertyGroup>

Expand Down
76 changes: 76 additions & 0 deletions OpenTrans.net/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,99 @@

namespace OpenTrans.net
{
/// <summary>
/// Order that is issues from a Buyer to a Seller.
/// </summary>
public class Order
{
/// <summary>
/// Unique order number of the buyer
/// </summary>
public string Id { get; set; }

/// <summary>
/// Date of the order
/// </summary>
public DateTime? OrderDate { get; set; }

/// <summary>
/// Date of shipment. The delivery date specifies the date the commissioned goods are accepted
/// by the buyer.If the delivery date deviates from the one specified in the header, the
/// delivery date on item level is valid.To specify exact one date for the shipment, e.g. in the
/// RECEIPTACKNOWLEDGEMENT-document.
///
/// This property is accompanied by the property DesiredDeliveryDateEnd which specifies the end of the
/// delivery window.
/// </summary>
public DateTime DesiredDeliveryDateStart { get; set; }

/// <summary>
/// Date of shipment. The delivery date specifies the date the commissioned goods are accepted
/// by the buyer.If the delivery date deviates from the one specified in the header, the
/// delivery date on item level is valid.To specify exact one date for the shipment, e.g. in the
/// RECEIPTACKNOWLEDGEMENT-document.
///
/// This property is accompanied by the property DesiredDeliveryDateStart which specifies the start of the
/// delivery window.
/// </summary>
public DateTime DesiredDeliveryDateEnd { get; set; }

/// <summary>
/// The element is related to an item and refers to the previous order where the item was ordered
/// by the customer(purchasing party)
/// </summary>
public CustomerOrderReference CustomerOrderReference { get; set; }

/// <summary>
/// Reference to the business partners integrated in the process of the document flow
/// </summary>
public OrderPartiesReference OrderPartiesReference { get; set; }

/// <summary>
/// Provides the currency that is default for all price information in the catalog. If the price of a
/// product has a different currency, or this element is not used, the the currency has to be
/// specified in the corresponding element for the respective product.
/// </summary>
public string Currency { get; set; }

/// <summary>
/// Flag to indicate whether partial shipment is allowed. If allowed the value is TRUE, FALSE
/// otherwise.The flag is binding for the order, i.e. if the value is set to FALSE and only partial
/// shipments can be made by the recipient of the order, the order shall be invalid.
/// </summary>
public bool PartialShipmentAllowed { get; set; }

/// <summary>
/// List of parties that are relevant to this business document
/// </summary>
public List<Party> Parties { get; set; } = new List<Party>();
public List<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
public OrderSummary OrderSummary { get; set; }


/// <summary>
/// Loads an order from the given stream.
///
/// Make sure that the stream is open. After successful reading, the stream is left open, i.e.
/// the caller of the library has to take care of the stream lifecycle.
///
/// If the stream is not open or readable, an IllegalStreamException exception is raised.
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
public static Order Load(Stream stream)
{
OrderReader reader = new OrderReader();
return reader.Load(stream);
} // !Load()


/// <summary>
/// Loads an order from the given file.
/// If the file does not exist, a FileNotFoundException exception is raised.
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static Order Load(string filename)
{
OrderReader reader = new OrderReader();
Expand All @@ -67,6 +139,10 @@ public void Save(Stream stream)
} // !Save()


/// <summary>
/// Saves the order into the given file.
/// </summary>
/// <param name="filename"></param>
public void Save(string filename)
{
OrderWriter writer = new OrderWriter();
Expand Down
20 changes: 20 additions & 0 deletions OpenTrans.net/OrderResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,29 @@ public class OrderResponse



/// <summary>
/// Loads an order response from the given stream.
///
/// Make sure that the stream is open. After successful reading, the stream is left open, i.e.
/// the caller of the library has to take care of the stream lifecycle.
///
/// If the stream is not open or readable, an IllegalStreamException exception is raised.
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
public static OrderResponse Load(Stream stream)
{
OrderResponseReader reader = new OrderResponseReader();
return reader.Load(stream);
} // !Load()


/// <summary>
/// Loads an order response from the given file.
/// If the file does not exist, a FileNotFoundException exception is raised.
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static OrderResponse Load(string filename)
{
OrderResponseReader reader = new OrderResponseReader();
Expand All @@ -64,6 +80,10 @@ public void Save(Stream stream)
} // !Save()


/// <summary>
/// Saves the order response into the given file.
/// </summary>
/// <param name="filename"></param>
public void Save(string filename)
{
OrderResponseWriter writer = new OrderResponseWriter();
Expand Down

0 comments on commit a77ba46

Please sign in to comment.