Commit Graph

20 Commits

Author SHA1 Message Date
b5d62c2812 fix(pos): chatbot busca partes automaticamente con traduccion ES→EN
- System prompt: SIEMPRE devuelve search_query en ingles
- Diccionario de traducciones (balatas→Brake Pad, etc.)
- Busca directo sin preguntar mas info
- Fallback: extrae keywords si AI no da search_query

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:39:47 +00:00
0a44fb5304 feat(pos): chatbot IA con OpenRouter — busqueda de partes por lenguaje natural
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:18:55 +00:00
6628f2deef feat: subdomain routing por tenant — refac-xxx.nexusautoparts.com
- Nginx wildcard config: *.nexusautoparts.com routes to POS app with X-Tenant-Subdomain header
- middleware_tenant.py: resolves subdomain -> tenant_id via nexus_master.tenants.subdomain
- auth_bp: login and employee list endpoints accept tenant from subdomain, URL param, or body
- login.html: auto-detects tenant from subdomain, shows business name, falls back to ?tenant=ID
- tenant_manager: generates subdomain slug from business name on provision_tenant()
- Migration v1.2: adds subdomain column + unique index to tenants table
- setup-nginx.sh: one-command install script for the nginx config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:16:49 +00:00
a74fe94187 feat(pos): filtrar marcas a solo Mexico/USA/Canada (36 marcas)
Eliminadas marcas de otros mercados (China, Australia, etc.)
Solo se muestran las relevantes para Norteamerica.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:21:52 +00:00
d5569d0cb6 perf(pos): eliminar JOIN vehicle_parts de queries de navegacion
vehicle_parts tiene 14B+ rows. Las queries de brands, models, years,
engines ahora solo usan model_year_engine (mucho mas rapido).
vehicle_parts solo se consulta para categories/groups/parts donde
se filtra por un mye_id especifico.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:16:31 +00:00
a3abb6d3a8 fix(pos): restaurar catalog_service.py real (sobreescrito por stub)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:10:55 +00:00
33cb053519 feat(pos): rewrite catalog blueprint — 9 endpoints for vehicle hierarchy navigation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:42:58 +00:00
e88988f478 feat(pos): add catalog service — TecDoc hierarchy + stock enrichment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:41:35 +00:00
bc950efc26 fix(pos): resolve integration test failures for CFDI + accounting
- Fix sat_accounts.sql: split multi-row INSERT into individual statements
  so parent_id subqueries resolve correctly (was producing all NULLs)
- Add tenant_config table to v1.0 schema (required by CFDI invoicing)
- Seed tenant_config with RFC/regimen during tenant provisioning
- Fix cancel_sale to pass complete sale data for accounting reversal
- Fix CFDI XML builder: use `or` instead of dict.get() defaults to
  handle explicit None values from DB (clave_prod_serv, clave_unidad)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:54:50 +00:00
c56709d45e feat(pos): hook accounting auto-entries into sale/cancel flow (non-blocking)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 04:14:15 +00:00
4e6bac8661 feat(pos): add CFDI 4.0 XML builder — Ingreso, Egreso, Pago with lxml
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:13:08 +00:00
e0773cdc1e feat(pos): add invoicing blueprint — CFDI generation, queue, cancel
Six endpoints: POST invoice, GET queue, GET queue/<id>, POST queue/process,
POST cancel/<id>, GET <sale_id>/pdf. Also adds cfdi_builder stub (Task 2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:48 +00:00
40e7dd371a feat(pos): add accounting engine — auto journal entries for sales/purchases
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:30 +00:00
a665cdb737 feat(pos): add CFDI queue — offline timbrado with retry backoff
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:13 +00:00
d0343f8087 feat(pos): add POS engine — sale processing with Decimal totals and margin info
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 03:34:44 +00:00
4e7942d1d1 feat(pos): add inventory operations engine — append-only stock mutations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 02:10:18 +00:00
db205d6228 feat(pos): add barcode generator with PostgreSQL sequence 2026-03-31 02:10:14 +00:00
1a52ac61a0 feat(pos): add insert-only audit logging service 2026-03-31 01:31:48 +00:00
c82a29279e feat(pos): add tenant manager — provision DBs from template with sql.Identifier
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:27:12 +00:00
ba6568085e feat(pos): scaffold project structure and Flask app 2026-03-31 01:21:52 +00:00