feat(shared): add types for dashboard, cfdi, and impuestos
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
export * from './types/auth';
|
export * from './types/auth';
|
||||||
export * from './types/tenant';
|
export * from './types/tenant';
|
||||||
export * from './types/user';
|
export * from './types/user';
|
||||||
|
export * from './types/cfdi';
|
||||||
|
export * from './types/dashboard';
|
||||||
|
export * from './types/impuestos';
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
export * from './constants/plans';
|
export * from './constants/plans';
|
||||||
|
|||||||
50
packages/shared/src/types/cfdi.ts
Normal file
50
packages/shared/src/types/cfdi.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
export type TipoCfdi = 'ingreso' | 'egreso' | 'traslado' | 'pago' | 'nomina';
|
||||||
|
export type EstadoCfdi = 'vigente' | 'cancelado';
|
||||||
|
|
||||||
|
export interface Cfdi {
|
||||||
|
id: string;
|
||||||
|
uuidFiscal: string;
|
||||||
|
tipo: TipoCfdi;
|
||||||
|
serie: string | null;
|
||||||
|
folio: string | null;
|
||||||
|
fechaEmision: string;
|
||||||
|
fechaTimbrado: string;
|
||||||
|
rfcEmisor: string;
|
||||||
|
nombreEmisor: string;
|
||||||
|
rfcReceptor: string;
|
||||||
|
nombreReceptor: string;
|
||||||
|
subtotal: number;
|
||||||
|
descuento: number;
|
||||||
|
iva: number;
|
||||||
|
isrRetenido: number;
|
||||||
|
ivaRetenido: number;
|
||||||
|
total: number;
|
||||||
|
moneda: string;
|
||||||
|
tipoCambio: number;
|
||||||
|
metodoPago: string | null;
|
||||||
|
formaPago: string | null;
|
||||||
|
usoCfdi: string | null;
|
||||||
|
estado: EstadoCfdi;
|
||||||
|
xmlUrl: string | null;
|
||||||
|
pdfUrl: string | null;
|
||||||
|
createdAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CfdiFilters {
|
||||||
|
tipo?: TipoCfdi;
|
||||||
|
estado?: EstadoCfdi;
|
||||||
|
fechaInicio?: string;
|
||||||
|
fechaFin?: string;
|
||||||
|
rfc?: string;
|
||||||
|
search?: string;
|
||||||
|
page?: number;
|
||||||
|
limit?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CfdiListResponse {
|
||||||
|
data: Cfdi[];
|
||||||
|
total: number;
|
||||||
|
page: number;
|
||||||
|
limit: number;
|
||||||
|
totalPages: number;
|
||||||
|
}
|
||||||
46
packages/shared/src/types/dashboard.ts
Normal file
46
packages/shared/src/types/dashboard.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
export interface KpiData {
|
||||||
|
ingresos: number;
|
||||||
|
egresos: number;
|
||||||
|
utilidad: number;
|
||||||
|
margen: number;
|
||||||
|
ivaBalance: number;
|
||||||
|
cfdisEmitidos: number;
|
||||||
|
cfdisRecibidos: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IngresosEgresosData {
|
||||||
|
mes: string;
|
||||||
|
ingresos: number;
|
||||||
|
egresos: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResumenFiscal {
|
||||||
|
ivaPorPagar: number;
|
||||||
|
ivaAFavor: number;
|
||||||
|
isrPorPagar: number;
|
||||||
|
declaracionesPendientes: number;
|
||||||
|
proximaObligacion: {
|
||||||
|
titulo: string;
|
||||||
|
fecha: string;
|
||||||
|
} | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Alerta {
|
||||||
|
id: number;
|
||||||
|
tipo: 'vencimiento' | 'discrepancia' | 'iva_favor' | 'declaracion';
|
||||||
|
titulo: string;
|
||||||
|
mensaje: string;
|
||||||
|
prioridad: 'alta' | 'media' | 'baja';
|
||||||
|
fechaVencimiento: string | null;
|
||||||
|
leida: boolean;
|
||||||
|
resuelta: boolean;
|
||||||
|
createdAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type PeriodoFiltro = 'semana' | 'mes' | 'trimestre' | 'año' | 'custom';
|
||||||
|
|
||||||
|
export interface DashboardFilters {
|
||||||
|
periodo: PeriodoFiltro;
|
||||||
|
fechaInicio?: string;
|
||||||
|
fechaFin?: string;
|
||||||
|
}
|
||||||
45
packages/shared/src/types/impuestos.ts
Normal file
45
packages/shared/src/types/impuestos.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
export type EstadoDeclaracion = 'pendiente' | 'declarado' | 'acreditado';
|
||||||
|
|
||||||
|
export interface IvaMensual {
|
||||||
|
id: number;
|
||||||
|
año: number;
|
||||||
|
mes: number;
|
||||||
|
ivaTrasladado: number;
|
||||||
|
ivaAcreditable: number;
|
||||||
|
ivaRetenido: number;
|
||||||
|
resultado: number;
|
||||||
|
acumulado: number;
|
||||||
|
estado: EstadoDeclaracion;
|
||||||
|
fechaDeclaracion: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IsrMensual {
|
||||||
|
id: number;
|
||||||
|
año: number;
|
||||||
|
mes: number;
|
||||||
|
ingresosAcumulados: number;
|
||||||
|
deducciones: number;
|
||||||
|
baseGravable: number;
|
||||||
|
isrCausado: number;
|
||||||
|
isrRetenido: number;
|
||||||
|
isrAPagar: number;
|
||||||
|
estado: EstadoDeclaracion;
|
||||||
|
fechaDeclaracion: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResumenIva {
|
||||||
|
trasladado: number;
|
||||||
|
acreditable: number;
|
||||||
|
retenido: number;
|
||||||
|
resultado: number;
|
||||||
|
acumuladoAnual: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResumenIsr {
|
||||||
|
ingresosAcumulados: number;
|
||||||
|
deducciones: number;
|
||||||
|
baseGravable: number;
|
||||||
|
isrCausado: number;
|
||||||
|
isrRetenido: number;
|
||||||
|
isrAPagar: number;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user