From 0790623ee094e5fba0b0731673ced74e25984100 Mon Sep 17 00:00:00 2001 From: admin-valentin Date: Sun, 2 Aug 2026 12:32:22 +0000 Subject: [PATCH] feat(CC-072): add Workflow Library page with 8 business process templates --- src/app/dashboard/workflows/page.tsx | 205 +++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 src/app/dashboard/workflows/page.tsx diff --git a/src/app/dashboard/workflows/page.tsx b/src/app/dashboard/workflows/page.tsx new file mode 100644 index 0000000..eae36d1 --- /dev/null +++ b/src/app/dashboard/workflows/page.tsx @@ -0,0 +1,205 @@ +'use client'; + +import Link from 'next/link'; + +interface WorkflowTemplate { + id: string; name: string; category: string; description: string; + steps: string[]; estimatedTime: string; requiredModules: string[]; + icon: string; +} + +const WORKFLOW_TEMPLATES: WorkflowTemplate[] = [ + { + id: 'doc-processing', + name: 'Document Processing', + category: 'Documente', + icon: '📄', + description: 'Upload document → OCR → clasificare automată → arhivare sau aprobare.', + steps: ['Upload în Document Inbox', 'OCR automat', 'Clasificare C0-C4', 'Verificare umană pentru C3/C4', 'Arhivare cu metadata'], + estimatedTime: '5-15 minute', + requiredModules: ['Documents', 'OCR', 'Privacy Classification'], + }, + { + id: 'transaction-evidence', + name: 'Transaction Evidence Collection', + category: 'Financiar', + icon: '🧾', + description: 'Identifică tranzacții fără dovezi → notifică → colectează evidențe → marchează complet.', + steps: ['Query tranzacții cu evidenceStatus=missing', 'Generare task per tranzacție', 'Atașare URL sau document', 'PATCH evidenceStatus=complete', 'Audit trail'], + estimatedTime: '2-5 minute per tranzacție', + requiredModules: ['Transactions', 'Evidence Center', 'Tasks'], + }, + { + id: 'lead-qualification', + name: 'Lead Qualification', + category: 'Sales', + icon: '🎯', + description: 'Nou contact → calificare ICP → scor → alocare bucket pipeline → acțiune follow-up.', + steps: ['Contact nou intră în CRM', 'Matching cu Ideal Customer Profile', 'Scor și segment auto', 'Alocare în pipeline bucket', 'Task follow-up cu context'], + estimatedTime: '1-2 minute', + requiredModules: ['CRM', 'Contacts', 'Opportunities Pipeline', 'Segments'], + }, + { + id: 'accountant-pack', + name: 'Accountant Data Pack', + category: 'Contabilitate', + icon: '📊', + description: 'Pregătire pachet lunar pentru contabil: tranzacții, documente, obligații fiscale.', + steps: ['Export tranzacții luna curentă (CSV)', 'Verificare evidențe complete', 'Export contracte active', 'Raport obligații fiscale scadente', 'Arhivare în Shared Documents'], + estimatedTime: '10-20 minute', + requiredModules: ['Transactions', 'Documents', 'Obligations', 'Exports', 'Accountant Reports'], + }, + { + id: 'compliance-review', + name: 'Compliance Monthly Review', + category: 'Compliance', + icon: '⚖️', + description: 'Revizuire lunară de compliance: obligații, riscuri, score, raport.', + steps: ['Calculare Compliance Health Score', 'Review obligații depășite', 'Review riscuri critice/înalte', 'Actualizare assumptions', 'Generare Compliance Report'], + estimatedTime: '30-60 minute', + requiredModules: ['Compliance', 'Risks', 'Obligations', 'Assumptions', 'Reports'], + }, + { + id: 'decision-lifecycle', + name: 'Decision Lifecycle', + category: 'Decizii', + icon: '🧠', + description: 'Decizie nouă → scenarii → asumpții → plan de acțiune → revizuire outcome.', + steps: ['Creează decizie cu context', 'Adaugă scenarii cu probabilitate și impact', 'Identifică asumpții critice', 'Crează plan de acțiune', 'Programează outcome review la 30/90 zile'], + estimatedTime: '45-90 minute', + requiredModules: ['Decisions', 'Scenarios', 'Assumptions', 'Action Plans', 'Outcome Reviews'], + }, + { + id: 'risk-management', + name: 'Risk Identification & Mitigation', + category: 'Riscuri', + icon: '⚠️', + description: 'Identificare riscuri → evaluare probabilitate/impact → plan de mitigare → monitoring.', + steps: ['Identificare risc nou', 'Evaluare probabilitate (low/medium/high)', 'Evaluare impact financiar', 'Plan de mitigare în Action Plans', 'Review periodic'], + estimatedTime: '20-40 minute', + requiredModules: ['Risks', 'Action Plans', 'Compliance'], + }, + { + id: 'onboarding-client', + name: 'Client Onboarding', + category: 'CRM', + icon: '🤝', + description: 'Client nou → contract → obligații → contacte → segment → welcome workflow.', + steps: ['Creare organizație + contacte', 'Contract semnat în Documents', 'Obligații contractuale în Obligations', 'Alocare segment client', 'Notificare internă echipă'], + estimatedTime: '15-30 minute', + requiredModules: ['CRM', 'Contracts', 'Obligations', 'Documents', 'Segments'], + }, +]; + +const CATEGORIES = ['Toate', ...Array.from(new Set(WORKFLOW_TEMPLATES.map((w) => w.category)))]; + +const CAT_CLS: Record = { + 'Documente': 'bg-violet-50 text-violet-700 dark:bg-violet-900/20 dark:text-violet-400', + 'Financiar': 'bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400', + 'Sales': 'bg-orange-50 text-orange-700 dark:bg-orange-900/20 dark:text-orange-400', + 'Contabilitate': 'bg-blue-50 text-blue-700 dark:bg-blue-900/20 dark:text-blue-400', + 'Compliance': 'bg-amber-50 text-amber-700 dark:bg-amber-900/20 dark:text-amber-400', + 'Decizii': 'bg-purple-50 text-purple-700 dark:bg-purple-900/20 dark:text-purple-400', + 'Riscuri': 'bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400', + 'CRM': 'bg-teal-50 text-teal-700 dark:bg-teal-900/20 dark:text-teal-400', +}; + +import { useState } from 'react'; + +export default function WorkflowLibraryPage() { + const [category, setCategory] = useState('Toate'); + const [expanded, setExpanded] = useState(null); + + const filtered = category === 'Toate' + ? WORKFLOW_TEMPLATES + : WORKFLOW_TEMPLATES.filter((w) => w.category === category); + + return ( +
+
+

Workflow Library

+

+ {WORKFLOW_TEMPLATES.length} template-uri de automatizare pentru procese de business frecvente. +

+
+ + {/* Category filter */} +
+ {CATEGORIES.map((cat) => ( + + ))} +
+ + {/* Templates grid */} +
+ {filtered.map((w) => { + const isOpen = expanded === w.id; + return ( +
+
+
+
+ {w.icon} +
+

{w.name}

+ + {w.category} + +
+
+ ⏱ {w.estimatedTime} +
+ +

{w.description}

+ + + + {isOpen && ( +
+

Pași

+
    + {w.steps.map((step, i) => ( +
  1. + {i+1} + {step} +
  2. + ))} +
+ +
+

Module necesare

+
+ {w.requiredModules.map((mod) => ( + {mod} + ))} +
+
+
+ )} +
+
+ ); + })} +
+ + {/* n8n CTA */} +
+ ⚙️ +
+

Automatizare cu n8n

+

+ n8n rulează pe Hetzner cu 8179+ template-uri disponibile. Conectează CEO OS cu orice serviciu extern + prin webhook-uri semnate, triggers și flows customizate. +

+

Status: ⚠️ Callback-urile semnate și legarea la Policy Fabric sunt în plan (A3).

+
+
+
+ ); +}