Files
gomag-vending/CLAUDE.md
Claude Agent 9f2fd24d93 docs(design): add design system with typography, colors, and mobile specs
Industrial/utilitarian aesthetic with amber accent, Space Grotesk + DM Sans +
JetBrains Mono stack, full dark mode, and dedicated mobile design including
bottom nav and card-based order views. Updates CLAUDE.md to enforce DESIGN.md
compliance on all visual work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:29:13 +00:00

4.5 KiB

CLAUDE.md

Project Overview

System: Import Comenzi Web GoMag → Sistem ROA Oracle Stack: FastAPI + Jinja2 + Bootstrap 5.3 + Oracle PL/SQL + SQLite

Documentatie completa: README.md

Implementare cu TeamCreate

OBLIGATORIU: Folosim TeamCreate + TaskCreate, NU Agent tool cu subagenti paraleli. Skill-ul superpowers:dispatching-parallel-agents NU se aplica in acest proiect.

  • Team lead citeste TOATE fisierele implicate, creeaza planul
  • ASTEAPTA aprobare explicita de la user inainte de implementare
  • Task-uri pe fisiere non-overlapping (evita conflicte)
  • Cache-bust static assets (?v=N) la fiecare schimbare UI

Development Commands

# INTOTDEAUNA via start.sh (seteaza Oracle env vars)
./start.sh
# NU folosi uvicorn direct — lipsesc LD_LIBRARY_PATH si TNS_ADMIN

Testing & CI/CD

# Teste rapide (unit + e2e, ~30s, fara Oracle)
./test.sh ci

# Teste complete (totul inclusiv Oracle + sync real + PL/SQL, ~2-3 min)
./test.sh full

# Smoke test pe productie (read-only, dupa deploy)
./test.sh smoke-prod --base-url http://79.119.86.134/gomag

# Doar un layer specific
./test.sh unit          # SQLite CRUD, imports, routes
./test.sh e2e           # Browser tests (Playwright)
./test.sh oracle        # Oracle integration
./test.sh sync          # Sync real GoMag → Oracle
./test.sh qa            # API health + responsive + log monitor
./test.sh logs          # Doar log monitoring

# Validate prerequisites
./test.sh --dry-run

Flow zilnic:

  1. Lucrezi pe branch fix/* sau feat/*
  2. git push → pre-push hook ruleaza ./test.sh ci automat (~30s)
  3. Inainte de PR → ./test.sh full manual (~2-3 min)
  4. Dupa deploy pe prod → ./test.sh smoke-prod --base-url http://79.119.86.134/gomag

Output: qa-reports/ — health score, raport markdown, screenshots, baseline comparison.

Markers pytest: unit, oracle, e2e, qa, sync

Reguli critice (nu le incalca)

Flux import comenzi

  1. Download GoMag API → JSON → parse → validate SKU-uri → import Oracle
  2. Ordinea: parteneri (cauta/creeaza) → adresecomandafactura cache
  3. SKU lookup: ARTICOLE_TERTI (mapped) are prioritate fata de NOM_ARTICOLE (direct)
  4. Complex sets (kituri/pachete): un SKU → multiple CODMAT-uri cu cantitate_roa; preturile se preiau din lista de preturi Oracle
  5. Comenzi anulate (GoMag statusId=7): verifica daca au factura inainte de stergere din Oracle

Statusuri comenzi

IMPORTED / ALREADY_IMPORTED / SKIPPED / ERROR / CANCELLED / DELETED_IN_ROA

  • Upsert: IMPORTED existent NU se suprascrie cu ALREADY_IMPORTED
  • Recovery: la fiecare sync, comenzile ERROR sunt reverificate in Oracle

Parteneri

  • Prioritate: companie (PJ, cod_fiscal + registru) daca exista in GoMag, altfel persoana fizica cu shipping name
  • Adresa livrare: intotdeauna GoMag shipping
  • Adresa facturare: daca shipping ≠ billing person → shipping pt ambele; altfel → billing din GoMag

Preturi

  • Dual policy: articolele sunt rutate la id_pol_vanzare sau id_pol_productie pe baza contului contabil (341/345 = productie)
  • Daca pretul lipseste, se insereaza automat pret=0

Dashboard paginare

  • Contorul din paginare arata totalul comenzilor din perioada selectata (ex: "378 comenzi"), NU doar cele filtrate
  • Butoanele de filtru (Importat, Omise, Erori, Facturate, Nefacturate, Anulate) arata fiecare cate comenzi are pe langa total
  • Aceasta este comportamentul dorit: userul vede cate comenzi totale sunt, din care cate importate, cu erori etc.

Invoice cache

  • Coloanele factura_* pe orders (SQLite), populate lazy din Oracle (vanzari WHERE sters=0)
  • Refresh complet: verifica facturi noi + facturi sterse + comenzi sterse din ROA

Sync articole VENDING → MARIUSM_AUTO

# Dry-run (arată diferențele fără să modifice)
python3 scripts/sync_vending_to_mariusm.py

# Aplică cu confirmare
python3 scripts/sync_vending_to_mariusm.py --apply

# Fără confirmare (automatizare)
python3 scripts/sync_vending_to_mariusm.py --apply --yes

Sincronizează via SSH din VENDING (prod Windows) în MARIUSM_AUTO (dev ROA_CENTRAL): nom_articole (noi by codmat, codmat updatat) + articole_terti (noi, modificate, soft-delete).

Design System

Always read DESIGN.md before making any visual or UI decisions. All font choices, colors, spacing, and aesthetic direction are defined there. Do not deviate without explicit user approval. In QA mode, flag any code that doesn't match DESIGN.md.

Deploy Windows

Vezi README.md