feat: implement relational lead origins with team assignments
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m51s

- Dropped simple origins table in favor of origin_groups and origin_items to match the Funnels architecture.

- Added origin_group_id to teams table to assign specific origins to specific teams.

- Updated /admin/origins page to support creating origin groups, adding origin items to them, and assigning teams to groups.

- Updated Dashboard and UserDetail pages to dynamically load the exact origin items belonging to the active team/user.
This commit is contained in:
Cauê Faleiros
2026-03-18 11:18:30 -03:00
parent 64c4ca8fb5
commit 1d3315a1d0
8 changed files with 641 additions and 27 deletions

View File

@@ -23,6 +23,20 @@ export interface FunnelDef {
teamIds: string[];
}
export interface OriginItemDef {
id: string;
origin_group_id: string;
name: string;
}
export interface OriginGroupDef {
id: string;
tenant_id: string;
name: string;
items: OriginItemDef[];
teamIds: string[];
}
export interface User {
id: string;
tenant_id: string;
@@ -50,7 +64,7 @@ export interface Attendance {
first_response_time_min: number;
handling_time_min: number;
funnel_stage: string;
origin: 'WhatsApp' | 'Instagram' | 'Website' | 'LinkedIn' | 'Indicação';
origin: string;
product_requested: string;
product_sold?: string;
converted: boolean;