diff --git a/admin-compliance/app/(admin)/development/sdk-flow/flow-data.ts b/admin-compliance/app/(admin)/development/sdk-flow/flow-data.ts index e5a9552..b670a60 100644 --- a/admin-compliance/app/(admin)/development/sdk-flow/flow-data.ts +++ b/admin-compliance/app/(admin)/development/sdk-flow/flow-data.ts @@ -39,6 +39,13 @@ export interface SDKFlowStep { generates?: string[] isOptional?: boolean url: string + + /** + * Fertigstellungsgrad in Prozent (0–100). + * Nur für Betrieb-Module gesetzt (außer academy/training). + * Berechnung: Frontend-Reifegrad + Backend-Persistenz + API-Abdeckung. + */ + completion?: number } // ============================================================================= @@ -632,6 +639,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ ragPurpose: 'Art. 15-21 DSGVO Betroffenenrechte', isOptional: false, url: '/sdk/dsr', + completion: 65, }, { id: 'escalations', @@ -653,6 +661,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ ragCollections: [], isOptional: false, url: '/sdk/escalations', + completion: 30, }, { id: 'vendor-compliance', @@ -675,6 +684,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ ragPurpose: 'AVV-Vorlagen und Pruefkataloge', isOptional: false, url: '/sdk/vendor-compliance', + completion: 35, }, { id: 'consent-management', @@ -696,6 +706,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ ragCollections: [], isOptional: false, url: '/sdk/consent-management', + completion: 75, }, { id: 'notfallplan', @@ -718,6 +729,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ generates: ['Notfallplan (PDF)'], isOptional: false, url: '/sdk/notfallplan', + completion: 50, }, { id: 'incidents', @@ -739,6 +751,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ ragCollections: [], isOptional: false, url: '/sdk/incidents', + completion: 55, }, { id: 'whistleblower', @@ -760,6 +773,7 @@ export const SDK_FLOW_STEPS: SDKFlowStep[] = [ ragCollections: [], isOptional: false, url: '/sdk/whistleblower', + completion: 60, }, { id: 'academy', diff --git a/admin-compliance/app/(admin)/development/sdk-flow/page.tsx b/admin-compliance/app/(admin)/development/sdk-flow/page.tsx index 37d94df..654ab1e 100644 --- a/admin-compliance/app/(admin)/development/sdk-flow/page.tsx +++ b/admin-compliance/app/(admin)/development/sdk-flow/page.tsx @@ -77,6 +77,98 @@ function getStepPosition(step: SDKFlowStep): { x: number; y: number } { } } +// ============================================================================= +// HELPERS — FERTIGSTELLUNGSGRAD +// ============================================================================= + +function completionColor(pct: number): string { + if (pct >= 70) return '#22c55e' // green + if (pct >= 50) return '#84cc16' // lime + if (pct >= 35) return '#f59e0b' // amber + return '#ef4444' // red +} + +function completionLabel(pct: number): string { + if (pct >= 70) return 'Fortgeschritten' + if (pct >= 50) return 'In Entwicklung' + if (pct >= 35) return 'Begonnen' + return 'Frühe Phase' +} + +// ============================================================================= +// BETRIEB OVERVIEW PANEL +// ============================================================================= + +function BetriebOverviewPanel() { + const betriebWithCompletion = SDK_FLOW_STEPS.filter( + s => s.package === 'betrieb' && s.completion !== undefined + ).sort((a, b) => (b.completion ?? 0) - (a.completion ?? 0)) + + const avg = Math.round( + betriebWithCompletion.reduce((sum, s) => sum + (s.completion ?? 0), 0) / + betriebWithCompletion.length + ) + + return ( +
+ {betriebWithCompletion.length} Module bewertet · Academy & Training ausgeschlossen +
+{step.description}
@@ -359,6 +483,28 @@ export default function SDKFlowPage() { {step.checkpointId || ''} {badge}