Skip to content

FINERACT-2769: Tax group – Start Date field validation/behavior issues on edit mode if the group is unlinked - #6290

Open
rymghosn wants to merge 1 commit into
apache:developfrom
foodeveloper:port/CBS-202-tax-group-start-date-editability
Open

FINERACT-2769: Tax group – Start Date field validation/behavior issues on edit mode if the group is unlinked#6290
rymghosn wants to merge 1 commit into
apache:developfrom
foodeveloper:port/CBS-202-tax-group-start-date-editability

Conversation

@rymghosn

Copy link
Copy Markdown
Contributor

Tax group updates could never actually carry a start date change through to
an existing component mapping, and a JSON-key bug made updates fail
unnecessarily:

  • validateForTaxGroupUpdate extracted a submitted mapping's id using the
    taxComponentId JSON key instead of id. Since taxComponentId is
    immutable and normally omitted on update, this misclassified a
    legitimate "update existing mapping" request as "add a new component"
    and wrongly demanded a taxComponentId.

  • TaxAssembler/TaxGroupMappings/TaxGroup always discarded any
    submitted startDate on update — only endDate was ever applied, even
    though startDate was already an accepted request parameter.

  • Adding a brand-new tax component to an existing group via update never
    set the new mapping's taxGroup relationship, which would violate the
    tax_group_id NOT NULL constraint on insert.
    This PR:

  • Fixes the JSON-key bug.

  • Lets an existing component's start date be edited, but only while it
    hasn't taken effect yet (i.e. its current start date is still in the
    future) — once a start date is on or before today it's locked, and only
    the end date remains editable.

  • Fixes the missing taxGroup FK assignment for newly-added components.

  • Exposes groupEditable (on GET /taxes/group/{id}?template=true) and
    per-component componentEditable so clients can tell which fields are
    still open for editing: a group linked to charge products is only
    editable if at least one of its components hasn't taken effect yet.
    PR:(https://issues.apache.org/jira/browse/FINERACT-2769)

…e it takes effect

Tax group updates could never carry a start date change through: the
JSON-level id-vs-taxComponentId mismatch made the validator require a new
taxComponentId even when only an existing mapping's id was submitted, and
the write path always discarded any submitted start date. This also fixes
a latent bug where adding a new component to an existing group left its
tax_group_id foreign key unset.

An existing component's start date can now be changed as long as it has
not taken effect yet (its current start date is still in the future), and
the group/component read side exposes groupEditable/componentEditable so
clients can tell which fields are still open for editing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant