Fluxograma - Automação Rápido Figueiredo

🚚 Transportadora Rápido Figueiredo

Sistema de Automação de Cobrança - Fluxograma Completo

📊 Fluxograma Principal - Visão Geral
flowchart TD A[📥 Recebe Planilha GW
10:00h Diário] --> B{🗓️ É Segunda-feira?} B -->|SIM| C[📋 Listar Contatos
sem Telefone] C --> D[📧 Enviar E-mail
Setores Cobrança por Filial] D --> END1[✅ Processo Segunda
Finalizado] B -->|NÃO
Ter-Sex| E[📱 Verifica se Celular
Está Preenchido] E --> F[📅 Filtra Dias de Vencimento
0, 1, 5] F --> G[🔍 Verifica Palavras Chaves
Relacionamentos] G --> H[💰 Valor > R$ 10,00] H --> I[🏢 Separa Por Filiais
JPA,RCF,SOU,GBA,CGE,SPO] I --> J[📱 Verifica se Número
É Válido] J --> K{❓ Número
Válido?} K -->|SIM| L[💬 Verificar
WhatsApp] K -->|NÃO| REJECT[❌ Rejeitar] L --> M{❓ Existe no
WhatsApp?} M -->|SIM| N{📄 Tipo
Documento} M -->|NÃO| REJECT N -->|Boleto| O[🧾 Gerar PDF
Boleto FEBRABAN] N -->|Fatura| P[💳 Gerar PDF
Fatura PIX] O --> Q{📅 Dias
Atraso} P --> Q Q -->|0 dias| R[📢 Enviar Mensagem
Vencimento] Q -->|1 dia| S[⚠️ Enviar Mensagem
Pendência] Q -->|5 dias| T[🚨 Enviar Mensagem
URGENTE] R --> END2[✅ Enviado] S --> END2 T --> END2 style A fill:#e8f5e8,stroke:#04364F,stroke-width:3px style B fill:#fff3e0,stroke:#04364F,stroke-width:2px style C fill:#e8f5e8,stroke:#04C64F,stroke-width:2px style D fill:#e8f5e8,stroke:#04C64F,stroke-width:2px style O fill:#fff3e0,stroke:#04364F,stroke-width:2px style P fill:#fff3e0,stroke:#04364F,stroke-width:2px style R fill:#e1f5fe,stroke:#04364F,stroke-width:2px style S fill:#f3e5f5,stroke:#04364F,stroke-width:2px style T fill:#ffebee,stroke:#04364F,stroke-width:2px style REJECT fill:#ffcdd2,stroke:#04364F,stroke-width:2px style END1 fill:#e8f5e8,stroke:#04C64F,stroke-width:3px style END2 fill:#e8f5e8,stroke:#04C64F,stroke-width:3px
🔍 Fluxograma Detalhado - Filtros e Validações
flowchart TD START[📥 Planilha GW Sistemas] --> CHECK1{📱 Coluna 'celular'
preenchida?} CHECK1 -->|NÃO| FILTER_OUT1[❌ Excluir do fluxo] CHECK1 -->|SIM| CHECK2{📅 dias_atraso
= 0, 1 ou 5?} CHECK2 -->|NÃO| FILTER_OUT2[❌ Excluir do fluxo] CHECK2 -->|SIM| CHECK3{🔍 Relacionamentos
contém palavras-chave?} CHECK3 -->|SIM| FILTER_OUT3[❌ Excluir do fluxo
Cliente negociado] CHECK3 -->|NÃO| CHECK4{💰 valor_fatura
> R$ 10,00?} CHECK4 -->|NÃO| FILTER_OUT4[❌ Excluir do fluxo
Valor muito baixo] CHECK4 -->|SIM| CHECK5{🏢 Filial válida?
JPA,RCF,SOU,GBA,CGE,SPO} CHECK5 -->|NÃO| FILTER_OUT5[❌ Excluir do fluxo] CHECK5 -->|SIM| APPROVED[✅ APROVADO
Prosseguir fluxo] style START fill:#e8f5e8,stroke:#04364F,stroke-width:3px style APPROVED fill:#e8f5e8,stroke:#04C64F,stroke-width:3px style FILTER_OUT1 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style FILTER_OUT2 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style FILTER_OUT3 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style FILTER_OUT4 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style FILTER_OUT5 fill:#ffcdd2,stroke:#04364F,stroke-width:2px
📱 Fluxograma de Validação de Contatos
flowchart TD CONTACT[📋 Contato Aprovado] --> VALIDATE[🔧 Validar Formato
Número] VALIDATE --> DDD{📍 DDD Válido?
11-99} DDD -->|NÃO| INVALID1[❌ Número Inválido] DDD -->|SIM| DIGITS{🔢 Quantidade
Dígitos OK?} DIGITS -->|NÃO| INVALID2[❌ Número Inválido] DIGITS -->|SIM| FORMAT{📱 Formato
Correto?} FORMAT -->|NÃO| INVALID3[❌ Número Inválido] FORMAT -->|SIM| WHATSAPP[💬 Verificar
WhatsApp API] WHATSAPP --> ACTIVE{✅ Ativo no
WhatsApp?} ACTIVE -->|NÃO| INACTIVE[❌ WhatsApp Inativo] ACTIVE -->|SIM| VALID[✅ CONTATO VALIDADO
Gerar Documento] style CONTACT fill:#e8f5e8,stroke:#04364F,stroke-width:3px style VALID fill:#e8f5e8,stroke:#04C64F,stroke-width:3px style INVALID1 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style INVALID2 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style INVALID3 fill:#ffcdd2,stroke:#04364F,stroke-width:2px style INACTIVE fill:#ffcdd2,stroke:#04364F,stroke-width:2px
📄 Fluxograma de Geração e Envio
flowchart TD VALIDATED[✅ Contato Validado] --> DOC_TYPE{📄 gerou_boleto
= 'sim'?} DOC_TYPE -->|SIM| BOLETO[🧾 Gerar PDF Boleto
Layout FEBRABAN
Código de Barras] DOC_TYPE -->|NÃO| FATURA[💳 Gerar PDF Fatura
Chave PIX
QR Code] BOLETO --> ATRASO{📅 Verificar
dias_atraso} FATURA --> ATRASO ATRASO -->|0| MSG0[📢 Enviar Mensagem
DIA VENCIMENTO
+ PDF Anexo] ATRASO -->|1| MSG1[⚠️ Enviar Mensagem
1 DIA ATRASO
+ PDF Anexo] ATRASO -->|5| MSG5[🚨 Enviar Mensagem
5 DIAS ATRASO
URGENTE + PDF] MSG0 --> SENT0[✅ Enviado WhatsApp
Lembrete Vencimento] MSG1 --> SENT1[✅ Enviado WhatsApp
Pagamento Pendente] MSG5 --> SENT5[✅ Enviado WhatsApp
Última Chance] style VALIDATED fill:#e8f5e8,stroke:#04364F,stroke-width:3px style BOLETO fill:#fff3e0,stroke:#04364F,stroke-width:2px style FATURA fill:#fff3e0,stroke:#04364F,stroke-width:2px style MSG0 fill:#e1f5fe,stroke:#04364F,stroke-width:2px style MSG1 fill:#f3e5f5,stroke:#04364F,stroke-width:2px style MSG5 fill:#ffebee,stroke:#04364F,stroke-width:2px style SENT0 fill:#e8f5e8,stroke:#04C64F,stroke-width:2px style SENT1 fill:#e8f5e8,stroke:#04C64F,stroke-width:2px style SENT5 fill:#e8f5e8,stroke:#04C64F,stroke-width:2px

