feat: Dropflow orders reach Tiny in DTF DROPFLOW, and dinheiro and customer credit name their forma de recebimento
All checks were successful
Build and deploy / Validate source (push) Successful in 13s
Build and deploy / Integration suite on a real stack (push) Successful in 4m40s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m27s
All checks were successful
Build and deploy / Validate source (push) Successful in 13s
Build and deploy / Integration suite on a real stack (push) Successful in 4m40s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m27s
Marcus's ids of 2026-10-27: the revenue category DTF DROPFLOW (987032506) for Dropflow orders, which no longer stay out of Tiny, and the formas de recebimento Dinheiro (919478944) and CORREÇÃO DTF (977493654) for the customer's credit, on orders the team registers as paid outside the site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -181,14 +181,17 @@ def run():
|
||||
with db.connect() as c:
|
||||
sent = c.execute("SELECT payload FROM dtf_local.outbox WHERE event_key=%s", (order['id'] + ':paid:tiny',)).fetchone()
|
||||
assert sent and sent['payload']['origin'] == 'atendimento' and sent['payload']['payment'] == {'method': 'cash', 'outside': True}, sent
|
||||
# A Dropflow batch stays out of Tiny until its revenue category exists, cancelled or not.
|
||||
# A Dropflow batch reaches Tiny too, carrying its origin for its own category; and its cancel.
|
||||
_, batch_quote, _ = reviewed_quote()
|
||||
batch = register(batch_quote, {'origin': 'dropflow', 'method': 'credit'})
|
||||
board.call('/operator/orders/' + batch['id'] + '/cancel', {'note': 'Lote refeito'}, operator=True)
|
||||
with db.connect() as c:
|
||||
held = c.execute("SELECT count(*) AS n FROM dtf_local.outbox WHERE event_key LIKE %s", (batch['id'] + ':%',)).fetchone()['n']
|
||||
assert batch['origin'] == 'dropflow' and held == 0, (batch, held)
|
||||
print('PASS: an order paid outside is registered with its origin and payment; Dropflow stays out of Tiny')
|
||||
events = {r['event_key']: r['payload'] for r in c.execute(
|
||||
"SELECT event_key, payload FROM dtf_local.outbox WHERE event_key LIKE %s", (batch['id'] + ':%',)).fetchall()}
|
||||
paid = events.get(batch['id'] + ':paid:tiny')
|
||||
assert batch['origin'] == 'dropflow' and paid and paid['origin'] == 'dropflow', (batch, events)
|
||||
assert batch['id'] + ':cancelled:tiny' in events, events
|
||||
print('PASS: an order paid outside is registered with its origin and payment, Dropflow ones included')
|
||||
|
||||
# Files are uploaded before payment. An unpaid cart keeps them briefly; a
|
||||
# paid order keeps them for its 30 days; a payment never starts for files
|
||||
|
||||
Reference in New Issue
Block a user