Oleada UX 6: Reportes agrupados en familias con rango global persistente y favoritos; Configuracion con auditoria de cambios y simulador de comisiones

This commit is contained in:
2026-09-17 22:06:11 +00:00
parent cd945df6a5
commit 31c92ac419
21 changed files with 1325 additions and 137 deletions

View File

@@ -260,6 +260,59 @@ export interface Service {
genera_monedero?: boolean;
}
export interface ImpactSimulationDoctor {
doctor_id: number;
doctor: string;
job_title: string;
base: number;
commission_pct_propio: number;
commission_pct_efectivo: number;
origen_pct: 'propio' | 'global' | 'propuesto';
commission: number;
}
export interface ImpactSimulation {
status: string;
date_from: string | null;
date_to: string | null;
commission_pct_global: number;
commission_pct_propuesto: number | null;
doctores: ImpactSimulationDoctor[];
total_base: number;
total_commission: number;
ventas: number;
rate: number | null;
rate_actual: number | null;
total_usd: number | null;
message?: string;
}
export interface ConfigAuditRow {
id: number;
date: string | null;
user_login: string;
user_name: string;
user_role: string;
module: string;
module_label: string;
entity: string;
entity_label: string;
field: string;
old_value: string;
new_value: string;
notes: string;
}
export interface ConfigAuditResponse {
status: string;
registros: ConfigAuditRow[];
total: number;
page: number;
page_size: number;
total_pages: number;
message?: string;
}
export interface Doctor {
id: number;
name: string;
@@ -1433,6 +1486,23 @@ export const odooApi = {
return data;
},
// Simulación de impacto ("Ver efecto") con las ventas atribuidas del periodo
async getImpactSimulation(params: {
date_from?: string; date_to?: string; commission_pct?: number; rate?: number;
}): Promise<ImpactSimulation> {
const { data } = await axios.get(`${ODOO_BASE}/skeen/frontend/v1/config/impact_simulation`, { params });
return data;
},
// Auditoría de configuración
async getConfigAudit(params?: {
date_from?: string; date_to?: string; module?: string; user?: string;
entity?: string; page?: number; page_size?: number;
}): Promise<ConfigAuditResponse> {
const { data } = await axios.get(`${ODOO_BASE}/skeen/frontend/v1/config/audit`, { params });
return data;
},
async getDoctorHistory(id: number): Promise<DoctorHistory> {
const { data } = await axios.get(`${ODOO_BASE}/skeen/frontend/v1/doctors/${id}/history`);
return data;