chore: import DH V2 D5.6.4 production baseline

This commit is contained in:
DH V2
2026-09-05 10:12:35 -03:00
commit 82213e72f5
757 changed files with 84218 additions and 0 deletions
@@ -0,0 +1,18 @@
import 'reflect-metadata';
import assert from 'node:assert/strict';
import test from 'node:test';
import { REQUIRED_PERMISSIONS_KEY } from '../../src/authorization/decorators/require-permissions.decorator';
import { SurveyExecutionController } from '../../src/survey-execution/survey-execution.controller';
function permissionFor(method: string): string[] {
const controller = SurveyExecutionController.prototype;
const handler = controller[method as keyof typeof controller];
return Reflect.getMetadata(REQUIRED_PERMISSIONS_KEY, handler) as string[];
}
test('survey report endpoints separate reading, capture and review', () => {
assert.deepEqual(permissionFor('get'), ['surveys.read_reports']);
assert.deepEqual(permissionFor('save'), ['surveys.capture']);
assert.deepEqual(permissionFor('submit'), ['surveys.capture']);
assert.deepEqual(permissionFor('review'), ['surveys.review']);
});