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:
@@ -398,6 +398,37 @@ def stall(conn: Any, pp: policy.Principal, station_id: int, filters: Mapping[str
|
||||
}
|
||||
|
||||
|
||||
MSG_NONE_ASSIGNED = "Nothing is assigned to you now. Your supervisor assigns packets to you."
|
||||
|
||||
|
||||
def stall_mine(conn: Any, pp: policy.Principal, filters: Mapping[str, Any] | None = None) -> dict[str, Any]:
|
||||
"""GET /api/stall/mine: the packets assigned to the signed-in person (welder_id = me), each at the station the
|
||||
supervisor picked when assigning, across stations (change C11, Gitea issue 36). Nobody picks a station; moving a
|
||||
welder is a re-assign by the supervisor. The stall board's shape, with `station` None and `station_id` and
|
||||
`station_name` on every card. `filters` (the find bar's) narrow the cards."""
|
||||
ids: list[int] = []
|
||||
if pp.user_id:
|
||||
found = packets.rows(
|
||||
conn,
|
||||
"SELECT id FROM packets WHERE welder_id = %s::uuid AND removed_at IS NULL"
|
||||
" AND status::text = ANY(%s) ORDER BY updated_at, id LIMIT %s",
|
||||
(str(pp.user_id), list(search.STALL_STATUSES), BOARD_LIMIT),
|
||||
)
|
||||
ids = [int(r["id"]) for r in found]
|
||||
cards = _cards(conn, pp, ids, **search.board_filters(filters or {}))
|
||||
for c in cards:
|
||||
st = c.get("station") or {}
|
||||
c["station_id"] = st.get("id")
|
||||
c["station_name"] = st.get("name")
|
||||
return {
|
||||
"station": None,
|
||||
"mine": [c for c in cards if c["status"] in policy.ACTIVE],
|
||||
"submitted": [c for c in cards if c["status"] == "review"],
|
||||
"facets": search.facets(conn, ids=ids),
|
||||
"empty": None if ids else MSG_NONE_ASSIGNED,
|
||||
}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- the assign sheet's people
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user