Files
PacketStation/tests/fixtures
spencermandClaude Opus 5.5 bb8eb17748
ci / server (pull_request) Failing after 17s
ci / frontend (pull_request) Successful in 42s
ci / image (pull_request) Skipped
ci / e2e (pull_request) Skipped
drawings: on a rev mismatch, Clerical can keep the retired rev VISUAL calls (#41)
When VISUAL calls a rev that M-Files has retired, the draft is still
flagged rev_mismatch, but the drawing job now also copies the rev VISUAL
calls (MFilesKit 0.1.3 DrawingLookup.revision) into drawing_revisions and
visual.called. A Clerical Supervisor picks either rev on the packet:
"Use latest rev N" as before, or "Use rev V as VISUAL calls it"
(rev-approve with use=called), with a reason and a signature.

The kept rev holds while M-Files' Effective rev stays the one chosen
against: no flag, no change order. A newer Effective rev flags the
packet again; a new VISUAL rev clears the choice.

Migration 0009 adds drawing_revisions. Needs mfileskit 0.1.3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 13:39:14 -06:00
..

Synthetic VISUAL and M-Files fixtures

Everything here is made up. Real job data never goes in git: recordings from DEV stay in tests/fixtures/local/ (ignored).

python -m tests.fixtures.generator --out tests/fixtures/generated

writes feed.1.json, feed.2.json, drawings.1.json, drawings.2.json, the one-page PDFs the drawing files name, and state (1). tests/fixtures/generated/ is ignored by git. CI runs the command before compose up and mounts the folder at /fixtures in the worker (read-only) and Playwright (read-write). With FEED_SOURCE=fixture and DRAWING_SOURCE=fixture the worker reads FIXTURE_DIR/state and the matching files instead of VISUAL and M-Files. Write 2 to state to switch.

The feed files have the shape of VisualKit's examples/packet_station_feed.py: rows carry the status as a word (Firmed, Released, Unreleased, Closed, Cancelled), materials carry the status code, numbers are JSON numbers, dates are ISO, lot, split and sub are text, seq and piece are integers. An extra labor list holds hours per operation.

Dates are offsets from the day the generator runs (--today overrides), so the window rows sit inside the default window. The output is the same for the same day.

State 1

Project L900, units L900001 and L900002, plus L901001 under project L901.

Work order Lot What it covers
L900-01 1 LAYOUT and WELD-PART on drawing L900-0101 rev 1 (two packets), MFG and MAT_PIPE fold, FORKLIFT ignored; split-item header (piece 10 with 11 and 12), MAIN warehouse line, WIP sub-assembly, a line on another drawing (dropped)
L900-01 split 1 1 Unreleased (only on a packet when tracked)
L900-02 1 two WELD-CODE operations on one drawing: two legs on one packet; VISUAL rev 2, M-Files rev 3 (rev mismatch)
L900-03 1 no drawing ((no drawing) key)
L900-04, L900-08-1 2 one packet, rev A (bad rev), piece 1 on both legs (items 1 and 1-1), a base linked to order C24-0901
L900-05 2 drawing in drafting (not released)
L900-06 2 Released, with materials: only a packet when tracked
L900-07 2 drawing not in M-Files
L900-09, L900-10 1 close and cancel in state 2
L900-11, L900-12 1 Closed and Cancelled, only when tracked
L900-13 2 released 10 days back: ignored when the tests set go-live 5 days back
L900-14 7A a lettered lot: no unit, no packet
L900-15 2 resource NEWRES, not in the map
L900-16 2 moves to drawing L900-1602 in state 2
L901-01 1 project L901, only a closed order

Orders: L900 has two open orders. C24-0901 (Acme Refining) names top job L900002 and is linked to base L900-04. C24-0902 (Bayou Chemical) names L900001, so the unit rule picks it for L900001. L901 has one closed order (Delta Gas).

State 2

  • L900-01 rev 1 to 2 (a change order on an in-shop packet; the LAYOUT draft updates in place).
  • L900-02 qty 2 to 3 (a draft updated in place).
  • L900-07 target hours only (a minor change order once past draft).
  • L900-05 gone from VISUAL (flagged after two runs).
  • L900-16 on drawing L900-1602 (the old draft retires, a new one is made).
  • L900-09 Closed, L900-10 Cancelled.
  • NEWRES still unmapped.

Drawings

drawings.1.json: L900-0101 rev 1 (attach), L900-0201 rev 3 (VISUAL calls 2), L900-0401 rev 1 (VISUAL calls A), L900-0501 in drafting, L900-0701 and L900-1601 missing (not found), the rest at rev 1. drawings.2.json: the same with L900-0101 at rev 2 (a new file, so the change order gets staged) and L900-1602.

generate(out_dir), feed_state(n) and drawings_state(n) are importable; tests/server/feedhelpers.py uses them.