📢 Mensagem Dia Vencimento (0 dias)

📢 *Lembrete de Vencimento:* $numeroFatura
Olá, $nomeCliente
Estou passando apenas para informar que o *boleto $numeroFatura no *valor de R$ $valorFatura, referente ao *CT-e $numeroCte, vence hoje!
*Evite juros e multas* pagando o quanto antes.
*Escolha uma opção caso necessário:*
1️⃣ Outras formas de pagamento 2️⃣ Falar com um atendente 3️⃣ Negociar pagamento
💡 *Se precisar de algo diferente, é só chamar por aqui!*

⚠️ Mensagem 1 Dia de Atraso

⚠️ *Pagamento Pendente:* $numeroFatura
Olá, $nomeCliente!
Identificamos que o *pagamento de R$ $valorFatura*, referente à *fatura $numeroFatura*, ainda não foi confirmado.
Se já pagou, *envie o comprovante por aqui*. Se precisar de ajuda, escolha uma opção:
1️⃣ Já paguei 2️⃣ Falar com um atendente
💡 *Dica:* regularize o quanto antes para evitar juros!

🚨 Mensagem 5 Dias de Atraso - URGENTE

⚠️ *URGENTE: Última Chance!*
Olá, $nomeCliente,
*Atenção!* Essa é sua última chance para *evitar a negativação do seu nome*!
Você ainda possui uma *dívida de R$ $valorFatura*, referente à *fatura $numeroFatura*, que continua em aberto.
Nos últimos dias, *oferecemos várias formas para você regularizar*, mas ainda não tivemos retorno.
📌 *A partir de amanhã*, o caso será encaminhado à *AGGE, nossa parceira de cobrança*. Isso *pode gerar negativação do seu CPF/CNPJ e até ações judiciais*.

🚨 Ainda dá tempo de evitar isso! Resolva de forma amigável agora mesmo:
1️⃣ Negociar uma alternativa de pagamento
⏳ *Evite restrições no seu CPF ou CNPJ!*

🚫 Palavras-chave dos Relacionamentos (IGNORAR SE CONTÉM)

negociado parcelado acordo reajustado prorrogado postergado ajustado reagendado
Regex: /(negociado|parcelado|acordo|reajustado|prorrogado|postergado|ajustado|reagendado)/g

✅ Critérios de Validação Completos

  • Coluna "celular" deve estar preenchida
  • dias_atraso deve ser exatamente 0, 1 ou 5
  • valor_fatura deve ser maior que R$ 10,00
  • Filial deve ser: JPA, RCF, SOU, GBA, CGE ou SPO
  • Número de telefone deve ter DDD válido (11-99)
  • Número deve ter formato correto (10 ou 11 dígitos)
  • Número deve estar ativo no WhatsApp
  • Campo "relacionamentos" NÃO deve conter palavras-chave
  • Segunda-feira: filtrar dias_atraso ≥ 0 para lista de contatos

📧 E-mail GW Sistemas

Recebimento de planilhas diárias

💬 WhatsApp Business API

Envio de mensagens e validação

📄 Gerador de PDF

Geração de boletos e faturas

💳 PIX/Boleto API

Integração bancária FEBRABAN

✅ Validador de Telefones

Verificação de DDD e formato