diff --git a/README-ORACLE-MODES.md b/README-ORACLE-MODES.md deleted file mode 100644 index 8a4dd30..0000000 --- a/README-ORACLE-MODES.md +++ /dev/null @@ -1,150 +0,0 @@ -# Oracle Modes Configuration Guide - UNIFIED - -## 🎯 Un Singur Dockerfile + Docker Compose - -| Oracle Version | Configurație .env | Comandă Build | Port | -|---------------|-------------------|---------------|------| -| 10g (test) | `INSTANTCLIENTPATH=...` | `docker-compose up --build` | 5003 | -| 11g (prod) | `INSTANTCLIENTPATH=...` | `docker-compose up --build` | 5003 | -| 12.1+ (nou) | `FORCE_THIN_MODE=true` | `ORACLE_MODE=thin docker-compose up --build` | 5003 | - ---- - -## 🔧 THICK MODE (Oracle 10g/11g) - DEFAULT - -### Configurare .env: -```env -# Uncomment această linie pentru thick mode: -INSTANTCLIENTPATH=/opt/oracle/instantclient_23_9 - -# Comment această linie: -# FORCE_THIN_MODE=true -``` - -### Rulare: -```bash -docker-compose up --build -d -curl http://localhost:5003/health -``` - ---- - -## 🚀 THIN MODE (Oracle 12.1+) - -### Varianta 1 - Prin .env (Recomandat): -```env -# Comment această linie pentru thin mode: -# INSTANTCLIENTPATH=/opt/oracle/instantclient_23_9 - -# Uncomment această linie: -FORCE_THIN_MODE=true -``` - -### Varianta 2 - Prin build argument: -```bash -ORACLE_MODE=thin docker-compose up --build -d -``` - -### Test: -```bash -curl http://localhost:5003/health -``` - ---- - -## 🔄 LOGICA AUTO-DETECT - -Container-ul detectează automat modul: - -1. **FORCE_THIN_MODE=true** → **Thin Mode** -2. **INSTANTCLIENTPATH** există → **Thick Mode** -3. Build cu **ORACLE_MODE=thin** → **Thin Mode** -4. Default → **Thick Mode** - ---- - -## 🛠️ COMENZI SIMPLE - -### Pentru Oracle 10g/11g (setup-ul tău actual): -```bash -# Verifică .env să aibă: -grep INSTANTCLIENTPATH ./api/.env - -# Start -docker-compose up --build -d -curl http://localhost:5003/test-db -``` - -### Pentru Oracle 12.1+ (viitor): -```bash -# Editează .env: decomentează FORCE_THIN_MODE=true -# SAU rulează direct: -ORACLE_MODE=thin docker-compose up --build -d -curl http://localhost:5003/test-db -``` - -### Switch rapid: -```bash -# Stop -docker-compose down - -# Edit .env (change INSTANTCLIENTPATH ↔ FORCE_THIN_MODE) -# Start -docker-compose up --build -d -``` - ---- - -## ⚠️ TROUBLESHOOTING - -### Eroare DPY-3010 în Thin Mode: -``` -DPY-3010: connections to this database server version are not supported -``` -**Soluție:** Oracle este 11g sau mai vechi → folosește thick mode - -### Eroare libaio în Thick Mode: -``` -Cannot locate a 64-bit Oracle Client library: libaio.so.1 -``` -**Soluție:** Rebuild container (fix automat în Dockerfile.thick) - -### Container nu pornește: -```bash -docker-compose logs -docker-compose down && docker-compose up --build -``` - ---- - -## 📊 COMPARAȚIE PERFORMANȚĂ - -| Aspect | Thick Mode | Thin Mode | -|--------|------------|-----------| -| Container Size | ~200MB | ~50MB | -| Startup Time | 10-15s | 3-5s | -| Memory Usage | ~100MB | ~30MB | -| Oracle Support | 10g+ | 12.1+ | -| Dependencies | Instant Client | None | - ---- - -## 🔧 DEZVOLTARE - -### Pentru dezvoltatori: -1. **Thick mode** pentru compatibilitate maximă -2. **Thin mode** pentru development rapid pe Oracle nou -3. **Auto-detect** în producție pentru flexibilitate - -### Testare ambele moduri: -```bash -# Thick pe port 5003 -docker-compose -f docker-compose.thick.yaml up -d - -# Thin pe port 5004 -docker-compose -f docker-compose.thin.yaml up -d - -# Test ambele -curl http://localhost:5003/health -curl http://localhost:5004/health -``` \ No newline at end of file diff --git a/README.md b/README.md index 40e8c6f..1da074a 100644 --- a/README.md +++ b/README.md @@ -456,7 +456,6 @@ curl -X POST http://localhost:5003/api/dashboard/refresh-invoices | [docs/oracle-schema-notes.md](docs/oracle-schema-notes.md) | Schema Oracle: tabele comenzi, facturi, preturi, proceduri cheie | | [docs/pack_facturare_analysis.md](docs/pack_facturare_analysis.md) | Analiza flow facturare: call chain, parametri, STOC lookup, FACT-008 | | [scripts/HANDOFF_MAPPING.md](scripts/HANDOFF_MAPPING.md) | Matching GoMag SKU → ROA articole (strategie si rezultate) | -| [README-ORACLE-MODES.md](README-ORACLE-MODES.md) | Configurare Oracle thick/thin mode cu Docker | --- diff --git a/api/README.md b/api/README.md index 70eb56d..cf4be89 100644 --- a/api/README.md +++ b/api/README.md @@ -37,17 +37,19 @@ Admin interface si orchestrator pentru importul comenzilor GoMag in Oracle ROA. ```bash pip install -r requirements.txt -uvicorn app.main:app --host 0.0.0.0 --port 5003 --reload +# INTOTDEAUNA via start.sh din project root (seteaza Oracle env vars) +cd .. && ./start.sh ``` ## Testare ```bash -# Test A - fara Oracle (verifica importuri + rute) -python test_app_basic.py - -# Test C - cu Oracle (integrare completa) -python test_integration.py +# Din project root: +./test.sh ci # Teste rapide (unit + e2e, ~30s, fara Oracle) +./test.sh full # Teste complete (inclusiv Oracle, ~2-3 min) +./test.sh unit # Doar unit tests +./test.sh e2e # Doar browser tests (Playwright) +./test.sh oracle # Doar Oracle integration ``` ## Dual Database diff --git a/scripts/HANDOFF_MAPPING.md b/scripts/HANDOFF_MAPPING.md index 73344e3..290258b 100644 --- a/scripts/HANDOFF_MAPPING.md +++ b/scripts/HANDOFF_MAPPING.md @@ -72,10 +72,9 @@ Cand o comanda are produse complet diferite fata de factura, algoritmul forteaza - Exemplu: "Lavazza Crema E Aroma Cafea Boabe 1 Kg" vs "LAVAZZA BBE CREMA E AROMA" - Ar putea fi mai precis decat match pe pret, mai ales cand preturile coincid accidental -### Tools utile deja existente: -- `scripts/compare_order.py ` — comparare detaliata o comanda vs o factura -- `scripts/fetch_one_order.py ` — fetch JSON complet din GoMag API -- `scripts/match_all.py` — matching bulk (de refacut cu strategie noua) +### Tools (nota: scripturile de matching au fost sterse din repo) +Scripturile `match_all.py`, `compare_order.py`, `fetch_one_order.py` au fost eliminate. +Strategia de matching descrisa mai sus ramane valida ca referinta conceptuala. ## Structura Oracle relevanta