Commit Graph

25 Commits

Author SHA1 Message Date
8b12d7f231 fix(cors): Resolve duplicate CORS headers in production
## Problem
CORS error: "Access-Control-Allow-Origin header contains multiple values"
caused by both Nginx and NestJS sending CORS headers.

## Solution
- NestJS handles CORS exclusively (main.ts)
- Nginx acts as SSL proxy only (no CORS headers)
- Updated .env.production.example with HTTPS origins
- Created GUIA-CORS-PRODUCCION.md with complete documentation

## Files Changed
- .gitignore: Allow .env.*.example files
- apps/backend/.gitignore: Allow .env.*.example files
- apps/backend/.env.production.example: HTTPS CORS config
- apps/frontend/.env.production.example: HTTPS/WSS config
- docs/95-guias-desarrollo/GUIA-CORS-PRODUCCION.md: Full guide

## Production Steps
1. Update .env.production files with HTTPS origins
2. Remove CORS headers from Nginx config
3. Rebuild frontend, restart backend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:24:01 -06:00
d0d5699cd5 feat: Add production deployment scripts and synchronization analysis
Changes:
- Fix ecosystem.config.js path (line 138)
- Add production scripts (update-production.sh, diagnose-production.sh)
- Add PRODUCTION-UPDATE.md with quick instructions
- Add reference to production deployment documentation

Analysis reports:
- PLAN-SINCRONIZACION-WORKSPACES-2025-12-18.md - Master sync plan
- ANALISIS-CONFIGURACION-PRODUCCION-2025-12-18.md - Config analysis
- PLAN-IMPLEMENTACION-SINCRONIZACION-2025-12-18.md - Implementation plan
- VALIDACION-PLAN-SINCRONIZACION-2025-12-18.md - Validation report

Result: Both workspaces (NUEVO/VIEJO) are now 100% synchronized
- DDL: 100% identical
- Seeds: 100% identical
- Backend: 100% synchronized
- Frontend: 100% synchronized

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:14:22 -06:00
c4b4b9cd89 docs: Add workspace synchronization directive and update project context
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
## Summary
- Add DIRECTIVA-SINCRONIZACION-WORKSPACES.md with rules for dual workspace management
- Update CONTEXTO-PROYECTO.md with workspace dual information

## Workspaces
- NEW (development priority): ~/workspace/projects/gamilit → Gitea
- OLD (production client): ~/workspace-old/.../gamilit → GitHub

## Key Rules
- Development happens in NEW workspace first
- Production configs (.env.production, ecosystem.config.js) must exist in BOTH
- Production scripts and guides only in OLD workspace
- DDL/Seeds must be IDENTICAL in both

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 09:19:56 -06:00
608e1e2a2e Multi-project update: gamilit, orchestration, trading-platform
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
Gamilit:
- Backend: Teacher services, assignments, gamification, exercise submissions
- Frontend: Admin/Teacher/Student portals, module 4-5 mechanics, monitoring
- Database: DDL functions, seeds for dev/prod, auth/gamification schemas
- Docs: Architecture, features, guides cleanup and reorganization

Core/Orchestration:
- New workspace directives index
- Documentation directive

Trading-platform:
- Database seeds and inventory updates
- Tech leader validation report

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 07:17:46 -06:00
e360b88612 changes on erp
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
2025-12-18 06:25:52 -06:00
98c5b3d86b changes gamilit corrections errors
Some checks failed
CI Pipeline / changes (push) Has been cancelled
CI Pipeline / core (push) Has been cancelled
CI Pipeline / trading-backend (push) Has been cancelled
CI Pipeline / trading-data-service (push) Has been cancelled
CI Pipeline / trading-frontend (push) Has been cancelled
CI Pipeline / erp-core (push) Has been cancelled
CI Pipeline / erp-mecanicas (push) Has been cancelled
CI Pipeline / gamilit-backend (push) Has been cancelled
CI Pipeline / gamilit-frontend (push) Has been cancelled
2025-12-12 23:23:58 -06:00
3a44cad22e changes for detail agents and erp-suite
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
2025-12-12 23:16:32 -06:00
513a86ceee Major update: orchestration system, catalog references, and multi-project enhancements
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
Core:
- Add catalog reference implementations (auth, payments, notifications, websocket, etc.)
- New agent profiles: Database Auditor, Integration Validator, LLM Agent, Policy Auditor, Trading Strategist
- Update SIMCO directives and add escalation/git guidelines
- Add deployment inventory and audit execution reports

