chinmaya samantara created FINERACT-2907:
--------------------------------------------

             Summary: GET /clients/{clientId} does not return 
clientNonPersonDetails for entity clients
                 Key: FINERACT-2907
                 URL: https://issues.apache.org/jira/browse/FINERACT-2907
             Project: Apache Fineract
          Issue Type: Bug
            Reporter: chinmaya samantara


For a client with Legal Form = Entity, the legal entity details (constitution, 
main business line, incorporation number, incorporation validity date, remarks) 
are saved, but GET /clients/\{clientId\} never returns them. Front ends that 
edit the client (e.g. the Mifos web app) show these fields empty, so a user who 
saves the edit form can't see the existing values.

Steps to reproduce:
1. Create a client with Legal Form = Entity:

{code}
POST /fineract-provider/api/v1/clients
{
  "officeId": 1, "legalFormId": 2, "fullname": "Acme Traders", "active": false,
  "submittedOnDate": "01 October 2026", "dateFormat": "dd MMMM yyyy", "locale": 
"en",
  "clientNonPersonDetails": {
    "constitutionId": <a Constitution code value id>,
    "mainBusinessLineId": <a Main Business Line code value id>,
    "incorpNumber": "INC-001", "remarks": "Test entity",
    "incorpValidityTillDate": "31 December 2030",
    "dateFormat": "dd MMMM yyyy", "locale": "en"
  }
}
{code}

2. GET /fineract-provider/api/v1/clients/\{clientId\}

Actual result: the response has no clientNonPersonDetails (it is null). The row 
is in the database:

{code}
select client_id, constitution_cv_id, main_business_line_cv_id, incorp_no from 
m_client_non_person;
 1 | 23 | 24 | INC-001
{code}

Expected result: the response includes clientNonPersonDetails (constitution, 
mainBusinessLine, incorpNumber, incorpValidityTillDate, remarks), as the client 
data already supports.

Cause:
ClientReadPlatformServiceImpl.retrieveOne() builds the response with 
ClientMapper.map(client), and ClientMapper has

{code}
@Mapping(target = "clientNonPersonDetails", ignore = true)
{code}

(fineract-provider/src/main/java/org/apache/fineract/portfolio/client/mapper/ClientMapper.java).
 Nothing else in retrieveOne() sets the field, so it is always null. The SQL 
row mapper used elsewhere in ClientReadPlatformServiceImpl still builds 
ClientNonPersonData. The single-client path seems to have lost it when 
ClientMapper was added (FINERACT-1760).

Related symptom (same class): GET 
/groups/\{groupId\}/meetings/template?calendarId=\{id\} fails with 400 "No 
serializer found for class 
org.apache.fineract.portfolio.client.data.ClientNonPersonData and no properties 
discovered to create BeanSerializer (through reference chain: 
MeetingData["clients"]->...->ClientData["clientNonPersonDetails"])". So 
ClientNonPersonData itself can't be serialized at the moment, which may be why 
the mapper ignores it.

Possible fix: map clientNonPersonDetails from the client's ClientNonPerson in 
ClientMapper (or set it in retrieveOne), and add an integration test that 
creates an entity client and checks the GET response.

Found on: Fineract develop (7ac7801, local Docker), and the code is unchanged 
on develop f9c2fcd (2026-10-07).
Reported in the Mifos web app by Victor Romero; web-app ticket: 
https://mifosforge.jira.com/browse/WEB-1298




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to