feat(alertas): add alerts CRUD with stats and management UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Consultoria AS
2026-01-22 03:00:14 +00:00
parent 6d59c8d842
commit 9b8aaea7eb
31 changed files with 4892 additions and 0 deletions

View File

@@ -5,6 +5,9 @@ export * from './types/user';
export * from './types/cfdi';
export * from './types/dashboard';
export * from './types/impuestos';
export * from './types/alertas';
export * from './types/reportes';
export * from './types/calendario';
// Constants
export * from './constants/plans';

View File

@@ -0,0 +1,35 @@
export type TipoAlerta = 'vencimiento' | 'discrepancia' | 'iva_favor' | 'declaracion' | 'limite_cfdi' | 'custom';
export type PrioridadAlerta = 'alta' | 'media' | 'baja';
export interface AlertaCreate {
tipo: TipoAlerta;
titulo: string;
mensaje: string;
prioridad: PrioridadAlerta;
fechaVencimiento?: string;
}
export interface AlertaUpdate {
leida?: boolean;
resuelta?: boolean;
}
export interface AlertaFull {
id: number;
tipo: TipoAlerta;
titulo: string;
mensaje: string;
prioridad: PrioridadAlerta;
fechaVencimiento: string | null;
leida: boolean;
resuelta: boolean;
createdAt: string;
}
export interface AlertasStats {
total: number;
noLeidas: number;
alta: number;
media: number;
baja: number;
}

View File

@@ -0,0 +1,37 @@
export type TipoEvento = 'declaracion' | 'pago' | 'obligacion' | 'custom';
export type Recurrencia = 'mensual' | 'bimestral' | 'trimestral' | 'anual' | 'unica';
export interface EventoFiscal {
id: number;
titulo: string;
descripcion: string;
tipo: TipoEvento;
fechaLimite: string;
recurrencia: Recurrencia;
completado: boolean;
notas: string | null;
createdAt: string;
}
export interface EventoCreate {
titulo: string;
descripcion: string;
tipo: TipoEvento;
fechaLimite: string;
recurrencia: Recurrencia;
notas?: string;
}
export interface EventoUpdate {
titulo?: string;
descripcion?: string;
fechaLimite?: string;
completado?: boolean;
notas?: string;
}
export interface CalendarioMes {
año: number;
mes: number;
eventos: EventoFiscal[];
}

View File

@@ -0,0 +1,46 @@
export interface EstadoResultados {
periodo: { inicio: string; fin: string };
ingresos: { concepto: string; monto: number }[];
egresos: { concepto: string; monto: number }[];
totalIngresos: number;
totalEgresos: number;
utilidadBruta: number;
impuestos: number;
utilidadNeta: number;
}
export interface FlujoEfectivo {
periodo: { inicio: string; fin: string };
saldoInicial: number;
entradas: { concepto: string; monto: number }[];
salidas: { concepto: string; monto: number }[];
totalEntradas: number;
totalSalidas: number;
flujoNeto: number;
saldoFinal: number;
}
export interface ComparativoPeriodos {
periodos: string[];
ingresos: number[];
egresos: number[];
utilidad: number[];
variacionIngresos: number;
variacionEgresos: number;
variacionUtilidad: number;
}
export interface ConcentradoRfc {
rfc: string;
nombre: string;
tipo: 'cliente' | 'proveedor';
totalFacturado: number;
totalIva: number;
cantidadCfdis: number;
}
export interface ReporteFilters {
fechaInicio: string;
fechaFin: string;
tipo?: 'mensual' | 'trimestral' | 'anual';
}

View File

@@ -23,3 +23,35 @@ export interface UpdateUserRequest {
role?: Role;
active?: boolean;
}
export interface UserInvite {
email: string;
nombre: string;
role: 'admin' | 'contador' | 'visor';
}
export interface UserListItem {
id: string;
email: string;
nombre: string;
role: 'admin' | 'contador' | 'visor';
active: boolean;
lastLogin: string | null;
createdAt: string;
}
export interface UserUpdate {
nombre?: string;
role?: 'admin' | 'contador' | 'visor';
active?: boolean;
}
export interface AuditLog {
id: number;
userId: string;
userName: string;
action: string;
details: string;
ip: string;
createdAt: string;
}