feat(notifications): add PUT update endpoints for channels/templates/rules #293
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-386-notification-config-update-endpoints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Notification channels, templates, and rules could be created and deleted but never updated: routes registered only get/post/delete, so editing an existing config row meant delete + recreate, losing its id and any FK references (the dispatcher's rule.template_id, audit history). The UI's edit action had no endpoint to call.
Add PUT /notification-channels/{id}, /notification-templates/{id}, and /notification-rules/{id}. Each is full-replacement (PUT) semantics over the existing Upsert* request DTO, RequireAdmin-gated like the create path, tenant-scoped, and returns 404 when the row does not exist. The channel update re-encrypts config under the data key. Each mutation writes an AuditAction::Update row with before/after snapshots inside the same transaction, matching the create handlers.
#PMS-386
Notification channels, templates, and rules could be created and deleted but never updated: routes registered only get/post/delete, so editing an existing config row meant delete + recreate, losing its id and any FK references (the dispatcher's rule.template_id, audit history). The UI's edit action had no endpoint to call. Add PUT /notification-channels/{id}, /notification-templates/{id}, and /notification-rules/{id}. Each is full-replacement (PUT) semantics over the existing Upsert* request DTO, RequireAdmin-gated like the create path, tenant-scoped, and returns 404 when the row does not exist. The channel update re-encrypts config under the data key. Each mutation writes an AuditAction::Update row with before/after snapshots inside the same transaction, matching the create handlers. #PMS-386