Files
HoruxStrategyKimi/apps/api/package.json
HORUX360 45570baccc feat: Implement Phase 3 & 4 - AI Reports & ERP Integrations
## Phase 3: DeepSeek AI Integration

### AI Services (apps/api/src/services/ai/)
- DeepSeek API client with streaming, rate limiting, retries
- AI service for financial analysis, executive summaries, recommendations
- Optimized prompts for Mexican CFO digital assistant
- Redis caching for AI responses

### Report Generation (apps/api/src/services/reports/)
- ReportGenerator: monthly, quarterly, annual, custom reports
- PDF generator with corporate branding (PDFKit)
- Report templates for PYME, Startup, Enterprise
- Spanish prompts for financial narratives
- MinIO storage for generated PDFs

### AI & Reports API Routes
- POST /api/ai/analyze - Financial metrics analysis
- POST /api/ai/chat - CFO digital chat with streaming
- POST /api/reports/generate - Async report generation
- GET /api/reports/:id/download - PDF download
- BullMQ jobs for background processing

### Frontend Pages
- /reportes - Report listing with filters
- /reportes/nuevo - 3-step wizard for report generation
- /reportes/[id] - Full report viewer with charts
- /asistente - CFO Digital chat interface
- Components: ChatInterface, ReportCard, AIInsightCard

## Phase 4: ERP Integrations

### CONTPAQi Connector (SQL Server)
- Contabilidad: catalog, polizas, balanza, estado de resultados
- Comercial: clientes, proveedores, facturas, inventario
- Nominas: empleados, nominas, percepciones/deducciones

### Aspel Connector (Firebird/SQL Server)
- COI: accounting, polizas, balanza, auxiliares
- SAE: sales, purchases, inventory, A/R, A/P
- NOI: payroll, employees, receipts
- BANCO: bank accounts, movements, reconciliation
- Latin1 to UTF-8 encoding handling

### Odoo Connector (XML-RPC)
- Accounting: chart of accounts, journal entries, reports
- Invoicing: customer/vendor invoices, payments
- Partners: customers, vendors, statements
- Inventory: products, stock levels, valuations
- Multi-company and version 14-17 support

### Alegra Connector (REST API)
- Invoices, credit/debit notes with CFDI support
- Contacts with Mexican fiscal fields (RFC, regimen)
- Payments and bank reconciliation
- Financial reports: trial balance, P&L, balance sheet
- Webhook support for real-time sync

### SAP Business One Connector (OData/Service Layer)
- Session management with auto-refresh
- Financials: chart of accounts, journal entries, reports
- Sales: invoices, credit notes, delivery notes, orders
- Purchasing: bills, POs, goods receipts
- Inventory: items, stock, transfers, valuation
- Banking: accounts, payments, cash flow

### Integration Manager
- Unified interface for all connectors
- BullMQ scheduler for automated sync
- Webhook handling for real-time updates
- Migration 003_integrations.sql with sync tables
- Frontend page /integraciones for configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 11:25:17 +00:00

56 lines
1.4 KiB
JSON

{
"name": "@horux/api",
"version": "0.1.0",
"private": true,
"description": "Horux Strategy Backend API",
"main": "dist/index.js",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:watch": "vitest --watch",
"clean": "rm -rf dist node_modules"
},
"dependencies": {
"@horux/database": "workspace:*",
"@horux/shared": "workspace:*",
"bcryptjs": "^2.4.3",
"bullmq": "^5.1.0",
"compression": "^1.7.4",
"cors": "^2.8.5",
"dotenv": "^16.4.0",
"express": "^4.18.2",
"express-rate-limit": "^7.1.5",
"helmet": "^7.1.0",
"ioredis": "^5.3.2",
"jsonwebtoken": "^9.0.2",
"minio": "^7.1.3",
"mssql": "^10.0.2",
"pdfkit": "^0.15.0",
"pg": "^8.11.3",
"uuid": "^9.0.1",
"winston": "^3.11.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jsonwebtoken": "^9.0.5",
"@types/mssql": "^9.1.5",
"@types/node": "^20.11.0",
"@types/pdfkit": "^0.13.4",
"@types/pg": "^8.10.9",
"@types/uuid": "^9.0.7",
"eslint": "^8.56.0",
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vitest": "^1.2.0"
}
}