feat: places per machine, drops on Imprimindo go to your machine, a Venda carries its seller to Tiny (DTF-WEB-V)
All checks were successful
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 7m38s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m19s
All checks were successful
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 7m38s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m19s
Marcus, 2026-11-17: - Each machine has its own places (machines.places, 1 to 6, three to start): orders at once in Imprimindo and files at once in its hot folder. Admin sets it in the machine dialog; Admin and Gestão in the machine sheet's Dados da máquina. A third order shows as "Na vez". - Whoever is signed in on a machine drops a card anywhere in Imprimindo and it goes to that machine; without one, the lane under the pointer. - Each Kanban user may name their Tiny seller (Usuários, read from Tiny's own list); a montador Venda reaches Tiny with the seller of who assembled it. Every other order still sends no seller. - A folder download that never reached storage (a network drop) waits for the next pass as a warning and is reported only if it keeps failing (Sentry DTF-WEB-V). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -87,9 +87,17 @@ def run():
|
||||
# With a dot, as Dropstar's own codes (NX.226).
|
||||
stamp_code = 'T.' + tag
|
||||
try:
|
||||
# The seller is a Tiny seller too (Marcus, 2026-11-17): the fake Tiny
|
||||
# lists two, and a Venda this user assembles carries the one chosen.
|
||||
sellers = su.call('/operator/tiny/sellers', operator=True)
|
||||
assert sellers == [{'id': 2001, 'name': 'Lais'}, {'id': 2002, 'name': 'Marcus'}], sellers
|
||||
for role, email in emails.items():
|
||||
su.call('/operator/users', {'name': role.title(), 'email': email, 'role': role,
|
||||
'password': PASSWORD}, operator=True)
|
||||
su.call('/operator/users', {'name': role.title(), 'email': email, 'role': role, 'password': PASSWORD,
|
||||
**({'tiny_seller': sellers[0]} if role == 'vendedor' else {})},
|
||||
operator=True)
|
||||
listed = {u['email']: u for u in su.call('/operator/users', operator=True)['users']}
|
||||
assert listed[emails['vendedor']]['tiny_seller'] == sellers[0], listed[emails['vendedor']]
|
||||
assert listed[emails['gestao']]['tiny_seller'] is None, listed[emails['gestao']]
|
||||
# The new profile creates through the users API and reads the table.
|
||||
shipping = signed_in(emails['expedicao'])
|
||||
seller = signed_in(emails['vendedor'])
|
||||
@@ -176,6 +184,8 @@ def run():
|
||||
made_quotes.append(UUID(order_venda['quote_id']))
|
||||
assert order_venda['state'] == 'rec' and order_venda['origin'] == 'atendimento', order_venda
|
||||
assert order_venda['snapshot']['with_order'] == 4321, order_venda['snapshot'].get('with_order')
|
||||
assert order_venda['snapshot']['seller'] == {'id': 2001, 'name': 'Lais'}, order_venda['snapshot'].get('seller')
|
||||
assert 'seller' not in order_interno['snapshot'], order_interno['snapshot'].get('seller')
|
||||
payment = order_venda['payment']
|
||||
assert (payment['provider'], payment['method'], payment['status']) == ('manual', 'faturado', 'paid'), payment
|
||||
with db.connect() as c:
|
||||
|
||||
@@ -148,6 +148,13 @@ class TinyTests(FakeTinyCase):
|
||||
contact = contact_payload(PAID['order'])
|
||||
self.assertEqual((contact['tipoPessoa'], contact['cpfCnpj'], contact['endereco']['uf']),
|
||||
('J', '11.222.333/0001-81', 'SP'))
|
||||
|
||||
def test_only_a_montador_venda_names_its_seller(self):
|
||||
# No seller: Tiny's channel sets it (Dropstar, 2026-10-23).
|
||||
self.assertNotIn('vendedor', order_payload(PAID, 777, date(2026, 9, 24)))
|
||||
# A Venda carries who assembled it (Marcus, 2026-11-17).
|
||||
venda = {**PAID, 'order': {**PAID['order'], 'seller': {'id': 2001, 'name': 'Lais'}}}
|
||||
self.assertEqual(order_payload(venda, 777, date(2026, 9, 24))['vendedor'], {'id': 2001})
|
||||
pickup = order_payload({**PAID, 'order': {**PAID['order'], 'destination': None,
|
||||
'freight': {'service': 'pickup', 'total_cents': 0}}}, 1)
|
||||
self.assertNotIn('enderecoEntrega', pickup)
|
||||
|
||||
@@ -378,9 +378,13 @@ def run():
|
||||
assert (shared['orders'], shared['metres'], shared['printing_hours'], shared['metres_per_hour']) == \
|
||||
(2, 1.5, 0.5, 3.0), shared
|
||||
|
||||
# Two at most in Imprimindo per machine (Dropstar, 2026-10-29): the first
|
||||
# to come in is printing, the second ripping; a third waits for a place.
|
||||
# A machine's places in Imprimindo (machines.places, Marcus 2026-11-17):
|
||||
# three for a new one; here two, so the first to come in is printing,
|
||||
# the second ripping, and a third waits for a place.
|
||||
cap = admin.call('/operator/machines', {'name': f'Cap {tag}', 'products': ['textil']})['id']
|
||||
assert next(m for m in admin.call('/operator/machines')['machines'] if m['id'] == cap)['places'] == 3
|
||||
su.call(f'/operator/machines/{cap}/places', {'places': 7}, operator=True, expected=422)
|
||||
su.call(f'/operator/machines/{cap}/places', {'places': 2}, operator=True)
|
||||
machines.append(cap)
|
||||
with db.connect() as c:
|
||||
pulled = [order_fixture(c, owner, 'file') for _ in range(5)]
|
||||
@@ -425,7 +429,7 @@ def run():
|
||||
board = {o['id']: o for o in loaded['orders']}
|
||||
assert (board[first]['printing'], board[second_in]['printing'], board[third]['printing']) == \
|
||||
('imprimindo', 'ripando', None)
|
||||
assert loaded['printing_cap'] == 2
|
||||
assert next(m for m in loaded['machines'] if m['id'] == cap)['places'] == 2
|
||||
assert next(m for m in loaded['machines'] if m['id'] == cap)['states'] == {'imp': 2, 'tra': 2}
|
||||
# Nor does an order already printing elsewhere come onto the full machine.
|
||||
with db.connect() as c:
|
||||
|
||||
Reference in New Issue
Block a user