# ClientFlow v4926.7 — fiscal identity guardrails + duplicate NIF handling ## Fixes - Rejects invalid company mentions extracted from email identity, including bare TLD/domain fragments such as `pt`, `com`, `www`, and full domains like `sementenergias.pt`. - Prevents short fragments such as `pt` from matching inside company names like `PLANETOPTION, LDA`. - Reduces false fiscal conflicts caused by invalid email identity mentions. - Adds friendly duplicate-NIF handling when editing customers. Editing a customer with a NIF that already belongs to another customer now returns a business conflict instead of a raw PostgreSQL unique violation. ## Scripts - `scripts/cleanup_invalid_email_identity_suggestions.py` rejects pending/accepted email-identity suggestions created from invalid lookup values such as `pt`. - `scripts/inspect_customer_tax_id_conflict.py` lists customers and linked counts for a duplicate NIF conflict. ## Operator notes For the SEMENTENERGIAS case, refresh email identity extraction after installing and reject old invalid suggestions created from `pt`.