improvement: QRcode and shared link added to cases inorder to make it possible for staff users to share a case info with other staffs or other clinics.

This commit is contained in:
2026-07-14 21:07:05 +03:30
parent 953e609fb8
commit 08df2f71ea
41 changed files with 1535 additions and 83 deletions

View File

@@ -42,6 +42,7 @@ export const ErrorCode = {
PERMISSION_ACCESS_STAFF: 'PERMISSION_ACCESS_STAFF',
PERMISSION_EDIT_STAFF: 'PERMISSION_EDIT_STAFF',
PERMISSION_ORG_NOT_FOUND: 'PERMISSION_ORG_NOT_FOUND',
LAB_CASE_ACCESS_DENIED: 'LAB_CASE_ACCESS_DENIED',
// Validation
VALIDATION_FAILED: 'VALIDATION_FAILED',

View File

@@ -0,0 +1,11 @@
import { randomBytes } from 'crypto';
export function generateLabCaseAccessToken(): string {
return randomBytes(32).toString('base64url');
}
export function buildLabCaseShareUrl(accessToken: string, locale = 'en'): string {
const appUrl = (process.env.FRONTEND_URL || 'http://localhost:3001').replace(/\/$/, '');
const normalizedLocale = locale.trim() || 'en';
return `${appUrl}/${normalizedLocale}/lab-case/${accessToken}`;
}