feat: Site orders carry DTF-<n> as Tiny's numeroPedidoEcommerce
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 3m47s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m14s
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 3m47s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m14s
Dropstar asked on 2026-10-23 for the Kanban number in numeroPedidoEcommerce. It goes there on every order now, next to numeroOrdemCompra, which the resend check still searches. Tiny's v3 model takes the e-commerce block without a channel id; TINY_ECOMMERCE_ID adds one and can now be set in the stack. The supervised test order reads the number back from Tiny and fails if Tiny did not keep it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,9 @@ sum, 1,30 m = 1 × "1 metro" + 1 × "30 cm", at the price the customer paid.
|
||||
Idempotency: the outbox may deliver the same event more than once. Every order
|
||||
carries numeroOrdemCompra = "DTF-<order number>", and before creating one the
|
||||
customer's recent orders are searched for that number, so a second delivery
|
||||
finds the first order instead of creating another.
|
||||
finds the first order instead of creating another. The same number goes in
|
||||
numeroPedidoEcommerce (Dropstar, 2026-10-23), which n8n reads as
|
||||
numero_ecommerce.
|
||||
|
||||
Customer notices: the client sends WhatsApp messages from Tiny's order
|
||||
situação (Tiny webhook -> their middleware -> n8n), on Aprovado, Pronto para
|
||||
@@ -499,9 +501,11 @@ def order_payload(payload, contact_id, today=None, product_id=None, shipping=Non
|
||||
pedido['enderecoEntrega'] = {**address(destination), 'enderecoNro': destination['number'],
|
||||
'nomeDestinatario': destination['recipient']}
|
||||
del pedido['enderecoEntrega']['numero']
|
||||
# The channel id is optional in Tiny's v3 model; TINY_ECOMMERCE_ID adds it.
|
||||
pedido['ecommerce'] = {'numeroPedidoEcommerce': purchase_order(payload['number'])}
|
||||
ecommerce = os.environ.get('TINY_ECOMMERCE_ID', '')
|
||||
if ecommerce.isdigit():
|
||||
pedido['ecommerce'] = {'id': int(ecommerce), 'numeroPedidoEcommerce': purchase_order(payload['number'])}
|
||||
pedido['ecommerce']['id'] = int(ecommerce)
|
||||
return pedido
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user