Projects:
- erp-suite: DevOps configs, Dockerfiles, shared libs, vertical enhancements
- gamilit: Test structure, admin controllers, service refactoring, husky/commitlint
- trading-platform: MT4 gateway, auth controllers, admin frontend, deployment scripts
- platform_marketing_content: Full DevOps setup, tests, Docker configs
- betting-analytics/inmobiliaria-analytics: Initial app structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 22:53:55 -06:00
f8f11b24fa Update orchestration guidelines and platform marketing content configs
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
- Updated legacy directives documentation
- Updated project context files for betting-analytics, construccion, inmobiliaria-analytics
- Enhanced platform_marketing_content orchestration: architecture directive, nomenclature guide, master inventory, backend prompt

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 08:19:33 -06:00
7ed5c5ab45 changes on project erp-suite documentation
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
2025-12-12 08:18:01 -06:00
4ac2b7aa0d Add orchestration templates, agent profiles, and validation scripts
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
- New agent profiles: DevOps, Security Auditor, Testing
- New templates: Sprint report, HU derivada, Analysis impact
- Onboarding guide for projects
- Validation scripts for CAPVED gate, inventory coherence, propagation
- Platform marketing content orchestration state files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 07:54:33 -06:00
7a0e02cde8 changes on project erp-suite
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
2025-12-12 07:51:55 -06:00
48e7235e79 First version for working parallel
Some checks are pending
CI Pipeline / changes (push) Waiting to run
CI Pipeline / core (push) Blocked by required conditions
CI Pipeline / trading-backend (push) Blocked by required conditions
CI Pipeline / trading-data-service (push) Blocked by required conditions
CI Pipeline / trading-frontend (push) Blocked by required conditions
CI Pipeline / erp-core (push) Blocked by required conditions
CI Pipeline / erp-mecanicas (push) Blocked by required conditions
CI Pipeline / gamilit-backend (push) Blocked by required conditions
CI Pipeline / gamilit-frontend (push) Blocked by required conditions
2025-12-12 06:36:15 -06:00
789d1ab46b changes on workspace
Some checks failed
CI Pipeline / changes (push) Has been cancelled
CI Pipeline / core (push) Has been cancelled
CI Pipeline / trading-backend (push) Has been cancelled
CI Pipeline / trading-data-service (push) Has been cancelled
CI Pipeline / trading-frontend (push) Has been cancelled
CI Pipeline / erp-core (push) Has been cancelled
CI Pipeline / erp-mecanicas (push) Has been cancelled
CI Pipeline / gamilit-backend (push) Has been cancelled
CI Pipeline / gamilit-frontend (push) Has been cancelled
2025-12-09 14:46:20 -06:00
49155822ae fix: Resolve TypeScript compilation errors across all projects
Platform Marketing Content:
- Add PaginationParams, PaginationMeta, PaginatedResponse interfaces
- Fix JwtAuthGuard import paths (common/guards instead of modules/auth)
- Add missing fields to CRM interfaces (address, keywords, features, benefits)
- Install @nestjs/throttler dependency

ERP Suite - Construccion:
- Create tsconfig.node.json for web frontend
- Add vite-env.d.ts for Vite types
- Fix implicit return errors in Express controllers
- Prefix unused parameters with underscore

ERP Suite - ERP Core:
- Export PoolClient type from database config
- Fix invoice type comparison (customer/supplier vs out_invoice)
- Refactor base.service.ts query handling for proper type inference
- Rename Role type to RoleType to avoid conflict with entity
- Fix ProtectedRoute to use role?.name instead of roles array

ERP Suite - POS Micro:
- Add vite-env.d.ts for Vite types
- Fix Sale property names (discountAmount, changeAmount)
- Export TodaySummary interface from sales service

All projects now pass npm install and npm run build successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 22:35:55 -06:00
ad752c1c3c First commit 2025-12-08 21:15:39 -06:00
db4bf55c31 Changes on workspace projects, new project platform_marketing_content 2025-12-08 18:33:25 -06:00
35020e02f1 fix(pos-micro): Align frontend with backend API contracts
Critical fixes:
- Fix LoginPage to use phone+pin for login (was using businessName)
- Add ownerName field for registration flow
- Fix useProducts hooks: /products?isFavorite=true, /toggle-favorite
- Fix useSales hooks: /sales/recent, /sales/today, POST for cancel
- Align TypeScript types with backend entities:
  - stockQuantity/lowStockAlert instead of currentStock/minStock
  - discountPercent/discountAmount for proper discount handling
  - Add SubscriptionStatus type for tenant state

Cart store improvements:
- Properly calculate subtotals with discount percentage
- Compute tax amount (16% IVA included)
- Track discountAmount and taxAmount separately

