Build Seth's changes C1 to C11 (Gitea issues 1, 8, 18, 23, 24, 25, 27, 31, 32, 33, 36)
- C1 (issue 1): over target follows VISUAL ticket hours, not the timer. - C2 (issue 24): a Q.C. reject always needs a reason; accept needs an NCR number after a reject without one. - C3 (issue 25): an incomplete unit ITP blocks filing. - C4 (issue 27): prints open the print dialog on the page, no new tab. - C5 (issue 31): filing is blocked while VISUAL shows a work order open; the feed sets vclosed on VISUAL packets. - C6 (issue 8): the data book leaves out the history pages. - C7 (issue 18): the supervisor approves each received short; accept and filing wait for it. - C8 (issue 23): per-department checklists, edited by the department supervisor or Admin, frozen at START. - C9 (issue 32): Q.C. and Clerical may run the stamp check. - C10 (issue 33): the PM screen and reports are for PS-ProjectMgmt and Admin only. - C11 (issue 36): the Stall screen lists the packets assigned to the welder, at the supervisor's stall. Migration 0011. Docs: PLAN (also issue 9 confirmed, issue 4 asked), POLICY, SECURITY, SCHEMA, FEED, README, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
"""Change C3 (Gitea issue 25): FILE is refused while the packet's unit has an ITP that is not complete. A unit with
|
||||
no ITP does not block. The reason shows in `blocked.file` so the close panel says why."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterator
|
||||
|
||||
import pytest
|
||||
from closehelpers import at_complete, file_packet, vclose
|
||||
from fakedir import FakeDirectory
|
||||
from pshelpers import needs_pg
|
||||
from qchelpers import start_itp
|
||||
from shophelpers import Shop, fresh, make_unit, ok, open_shop, refused, run
|
||||
|
||||
from packetstation.settings import Settings
|
||||
|
||||
pytestmark = needs_pg
|
||||
|
||||
MSG = "Complete the unit's ITP first. Q.C. signs it off on the ITP page."
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def shop(pg_settings: Settings, fake_dir: FakeDirectory, dev_visual: None) -> Iterator[Shop]:
|
||||
yield from open_shop(pg_settings, fake_dir)
|
||||
|
||||
|
||||
def test_open_itp_blocks_the_file_until_signed_off(shop: Shop) -> None:
|
||||
_, unit_id = make_unit(shop.settings)
|
||||
pkt = vclose(shop, at_complete(shop, unit_id))
|
||||
pid = pkt["id"]
|
||||
assert "file" in pkt["can"] # no ITP on the unit: nothing blocks
|
||||
itp = start_itp(shop, unit_id)
|
||||
view = fresh(shop("clerk.clara"), pid)
|
||||
assert "file" not in view["can"] and view["blocked"]["file"] == [MSG]
|
||||
[card] = ok(shop("clerk.clara").get(f"/api/packets?unit_id={unit_id}"))["packets"]
|
||||
assert card["blocked"]["file"] == [MSG]
|
||||
refused(file_packet(shop, view), 403, "precondition", MSG)
|
||||
# the ITP sign-off itself is tested in test_itp.py; here its end state is enough
|
||||
run(shop.settings, "UPDATE itps SET status = 'complete', signoff_at = now() WHERE id = %s", (itp["id"],))
|
||||
view = fresh(shop("clerk.clara"), pid)
|
||||
assert "file" in view["can"] and "file" not in view["blocked"]
|
||||
assert ok(file_packet(shop, view))["status"] == "filed"
|
||||
Reference in New Issue
Block a user