2026-04-27 04:25:52 +00:00

22 lines
862 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const express = require('express');
const router = express.Router();
const { issueVHLController } = require('../controllers/vhlIssue');
const { getManifestController, getDocumentController } = require('../controllers/vhlVerify');
// Specific sub-paths are registered before /:patientId to avoid ambiguity.
// Express matches routes in registration order; 'manifest' and 'document'
// are literal path segments, so they won't be captured by /:patientId.
// Fase 4 — Retrieve VHL Manifest (validar_qr_vhl.mmd, step 6)
router.post('/manifest/:manifestId', getManifestController);
// Fase 4 — Serve encrypted IPS document (validar_qr_vhl.mmd, step 8)
router.get('/document/:documentId', getDocumentController);
// Fase 1 — Issue VHL (obtener_qr_vhl.mmd, steps 23)
router.post('/:patientId', issueVHLController);
module.exports = router;