Files
fasto/types.ts
Cauê Faleiros 20bdf510fd
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m54s
feat: implement secure multi-tenancy, RBAC, and premium dark mode
- Enforced tenant isolation and Role-Based Access Control across all API routes

- Implemented secure profile avatar upload using multer and UUIDs

- Redesigned UI with a premium "Onyx & Gold" Charcoal dark mode

- Added Funnel Stage and Origin filters to Dashboard and User Detail pages

- Replaced "Referral" with "Indicação" across the platform and database

- Optimized Dockerfile and local environment setup for reliable deployments

- Fixed frontend syntax errors and improved KPI/Chart visualizations
2026-03-03 17:16:55 -03:00

65 lines
1.3 KiB
TypeScript

export enum FunnelStage {
NO_CONTACT = 'Sem atendimento',
IDENTIFICATION = 'Identificação',
NEGOTIATION = 'Negociação',
WON = 'Ganhos',
LOST = 'Perdidos',
}
export interface User {
id: string;
tenant_id: string;
name: string;
email: string;
avatar_url: string;
role: 'super_admin' | 'admin' | 'manager' | 'agent';
team_id: string;
bio?: string;
status: 'active' | 'inactive';
}
export interface Attendance {
id: string;
tenant_id: string;
user_id: string;
created_at: string; // ISO Date
summary: string;
attention_points: string[];
improvement_points: string[];
score: number; // 0-100
first_response_time_min: number;
handling_time_min: number;
funnel_stage: FunnelStage;
origin: 'WhatsApp' | 'Instagram' | 'Website' | 'LinkedIn' | 'Indicação';
product_requested: string;
product_sold?: string;
converted: boolean;
}
export interface Tenant {
id: string;
name: string;
logo_url?: string;
// Extended fields for Super Admin
slug?: string;
admin_email?: string;
status?: 'active' | 'inactive' | 'trial';
user_count?: number;
attendance_count?: number;
created_at?: string;
}
export interface DateRange {
start: Date;
end: Date;
}
export interface DashboardFilter {
dateRange: DateRange;
userId?: string;
teamId?: string;
funnelStage?: string;
origin?: string;
}