[
https://issues.apache.org/jira/browse/FINERACT-2911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aman Mittal updated FINERACT-2911:
----------------------------------
Fix Version/s: 1.16.0
> Recording attendance for a center meeting always fails with "Client with
> identifier null is not in center"
> ----------------------------------------------------------------------------------------------------------
>
> Key: FINERACT-2911
> URL: https://issues.apache.org/jira/browse/FINERACT-2911
> Project: Apache Fineract
> Issue Type: Bug
> Reporter: chinmaya samantara
> Assignee: chinmaya samantara
> Priority: Major
> Fix For: 1.16.0
>
>
> Since the meeting commands moved to the new command processing
> (FINERACT-2548), POST /centers/\{centerId}/meetings rejects every attendance
> entry, even for clients who are in the center. Missing or incomplete
> clientsAttendance also gives a 500 instead of a validation error.
> *Steps to reproduce* (center 5 has group 6, client 7 is an active member of
> group 6, the center has a weekly Tuesday calendar 6 starting 01 September
> 2026):
> {code:json}
> POST /fineract-provider/api/v1/centers/5/meetings
> {
> "calendarId": 6, "meetingDate": "06 October 2026",
> "dateFormat": "dd MMMM yyyy", "locale": "en",
> "clientsAttendance": [ { "clientId": 7, "attendanceType": { "id": 1 } } ]
> }
> {code}
> *Actual result:* HTTP 403, "Client with identifier null is not in center 5"
> (error.msg.client.not.in.center).
> *Expected result:* the meeting and the attendance are saved.
> *Cause* (MeetingWriteServiceImpl.getClientsAttendance,
> fineract-provider/.../portfolio/meeting/service/MeetingWriteServiceImpl.java):
> {code:java}
> .filter(group -> group.isChildClient(attendance.getId())).count();
> {code}
> {{attendance.getId()}} is the id of the attendance record, which is always
> null when creating a meeting. It should be {{attendance.getClientId()}}. The
> code before FINERACT-2548 (MeetingWritePlatformServiceJpaRepositoryImpl) used
> the client id: {{group.isChildClient(clientId)}}. The group branch and the
> center error message use {{attendance.getId()}} too, so the group error says
> "Client with identifier null is not in group" as well.
> *Related problems in the same method:*
> # No clientsAttendance in the request:
> {code:json}
> POST /fineract-provider/api/v1/groups/2/meetings
> { "calendarId": 2, "meetingDate": "05 October 2026", "dateFormat": "dd MMMM
> yyyy", "locale": "en" }
> {code}
> Actual: HTTP 500 ({{for (var attendance : attendances)}} with attendances ==
> null). The field is not @NotNull, so either it is optional and null should
> mean no attendance, or it should be rejected with a 400.
> # An attendance entry without clientId gives HTTP 500. MeetingAttendanceData
> has @NotNull on clientId and attendanceType, but the list in
> MeetingCreateRequest is not annotated @Valid, so those constraints are never
> checked. Request body part:
> {code:json}
> "clientsAttendance": [ { "attendanceType": { "id": 1 } } ]
> {code}
> For comparison, a valid group meeting on group 2 returns 200, so the group
> path works when the data is complete:
> {code:json}
> "clientsAttendance": [ { "clientId": 5, "attendanceType": { "id": 1 } } ]
> {code}
> *Question:* before the new command processing, attendanceType was a number.
> It now has to be an object with an id; a number gives 400 "The referenced
> JSON data is invalid". The Mifos web app still sends a number. Was this
> change intended? If yes, the web app needs an update; if not, the API could
> accept both.
> {code:json}
> "attendanceType": 1 (old format, now 400)
> "attendanceType": { "id": 1 } (new format)
> {code}
> *Possible fix:* use {{attendance.getClientId()}} in the group and center
> checks, treat a null clientsAttendance as an empty list (or validate it), add
> @Valid to the list, and add integration tests for center attendance and the
> validation cases.
> Found on: Fineract develop (7ac7801, local Docker). MeetingWriteServiceImpl
> is unchanged on develop 8bdbff9 (2026-10-09); its last change is 912eaf1
> (FINERACT-2548).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)