fix(address+ui): remove TIER 2 reuse, typed diff badges, false positive reduction
- Remove TIER 2 address lookup (county+city without street) from PL/SQL — creates new address when street differs instead of reusing wrong one - Replace generic "N diferente" badge with typed micro-badges (CUI, Denumire, TVA, Adr. livr., Adr. fact., Preturi) with red/amber semantic colors - Extend addrMatch() regex to strip full Romanian address words (STRADA, NUMAR, BLOC, COMUNA, SAT, MUNICIPIUL, etc.) — fixes "Strada X" vs "X" false positives - Extend normalize_company_name() for II, PFA, INTREPRINDERE INDIVIDUALA legal forms - Persist address_mismatch to SQLite so "Dif." filter includes address-only diffs - Add red/amber indicator dots to desktop table and mobile list rows - 12 unit tests for normalization and server-side address matching Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ CREATE OR REPLACE PACKAGE PACK_IMPORT_PARTENERI AS
|
||||
-- 02.04.2026 - cautare CUI strict (p_strict_search=1) sau dual anti-dedup (NULL)
|
||||
-- 02.04.2026 - parser adrese: extrage APARTAMENT/SCARA/ETAJ embedded in strada (fix "Nr17 apartament 8")
|
||||
-- 02.04.2026 - fallback cautare PF cu permutari nume (evita duplicate la swap firstname/lastname)
|
||||
-- 06.04.2026 - eliminat TIER 2 cautare adresa (judet+loc fara strada) — creeaza adresa noua cand strada difera
|
||||
|
||||
-- ====================================================================
|
||||
-- CONSTANTS
|
||||
@@ -948,23 +949,6 @@ CREATE OR REPLACE PACKAGE BODY PACK_IMPORT_PARTENERI AS
|
||||
when NO_DATA_FOUND then p_id_adresa := null;
|
||||
end;
|
||||
|
||||
-- TIER 2: county + city (no street) but ONLY with valid id_loc
|
||||
if p_id_adresa is null then
|
||||
begin
|
||||
select id_adresa into p_id_adresa from (
|
||||
select id_adresa
|
||||
from vadrese_parteneri
|
||||
where id_part = p_id_part
|
||||
and judet = v_judet
|
||||
and localitate = v_localitate
|
||||
and id_loc IS NOT NULL
|
||||
order by principala desc, id_adresa desc
|
||||
) where rownum = 1;
|
||||
exception
|
||||
when NO_DATA_FOUND then p_id_adresa := null;
|
||||
end;
|
||||
end if;
|
||||
|
||||
-- Adaug o adresa
|
||||
if p_id_adresa is null then
|
||||
-- caut judetul
|
||||
|
||||
Reference in New Issue
Block a user