konik-io / konik

A library to create, read and validate ZUGFeRD compliant invoices. Available for Java and .NET
https://konik.io
Other
46 stars 18 forks source link

Use bean class level validators #61

Closed djmj closed 5 years ago

djmj commented 5 years ago

The class MonetarySummationValidator could be defined as a bean validator on class level. This could make the code cleaner and if a different Validator instance is used on Invoice bean it will still validate the summation (see #60).

Something like:

// validate global sums with calculated
@ValidInvoice
public class Invoice

// validate properties for comformance level
@ValidMonetarySummation
public class MonetarySummation

// validate things as gross / net price/unit compared to total line amount, tax values
@ValidItem
public class Item { }
Vad1mo commented 5 years ago

Like the concept with @ValidInvoice, makes sense if lib uses are already in the bean validation environment.

Perfect fit for 1.4 release

Regarding @ValidMonetarySummation, @ValidItem need to check if it can make it to 1.4 as well.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.