invopop / gobl

Go Business Language
Apache License 2.0
80 stars 5 forks source link

Unit updates and compatibility with UN/ECE codes #223

Closed samlown closed 9 months ago

samlown commented 9 months ago
samlown commented 9 months ago

@cavalle I hear you, but I'm not convinced on the alternate paths at the moment. Also bare in mind that the previous version allowed any key in the unit field. You'll see in the commit there that some of the tests in Mexico were using an invalid unit, which wasn't great either.

While it feels a bit unusual, the JSON Schema is sound. Its just a string for which you can use a constant, or a code. The unit isn't used for decision making, which lessons the requirements, and I think its useful to be able to fall back on standard codes if the customer requires it.

I'll commit for the time being so we can fix some of the issues in Mexico.