Samer-Melhem-FOO opened a new pull request, #6116:
URL: https://github.com/apache/fineract/pull/6116
## Problem
Bulk Client Upload (Excel import) fails once a custom datatable is registered
against the Client entity and an Entity Datatable Check makes it mandatory
for client creation (Entity = Client, Status = Create). The bulk import
workbook populator and import handlers have no support for datatable
columns: the downloaded template doesn't render columns for datatables
configured on the Client entity, and the import handlers have no way to
validate, parse, or submit datatable data as part of client creation — so a
mandatory datatable check blocks every row in the upload.
## Fix
- `ClientEntityWorkbookPopulator` / `ClientPersonWorkbookPopulator` now
render a column for every datatable configured against the Client entity
(including ones with no existing check, so they can be optionally
populated), with support for dropdown, date, datetime, and boolean column
types. Columns from single-row datatables are marked mandatory (`*`) to
match Entity Datatable Check requirements; multi-row (repeatable child)
datatable columns are always optional.
- `ImportHandlerUtils` gains helpers to parse and validate datatable columns
from the workbook, and `validateRequiredDatatables()` now skips multi-row
datatables, since they represent repeatable child data rather than a
single mandatory value.
- `ClientEntityImportHandler` / `ClientPersonImportHandler` submit parsed
datatable data as part of the client-create command, with clearer error
reporting when validation fails.
- `DatatableData` gains an `isMultiRow()` flag, threaded through
`DatatableReadServiceImpl` and `ReadSurveyServiceImpl` (which shares the
same `DatatableData.create(...)` factory).
## Affected APIs
- `GET
/v1/clients/downloadtemplate?legalFormType=CLIENTS_PERSON|CLIENTS_ENTITY`
- `POST
/v1/clients/uploadtemplate?legalFormType=CLIENTS_PERSON|CLIENTS_ENTITY`
- `GET /v1/imports`, `GET /v1/imports/downloadOutputTemplate`
## Testing
- Added unit tests for `DatatableData` covering single-row vs. multi-row
behavior (`DatatableDataTest`).
- Manually verified end-to-end: registered a custom datatable on the Client
entity, added an Entity Datatable Check (Create), downloaded the template
(columns present, single-row marked mandatory), filled it in, uploaded it,
and confirmed the client was created successfully for both Person and
Entity legal forms, and for both single-row and multi-row datatables.
- `./gradlew :fineract-provider:compileJava`,
`:fineract-core:compileTestJava`, `:fineract-provider:compileTestJava` all
pass.
JIRA: https://issues.apache.org/jira/browse/FINERACT-2682
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]