Documentation:
- Add comprehensive ANALISIS-GAPS.md comparing:
  - POS Micro vs ERP Core architecture patterns
  - POS Micro vs Odoo POS feature parity
  - Identified gaps and roadmap for future phases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 12:25:06 -06:00
e85b548b8f feat(pos-micro): Implement React PWA frontend
- Add Vite + React 18 + TypeScript configuration
- Implement PWA with offline support via vite-plugin-pwa
- Create mobile-first UI with Tailwind CSS
- Implement authentication flow with PIN-based login
- Add product grid with category filtering and favorites
- Create cart management with quantity controls
- Implement checkout flow with multiple payment methods
- Add daily sales reports page
- Configure Zustand stores for auth and cart state
- Add React Query for API data fetching
- Include Docker and nginx configuration for production

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 12:15:46 -06:00
9bfc6fb152 feat(pos-micro): Implement MVP backend and database schema
POS Micro - Ultra-minimal point of sale (100 MXN/month):
- Database DDL: 10 tables (tenants, users, categories, products,
  payment_methods, sales, sale_items, cash_movements,
  daily_summaries, whatsapp_sessions)
- NestJS Backend: Complete API with modules for auth, products,
  categories, sales, and payments
- Docker Compose: Development environment with PostgreSQL
- Dev scripts: Easy setup for local development

SaaS Billing Schema:
- 10 tables for subscription management (plans, subscriptions,
  invoices, payments, usage_tracking, support_tickets)
- Default plans: POS Micro (100 MXN), ERP Básico (300 MXN),
  ERP Pro (500 MXN), Vertical (1000+ MXN)
- Support for Stripe and Conekta payment providers
- CFDI integration ready for Mexico

Target: Mexican informal market (street vendors, small shops, food stands)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 11:48:07 -06:00
2781837d9e feat: Add SaaS products architecture and alignment analysis
Analysis and Documentation:
- Add ANALISIS-ALINEACION-WORKSPACE-2025-12-08.md with comprehensive gap analysis
- Document SIMCO v3.2 system with 20+ directives
- Identify alignment gaps between orchestration and projects

New SaaS Products Structure:
- Create apps/products/pos-micro/ - Ultra basic POS (~100 MXN/month)
  - Target: Mexican informal market (street vendors, small stores)
  - Features: Offline-first PWA, WhatsApp bot, minimal DB (~10 tables)
- Create apps/products/erp-basico/ - Austere ERP (~300-500 MXN/month)
  - Target: SMBs needing full ERP without complexity
  - Features: Inherits from erp-core, modular pricing

SaaS Layer:
- Create apps/saas/ structure (billing, portal, admin, onboarding)
- Add README.md and CONTEXTO-SAAS.md documentation

Vertical Alignment:
- Verify HERENCIA-ERP-CORE.md exists in all verticals
- Add HERENCIA-SPECS-CORE.md to verticals
- Update orchestration inventories

Updates:
- Update WORKSPACE-STATUS.md with new products and analysis
- Update suite inventories with new structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 11:34:35 -06:00
d30fe4d644 feat(construccion): Add HR module entities
- Add Employee entity
- Add EmployeeFraccionamiento relationship entity
- Add Puesto (position) entity
- Add entities index export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 10:46:47 -06:00
94371c0e75 feat(construccion): Add construction module entities
- Add Fraccionamiento entity
- Add Proyecto entity
- Add entities index export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 10:46:28 -06:00
436aafae62 feat: Add agent profiles, SIMCO directives and ERP vertical configurations
- Add 8 new agent profiles (Backend-Express, Bug-Fixer, Code-Reviewer, etc.)
- Add SIMCO-ML and SIMCO-MOBILE directives for specialized domains
- Add vertical-specific directives for clinicas, mecanicas-diesel, retail, vidrio-templado
- Add database inheritance documentation (HERENCIA-ERP-CORE.md)
- Update inventory files and orchestration status

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 10:46:00 -06:00
ea1879f4ad feat: Initial workspace structure with multi-level Git configuration
- Configure workspace Git repository with comprehensive .gitignore
- Add Odoo as submodule for ERP reference code
- Include documentation: SETUP.md, GIT-STRUCTURE.md
- Add gitignore templates for projects (backend, frontend, database)
- Structure supports independent repos per project/subproject level

Workspace includes:
- core/ - Reusable patterns, modules, orchestration system
- projects/ - Active projects (erp-suite, gamilit, trading-platform, etc.)
- knowledge-base/ - Reference code and patterns (includes Odoo submodule)
- devtools/ - Development tools and templates
- customers/ - Client implementations template

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 10:44:23 -06:00