pwargulak commented on PR #6663:
URL: https://github.com/apache/fineract/pull/6663#issuecomment-6267558388

   Thanks @galovics, all five addressed in the new commit:
   
   - `whereValue`: it was still the result's `entityId`, but your shape is 
cleaner: the `DELETE` is now built once (`WHERE <fk> = ?`, plus `AND id = ?` 
only when `datatableId != null`), and the entity id is `datatableId ?? 
appTableId` inline.
   - 404 message: agreed, it named the wrong id. A new 
`DatatableNotFoundException(datatable, appTableId, datatableId)` names both; it 
keeps the code `error.msg.datatable.data.not.found`, and the update's not-found 
for an entry id uses it too, so both routes read the same.
   - Client-visible changes: added a release-note paragraph to the description 
(404 for a missing or foreign entry, 403 for an entry id on one-to-one). On `x, 
x`: in openMF/web-app (`develop`, 947023e) the two-id PUT and DELETE are called 
only from `datatable-multi-row.component.ts`, and `edit-client.component.ts` 
sends the entry id only when `section.isMultiRow`; every one-to-one write sends 
one id. I found no other client that sends it.
   - PK hunk: it is part of this ticket. It is the same read-one-row, 
write-another defect: on a registered table whose PK is the FK and which also 
has an `id` column, the read is filtered `fk = a AND id = b` (a's row) while 
the old `UPDATE … WHERE pk = b` wrote b's row. The cast is gone: the PK value 
read is bound as is, and only the reported entity id takes it when it is 
numeric. A non-numeric PK used to be bound as a `Long`; now it gets its own 
value.
   - Tests: new integration cases for `DELETE 
/survey/{name}/{clientId}/{fulfilledId}` and for the `/batches` route, both 
deleting another client's entry (404, the entry survives). The two 404 cases 
are merged into one. The unit tests that restated the SQL 
(`…IsScopedToApplicationTableId`, `…KeysOnItsId`) are dropped; what is left 
covers the refusals, the 0-row delete firing no event, and the registered-table 
PK, which no IT reaches.
   


-- 
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]

Reply via email to