feat(core-dsr): handlers, dsrRouter, integration tests

Add four protocol-agnostic handlers (export, delete, rectify, restrict)
returning normalized { status, body, headers } responses, and a tRPC
dsrRouter via createDsrRouter(binding) following the factory pattern.

Auth checks: requireAuthenticated middleware gates all four procedures;
cascade-hard delete additionally requires admin role. Integration tests
assert happy-path response shapes, UNAUTHORIZED/FORBIDDEN error codes,
and error passthrough from the DSR service layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 20:34:51 +00:00
parent 6f56a04335
commit 46e575a5a6
13 changed files with 588 additions and 4 deletions

View File

@@ -4,7 +4,8 @@
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
".": "./src/index.ts",
"./api": "./src/dsr.router.ts"
},
"scripts": {
"build": "tsc --noEmit",
@@ -14,7 +15,9 @@
},
"dependencies": {
"@repo/core-shared": "workspace:*",
"payload": "^3.0.0"
"@trpc/server": "^11.0.0",
"payload": "^3.0.0",
"zod": "^3.24.0"
},
"devDependencies": {
"@repo/core-eslint": "workspace:*",