feat: the Tiny probe tells why an order has no seller, the test order checks the seller Tiny kept, and each delivery records the seller sent (Marcus, 2026-12-02)
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 8m30s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m13s

Dropstar says every order reaches Tiny without the seller of the customer's
registration and they add it by hand (#237, DTF-237: contact with Kedma,
order with vendedor null). The field names match Tiny's v3 schema
(contato.vendedor {id, nome}, pedido.vendedor {id}), so the cause is in the
data or in Tiny. "tiny_probe vendedor NUMERO" (read-only) shows the order's
seller, its contact and that contact's seller, the contacts sharing the
CPF/CNPJ, and what the integration's own search and reading give today, with
a conclusion. The supervised test order now previews the contact's seller,
reads the order back and says OK or FALHA for the seller. The Tiny receipt
keeps "seller", the id sent or null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-12-02 15:43:13 -03:00
parent dea8036b73
commit 6c7af233bc
3 changed files with 128 additions and 6 deletions

View File

@@ -955,11 +955,14 @@ class TinyOrders:
tiny_id, situacao = existing.get('id'), existing.get('situacao')
else:
contact_id, seller = self.contact(payload['order'])
created = self.request('POST', '/pedidos', json=order_payload(
payload, contact_id, self.today, product_id=self.product_id, shipping=self.shipping,
contact_seller=seller))
body = order_payload(payload, contact_id, self.today, product_id=self.product_id,
shipping=self.shipping, contact_seller=seller)
sent_seller = (body.get('vendedor') or {}).get('id')
created = self.request('POST', '/pedidos', json=body)
receipt = {'provider': 'tiny', 'event_key': event_key, 'status': 'created',
'tiny_id': str(created.get('id')), 'tiny_number': str(created.get('numeroPedido'))}
'tiny_id': str(created.get('id')), 'tiny_number': str(created.get('numeroPedido')),
# Which seller went, so a missing one can be traced (#237).
'seller': sent_seller}
tiny_id, situacao = created.get('id'), ABERTA
# Tagged before it is approved, so a failure here is retried while the order is still open.
if situacao == ABERTA: