feat: add OmitTaxType for bookkeeping 2.0 sales documents #1

Merged
Mats merged 1 commit from feat/invoice-omit-tax-type into main 2026-10-09 18:26:58 +00:00
Owner

Adds OmitTaxType (json:"-") to sales.InvoiceCreate, sales.CreditNoteCreate and sales.OrderCreate. When it is set, the factory body sends taxRule alone: it omits both an explicit TaxType and the one the library normally derives from the rule. Consumers set the flag when Basics.BookkeepingSystemVersion reports 2.0, so they no longer depend on sevdesk's transitional mapping of taxType.

  • Without the flag the behavior is unchanged; the existing golden bodies still assert taxType for 1.0.
  • TestOmitTaxType covers all three factories. A mutation test showed that each missing clear fails its own subtest.
  • Docs updated: sales/doc.go, the struct comments, README and the CHANGELOG [0.1.1] entry.

Once this is merged, tag the merge commit as v0.1.1. mtn-backend's sevdesk migration (branch feat/sevdesk-sdk-migration) depends on that tag.

Checks: the pre-push hook ran every step of ci.yml with Go 1.26.9, matching the CI lint job (gofmt, vet, go test -race, check-comments, staticcheck v0.8.1, govulncheck, build), and all passed. Two clean review rounds in a row from both Opus and Sol.

Note: staticcheck v0.8.1 cannot load packages built with Go 1.27 (export data v5), so the pre-push hook fails on Go 1.27 hosts. CI lint pins 1.26, so CI is unaffected.

Adds `OmitTaxType` (`json:"-"`) to `sales.InvoiceCreate`, `sales.CreditNoteCreate` and `sales.OrderCreate`. When it is set, the factory body sends `taxRule` alone: it omits both an explicit `TaxType` and the one the library normally derives from the rule. Consumers set the flag when `Basics.BookkeepingSystemVersion` reports 2.0, so they no longer depend on sevdesk's transitional mapping of `taxType`. - Without the flag the behavior is unchanged; the existing golden bodies still assert `taxType` for 1.0. - `TestOmitTaxType` covers all three factories. A mutation test showed that each missing clear fails its own subtest. - Docs updated: `sales/doc.go`, the struct comments, README and the CHANGELOG `[0.1.1]` entry. Once this is merged, tag the merge commit as `v0.1.1`. mtn-backend's sevdesk migration (branch `feat/sevdesk-sdk-migration`) depends on that tag. Checks: the pre-push hook ran every step of `ci.yml` with Go 1.26.9, matching the CI lint job (gofmt, vet, `go test -race`, check-comments, staticcheck v0.8.1, govulncheck, build), and all passed. Two clean review rounds in a row from both Opus and Sol. Note: staticcheck v0.8.1 cannot load packages built with Go 1.27 (export data v5), so the pre-push hook fails on Go 1.27 hosts. CI lint pins 1.26, so CI is unaffected.
feat: add OmitTaxType for bookkeeping 2.0 sales documents
Some checks failed
CI / test (1.26) (pull_request) Has been cancelled
CI / test (1.27) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / test (1.26) (push) Successful in 33s
CI / lint (push) Successful in 32s
CI / build (push) Successful in 18s
CI / test (1.27) (push) Successful in 27s
0c95fa60cf
Mats merged commit ff8a216d5e into main 2026-10-09 18:26:58 +00:00
Mats deleted branch feat/invoice-omit-tax-type 2026-10-09 18:26:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mtn-media-group/mtn_go_sevdesk!1
No description provided.