From d31742d5ddb999dd1a0b6d351c2abc45bc4a1d6a Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Fri, 25 Oct 2024 09:30:33 +0000 Subject: [PATCH] Updating CHANGELOG, extra test --- CHANGELOG.md | 5 ++++- tax/regime_def_test.go | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdbf228b..40de9ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Added -- New "tax catalogues" used for defining extensions for specific standards. +- `tax`: New "tax catalogues" used for defining extensions for specific standards. +- `iso`: catalogue created with `iso-schema-id` extensions. +- `untdid`: catalogue created with extensions: `untdid-document-type`, `untdid-payment-means`, and `untdid-tax-category`. - `eu-en16931-v2017`: addon for underlying support of the EN16931 semantic specifications. - `de-xrechnung-v3`: addon with extra normalization for XRechnung specification in Germany. +- `pay`: Added `sepa` payment means key extension in main definition to be used with Credit Transfers and Direct Debit. ### Removed diff --git a/tax/regime_def_test.go b/tax/regime_def_test.go index afd18b28..2c2fd6a5 100644 --- a/tax/regime_def_test.go +++ b/tax/regime_def_test.go @@ -4,7 +4,9 @@ import ( "testing" "time" + "github.com/invopop/gobl/cbc" "github.com/invopop/gobl/tax" + "github.com/invopop/validation" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -21,3 +23,10 @@ func TestRegimeTimeLocation(t *testing.T) { loc = r.TimeLocation() assert.Equal(t, loc, time.UTC) } + +func TestRegimeInCategoryRates(t *testing.T) { + var r *tax.RegimeDef // nil regime + rate := cbc.Key("standard") + err := validation.Validate(rate, r.InCategoryRates(tax.CategoryVAT)) + assert.ErrorContains(t, err, "must be blank when regime is undefine") +}