Git Product home page Git Product logo

opentrans.net's People

Contributors

guiohm avatar jmu-horaios avatar mitchvdl avatar patricksproll avatar rainer-helbing avatar stephanstapel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

opentrans.net's Issues

_translateCountry() additions

Hi,

not an urgent issue, but maybe you could add some more country codes to the _translateCountry method, e.g. at least "Austria / AT".

Thank you!

Map ORDERRESPONSE_DATE to Order

Heyho 👋

First of all: Thank you for providing this helpful library/package. I'm currently using your library to realize a communication with an external service and they use the ORDERRESPONSE_DATE element to provide the information when they processed an order, so they call it "confirmation date" internally. Unfortunately you don't provide a Property in Order or OrderResponse for this element, only on serialization of an OrderResponse you write DateTime.Now into it:

_writeDateTime(Writer, "ORDERRESPONSE_DATE", DateTime.Now);

Do you plan to add the ORDERRESPONSE_DATE to Order and OrderResponse or isn't it relevant enough for the majority to put some effort into it? Fortunately it's not that critical for me, so it's no a reason to not use your libray.

Thanks in advance.

Quantity Codes are not complete

I noticed that the current package published on Nuget lists every existing unit of measurement and probably more, but the latest version on GitHub just lists a few codes. Did this reduction happen by mistake, or was there an intention?

Also, while I was searching for some codes I found this website. It has a table of all codes with proper unit name and sometimes even a description. Maybe I can find some time to write a script for parsing the table. So we could use the result to complete the quantity codes with comment for each one. Guess that would help a lot to find the correct code without leaving the IDE.

Feature Request: Party.RolesUnknown

Hi Stephan,

I'm using your library to read an ORDER_RESPONSE, where the sender uses Parties with party roles that are not part of standard (e.g. "object_owner").
Fortunately your parser is able to read these values as PartyRoles.unknown. However, I would like to know the original value, that was sent in the XML (i.e. "object_owner"). Therefore I would like to add an additional property to Party.

        /// <summary>
        /// Original string values of each "unknown" party role 
        /// </summary>
        public List<string> RolesUnknown { get; set; } = new List<string>();

To load and store this property, BaseReader and BaseWriter would need to be modified.

If you agree to this new feature, I can send you a pull request for these changes. At the moment, I cannot push to your repository.

regards
Rainer

Wrong element EMAILS in ADDRESS

You have the element EMAILS in the ADDRESS, but when i look in the OpenTrans documentation ADDRESS only have a EMAIL element and the EMAILS element is in CONTACT_DETAILS. Can you please have a look on this?
Thanks

Issue when recipient is using XmlConvert.ToBoolean to parse boolean field

Hello Stephan,

first off, thanks for your work. It is a really easy to use API and the documents look good for us.

We noticed that you hardcoded PARTIAL_SHIPMENT_ALLOWED to TRUE or FALSE when creating the Order object:

_writeOptionalElementString(Writer, "PARTIAL_SHIPMENT_ALLOWED", order.PartialShipmentAllowed? "TRUE": "FALSE");

However, we noticed that our receiver system seems to be using XmlConvert.ToBoolean, which apparently does not like the upper-case variant of TRUE or FALSE.

Since the openTRANS 2.1 document states, dtBoolean values are case-insensitive.

What is your view on changing it in your library, to make it seemingly more broadly compatible with other systems vs. keeping it upper-case, since it should not matter?

Thanks!

NuGET package

Hi,
would you mind publishing your library as a NuGET package?
Thank you,
best regards

24H format is not parsed.

Hi, thanks for the Lib.

In the BaseReader Class there is the _nodeAsDateTime() method, which will return null if the time is in 24H format e.g. "2021-08-05T14:48:37"

To parse it you are using TryParseExact with the format "yyyy-MM-ddThh:mm:ss". the hh are for 12H for 24 one should use HH in C#.
Is that a bug or a requirement? :)

Here the code

if (DateTime.TryParseExact(_temp, "yyyy-MM-ddThh:mm:sszzz", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime retval))

