Repository navigation
Conversation
…plate GET /loanproducts/template did not return `datatables`, unlike the client, group, center, loan and savings templates. With a Loan Product / CREATE Entity Data Table Check in place, a UI had no way to know which datatable entry the create form must collect, so the check could not be satisfied from the screen. The template now fills `datatables` from EntityDatatableChecksReadService.retrieveTemplates(CREATE, m_product_loan, null), the same way CentersApiResource does, and `datatables` is part of the response parameter set so `fields=` filtering keeps it. Assisted-By: claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
JIRA: FINERACT-2892. This is the backend half; showing the datatable on the Loan Product screen is web-app work.
Follow-up to #6538 (FINERACT-2874), which lets a Loan Product carry a CREATE Entity Data Table Check. This PR doesn't depend on #6538 to compile, but the gap only shows up once #6538 is in.
Root cause: the client, group, center, loan and savings templates all return
datatablesfromEntityDatatableChecksReadService.retrieveTemplates(CREATE, <entity>, productId), so a UI knows which datatable entry the create form must collect.GET /loanproducts/templatenever did. With a Loan Product / CREATE check in place,POST /loanproductsthen fails with 403error.msg.entry.required.in.datatable, and the client has no way to discover which datatable it needs.Fix:
LoanProductDatagets a settabledatatables.LoanProductsApiResource.retrieveTemplatefills it fromretrieveTemplates(CREATE, m_product_loan, null), the same wayCentersApiResourcedoes.datatablesis also added to the response parameter set sofields=filtering keeps it.Tests: new
LoanProductsApiResourceTemplateDatatablesTest. One test checks that the CREATE-check datatables reach the serialized template and thatdatatablesis in the parameter set. The other checks that the field is absent when no check exists.Manual verification on a local build against PostgreSQL, with #6538 applied for both runs. The setup was a single-row datatable on
m_product_loanplus an Entity Data Table Check (m_product_loan, status 100) on it:GET /loanproducts/template→ 200 with nodatatableskey, and?fields=id,datatables→ 400 "The parameter datatables is not supported".datatableslists the datatable with its column headers,fields=id,datatableskeeps it, and once the check is deleted the key is absent again.Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
datatablesfield shaped like the other templates'; theGetLoanProductsTemplateResponseSwagger model is not updated here)Your assigned reviewer(s) will follow our guidelines for code reviews.