Skip to content

Add ZATCA rule set#9

Open
migueltorresvalls wants to merge 2 commits intomainfrom
zatca-support
Open

Add ZATCA rule set#9
migueltorresvalls wants to merge 2 commits intomainfrom
zatca-support

Conversation

@migueltorresvalls
Copy link
Copy Markdown

No description provided.

@migueltorresvalls migueltorresvalls changed the title Add ZATCA rule set and schematron Add ZATCA rule set Apr 27, 2026
@migueltorresvalls migueltorresvalls marked this pull request as ready for review April 27, 2026 17:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Saudi Arabia (ZATCA) e-invoicing validation support via phive-rules, and introduces a targeted fallback to recover from a known SVRL/JAXB parsing failure in the ZATCA Schematron layer.

Changes:

  • Register ZATCA validation rules in the Phive rules initializer.
  • Add the phive-rules-zatca Maven dependency.
  • Add a ZATCA-specific Schematron SVRL fallback path that re-runs the XSLT and parses SVRL with schema validation disabled after stripping whitespace-only text nodes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main/java/rpc/ValidationServiceImpl.java Adds ZATCA Schematron SVRL fallback re-parse logic and uses the “effective” result when building layer output.
src/main/java/config/PhiveRulesInitializer.java Registers the ZATCA ruleset via reflection-based initializer.
pom.xml Adds phive-rules-zatca dependency to include the ZATCA ruleset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 18 to 31
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.helger.collection.commons.ICommonsList;
import com.helger.diagnostics.error.level.IErrorLevel;
import com.helger.diagnostics.error.list.ErrorList;
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports java.nio.charset.StandardCharsets and com.helger.diagnostics.error.level.IErrorLevel remain in this file but are not referenced anywhere. Please remove them to keep the file clean and avoid lint/build failures if unused-import checks are enabled.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants