Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

FINERACT-3171: Validate updates to existing non-person clients - #7206

Open
Joab-SC wants to merge 2 commits into
apache:developfrom
Joab-SC:FINERACT-3171-client-non-person-update
Open

Joab-SC wants to merge 2 commits into
apache:developfrom
Joab-SC:FINERACT-3171-client-non-person-update

Conversation

@Joab-SC

@Joab-SC Joab-SC commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Description

Validate updates to existing ClientNonPerson records before the first saveAndFlush(...) in updateClient(...). For partial updates, the service combines the requested values with the stored values and passes the resulting incorporation date, validity date, and constitution ID to ClientDataValidator.validateClientNonPerson(...).

This covers both ways an update could leave the dates inconsistent. Changing only incorpValidityTillDate now checks it against the stored dateOfBirth. Changing only dateOfBirth checks it against the stored validity date, even when the request omits clientNonPersonDetails. Equal dates are valid.

Move JsonCommand handling and change tracking from ClientNonPerson.update(...) into the write service. The entity receives typed values, and the service continues to report changed fields, including the original date string, format, and locale.

This addresses the existing-record update discussed in #7064. Both branches are based on develop and currently include the shared validator. I’ll rebase this branch after #7064 merges. General client validation is covered separately in #7118.

This PR completes part of FINERACT-3171.

Verification

  • All 19 tests in ClientCreateUpdateWritePlatformServiceTest and ClientDataValidatorTest passed in a focused JUnit run after formatting. Eight of those tests are new.
  • The service tests cover both invalid single-date updates and verify that neither repository saves on failure. They also cover a valid update to both dates, an explicit null constitution ID, an update that changes only the main business line, and creation with a missing constitution ID.
  • The validator tests cover equal or omitted dates and the order of errors when both the validity date and constitution are invalid.
  • Applied Fineract’s Spotless Java formatter to the changed files. git diff --check passed.

Checklist

  • The signed commit follows the commit and PR title guidelines.
  • I understand that I’m responsible for getting the build green before review.
  • Added and updated unit tests for the affected flows.
  • Followed the project’s coding conventions and applied Spotless.
  • Reviewed API documentation applicability. This change enforces the existing incorporation-date rule on updates using the existing request fields and validation errors.
  • Kept the PR focused on non-person client validation and its regression tests, following the pull request size guidelines.
  • Mark the JIRA issue resolved and set its Fix Version/s if this PR completes it. FINERACT-3171 remains open for the other changes in the agreed split.
  • Followed the AI Policy. The signed commit includes Assisted-By: OpenAI GPT-6.2-astra.

Assisted-By: OpenAI GPT-6.2-astra
Signed-off-by: Joab-SC <142185992+Joab-SC@users.noreply.github.com>
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