Implemented rbac

This commit is contained in:
2026-10-11 11:16:08 +02:00
parent 45a6c0aca0
commit 1142cfd94e
24 changed files with 3033 additions and 432 deletions
@@ -1,5 +1,3 @@
import { jsPDF } from 'jspdf';
import autoTable from 'jspdf-autotable';
export interface ExportColumn {
header: string;
@@ -53,7 +51,7 @@ export function exportToSpreadsheet({ filename, columns, data }: ExportDataOptio
/**
* Draws the high-visibility official PFM vector brand insignia onto the jsPDF document.
*/
function drawPfmLogo(doc: jsPDF, x: number, y: number, size: number): void {
function drawPfmLogo(doc: any, x: number, y: number, size: number): void {
const scale = size / 64;
doc.saveGraphicsState();
@@ -183,9 +181,14 @@ function drawPfmLogo(doc: jsPDF, x: number, y: number, size: number): void {
* Generates an executive-grade PDF document in LANDSCAPE mode with clear PFM logo visibility,
* metadata header, and structured autoTable data.
*/
export function exportToPdf({ title, subtitle, filename, columns, data }: ExportDataOptions): void {
export async function exportToPdf({ title, subtitle, filename, columns, data }: ExportDataOptions): Promise<void> {
if (!data || data.length === 0) return;
const [{ jsPDF }, { default: autoTable }] = await Promise.all([
import('jspdf'),
import('jspdf-autotable'),
]);
// Enforce Landscape orientation
const doc = new jsPDF({
orientation: 'landscape',