ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
242 stars 138 forks source link

Provide a way to set uriUniversalCommunicationId on the TradeParty using JSON deserialization #456

Closed phermsdorf closed 2 months ago

phermsdorf commented 3 months ago

Hi,

to create a valid xRechnung we need to be able to set the EMail Adress of a TradeParty. A setter would maybe look like this:

public void setUniversalCommunicationId(final String email) {
    uriUniversalCommunicationId = new SchemedID("EM", email);
}

Since we want to create the Invoice and TradeParty Objects by deserializing from JSON we need a way to set uriUniversalCommunicationId like the other values in the DeSerializationTest.java.

If you guide me a bit, i could also try to provide a pull request. Thank you!

Bye Peter

jstaerk commented 2 months ago

hi, did this work?

phermsdorf commented 2 months ago

Yes, i tried to document the usage by adjusting the test case in #460 . You need to use the setEmail method which internally creates the correct SchemeID and email address.