Add Malta Regime - #956
Add Malta Regime#956XiaoY-X wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
==========================================
+ Coverage 96.88% 96.90% +0.01%
==========================================
Files 335 337 +2
Lines 15916 16005 +89
==========================================
+ Hits 15421 15509 +88
- Misses 494 495 +1
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and tests appear consistent with existing regime patterns, with only a minor comment wording fix requested.
Pull request overview
Adds first-class support for the Malta (MT) VAT regime to GOBL, including VAT rate definitions, tax identity validation/normalization, generated regime/rules artifacts, and example documents.
Changes:
- Introduces
regimes/mtwith VAT categories/rates (including historical rate changes) and MT VAT number checksum validation. - Registers the MT regime and updates generated schema/rules/regime data to include
MT. - Adds Malta invoice examples (domestic + intra-community) and updates the changelog.
File summaries
| File | Description |
|---|---|
| regimes/regimes.go | Registers the MT regime package so it’s available at runtime. |
| regimes/mt/mt.go | Defines the Malta regime metadata, sources, timezone, scenarios, and categories. |
| regimes/mt/tax_categories.go | Adds MT VAT category with standard/reduced rate tiers and historical values. |
| regimes/mt/tax_identity.go | Implements MT VAT number format + MOD 37 checksum validation rules. |
| regimes/mt/mt_test.go | Tests regime construction and rate resolution (including history and commencements). |
| regimes/mt/tax_identity_test.go | Tests normalization and validation edge cases for MT VAT identities. |
| data/schemas/tax/regime-code.json | Adds MT to the regime-code schema enumeration. |
| data/rules/mt.json | Generated rules output for MT tax identity validation. |
| data/regimes/mt.json | Generated MT regime definition for distribution/consumption. |
| examples/mt/invoice-mt-en.yaml | Adds a domestic MT invoice example exercising multiple positive VAT rates. |
| examples/mt/invoice-mt-intra-community.yaml | Adds an MT→IE intra-community supply example using the correct VAT key. |
| examples/mt/out/invoice-mt-en.json | Generated output envelope for the domestic MT example. |
| examples/mt/out/invoice-mt-intra-community.json | Generated output envelope for the intra-community MT example. |
| data/schemas/pay/credit-transfer.json | Normalizes schema formatting to match generator output (removes persistent diff). |
| CHANGELOG.md | Documents the addition of the MT regime and VAT identity validation. |
Review details
- Files reviewed: 12/15 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Since versions a percentage, not the supplies it applies to: the Eighth Schedule items | ||
| // named below are today's and are not versioned. |
There was a problem hiding this comment.
Fixed in ed2e8cf: the comment now reads "Since each rate's history versions a percentage, not the supplies it applies to, ..."
# Conflicts: # CHANGELOG.md
CHANGELOG.md is now generated from the changes directory, so the Malta entry moves to its own unreleased file. Also rewords the rate history comment flagged in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
TestRateHistorycovers each transition.taxCategories. Names are English-only, since the VAT Act is enacted in English.[3, 4, 6, 7, 8, 9]and check against the last two digits. Only article 10 , 12 numbers are accepted. Article 13(3) gives those theMTprefix and says an article 11 small-enterprise number "shall not be treated for any purposes of this Act as a value added tax identification number". Article 50 agrees from the other side, since such a person issues fiscal receipts, never tax invoices.11679112, and is written out in a comment. Where valvat and python-stdnum diverge the stricter form is used.exempt. Fifth Schedule Part One is "exempt with credit" (no VAT charged, but input tax still recoverable under article 22(4)), mapping tozero,exportandintra-community; Part Two is "exempt without credit", which isexempt.tax.GlobalVATKeys()is used unchanged.Not included
Each is noted in
mt.gowith its statutory basis rather than left silent.scenarios.go. The Twelfth Schedule transposes Directive 2006/112/EC verbatim, and item 1(1) accepts full Directive compliance as sufficient for a valid Maltese tax invoice.org_identities.go. A Maltese tax invoice carries no non-tax business identifier; Twelfth Schedule item 3 requires name, address and VAT number only.Sources
The Act's rate table was cross-checked against the MTCA's published summary; the two agree item for item.
Notes
mage checkpasses: lint, generate, tests and a clean git state.Two details could go either way and I'd welcome an opinion:
Pre-Review Checklist
go generate .to ensure that the Schemas and Regime data are up to date.changes/unreleasedentry with an overview of my changes (CHANGELOG.md is generated from it).And if you are part of the org: