Skip to content

ADR-2813: Synchronous Batch Assignment and Multi Role Delegation Sign Off Architecture ​

  • Status: Accepted
  • Date: 2026-10-07
  • Authors: @fderuiter
  • Deciders: @fderuiter

1. Context & Problem Statement ​

Site administrators and Principal Investigators previously assigned training curricula individually for each site team member, creating administrative overhead during site activations. Additionally, Principal Investigators needed a 21 CFR Part 11 compliant bulk sign-off capability for delegation logs across multiple staff members (@req:PRD-TRN-001).

2. Decision Drivers & Constraints ​

  • 21 CFR Part 11 Compliance: Bulk signature operations must capture printed name, clinical role, legal statement, timestamp, and password validation (@req:PRD-TRN-001).
  • Request Size Guardrails: Synchronous batch API endpoints must enforce a maximum limit of 200 target items per request to prevent HTTP timeouts.
  • eTMF Routing: Signed delegation log records and certificates must route to eTMF Zone 5 (Artifact 05.02.04).
  • Gateway Reverse Proxy: Reverse proxy routing in YARP API Gateway must forward /api/v1/training/{**catch-all} endpoints to the Knowledge service cluster.

3. Options Considered ​

Option 1: Synchronous Batch Endpoints with Request Size Guardrails (Selected) ​

  • Overview: Implement synchronous Minimal API endpoints (/api/v1/training/curricula/batch-assign and /api/v1/training/delegations/bulk-signoff) with a synchronous max 200 item limit and duplicate skipping manifest (@req:PRD-TRN-001).
  • Pros:
    • ✅ Immediate feedback for site managers and Principal Investigators during site launch.
    • ✅ Guaranteed synchronous execution under 500ms for up to 200 personnel.
    • ✅ Direct gateway routing via YARP to knowledge-cluster.
  • Cons:
    • ❌ Enforces a hard maximum limit of 200 personnel per synchronous batch request.

Option 2: Asynchronous Job Queues via MassTransit Message Bus ​

  • Overview: Queue batch operations asynchronously and poll job execution status.
  • Pros:
    • ✅ Handles arbitrarily large request sizes (> 1000 items).
  • Cons:
    • ❌ Adds polling complexity to UI and delayed feedback during live site activation workflows.

4. Decision Outcome ​

  • Chosen Option: Option 1
  • Justification: Chosen because it satisfies @req:PRD-TRN-001 while ensuring immediate feedback for Principal Investigators and Site Managers with zero asynchronous polling overhead.

5. Consequences & Trade-offs ​

  • Positive Impact: Reduces site onboarding setup time by over 75% while maintaining full 21 CFR Part 11 digital seal traceability and DIA TMF Zone 5 artifact compliance.
  • Negative Impact / Technical Debt: Batch operations > 200 items must be split across multiple API calls by the caller.
  • Mitigation Strategy: Automated test coverage and CI lint validation in TrainingEndpointsTests.cs.

6. Implementation & Verification ​

  • Affected Repositories / Services: apps/knowledge, apps/gateway, apps/web.
  • Verification Plan: Automated unit tests in tests/Cadence.UnitTests/Knowledge/TrainingEndpointsTests.cs and Vitest component tests in apps/web/tests/components/ProtocolTrainingConsoleBatch.spec.ts.