feat: the customer's proof only on orders above 10 m (Dropstar, 2026-10-28)
All checks were successful
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m13s
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 4m6s

The checkout's "Quero aprovar uma prova" box shows only when the cart is
above 10 m, and the server keeps the request only then. Below 10 m there is
no proof; above it the room's own proof stays automatic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-28 14:12:59 -03:00
parent 8257ac24ab
commit 636c27ee88
5 changed files with 26 additions and 5 deletions

View File

@@ -193,6 +193,20 @@ def run():
assert batch['id'] + ':cancelled:tiny' in events, events
print('PASS: an order paid outside is registered with its origin and payment, Dropflow ones included')
# The customer's proof only above 10 m (Dropstar, 2026-10-28): asked for on a
# shorter order, the server leaves it out.
for metres, kept in (('1.01', False), ('12', True)):
asker = Client()
asker.call('/session')
art = upload_bytes(asker, b'PROOF ' + metres.encode())
spec = item_spec('file', metres, 0, art)
profile = {'cnpj': '11222333000181', 'zap': '11999999999', 'mail': 'proof-' + uuid4().hex[:8] + '@example.test'}
asked = asker.call('/quotes', {'request_key': str(uuid4()), 'customer': profile, 'items': [spec],
'freight': {'service': 'pickup'}, 'proof': True})
approved = approved_quote(asker, asked, [spec])
assert bool(approved.get('proof')) is kept, (metres, approved.get('proof'))
print('PASS: a proof asked for at checkout is kept only above 10 m')
# 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
# that are gone.