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

FINERACT-2907: Return clientNonPersonDetails from GET /clients/{clientId} - #6603

Merged
IOhacker merged 1 commit into
apache:developfrom
samchinmaya:FINERACT-2907-client-non-person-details
Oct 9, 2026
Merged

IOhacker merged 1 commit into
apache:developfrom
samchinmaya:FINERACT-2907-client-non-person-details

Conversation

@samchinmaya

Copy link
Copy Markdown
Contributor

Description

JIRA: FINERACT-2907

For a client with Legal Form = Entity, the legal entity details (constitution, main business line, incorporation number, incorporation validity date, remarks) are saved in m_client_non_person, but GET /clients/{clientId} never returns them: clientNonPersonDetails is always null. Front ends that edit the client (e.g. the Mifos web app's Edit Client) therefore show these fields empty, even though they are set.

Cause: since FINERACT-1760, ClientReadPlatformServiceImpl.retrieveOne() builds the response with ClientMapper.map(client), and ClientMapper has @Mapping(target = "clientNonPersonDetails", ignore = true), so the details are never filled in.

Change:

  • retrieveOne() loads the client's ClientNonPerson through ClientNonPersonRepositoryWrapper.findOneByClientId() and sets clientNonPersonDetails (constitution and main business line as CodeValueData). Clients without non-person details are unchanged.
  • @Getter on ClientNonPerson and ClientNonPersonData, for the mapping and the tests.
  • Swagger: clientNonPersonDetails added to the GET /clients/{clientId} response model.
  • Tests: unit test in ClientReadPlatformServiceImplTest (details are set when present, and stay null for a person client); integration test in ClientTest that creates an entity client and checks the returned details.

Verification:

  • Unit tests: ClientReadPlatformServiceImplTest passes (6/6). spotlessJavaCheck and checkstyle pass.
  • Real API, on a Fineract built from this branch with a fresh database: an entity client created with constitution, main business line, incorporation number/date and remarks now returns all of them in clientNonPersonDetails, for both GET /clients/{id} and GET /clients/{id}?template=true. On develop, the same request returns clientNonPersonDetails: null, while the row exists in m_client_non_person.
  • I could not run the integration-test module locally (the client SDK build runs out of memory on my machine), so I'm relying on CI for ClientTest.

The legacy apiLive.htm doesn't document the non-person fields at all, so I left it unchanged; the Swagger annotation documents the field.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.
  • If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
  • I followed the AI Policy.

Your assigned reviewer(s) will follow our guidelines for code reviews.

…tId}

For a client with Legal Form = Entity, the legal entity details
(constitution, main business line, incorporation number, incorporation
validity date, remarks) are saved in m_client_non_person, but
GET /clients/{clientId} never returned them. Since FINERACT-1760
retrieveOne() builds the response with ClientMapper, which ignores
clientNonPersonDetails, so front ends that edit the client showed these
fields empty.

Load the ClientNonPerson for the client in retrieveOne() and set
clientNonPersonDetails on the response. Document the field in the
Swagger response and cover it with a unit test and an integration test.

Assisted-By: claude-opus-5-5
@samchinmaya
samchinmaya force-pushed the FINERACT-2907-client-non-person-details branch from 80181b0 to 9ea8f8a Compare October 8, 2026 20:22
@IOhacker
IOhacker merged commit 133fc52 into apache:develop Oct 9, 2026
93 of 94 checks passed
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.

2 participants