Adds initial backend API endpoints for fetching users and attendances, including basic filtering. Sets up the frontend routing with a layout component and includes placeholder pages for dashboard, users, and login. Refactors the README for local development setup.
63 lines
1.3 KiB
TypeScript
63 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' | 'Referral';
|
|
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;
|
|
}
|