# RESUME — ISS-2026-9105 over-issue auto-draft redesign — ✅ COMPLETE (2026-07-18)

**Status:** 3/3 WPs done on hazemdev2 (both repos). Built + deployed to /app (`main-ZKHDRE4S.js`). Awaiting owner /fullpush + client testing.

## What shipped
Client-approved redesign of the production over-issue flow (ISS-9105 step 3999 + client 4042 «نفّذ كل الاتفاق»). Architect design gate → 3 WPs:

- **WP1 [FIN] BE `3b757f0c9`** — `IssueMaterials` PARTITION: a mixed issue now releases within-plan materials immediately and holds only the over-plan (uncovered) materials, instead of 422-aborting the whole issue. Response 200 `{issued, held}`. Tests 38→40. Review APPROVE (0 crit/high, OFF-path byte-for-byte).
- **WP2 [FIN] BE `77aa0aa20`** — approving an over-issue AUTO-GENERATES a draft إذن صرف for the material's whole qty (planned+excess) → keeper (or inline apply if keeper gate off). Atomic (flip+execute one tx), idempotent (pending-guard), canIssue-false→soft notice, created_by=approver. Tests 40→47. Review APPROVE-with-notes ([FIN] invariants HOLD on every path — no double stock/WIP/over-draw, bounded at consume time under order row-lock).
- **WP3 FE `1366dca88` + `0e0655478`** — removed the over-issue approve/reject SECTION from the material-issue dialog (lives only on the central «موافقات الصرف الزائد» screen); adapted issue-submit to the 200 `{issued, held}` response (open the request dialog from `held`); retyped the service (dropped the cast). Review APPROVE (central screen untouched). ng build green.

## Behavior (owner-visible)
- Issue mixed materials → within-plan issue now (draft to keeper), over-plan held + its request opens (mandatory reason).
- Approve on the central screen → auto draft إذن صرف (whole qty) → keeper.
- Keeper reject → allowance not consumed, order unchanged. Keeper partial → consumes actual approved qty only. (Already correct in prior code — verified by tests, not rebuilt.)
- OFF-path (over_issue setting off) unchanged, byte-for-byte.

## Decision D4 interpretation (recorded)
Per-MATERIAL split: an over-plan material is held ENTIRELY; its planned portion ships together with the excess in one approval-time draft (Q1 precedence). If the client wants an over-plan material's within-plan portion to ALSO stream immediately (literal per-quantity Q2), that reopens Q1 — surface as a follow-up.

## Deferrals (see LEDGER)
- WP2-review **M1 (MEDIUM, non-financial):** duplicate held draft if a user approves AND also manually re-issues the same material (second keeper-approve fails 422, stranded draft). Financial invariant holds. Flagged to client in verification; dedup-guard follow-up.
- WP2-review L1/L2 (LOW): silent no-op approve under concurrent backflush; keeper-reject test is a cancel-proxy.
- WP4 (cancel-revert of consumed allowance) + cosmetic label/title drift.

## Next
Owner runs /fullpush (sync + deploy). Client tests on /app. Then close ISS-9105. Tests: Production over-issue+confirmations+ownership 47 pass; Production issue-cancel + Inventory partial 15 pass; zero new failures vs baseline.
