Skip to content

[backend] TaxController.updateRule() doesn't re-validate dependent fields when rule.type changes #928

Description

@Wilfred007

Description

updateRule() allows changing a tax rule's type (e.g. from flat to percentage) without re-validating that the existing value field still makes sense for the new type. A percentage rule with a value of 50000 (clearly meant as a flat amount) could silently persist after a type change.

Where

backend/src/controllers — TaxController.updateRule

Acceptance Criteria

  • Re-validate value against the new type's constraints whenever type changes in an update
  • Add a test covering a type change that would leave an invalid value

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend developmentmediumModerate tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions