adamsaghy commented on PR #6633:
URL: https://github.com/apache/fineract/pull/6633#issuecomment-6454700676

   Thanks for the PR. The DOCUMENT CREATE/UPDATE/DELETE hooks now fire, which 
is what FINERACT-2536 asks for. Two things in the description don't match the 
code:
   
   **1. The root cause.** The description says DOCUMENT webhooks stopped firing 
when FINERACT-2246 moved documents to the new command processing. They never 
fired. Before 2ff0c62f40 (FINERACT-2246), `DocumentManagementApiResource` 
called 
`documentWritePlatformService.createDocument/updateDocument/deleteDocument` 
directly. It never went through `commandsSourceWritePlatformService`, and that 
has been true since the resource was added in 2012, so 
`SynchronousCommandProcessingService.publishHookEvent` was never reached for 
documents. Please fix the description and commit message. As written, this 
reads like a regression fix, and it is really a missing feature.
   
   **2. "Same payload fields as the legacy path".** It isn't the same. The 
legacy `publishHookEvent` also puts top-level `officeId` and `clientId` into 
the payload, taken from the `CommandProcessingResult`, and nulls `officeId` 
inside `response` (`SynchronousCommandProcessingService` L417-424). 
`WebhookCommandHookAfter` only sends entityName, actionName, createdBy*, 
request, response and timestamp.
   
   This matters beyond documents, because `HookableCommand` is meant to be the 
opt-in for every migrated command. `TwilioHookProcessor` (L107) and 
`MessageGatewayHookProcessor` (L97) only work when `clientId` is at the top 
level of the payload. Any migrated command that opts in, a client command for 
example, will publish the event, but SMS/Twilio hooks will quietly do nothing.
   
   Please either:
   - add `officeId`/`clientId` when the response provides them, or
   - drop the "same payload fields" claim and state the difference (the payload 
shape, and that `request` is now the serialized request DTO rather than the raw 
JSON body).
   


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