FINERACT-2767: Tax Component – Fields should be locked once linked to transactions - #6288
Open
rymghosn wants to merge 1 commit into
Open
Conversation
rymghosn
force-pushed
the
port/CBS-162-tax-component-editability-lock
branch
from
August 19, 2026 11:05
107c007 to
a1fb7ae
Compare
Percentage, GL account, and start date fields on a TaxComponent become read-only once the component is in use (mapped to a TaxGroup that is referenced by at least one Charge); only the name remains editable. Before activation (start date in the future) the start date can still be changed, but only to another future date. Once active, only GL accounts can be updated via the update endpoint, which previously allowed no GL account changes at all.
rymghosn
force-pushed
the
port/CBS-162-tax-component-editability-lock
branch
from
August 20, 2026 07:07
a1fb7ae to
bb9fced
Compare
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.
Currently, a Tax Component's percentage, GL accounts (debit/credit), and start date can be modified at any time via PUT /v1/taxes/component/{id},
even after the component has been linked to transactions through a Tax Group. This risks inconsistencies in historical calculations and journal
entries, since past periods rely on the component's percentage and GL account mapping at the time they were recorded.
This PR enforces the following rules on tax component updates:
If a Tax Component has not been linked to any Tax Group, all fields (name, percentage, GL accounts, start date) remain editable.
If a Tax Component is linked to a Tax Group that is in turn referenced by at least one Charge (i.e. it is "in use"), only the name can still be
edited. Attempting to change percentage, GL accounts, or start date returns a validation error.
Start date specifically: if the existing start date is still in the future (not yet active), it can still be changed, but only to another date
strictly after today. Once the start date has passed (component active), it is locked regardless of usage.
GL account (debit/credit type and account) updates are now supported through the update endpoint for components not yet in use — previously
this endpoint did not support changing GL accounts at all.
Changes
ChargeRepository: added existsByTaxGroupContainingTaxComponent(Long) to check whether any Charge references a Tax Group containing a given Tax
Component.
TaxComponent: added isInUse(Supplier) (mapped-to-a-group AND charge-usage check), and extended update(...) to accept and apply GL
account changes.
TaxComponentData: added accountsEditable indicator, surfaced on GET /v1/taxes/component/{id}.
TaxReadPlatformServiceImpl: computes accountsEditable and conditionally includes GL account template options based on it.
TaxWritePlatformServiceImpl: enforces the restricted-fields validation when a component is in use, and resolves GL accounts from the update
command.
TaxValidator: extends supported update parameters to include GL account fields; adds the two-tier start-date validation rule described above.
TaxConfiguration: wires the new ChargeRepository/GLAccountRepositoryWrapper dependencies into the read/write service beans.