printedparts stage 17: gage-lab asset tag + print-files redesign
The gage lab assigns real WJRP asset numbers, so identity splits: the internal itemcode stays auto-minted and a new optional unique gagelabtag (migration 0003) carries the lab's number - settable on create/edit, searchable, and resolved by the kiosk for scans and bare keypad digits against the numeric tail of either identifier (unique-match only). The print-files table becomes stacked revision cards - filename with rev/current badges, one meta line, delete pinned right - ending the horizontal scroll in that column.
This commit is contained in:
@@ -338,3 +338,32 @@ def test_alert_role_members_receive(client, auth_headers, app, item,
|
||||
'badge': directory_employee, 'quantity': 6})
|
||||
assert take.status_code == 200
|
||||
assert captured['to'] == ['crewone@site.test']
|
||||
|
||||
|
||||
def test_gagelabtag_assigned_searched_and_kiosk_resolved(client, auth_headers):
|
||||
"""The internal code stays auto-minted; the gage-lab tag is optional,
|
||||
unique, searchable, and the kiosk resolves it (exact and bare digits)."""
|
||||
created = client.post('/api/printedparts/items',
|
||||
json={'itemname': 'Gage block holder',
|
||||
'gagelabtag': 'wjrp0117'},
|
||||
headers=auth_headers)
|
||||
assert created.status_code == 201
|
||||
data = created.get_json()['data']
|
||||
assert data['gagelabtag'] == 'WJRP0117'
|
||||
assert data['itemcode'].startswith('3DP') # internal code untouched
|
||||
|
||||
duplicate = client.post('/api/printedparts/items',
|
||||
json={'itemname': 'Other',
|
||||
'gagelabtag': 'WJRP0117'},
|
||||
headers=auth_headers)
|
||||
assert duplicate.status_code == 409
|
||||
|
||||
searched = client.get('/api/printedparts/items?search=WJRP0117',
|
||||
headers=auth_headers).get_json()['data']
|
||||
assert len(searched) == 1
|
||||
|
||||
by_tag = client.get('/api/printedparts/kiosk/item/WJRP0117')
|
||||
assert by_tag.status_code == 200
|
||||
by_digits = client.get('/api/printedparts/kiosk/item/117')
|
||||
assert by_digits.status_code == 200
|
||||
assert by_digits.get_json()['data']['gagelabtag'] == 'WJRP0117'
|
||||
|
||||
Reference in New Issue
Block a user