--- issue: "034" title: "SellerOffer 'active' status does not exist in schema — saves with this value throw ValidationError" severity: major domain: seller-offer labels: [backend, bug] status: open created: 2026-05-29 source: Doc vs Code Audit 2026-05-29 --- # 🟠 SellerOffer 'active' status does not exist in schema — saves with this value throw ValidationError **Severity:** major **Domain:** seller-offer **Labels:** backend, bug ## Description The Seller Offer Flow doc lists `'active'` as a valid `SellerOffer.status`. The Mongoose schema and TypeScript interface only enumerate: ``` 'pending' | 'accepted' | 'rejected' | 'withdrawn' ``` Any code path that attempts to set `SellerOffer.status = 'active'` will throw a Mongoose `ValidationError`. The `createOffer()` service correctly checks `PurchaseRequest.status === 'active'` (a different model's status), but `SellerOffer.status = 'active'` is never valid. ## Current Behavior `SellerOffer.save()` with `status: 'active'` → Mongoose ValidationError. (Currently no code path actually tries to do this — the bug is latent but would be triggered by misreading the documentation.) ## Expected Behavior Remove `'active'` from all `SellerOffer` status documentation. The valid states are `pending | accepted | rejected | withdrawn`. ## Affected Files - Doc file updated: `04 - Flows/Seller Offer Flow.md` and `02 - Data Models/SellerOffer.md` ## References - [Doc vs Code Audit Report](../09%20-%20Audits/Doc%20vs%20Code%20Audit%20Report%20-%202026-05-29.md) — Finding M22