import { z } from 'zod';
export const UseCaseSchema = z.object({
id: z.string().uuid().optional(),
project_id: z.string().uuid(),
name: z.string().min(1),
category: z.enum([
'automation',
'analytics',
'customer_service',
'operations',
'sales_marketing',
'hr_recruiting',
'finance_accounting',
'custom'
]),
// Current state metrics
current_state: z.object({
process_time_hours: z.number().min(0),
cost_per_transaction: z.number().min(0),
error_rate: z.number().min(0).max(1),
volume_per_month: z.number().min(0),
fte_required: z.number().min(0)
}),
// Future state projections
future_state: z.object({
automation_percentage: z.number().min(0).max(1),
time_reduction_percentage: z.number().min(0).max(1),
error_reduction_percentage: z.number().min(0).max(1),
scalability_factor: z.number().min(1).default(1)
}),
// Implementation details
implementation: z.object({
development_hours: z.number().min(0),
complexity_score: z.number().min(1).max(10),
dependencies: z.array(z.string()).default([]),
risk_factors: z.array(z.object({
name: z.string(),
probability: z.number().min(0).max(1),
impact: z.enum(['low', 'medium', 'high', 'critical'])
})).default([])
})
});
export type UseCase = z.infer<typeof UseCaseSchema>;
export const UseCaseCreateSchema = UseCaseSchema.omit({
id: true,
project_id: true
});
export type UseCaseCreate = z.infer<typeof UseCaseCreateSchema>;