Skip to content

regimes: add Australia (AU) and New Zealand (NZ) GST tax regimes - #885

Open
migueltorresvalls wants to merge 1 commit into
mainfrom
au-nz-regime
Open

regimes: add Australia (AU) and New Zealand (NZ) GST tax regimes#885
migueltorresvalls wants to merge 1 commit into
mainfrom
au-nz-regime

Conversation

@migueltorresvalls

@migueltorresvalls migueltorresvalls commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Add GST-based tax regimes for Australia and New Zealand.

Changes:

  • AU: GST 10%, ABN tax-ID validation (weighted mod-89 checksum)
  • NZ: GST 15%, IRD-number validation (mod-11 checksum), te reo Māori (MI) translations
  • Register au & nz; regenerate embedded data (regimes, rules, regime-code schema)

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

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.02913% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.80%. Comparing base (595b77a) to head (602103f).
⚠️ Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
regimes/nz/tax_identity.go 94.87% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #885      +/-   ##
==========================================
+ Coverage   94.75%   94.80%   +0.04%     
==========================================
  Files         343      349       +6     
  Lines       18815    19021     +206     
==========================================
+ Hits        17829    18033     +204     
- Misses        600      601       +1     
- Partials      386      387       +1     

☔ View full report in Codecov by Harness.
📢 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.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds new GST-based tax regimes for Australia (AU) and New Zealand (NZ), including regime definitions, tax categories, tax identity validation/normalization, and regenerated embedded schema/rules/regime data.

Changes:

  • Register new AU and NZ regimes and include them in the global regimes registry.
  • Implement AU ABN and NZ IRD tax identity validation + normalization, with accompanying tests.
  • Regenerate embedded regime/rules data and extend the regime-code JSON schema to include AU and NZ.

Reviewed changes

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

Show a summary per file
File Description
regimes/regimes.go Registers the AU and NZ regime packages for side-effect initialization.
regimes/au/au.go Defines the AU regime metadata and registers rules + normalization.
regimes/au/tax_categories.go Adds AU GST category and standard 10% rate definition.
regimes/au/tax_identity.go Adds AU ABN format + checksum validation and normalization hook.
regimes/au/tax_identity_test.go Tests AU ABN validation and normalization behavior.
regimes/nz/nz.go Defines the NZ regime metadata (incl. MI name) and registers rules + normalization.
regimes/nz/tax_categories.go Adds NZ GST category and standard 15% rate definition with EN/MI strings.
regimes/nz/tax_identity.go Adds NZ IRD format + checksum validation and normalization hook.
regimes/nz/tax_identity_test.go Tests NZ IRD validation and normalization behavior.
data/schemas/tax/regime-code.json Extends the regime code schema to include AU and NZ.
data/rules/au.json Generated embedded rules for AU tax identity validation.
data/rules/nz.json Generated embedded rules for NZ tax identity validation.
data/regimes/au.json Generated embedded AU regime definition data.
data/regimes/nz.json Generated embedded NZ regime definition data.

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

Comment on lines +37 to +45
// isValidTaxIdentityCode reports whether the value is an ABN with valid check
// digits. Empty or non-conforming values are left to the format rule above.
func isValidTaxIdentityCode(value any) bool {
code, ok := value.(cbc.Code)
if !ok || code == "" {
return true
}
return validABN(code.String())
}
Comment on lines +48 to +57
// isValidTaxIdentityCode reports whether the value is an IRD number within range
// and with a valid check digit. Empty or non-conforming values are left to the
// format rule above.
func isValidTaxIdentityCode(value any) bool {
code, ok := value.(cbc.Code)
if !ok || code == "" {
return true
}
return validIRD(code.String())
}
Comment thread regimes/regimes.go
Comment on lines 8 to 12
_ "github.com/invopop/gobl/regimes/ae"
_ "github.com/invopop/gobl/regimes/ar"
_ "github.com/invopop/gobl/regimes/at"
_ "github.com/invopop/gobl/regimes/au"
_ "github.com/invopop/gobl/regimes/be"
@samlown samlown added the regime Related to a specific regime. label Jul 6, 2026
@migueltorresvalls migueltorresvalls mentioned this pull request Jul 18, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

regime Related to a specific regime.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants