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:
@@ -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';
|
||||
|
||||
35
packages/shared/src/types/alertas.ts
Normal file
35
packages/shared/src/types/alertas.ts
Normal 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;
|
||||
}
|
||||
37
packages/shared/src/types/calendario.ts
Normal file
37
packages/shared/src/types/calendario.ts
Normal 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[];
|
||||
}
|
||||
46
packages/shared/src/types/reportes.ts
Normal file
46
packages/shared/src/types/reportes.ts
Normal 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';
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user