fix(compliance): improve compliance

This commit is contained in:
2025-05-28 11:31:31 +00:00
parent 0140267eb2
commit a5b2d435d4
5 changed files with 157 additions and 4 deletions

View File

@ -75,12 +75,12 @@ export class EN16931Validator {
}
// BR-08: Seller postal address is mandatory
if (!invoice.from?.address?.city || !invoice.from?.address?.postalCode || !invoice.from?.address?.countryCode) {
if (!invoice.from?.address?.city || !invoice.from?.address?.postalCode || (!invoice.from?.address?.countryCode && !invoice.from?.address?.country)) {
errors.push('BR-08: Seller postal address (city, postal code, country) is mandatory');
}
// BR-10: Buyer postal address is mandatory
if (!invoice.to?.address?.city || !invoice.to?.address?.postalCode || !invoice.to?.address?.countryCode) {
if (!invoice.to?.address?.city || !invoice.to?.address?.postalCode || (!invoice.to?.address?.countryCode && !invoice.to?.address?.country)) {
errors.push('BR-10: Buyer postal address (city, postal code, country) is mandatory');
}