fix: Correcciones de errores y mejoras del dashboard CFO
- Corregido auth.service.ts para usar estructura multi-tenant correcta (user_tenants) - Dashboard rediseñado para CFO digital (ingresos/egresos, CFDIs, alertas) - Sidebar actualizado con rutas correctas (Métricas, Transacciones, CFDIs, Reportes, Asistente IA) - Agregadas páginas de Perfil (/profile) y Configuración (/settings) - Corregidos errores de TypeScript (strict mode, tipos duplicados) - Actualizado docker-compose.yml a PostgreSQL 16 - Corregidas migraciones SQL (índices IMMUTABLE, constraints) - Configuración ESM modules en packages - CORS configurado para acceso de red local Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"name": "@horux/database",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "Database schemas and migrations for Horux Strategy",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
* - Type definitions for database entities
|
||||
*/
|
||||
|
||||
// Import types used in this file
|
||||
import type { TenantStatus, TenantSettings } from './tenant.js';
|
||||
|
||||
// Connection management
|
||||
export {
|
||||
DatabaseConnection,
|
||||
|
||||
@@ -253,7 +253,6 @@ CREATE INDEX idx_cfdis_reconciled ON cfdis(is_reconciled, fecha_emision DESC) WH
|
||||
-- Composite indexes for common queries
|
||||
CREATE INDEX idx_cfdis_emitted_date ON cfdis(is_emitted, fecha_emision DESC);
|
||||
CREATE INDEX idx_cfdis_type_date ON cfdis(tipo_comprobante, fecha_emision DESC);
|
||||
CREATE INDEX idx_cfdis_month_report ON cfdis(DATE_TRUNC('month', fecha_emision), tipo_comprobante, is_emitted);
|
||||
|
||||
-- Full-text search index
|
||||
CREATE INDEX idx_cfdis_search ON cfdis USING gin(to_tsvector('spanish', emisor_nombre || ' ' || receptor_nombre || ' ' || COALESCE(serie, '') || ' ' || COALESCE(folio, '')));
|
||||
@@ -345,7 +344,6 @@ CREATE INDEX idx_transactions_cfdi ON transactions(cfdi_id) WHERE cfdi_id IS NOT
|
||||
CREATE INDEX idx_transactions_reconciled ON transactions(is_reconciled, transaction_date DESC) WHERE is_reconciled = false;
|
||||
|
||||
-- Composite indexes for reporting
|
||||
CREATE INDEX idx_transactions_monthly ON transactions(DATE_TRUNC('month', transaction_date), type, status);
|
||||
CREATE INDEX idx_transactions_category_date ON transactions(category_id, transaction_date DESC) WHERE category_id IS NOT NULL;
|
||||
|
||||
-- ============================================================================
|
||||
|
||||
@@ -137,10 +137,8 @@ CREATE TABLE IF NOT EXISTS integrations (
|
||||
created_by UUID NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
||||
deleted_at TIMESTAMP WITH TIME ZONE,
|
||||
|
||||
-- Constraints
|
||||
CONSTRAINT integrations_unique_type UNIQUE (type) WHERE type NOT IN ('webhook', 'api_custom') AND deleted_at IS NULL
|
||||
deleted_at TIMESTAMP WITH TIME ZONE
|
||||
-- Note: One integration per type enforced by partial unique index below
|
||||
);
|
||||
|
||||
-- Indexes for integrations
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"isolatedModules": true
|
||||
"isolatedModules": false
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
||||
|
||||
Reference in New Issue
Block a user