--- issue: "015" title: "Seller offer withdraw has no HTTP route — withdrawOffer() service method is dead code" severity: major domain: seller-offer labels: [backend, missing-feature] status: open created: 2026-05-29 source: Doc vs Code Audit 2026-05-29 --- # 🟠 Seller offer withdraw has no HTTP route — withdrawOffer() service method is dead code **Severity:** major **Domain:** seller-offer **Labels:** backend, missing-feature ## Description `SellerOfferService.withdrawOffer()` (SellerOfferService.ts lines ~427-443) exists and implements withdrawal logic, but no HTTP route calls it. The documented `POST /api/marketplace/offers/:id/withdraw` endpoint does not exist in `routes.ts` or `marketplaceController.ts`. There is also no frontend `withdrawOffer()` action, no withdraw button in any seller step component, and no seller offers history page at `/dashboard/seller/marketplace/offers`. The only workaround is `PUT /api/marketplace/offers/:id/status` with `{ status: 'withdrawn' }`, which has no guard ensuring the requester is the offer's seller. ## Current Behavior Sellers cannot withdraw their pending offers through any UI path. Withdrawing via `PUT /offers/:id/status` is the only API path and has no ownership guard. ## Expected Behavior 1. Wire a `POST /api/marketplace/offers/:id/withdraw` route to `SellerOfferService.withdrawOffer()` 2. Add an ownership guard (only the offer's seller can withdraw) 3. Add a frontend withdraw button and action ## Affected Files - `backend/src/routes/routes.ts` — missing `POST /offers/:id/withdraw` route - `frontend/src/actions/marketplace.ts` — missing `withdrawOffer` action - Frontend seller dashboard — missing offers list page ## References - [Doc vs Code Audit Report](../09%20-%20Audits/Doc%20vs%20Code%20Audit%20Report%20-%202026-05-29.md) — Findings C9, M26