Add envelope finalization trigger and workflow updates

Introduced `EnvelopeFinalizationTrigger` to enable external
triggering of the `EnvelopeFinalizationWorker` for immediate
envelope processing. Updated `EnvelopeFinalizationWorker` to
support both polling and external triggers, improving
performance and flexibility.

Added `BackgroundServicesController` with an API endpoint to
trigger the worker, including configuration checks for
availability. Temporarily used `[AllowAnonymous]` with plans
to replace it with sender-scoped authorization.

Enhanced manual testing workflows in `AGENTS.md`:
- Standardized request-to-domain mapping policy.
- Migrated dynamic SQL to parameterized queries for security.
- Improved UX for deterministic row double-click behavior.
- Implemented SPA-style language switching.
- Added sender-scoped caching for recent receiver suggestions.

Updated dependency injection in `Program.cs` to register
`EnvelopeFinalizationTrigger` and ensure the worker is only
enabled when configured.
This commit is contained in:
2026-11-27 13:07:50 +01:00
parent 58d7d34562
commit 43758e3390
6 changed files with 113 additions and 2 deletions

View File

@@ -294,6 +294,7 @@ Manual testing workflow:
- Alternative UX design (Server component): in `EnvelopeGenerator.Server/EnvelopeGenerator.Server/Components/Pages/EnvelopeSenderPage.razor`, enforce deterministic row double-click behavior as exactly one action (preview OR edit), and keep row action buttons/tooltips aligned with the same rule to eliminate ambiguous navigation.
- Implement SPA-style language switching so the UI culture updates immediately without a full page reload.
- Implement sender-scoped caching for "recent receiver suggestions" used during envelope creation (wizard/editor flows): cache key should include sender identity, support short TTL + invalidation hooks after successful envelope receiver writes, and prevent cross-sender suggestion leakage.
- Add authorization model for background-service trigger endpoints (`BackgroundServicesController`): replace temporary `AllowAnonymous`, define sender/admin policy, and enforce audit/rate-limit rules.
## Database