Repository navigation
fix!: require vatIncluded instead of defaulting it to true - #25
Merged
Merged
Conversation
The three payload builders sent VATIncluded: true when the caller left the flag out. SUMIT's own default for an omitted VATIncluded is false (published schema: "Leave empty for false"), so a caller who passed net prices and followed SUMIT's documentation got a document or a charge whose total left the VAT out, and nothing failed. vatIncluded is now a required parameter of buildOneOffChargePayload, buildRecurringChargePayload and buildCreateDocumentPayload, and the builders throw when it is not a boolean, so plain-JavaScript callers get an error instead of a guessed amount. Closes #23 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
buildOneOffChargePayload,buildRecurringChargePayloadandbuildCreateDocumentPayloadsentVATIncluded: truewhen the caller leftvatIncludedout. SUMIT's own default is the opposite. From its published schema (api.sumit.co.il/swagger/v1/swagger.json, read again on 2026-10-12): documents and recurring charges say "Leave empty for false", one-off charges say "Defaults to false".So a caller who passed net prices and left the flag out got a total without VAT, and nothing failed. This happened on 2026-10-12 through
sumit-mcp: lines adding up to 5,450 before VAT produced a draft with a total of 5,450 instead of 6,431.Change
vatIncludedis required in the params of all three builders (option 2 in VATIncluded defaults to true, the opposite of SUMIT's own default #23).docs/API_REFERENCE.mdstates SUMIT's default.Breaking
Callers that relied on the default have to pass
vatIncluded: trueto keep their amounts. That is the point: the amount is no longer decided by a default. The CHANGELOG entry is under "Unreleased"; this should go out as 0.5.0, in a separate release PR.Known callers and what they do today:
Digitizers/sumit-mcp^0.4.0Digitizers/sumit-react^0.4.0Digitizers/Quoty^0.3.1None of them picks up 0.5.0 by itself under a caret range on 0.x.
sumit-mcpandsumit-reactneed their own change when they move to it (Digitizers/sumit-mcp#15 covers the first).Tests
pnpm test(34 passed),pnpm typecheck,pnpm build. Two new tests: the three builders refuse an omitted or non-boolean flag, and both values are sent as chosen. The 17 existing calls that relied on the default now passvatIncluded: true, so their expected payloads are unchanged.Closes #23
🤖 Generated with Claude Code