Skip to content

Add Finland regime#748

Open
rilla wants to merge 8 commits into
invopop:mainfrom
rilla:finland-regime
Open

Add Finland regime#748
rilla wants to merge 8 commits into
invopop:mainfrom
rilla:finland-regime

Conversation

@rilla

@rilla rilla commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduced new tax regime for Finland (FI) with the following VAT categories:
    • standard (25.5%)
    • reduced (13.5%)
    • super-reduced (10%)
  • Added historical VAT rates (2013-2026)
  • Implemented Y-tunnus (Business ID) validation based on MOD 11
  • Added a B2B invoice example GOBL document
  • Added tests for all regime-specific logic
  • Corrections left undefined: Finnish VAT law doesn't restrict correction to specific document types, so GOBL's default permissive behavior applies
  • No supplier tax ID validation: Finland has a €20,000 annual turnover threshold for VAT registration (since 2025). Sellers below it aren't VAT-registered and have no obligation to include a VAT identification number on invoices.
  • Updated CONTRIBUTING.md to remove stalled references to deleted template and provide more detailed instructions for new regime additions.

Sources

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.

@rilla rilla force-pushed the finland-regime branch 5 times, most recently from b8c8646 to 514fb69 Compare March 1, 2026 23:03
@samlown samlown requested a review from Copilot March 2, 2026 08:57
@codecov

codecov Bot commented Mar 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.46835% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.77%. Comparing base (225e39d) to head (f00183b).

Files with missing lines Patch % Lines
regimes/fi/tax_identity.go 92.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #748      +/-   ##
==========================================
+ Coverage   94.75%   94.77%   +0.01%     
==========================================
  Files         343      345       +2     
  Lines       18815    18894      +79     
==========================================
+ Hits        17829    17906      +77     
- 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.

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 a new Finland (FI) tax regime to GOBL, including VAT categories/rates, Y-tunnus (Business ID) validation, invoice requirements, and supporting generated data/examples.

Changes:

  • Registered the new fi regime and added FI to the regime-code JSON schema enum.
  • Implemented FI VAT categories (with historical rates) plus FI-specific validation/normalization (tax identity + invoice requirements) with tests.
  • Added FI example invoice documents and generated regime definition data, plus updated contributor guidance and changelog.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
regimes/regimes.go Registers the new Finland regime via blank import.
regimes/fi/fi.go Defines FI regime metadata and dispatches validation/normalization.
regimes/fi/tax_categories.go Declares FI VAT categories and historical rate values.
regimes/fi/tax_identity.go Adds Y-tunnus checksum validation logic.
regimes/fi/invoices.go Enforces FI invoice supplier Tax ID requirements.
regimes/fi/tax_identity_test.go Tests for FI tax ID validation and normalization.
regimes/fi/invoices_test.go Tests invoice validation requirement and date-based VAT calculations.
examples/fi/invoice-fi-fi.yaml Adds an FI invoice example input document.
examples/fi/out/invoice-fi-fi.json Adds generated JSON output for the FI example.
data/schemas/tax/regime-code.json Adds "FI" to the schema enum list.
data/regimes/fi.json Adds generated FI regime definition data.
CONTRIBUTING.md Updates regime-addition guidance and references.
CHANGELOG.md Notes the new FI regime addition.

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

Comment thread CONTRIBUTING.md
Comment thread regimes/fi/tax_identity_test.go Outdated

@samlown samlown left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very nice! Not much to change here. We just need to double check the situation with Finish Tax Identities to ensure a VAT ID is required for any invoice.

Comment thread regimes/fi/invoices.go Outdated
Comment thread CONTRIBUTING.md Outdated
@rilla rilla force-pushed the finland-regime branch 2 times, most recently from b7f3cfd to 3364e4c Compare March 2, 2026 09:44
Comment thread regimes/fi/tax_categories.go Outdated
@rilla rilla marked this pull request as ready for review March 2, 2026 09:55
@rilla

rilla commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the early review, @samlown, caught me in the middle of some final polish. I've addressed your (and Copilot's) comments and this is now ready for a final review.

@samlown

samlown commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Sorry! Too keen :-) I should have waited for the non-draft state! Just let me know when ready.

@rilla

rilla commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

Since #750 has been approved, I've amended the historic rates definitions so they reflect effective dates. I've also removed invoices_test.go as that behavior will be covered in tax/rate_def_test.go once the fix is merged.

@samlown samlown left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excelent.

# Conflicts:
#	CHANGELOG.md
@rilla rilla force-pushed the finland-regime branch 2 times, most recently from 28c7ddb to 567561d Compare April 15, 2026 15:51
@rilla

rilla commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

Hey @samlown, I've updated this branch with master and ported the regime to use validation rules.

@rilla rilla requested a review from samlown April 15, 2026 16:39
@samlown samlown requested a review from Copilot April 15, 2026 16:39

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

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


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

Comment thread regimes/fi/tax_identity.go
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated

@samlown samlown left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@samlown samlown added enhancement New feature or request regime Related to a specific regime. labels Jun 16, 2026
# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request regime Related to a specific regime.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants