feat: let operators create test orders from approved quotes
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 2m28s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 47s
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 2m28s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 47s
Without an approved card payment there was no way to try the board, the files and the print flow in production. "Criar pedido de teste" on an approved quote creates the order through the same path as a paid one, marked TESTE on its card and panel and audited; neither it nor its stage moves queue anything for Tiny or WhatsApp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,21 @@ def run():
|
||||
'status': 'pending', 'amount_cents': total})
|
||||
print('PASS: unknown references and non-approved statuses are recorded without acting')
|
||||
|
||||
# An operator's test order runs the production flow and notifies no one.
|
||||
tester, test_quote, _ = reviewed_quote()
|
||||
order = tester.call('/operator/quotes/' + test_quote + '/test-order', {}, operator=True)
|
||||
assert order['payment']['provider'] == 'teste' and order['state'] == 'rec', order
|
||||
assert tester.call('/operator/quotes/' + test_quote + '/test-order', {}, operator=True)['id'] == order['id']
|
||||
version = order['version']
|
||||
for state in ('tra',):
|
||||
moved = tester.call('/operator/orders/' + order['id'] + '/move', {'state': state, 'version': version}, operator=True)
|
||||
version = moved['version']
|
||||
with db.connect() as c:
|
||||
queued = c.execute("SELECT count(*) AS n FROM dtf_local.outbox WHERE event_key LIKE %s", (order['id'] + ':%',)).fetchone()['n']
|
||||
jobs = c.execute('SELECT count(*) AS n FROM dtf_local.print_files WHERE order_id=%s', (order['id'],)).fetchone()['n']
|
||||
assert queued == 0 and jobs == 1, (queued, jobs)
|
||||
print('PASS: an operator test order reaches the board and the print queue, never Tiny or WhatsApp')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
Reference in New Issue
Block a user