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

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:
Cauê Faleiros
2026-10-27 15:38:33 -03:00
parent 5692804c6f
commit 258128de9f
5 changed files with 36 additions and 19 deletions

View File

@@ -63,10 +63,9 @@ OUTSIDE_METHODS = ('pix', 'card', 'cash', 'credit')
def in_tiny(order):
"""Whether the order goes to Tiny: not a test, and not a Dropflow order,
held until Dropstar names that channel's revenue category (it must not be
DTF SITE, their rules document says)."""
return not is_test(order) and order['origin'] != 'dropflow'
"""Whether the order goes to Tiny: every order but a test. A Dropflow
order goes in its own revenue category (app/tiny.py, CATEGORIES)."""
return not is_test(order)
# How long a file is kept while nothing has been paid for it. A cart's files

View File

@@ -114,8 +114,10 @@ PICKUP_EXACT = 'retirar pessoalmente'
# Dropstar's own ids, read from its store orders with app.tiny_probe exemplo
# (2026-10-19). The app may not list formas de recebimento, so these are not
# looked up: Pix and credit card, as the store's orders are paid, and the
# DropStar carrier its pickup orders name.
RECEIPT_METHODS = {'pix': 919478952, 'card': 977460722}
# DropStar carrier its pickup orders name. Dinheiro and, for the customer's
# credit, Dropstar's own "CORREÇÃO DTF" were sent by Marcus on 2026-10-27, for
# the orders the team registers as paid outside the site (D-35).
RECEIPT_METHODS = {'pix': 919478952, 'card': 977460722, 'cash': 919478944, 'credit': 977493654}
PICKUP_CARRIER = 761565838
# Dropstar's answers: the financial category "DTF SITE" (RECEITAS, id sent on
# 2026-10-26; it goes in pagamento.categoria, and replaced the store's
@@ -124,6 +126,9 @@ PICKUP_CARRIER = 761565838
# POST /pedidos does not take marcadores. Capitals, no accent, no extra
# space: the string Kondado reads for Power BI.
CATEGORY = 986932924
# Dropflow's orders in their own category, "DTF DROPFLOW" (sent 2026-10-27):
# the rules document (D-21) keeps the two channels apart in the financial.
CATEGORIES = {'dropflow': 987032506}
TAG = 'SITE DTF'
# Freight is the sender's (CIF), as on the store's orders.
FREIGHT_PAID_BY = 'R'
@@ -503,7 +508,7 @@ def order_payload(payload, contact_id, today=None, product_id=None, shipping=Non
if days is not None:
pedido['dataPrevista'] = business_days_after(day, int(days)).isoformat()
# Paid at once, in full, as the store's orders: one parcel on the day.
pedido['pagamento'] = {'categoria': {'id': CATEGORY}}
pedido['pagamento'] = {'categoria': {'id': CATEGORIES.get(payload.get('origin'), CATEGORY)}}
received = RECEIPT_METHODS.get((payload.get('payment') or {}).get('method'))
if received:
total = money(order['total_cents'])