feat(budget): enforce includes_vat NOT NULL, align VAT behavior across pricing modes#1385
Merged
steilerDev merged 2 commits intobetafrom Apr 29, 2026
Merged
feat(budget): enforce includes_vat NOT NULL, align VAT behavior across pricing modes#1385steilerDev merged 2 commits intobetafrom
steilerDev merged 2 commits intobetafrom
Conversation
…s pricing modes - Add migration 0031 to backfill NULL includes_vat → true and enforce NOT NULL at DB level - Update Drizzle schema: includesVat is now .notNull().default(true) on both budget tables - Change shared types: BaseBudgetLine.includesVat is now boolean (not boolean | null) - Update JSON schemas in workItemBudgets and householdItemBudgets routes - Fix service converters to use ?? true fallback instead of ?? null - Align direct pricing mode with unit pricing: both modes now apply the VAT multiplier (1 or 1.19) before storing plannedAmount, so the stored value is always gross (VAT-inclusive) - Default includesVat form state to true in both WorkItemDetailPage and HouseholdItemDetailPage - Update all test fixtures to use includesVat: true (was null) Fixes: direct pricing VAT behavior was inconsistent with unit pricing mode. Co-Authored-By: Claude backend-developer (claude-haiku-4-5-20251001) <noreply@anthropic.com> Co-Authored-By: Claude frontend-developer (claude-haiku-4-5-20251001) <noreply@anthropic.com> Co-Authored-By: Claude qa-integration-tester (claude-sonnet-4-6) <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion Migration 0031 recreated work_item_budgets and household_item_budgets without the original CHECK(planned_amount >= 0) and CHECK(confidence IN (...)) constraints, causing tests that expect these constraints to be enforced to fail. Also switch to explicit column lists in INSERT...SELECT to be safe for existing databases where column order differs from the new table definition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 2.5.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
plannedAmountis always stored as the gross (VAT-inclusive) amount regardless of which pricing mode was used.NULL→trueforincludes_vatin bothwork_item_budgetsandhousehold_item_budgets, then recreates the tables withNOT NULL DEFAULT 1at the schema level.BaseBudgetLine.includesVatchanged fromboolean | nulltobooleanthroughout shared types, routes, and services.includesVatdefaults totruein the budget line form for both Work Items and Household Items.Test plan
input × 1.19qty × price × 1.19includes_vatare migrated totruenpm test— all unit and integration tests should pass🤖 Generated with Claude Code