feat: "Tratar a arte" on an order in Arte recebida (Dropstar's third round, item 8)
All checks were successful
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 59s
Build and deploy / Validate source (push) Successful in 5s
All checks were successful
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 59s
Build and deploy / Validate source (push) Successful in 5s
The order panel shows where each item's file is in the orders folder,
with Copiar: 1. Arte recebida\DTF-N-item-K, named as the automatic
folders save it (GET /api/operator/orders/{id}/folder-files). The browser
knows only the folder's name, so each computer is told once where it is
and the whole path is copied. "Subir arte tratada" sends the file saved
over; it becomes the item's final, "Arte tratada" lights and the order
can move to Arte conferida.
Only the treated item changes: the others keep their approved final,
which the server now accepts beside a new one (still refused when
nothing is new).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,5 +115,37 @@ def run():
|
||||
cookie.value=old_cookie;revoked.jar.set_cookie(cookie);revoked.call('/customer/orders',expected=401)
|
||||
other.call('/session');assert other.call('/customer/orders')['items']==[]
|
||||
print('PASS: logout revokes server session and signed-out visitors cannot see account orders')
|
||||
treating()
|
||||
|
||||
def treating():
|
||||
""""Tratar a arte" (Dropstar, 2026-10-29): the item's name in the folder,
|
||||
and a treated file that replaces only its own item's final."""
|
||||
customer=Client();customer.call('/session')
|
||||
originals=[upload_bytes(customer,b'LOCAL TREAT ORIGINAL %d' % n) for n in (1,2)]
|
||||
items=[item_spec('file','1.01',0,uid) for uid in originals]
|
||||
profile={'cnpj':'11222333000181','zap':'11999999999','mail':'treat-'+uuid4().hex[:8]+'@example.test'}
|
||||
q=customer.call('/quotes',{'request_key':str(uuid4()),'customer':profile,'items':items,'freight':{'service':'pickup'}})
|
||||
approved_quote(customer,q,items)
|
||||
order=customer.call('/orders/dev-paid',{'quote_id':q['id']});oid=order['id'];number=order['number']
|
||||
files=lambda:[f for f in customer.call('/operator/orders/'+oid+'/files',operator=True) if f['kind']=='final' and f['active']]
|
||||
first=[upload_bytes(customer,b'LOCAL FIRST FINAL %d' % n,order_id=oid) for n in (1,2)]
|
||||
version=customer.call('/operator/orders/'+oid+'/final-files',{'version':0,'note':'Aprovado',
|
||||
'files':[{'item_index':i,'upload_id':u} for i,u in enumerate(first)]},operator=True)['version']
|
||||
# Where each item is in the stage folder, named as the folders save it.
|
||||
folder=customer.call('/operator/orders/'+oid+'/folder-files',operator=True)
|
||||
assert folder['state']=='rec' and [f['item'] for f in folder['files']]==[1,2], folder
|
||||
assert all(f['name'].startswith('DTF-%d-item-%d' % (number,f['item'])) for f in folder['files']), folder
|
||||
customer.call('/operator/orders/'+oid+'/folder-files',expected=401)
|
||||
# Saved over with the same name and sent back: item 1 changes, item 2 keeps its final.
|
||||
png=b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR'+(6059).to_bytes(4,'big')+(2000).to_bytes(4,'big')+b'\x08\x06\x00\x00\x00'+b'\x00'*4
|
||||
treated=upload_bytes(customer,png,name='DTF-%d-item-1.png' % number,order_id=oid)
|
||||
both=[{'item_index':0,'upload_id':treated},{'item_index':1,'upload_id':first[1]}]
|
||||
version=customer.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':both,'note':'Arte tratada'},operator=True)['version']
|
||||
assert sorted((f['item_index'],f['upload_id']) for f in files())==[(0,treated),(1,first[1])], files()
|
||||
assert customer.call('/operator/orders/'+oid+'/folder-files',operator=True)['files'][0]['name']=='DTF-%d-item-1.png' % number
|
||||
# Nothing new: refused.
|
||||
customer.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':both,'note':'De novo'},operator=True,expected=409)
|
||||
customer.call('/operator/orders/'+oid+'/cancel',{'note':'Teste de arte tratada'},operator=True)
|
||||
print('PASS: treating the art: the file in the folder, and one item replaced while the other keeps its final')
|
||||
|
||||
if __name__=='__main__':run()
|
||||
|
||||
Reference in New Issue
Block a user