I found that OpenTrans use ISO 8601 (Second edition 1997) as the DateTime field, which is in 24H format
https://www.w3.org/TR/NOTE-datetime-970915

Should I make a PR replacing the format?

Thanks again.

some elements are in the wrong position

according to specification

  • CONTACT_DETAILS has to be between DEPARTMENT and STREET
  • EMAILS has to be between URL and AUTHENTIFICATION
  • PRODUCT_FEATURES has to be between PRODUCT_ID and PRODUCT_COMPONENTS

Address Country

Hi Stephan,

it would be great if you could make some small adjustments regarding the Address item's country properties.

  • "COUNTRY_CODE" should be "COUNTRY_CODED"
  • "COUNTRY" property as a separate string variable which can be set individually, like "Germany", "Deutschland", "Österreich", "Oesterreich", "Austria", etc.

Thank you!

date parsing ignores timezones

Hi Stephan,

while trying to load and store an ORDER_RESPONSE, I noticed that timezones are ignored.

The documentation says this:
grafik

But your code in BaseReader only reads the part before "+".

best regards
Rainer

Missing support for various elements

Support for following tags seems to be missing:

  • CONTROL_INFO

    • GENERATOR_INFO
  • ORDER_INFO

    • CUSTOMER_ORDER_REFERENCE
      • ORDER_ID
    • ORDER_PARTIES_REFERENCE
      • bmecat:BUYER_IDREF
      • bmecat:SUPPLIER_IDREF
      • SHIPMENT_PARTIES_REFERENCE
    • bmecat:CURRENCY
    • PARTIAL_SHIPMENT_ALLOWED
  • SHIPMENT_PARTIES_REFERENCE

    • DELIVERY_IDREF
  • ORDER_ITEM

    • PRODUCT_FEATURES
      • FEATURE
        • bmecat:FNAME
        • bmecat:FVALUE
    • PRODUCT_PRICE_FIX
      • bmecat:PRICE_AMOUNT
      • bmecat:PRICE_QUANTITY
  • ORDER

    • ORDER_SUMMARY
      • TOTAL_ITEM_NUM
      • TOTAL_AMOUNT

nuget for version 2.0.0 packed wrong

It seems that the nuget for version 2.0.0 was packed wrong, so the assembly is not referenced and namespaces not visible.
The assembly is not in the lib subfolder where afaik it should be....

Party ID Type

Hi Stephan,

would you mind implementing the property "Party ID Type"?
At the moment, this is set as a static string in BaseWriter.cs ("PredefinedOrCustomType").
However, some suppliers need texts like "buyer_specific" or "supplier_specific" to be set as type here.

Thank you,
best regards
Daniel

InvalidOperationException when saving to file

Hi,

I just tried your _createOrder() example method of file Application.cs.
Unfortunately, the Save() method results in an exception (message in German: "Token StartElement im Status Epilog würde in einem ungültigen XML-Dokument resultieren.").
An empty XML file is created.

This also happens when creating an order with minimal given items like only an order ID, and even with an empty order.

For me it seems like there is some invalid base XML tag created within the library.

It would be great if you could solve this error.

Thank you!

Edit: It happens in OrderWriter.cs; it cannot write the items ORDER_ITEM_LIST, ORDER_SUMMARY and TOTAL_ITEM_NUM.
Could maybe some none-existing URLs on top (xmlns, schemaLocation etc.) be the cause?

OrderResponse is always empty

Hello,

I download orders from an FTP folder and have to process them afterwards. However, I have the problem that OrderResponse is always empty.

I load the content of the orders in a MemoryStream and call OrderResponse.Load(Stream).

I have attached a sample file (anonymized) including an image.
I use the latest available version via NuGet in a .NET Core 3.1 class library.

example.zip

Reading additional information in order response files

Hi Stephan,

while reading / writing an order-response file from a supplier with your library I noticed some errors e.g.

  • PRODUCT_FEATURES are missing description (there is an error in the reader)
  • ALLOW_OR_CHARGES_FIX which is part of PRODUCT_PRICE_FIX is missing

Is it ok, if I fix the errors I find and send you the pull requests? I don't want to open an issue for each of them.

regards
Rainer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.