Files
fasto/types.ts
Cauê Faleiros c4bd4d58a1
All checks were successful
Build and Deploy / build-and-push (push) Successful in 2m18s
feat: complete UI/UX refinement, email flow updates, and deep black theme
- Updated all email templates to a clean light theme and changed button text to 'Finalizar Cadastro'.

- Enforced a strict 15-minute expiration on all auth/reset tokens.

- Created SetupAccount flow distinct from ResetPassword to capture user name during admin init.

- Refined dark mode to a premium True Black (Onyx) palette using Zinc.

- Fixed Dashboard KPI visibility and true period-over-period trend logic.

- Enhanced TeamManagement with global tenant filtering for Super Admins.

- Implemented secure User URL routing via slugs instead of raw UUIDs.

- Enforced strict Agent-level RBAC for viewing attendances.
2026-03-05 15:33:03 -03:00

66 lines
1.4 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;
slug?: 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;
}