feat(CC-072): add Workflow Library page with 8 business process templates
This commit is contained in:
parent
47daf49dd2
commit
0790623ee0
1 changed files with 205 additions and 0 deletions
205
src/app/dashboard/workflows/page.tsx
Normal file
205
src/app/dashboard/workflows/page.tsx
Normal file
|
|
@ -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<string, string> = {
|
||||
'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<string | null>(null);
|
||||
|
||||
const filtered = category === 'Toate'
|
||||
? WORKFLOW_TEMPLATES
|
||||
: WORKFLOW_TEMPLATES.filter((w) => w.category === category);
|
||||
|
||||
return (
|
||||
<div className="max-w-4xl space-y-6 p-6">
|
||||
<div>
|
||||
<h1 className="font-display text-2xl font-semibold text-ink">Workflow Library</h1>
|
||||
<p className="text-sm text-ink-faint mt-1">
|
||||
{WORKFLOW_TEMPLATES.length} template-uri de automatizare pentru procese de business frecvente.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Category filter */}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{CATEGORIES.map((cat) => (
|
||||
<button key={cat} onClick={() => setCategory(cat)}
|
||||
className={`rounded-full px-3 py-1 text-xs border transition-colors ${category === cat ? 'bg-primary/10 border-primary text-ink font-medium' : 'bg-card border-border text-ink-faint hover:border-primary/30'}`}>
|
||||
{cat}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Templates grid */}
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
{filtered.map((w) => {
|
||||
const isOpen = expanded === w.id;
|
||||
return (
|
||||
<div key={w.id} className="card overflow-hidden">
|
||||
<div className="p-5 space-y-3">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-2xl">{w.icon}</span>
|
||||
<div>
|
||||
<p className="text-sm font-semibold text-ink">{w.name}</p>
|
||||
<span className={`rounded-full px-2 py-0.5 text-[10px] font-medium ${CAT_CLS[w.category] ?? 'bg-muted text-ink-faint'}`}>
|
||||
{w.category}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span className="shrink-0 text-[10px] text-ink-faint">⏱ {w.estimatedTime}</span>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-ink-faint">{w.description}</p>
|
||||
|
||||
<button onClick={() => setExpanded(isOpen ? null : w.id)}
|
||||
className="text-xs text-primary hover:underline">
|
||||
{isOpen ? 'Ascunde pași ▲' : 'Vedere pași ▼'}
|
||||
</button>
|
||||
|
||||
{isOpen && (
|
||||
<div className="space-y-2 border-t border-border/50 pt-3">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-ink-faint">Pași</p>
|
||||
<ol className="space-y-1.5">
|
||||
{w.steps.map((step, i) => (
|
||||
<li key={i} className="flex items-start gap-2">
|
||||
<span className="shrink-0 rounded-full w-4 h-4 flex items-center justify-center bg-primary/10 text-[9px] font-bold text-primary">{i+1}</span>
|
||||
<span className="text-[11px] text-ink">{step}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
<div className="border-t border-border/50 pt-3">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-ink-faint mb-1.5">Module necesare</p>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{w.requiredModules.map((mod) => (
|
||||
<span key={mod} className="rounded bg-muted px-2 py-0.5 text-[10px] text-ink-faint">{mod}</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* n8n CTA */}
|
||||
<div className="card p-5 flex items-start gap-4">
|
||||
<span className="text-3xl">⚙️</span>
|
||||
<div className="space-y-2">
|
||||
<p className="text-sm font-semibold text-ink">Automatizare cu n8n</p>
|
||||
<p className="text-xs text-ink-faint">
|
||||
n8n rulează pe Hetzner cu 8179+ template-uri disponibile. Conectează CEO OS cu orice serviciu extern
|
||||
prin webhook-uri semnate, triggers și flows customizate.
|
||||
</p>
|
||||
<p className="text-xs text-ink-faint">Status: ⚠️ Callback-urile semnate și legarea la Policy Fabric sunt în plan (A3).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue