Use bean class level validators
djmj opened this issue · 2 comments
djmj commented
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
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 commented
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.