Skip to content

Ticketbai: Customer validation now only required for non-simplified invoices#754

Open
pmenendz wants to merge 2 commits intomainfrom
ticketbai
Open

Ticketbai: Customer validation now only required for non-simplified invoices#754
pmenendz wants to merge 2 commits intomainfrom
ticketbai

Conversation

@pmenendz
Copy link
Contributor

@pmenendz pmenendz commented Mar 5, 2026

  • Replace this bullet list with your changes

Pre-Review Checklist

  • Opened this PR as a draft
  • Read the CONTRIBUTING.md guide.
  • Performed a self-review of my code.
  • Added thorough tests with at least 90% code coverage.
  • Modified or created example GOBL documents to show my changes in use, if appropriate.
  • Added links to the source of the changes in tax regimes or addons, either structured or in the comments.
  • Run go generate . to ensure that the Schemas and Regime data are up to date.
  • Reviewed and fixed all linter warnings.
  • Been obsessive with pointer nil checks to avoid panics.
  • Updated the CHANGELOG.md with an overview of my changes.
  • Marked this PR as ready for review.

And if you are part of the org:

  • Requested a review from Copilot and fixed or dismissed (with a reason) all the feedback raised.
  • Requested a review from @samlown.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.05%. Comparing base (54ba861) to head (7fdad57).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #754   +/-   ##
=======================================
  Coverage   93.05%   93.05%           
=======================================
  Files         333      333           
  Lines       17794    17798    +4     
=======================================
+ Hits        16558    16562    +4     
  Misses        870      870           
  Partials      366      366           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

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

Updates the Spain TicketBAI (es-tbai-v1) addon invoice validation rules so that customer presence and TaxID validation are enforced only for non-simplified invoices, aligning validation behavior with simplified-invoice expectations.

Changes:

  • Make inv.Customer required only when the invoice is not tagged tax.TagSimplified, and only then run TicketBAI-specific customer TaxID validation.
  • Add test cases covering missing customer for standard invoices, and allowing missing customer / missing customer TaxID for simplified invoices.
  • Add an Unreleased changelog entry documenting the behavior change.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
addons/es/tbai/bill.go Gates customer Required + TicketBAI customer validation behind !inv.HasTags(tax.TagSimplified)
addons/es/tbai/bill_test.go Adds regression/behavior tests for standard vs simplified invoice customer requirements
CHANGELOG.md Documents the validation behavior change under Unreleased/Changed

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

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