This PR implements the Idempotency-Key middleware for POST/PATCH endpoints on /api/reports, ensuring safe retries.
- Fixed a bug where
persistedflag was missing in the global idempotency middleware, throwing a ReferenceError. - Fixed a bug where
res.jsonmanually inserted records causing duplicate database inserts. - Addressed undefined variables
TTL_MSandcorrelationIdinidempotency.ts. - Explicitly mounted the
idempotencymiddleware insidecreateReportsRouter(insrc/routes/reports.ts) for allPOSTandPATCHmethods.
- Global
audit_logswill now contain detailed states outlining what token roles were issued when impersonating.
Closes #123