Skip to content

[Rules] BR pack enhancement #285

@DanielSuhett

Description

@DanielSuhett

Problem

While the current RULE_PACKS["BR"] covers core baseline patterns (like Uber, iFood, and main streaming services), users with Brazilian bank accounts connected via Pluggy still encounter recurring uncategorized transactions. This happens because the pack lacks coverage for critical regional utilities (energy, water, and gas concessionaires), bank/government fees (IOF, administrative tariffs), cash withdrawals, and specific high-volume national brands (e.g., Zé Delivery, Ipiranga, Atacadão).

Proposed Solution

Expand the rules dictionary RULE_PACKS["BR"] inside backend/app/services/rule_service.py to include the following missing patterns:

1. National & Regional Utilities

  • contains: "LIGHT" / "ENEL" / "CPFL" / "NEOENERGIA" / "COPEL" / "CELESC" / "EQUATORIAL" / "EDP" / "CEMIG" → Moradia (Energy)
  • contains: "SABESP" / "CEDAE" / "AGUAS DO RIO" / "IGUA" / "BRK AMBIENTAL" / "SANEPAR" / "COPASA" / "EMBASA" / "COMPESA" / "CORSAN" / "CAGECE" / "SANEAGO" → Moradia (Water)
  • contains: "CEG" / "COMGAS" / "NATURGY" → Moradia (Gas)

2. Fees, Taxes & Cash

  • contains: "IOF" / "TARIFA" / "CUSTAS" / "MULTA" / "JUROS" / "ENCARGOS" → Impostos & Taxas
  • contains: "SAQUE" → Transferências

3. Retail & Brand Extensions

  • contains: "ZE DELIVERY" → Alimentação
  • contains: "IPIRANGA" / "PETROBRAS" → Transporte (Fuel)
  • contains: "VELOE" / "CONECTCAR" → Transporte (Mobility/Toll)
  • contains: "ATACADAO" / "PÃO DE AÇÚCAR" / "PAO DE ACUCAR" → Mercado
  • contains: "PACHECO" / "PAGUEMENOS" → Saúde
  • contains: "TICKETMASTER" / contains: "STEAM" → Lazer
  • contains: "PET" → Pets

Alternatives Considered

  • Relying on end-user custom rules for utilities, which creates a fragmented experience since concessionaires are regional monopolies every user in that state will inevitably interact with.
  • Relying entirely on LLM/AI categorization with MCP

Additional Context

These additions fill the remaining high-frequency gaps identified after checking the current rule engine implementation against real-world transaction payloads delivered by Pluggy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions