# TODOS ## P2: Refactor sync_service.py in module separate **What:** Split sync_service.py (870 linii) in: download_service, parse_service, sync_orchestrator. **Why:** Faciliteza debugging si testare. Un bug in price sync nu ar trebui sa afecteze import flow. **Effort:** M (human: ~1 sapt / CC: ~1-2h) **Context:** Dupa implementarea planului Command Center (retry_service deja extras). sync_service face download + parse + validate + import + price sync + invoice check — prea multe responsabilitati. **Depends on:** Finalizarea planului Command Center. ## P2: Email/webhook alert pe sync esuat **What:** Cand sync-ul gaseste >5 erori sau esueaza complet, trimite un email/webhook. **Why:** Post-lansare, cand app-ul ruleaza automat, nimeni nu sta sa verifice constant. **Effort:** M (human: ~1 sapt / CC: ~1h) **Context:** Depinde de infrastructura email/webhook disponibila la client. Implementare: SMTP simplu sau webhook URL configurabil in Settings. **Depends on:** Lansare in productie + infrastructura email la client. ## P3: Fix script — handle missing orders in GoMag API **What:** Fix script for 17 address-less orders should check if GoMag API returns data for each order, and report which orders couldn't be fixed. **Why:** Old orders may be deleted or expired from GoMag API. Without this check, the fix script fails silently and the operator thinks all 17 were fixed. **Effort:** S (human: ~10min / CC: ~2min) **Context:** Part of the address overflow fix (Pas 5). The fix script re-downloads from GoMag API to get original address text, but doesn't verify the API response. Add empty-response check + report. **Depends on:** Address parser fix (Pas 1-2) deployed. ## P3: Cleanup orphan VFP-era addresses in Oracle **What:** One-time script to find and soft-delete partner addresses created by VFP that have no linked orders and incorrect street data. **Why:** After TIER 2 removal, old addresses that were incorrectly reused remain attached to partners. They're cosmetic clutter but not harmful — new addresses are created correctly now. **Effort:** S (human: ~2h / CC: ~10min) **Context:** TIER 2 matched county+city without street, reusing VFP-era addresses with wrong streets. After removal (2026-04-06), new imports create correct addresses. Old wrong addresses stay. Could identify them by: address has id_loc but no linked order rows, and was last modified before 2026-04-06. **Depends on:** TIER 2 removal deployed and verified. ## P3: Extract match-column badge styles to CSS classes **What:** Replace inline styles on Kit and Disc. badges (in shared.js) with CSS classes (e.g., `.match-badge-kit`, `.match-badge-disc`). **Why:** Currently both badges use identical inline `style="background:var(--X-light);color:var(--X-text);font-size:10px;padding:2px 6px"`. If a 3rd badge type appears, inline styles become a maintenance burden. **Effort:** XS (human: ~30min / CC: ~5min) **Context:** Low priority. Two inline-styled badges is fine. Trigger: when a 3rd badge type is needed in the price match column. **Depends on:** Quantity discount feature shipped.