docs: rewrite CLAUDE.md and README.md, remove VFP references
- Remove all Visual FoxPro references (VFP fully replaced by Python) - Add TeamCreate workflow for parallel UI development - Document before/preview/after visual verification with Playwright - Add mandatory rule: use TeamCreate, not superpowers subagents - Update architecture, tech stack, project structure to current state - Update import flow to reference Python services Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
52
README.md
52
README.md
@@ -5,16 +5,16 @@ System automat de import comenzi din platforma GoMag in sistemul ERP ROA Oracle.
|
||||
## Arhitectura
|
||||
|
||||
```
|
||||
[GoMag API] → [VFP Orchestrator] → [Oracle PL/SQL] → [FastAPI Admin]
|
||||
↓ ↓ ↑ ↑
|
||||
JSON Orders Process & Log Store/Update Dashboard + Config
|
||||
[GoMag API] → [Python Sync Service] → [Oracle PL/SQL] → [FastAPI Admin]
|
||||
↓ ↓ ↑ ↑
|
||||
JSON Orders Download/Parse/Import Store/Update Dashboard + Config
|
||||
```
|
||||
|
||||
### Stack Tehnologic
|
||||
- **Database:** Oracle PL/SQL packages (PACK_IMPORT_PARTENERI, PACK_IMPORT_COMENZI)
|
||||
- **Integrare:** Visual FoxPro 9 (gomag-vending.prg, sync-comenzi-web.prg)
|
||||
- **Admin/Dashboard:** FastAPI + Jinja2 + Oracle pool + SQLite
|
||||
- **Date:** Oracle 11g/12c (schema ROA), SQLite (tracking local)
|
||||
- **API + Admin:** FastAPI + Jinja2 + Bootstrap 5.3
|
||||
- **GoMag Integration:** Python (`gomag_client.py` — download comenzi cu paginare)
|
||||
- **Sync Orchestrator:** Python (`sync_service.py` — download → parse → validate → import)
|
||||
- **Database:** Oracle PL/SQL packages (IMPORT_PARTENERI, IMPORT_COMENZI) + SQLite (tracking)
|
||||
|
||||
---
|
||||
|
||||
@@ -27,7 +27,6 @@ System automat de import comenzi din platforma GoMag in sistemul ERP ROA Oracle.
|
||||
### Instalare
|
||||
|
||||
```bash
|
||||
# Din project root (gomag/)
|
||||
pip install -r api/requirements.txt
|
||||
cp api/.env.example api/.env
|
||||
# Editeaza api/.env cu datele de conectare Oracle
|
||||
@@ -38,7 +37,6 @@ cp api/.env.example api/.env
|
||||
**Important:** serverul trebuie pornit **din project root**, nu din `api/`:
|
||||
|
||||
```bash
|
||||
# Din gomag/
|
||||
python -m uvicorn api.app.main:app --host 0.0.0.0 --port 5003
|
||||
```
|
||||
|
||||
@@ -55,13 +53,11 @@ Deschide `http://localhost:5003` in browser.
|
||||
```bash
|
||||
python api/test_app_basic.py
|
||||
```
|
||||
Verifica importuri de module + rute GET. Asteptat: 32/33 PASS (1 fail pre-existent `/sync` HTML).
|
||||
|
||||
**Test C - Integrare Oracle:**
|
||||
```bash
|
||||
python api/test_integration.py
|
||||
```
|
||||
Necesita Oracle activ. Verifica health, mappings CRUD, article search, validation, sync.
|
||||
|
||||
---
|
||||
|
||||
@@ -82,7 +78,7 @@ cp api/.env.example api/.env
|
||||
| `INSTANTCLIENTPATH` | Cale Instant Client (thick mode) | `/opt/oracle/instantclient_21_15` |
|
||||
| `FORCE_THIN_MODE` | Thin mode fara Instant Client | `true` |
|
||||
| `SQLITE_DB_PATH` | Path SQLite (relativ la project root) | `api/data/import.db` |
|
||||
| `JSON_OUTPUT_DIR` | Folder JSON-uri VFP (relativ la project root) | `vfp/output` |
|
||||
| `JSON_OUTPUT_DIR` | Folder JSON-uri descarcate | `api/data/orders` |
|
||||
| `APP_PORT` | Port HTTP | `5003` |
|
||||
| `ID_POL` | ID Politica ROA | `39` |
|
||||
| `ID_GESTIUNE` | ID Gestiune ROA | `0` |
|
||||
@@ -97,7 +93,7 @@ cp api/.env.example api/.env
|
||||
## Structura Proiect
|
||||
|
||||
```
|
||||
gomag/
|
||||
gomag-vending/
|
||||
├── api/ # FastAPI Admin + Dashboard
|
||||
│ ├── app/
|
||||
│ │ ├── main.py # Entry point, lifespan, logging
|
||||
@@ -111,30 +107,28 @@ gomag/
|
||||
│ │ │ ├── validation.py # /api/validate/*
|
||||
│ │ │ └── sync.py # /api/sync/* + /api/dashboard/orders
|
||||
│ │ ├── services/
|
||||
│ │ │ ├── sync_service.py # Orchestrare: JSON→validate→import
|
||||
│ │ │ ├── gomag_client.py # Download comenzi GoMag API
|
||||
│ │ │ ├── sync_service.py # Orchestrare: download→validate→import
|
||||
│ │ │ ├── import_service.py # Import comanda in Oracle ROA
|
||||
│ │ │ ├── mapping_service.py # CRUD ARTICOLE_TERTI + pct_total
|
||||
│ │ │ ├── sqlite_service.py # Tracking runs/orders/missing SKUs
|
||||
│ │ │ ├── order_reader.py # Citire gomag_orders_page*.json
|
||||
│ │ │ ├── validation_service.py
|
||||
│ │ │ ├── article_service.py
|
||||
│ │ │ ├── invoice_service.py # Verificare facturi ROA
|
||||
│ │ │ └── scheduler_service.py # APScheduler timer
|
||||
│ │ ├── templates/ # Jinja2 HTML
|
||||
│ │ └── static/ # CSS + JS
|
||||
│ ├── database-scripts/ # Oracle SQL (ARTICOLE_TERTI, packages)
|
||||
│ ├── data/ # SQLite DB (import.db)
|
||||
│ ├── data/ # SQLite DB (import.db) + JSON orders
|
||||
│ ├── .env # Configurare locala (nu in git)
|
||||
│ ├── .env.example # Template configurare
|
||||
│ ├── test_app_basic.py # Test A - fara Oracle
|
||||
│ ├── test_integration.py # Test C - cu Oracle
|
||||
│ └── requirements.txt
|
||||
├── vfp/ # VFP Integration
|
||||
│ ├── gomag-vending.prg # Client GoMag API (descarca JSON-uri)
|
||||
│ ├── sync-comenzi-web.prg # Orchestrator VFP
|
||||
│ ├── utils.prg # Utilitare (log, settings, connectivity)
|
||||
│ └── output/ # JSON-uri descarcate (gomag_orders_page*.json)
|
||||
├── logs/ # Log-uri aplicatie (sync_comenzi_*.log)
|
||||
├── docs/ # Documentatie (PRD, stories)
|
||||
├── screenshots/ # Before/preview/after pentru UI changes
|
||||
├── start.sh # Script pornire (Linux/WSL)
|
||||
└── CLAUDE.md # Instructiuni pentru AI assistants
|
||||
```
|
||||
@@ -171,10 +165,10 @@ gomag/
|
||||
## Fluxul de Import
|
||||
|
||||
```
|
||||
1. VFP descarca comenzi GoMag API → vfp/output/gomag_orders_page*.json
|
||||
2. FastAPI citeste JSON-urile (order_reader)
|
||||
3. Valideaza SKU-uri contra ARTICOLE_TERTI + NOM_ARTICOLE (validation_service)
|
||||
4. Import_service creeaza/cauta partener in Oracle (shipping person = facturare)
|
||||
1. gomag_client.py descarca comenzi GoMag API → JSON files
|
||||
2. order_reader.py parseaza JSON-urile
|
||||
3. validation_service.py valideaza SKU-uri contra ARTICOLE_TERTI + NOM_ARTICOLE
|
||||
4. import_service.py creeaza/cauta partener in Oracle (shipping person = facturare)
|
||||
5. PACK_IMPORT_COMENZI.importa_comanda_web() insereaza comanda in ROA
|
||||
6. Rezultate salvate in SQLite (orders, sync_run_orders, order_items)
|
||||
```
|
||||
@@ -192,15 +186,15 @@ gomag/
|
||||
|
||||
| Faza | Status | Descriere |
|
||||
|------|--------|-----------|
|
||||
| Phase 1: Database Foundation | ✅ Complet | ARTICOLE_TERTI, PACK_IMPORT_PARTENERI, PACK_IMPORT_COMENZI |
|
||||
| Phase 2: VFP Integration | ✅ Complet | gomag-vending.prg, sync-comenzi-web.prg |
|
||||
| Phase 3-4: FastAPI Dashboard | ✅ Complet | Redesign UI, smart polling, filter bar, paginare, tooltip |
|
||||
| Phase 5: Production | 🔄 In Progress | Logging ✅, Auth ⏳, SMTP ⏳, NSSM service ⏳ |
|
||||
| Phase 1: Database Foundation | Complet | ARTICOLE_TERTI, PACK_IMPORT_PARTENERI, PACK_IMPORT_COMENZI |
|
||||
| Phase 2: Python Integration | Complet | gomag_client.py, sync_service.py |
|
||||
| Phase 3-4: FastAPI Dashboard | Complet | UI responsive, smart polling, filter bar, paginare |
|
||||
| Phase 5: Production | In Progress | Logging done, Auth + SMTP pending |
|
||||
|
||||
---
|
||||
|
||||
## WSL2 Note
|
||||
|
||||
- `uvicorn --reload` **nu functioneaza** pe `/mnt/e/` (WSL2 limitation) — restarta manual
|
||||
- Serverul trebuie pornit din **project root** (`gomag/`), nu din `api/`
|
||||
- Serverul trebuie pornit din **project root**, nu din `api/`
|
||||
- `JSON_OUTPUT_DIR` si `SQLITE_DB_PATH` sunt relative la project root
|
||||
|
||||
Reference in New Issue
Block a user