Fill Jadlog tracking codes from the MULTI EMPRESAS account
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m53s

Jadlog orders are invoiced by the MULTI EMPRESAS Olist account, so our
order reaches "Enviado" with forma_envio J and an empty tracking code.
When TINY_API_TOKEN_MULTI is set, shipped Jadlog orders without tracking
are matched in that account (search by customer CPF/name from the order
date, confirmed by numero_ordem_compra) and the code is forwarded in
codigo_rastreamento. Calls are serialized and cached; any failure keeps
today's payload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-19 13:24:01 -03:00
parent e204135eb6
commit 64aa0a6338
4 changed files with 329 additions and 1 deletions

View File

@@ -16,6 +16,8 @@ services:
- TINY_WEBHOOK_SECRET=${TINY_WEBHOOK_SECRET}
- N8N_AUTH_TOKEN=${N8N_AUTH_TOKEN}
- TINY_API_TOKEN=${TINY_API_TOKEN}
# Token of the MULTI EMPRESAS Olist account, where Jadlog tracking codes live.
- TINY_API_TOKEN_MULTI=${TINY_API_TOKEN_MULTI}
- GRAPHS_API_URL=${GRAPHS_API_URL}
- GRAPHS_API_KEY=${GRAPHS_API_KEY}
- GRAPHS_BACKFILL_CONTACT_FALLBACK=${GRAPHS_BACKFILL_CONTACT_FALLBACK:-true}