Conversation
Adds a VAT tax regime for South Korea, following the existing Norway regime and using the current rules + norm validation framework. - VAT (부가가치세) at the standard 10% rate, with zero-rating for exports - Business Registration Number (사업자등록번호) check-digit validation - Credit and debit note corrections (revised tax invoice, 수정세금계산서) - Example invoices and regenerated regime/rule/schema data
|
Ready for review @samlown — thanks! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #878 +/- ##
=======================================
Coverage 94.75% 94.76%
=======================================
Files 343 345 +2
Lines 18815 18878 +63
=======================================
+ Hits 17829 17890 +61
- Misses 600 601 +1
- Partials 386 387 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new South Korea (KR) tax regime to the GOBL regimes registry, including VAT definitions, BRN (사업자등록번호) normalization/validation, and example documents, and regenerates the derived JSON rule/regime artifacts and schema enum.
Changes:
- Register the new
krregime and define KR VAT (10%) category/rate metadata. - Add KR tax identity normalization + BRN check-digit validation with unit/integration tests.
- Add KR example invoices/credit note and regenerate
data/regimes/kr.json,data/rules/kr.json, and the regime-code schema enum.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| regimes/regimes.go | Registers the new KR regime via blank import. |
| regimes/kr/kr.go | Defines and registers the KR regime (VAT scheme, timezone, corrections, norm/rules wiring). |
| regimes/kr/tax_categories.go | Adds KR VAT category and 10% general rate with sources. |
| regimes/kr/tax_identity.go | Implements KR BRN validation rules + check-digit algorithm hook. |
| regimes/kr/kr_test.go | Regime + invoice calculation/validation tests for KR. |
| regimes/kr/tax_identity_test.go | Normalization + validation tests for KR BRN handling. |
| regimes/kr/tax_identity_internal_test.go | Direct guard-rail test for isValidBRN type assertion behavior. |
| examples/kr/invoice-kr-standard.yaml | Source example for a standard KR invoice. |
| examples/kr/invoice-kr-zero-rated.yaml | Source example for a zero-rated export KR invoice. |
| examples/kr/credit-note-kr.yaml | Source example for a KR credit note (correction). |
| examples/kr/out/invoice-kr-standard.json | Generated output for standard KR invoice example. |
| examples/kr/out/invoice-kr-zero-rated.json | Generated output for zero-rated KR invoice example. |
| examples/kr/out/credit-note-kr.json | Generated output for KR credit note example. |
| data/schemas/tax/regime-code.json | Adds KR to the regime code enum schema. |
| data/rules/kr.json | Generated rules artifact for KR tax identity validation. |
| data/regimes/kr.json | Generated regime definition artifact for KR. |
| CHANGELOG.md | Documents addition of the KR regime. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds a new tax regime for South Korea (KR). It follows the structure of the
recently merged Norway regime (
regimes/no) and uses the currentrules+normvalidation framework.
1 July 1977), with zero-rating for exports handled via the standard VAT keys.
validation. The algorithm is verified against real, public BRNs in the tests.
(수정세금계산서), which can adjust a prior invoice up or down.
data/regimes/kr.json,data/rules/kr.json, and the regime-code schema enum.Sources
Scope decisions (and what I deliberately left out)
is the defining property of a VAT (unlike a consumption/sales tax).
to identify parties on Korean tax invoices — the BRN is — so I didn't add an identity
type that wouldn't appear on invoices, and I couldn't verify its check digit against a
known-valid number.
(간이과세자) below the VAT-registration threshold, so a blanket requirement would be
wrong. Kept the regime minimal; format/agency-specific rules belong in a future addon.
system and out of scope for a base regime.
Checklist
go generate .so schema and regime data are up to datego vet,gofmt)