# Materials: new stock and site surplus

## Included in the prototype

- `/materials` defaults to **New materials** with nine fictional supplier listings.
- `/materials?source=surplus` opens **Site surplus** with three fictional discounted lots: reinforcement steel, gravel and concrete blocks. These are example asking prices, not verified savings or live stock. Existing credited category photos are reused as representative images.
- The two buttons filter both catalog fixtures and locally published material listings. Search, categories, price, area, delivery, sorting and grid/list/map views operate within the selected group. Switching groups preserves the other filters. Empty states explain how to broaden the search.
- The selected group is stored in the URL. Surplus details link back to that group; detail and quote routes keep the lot identity.
- The seller form includes the group choice and a material-category selector, including **Earth & soil**. Surplus requires condition as well as the existing stock/quantity and fulfilment fields. The choice survives draft save, edit and local publication, and appears in preview/details.
- New labels, validation text and demo lot copy have English, Hebrew and Arabic presentation. Search indexes the new translated demo names. User-authored listings are preserved as entered.

## Source contract

`MaterialRecord.materialSource` and `ProviderListingDraft.materialSource` use `new` or `surplus`. Historical fixtures and saved browser drafts without the field default to `new`. Production should persist an explicit validated enum and backfill existing records. This describes where the stock comes from; **condition is a separate field**. Unused materials left on a site are still surplus.

Key files: `components/marketplace/material-source.ts`, `materials-explorer.tsx`, `catalog-data.ts`, `published-listings.tsx`, `components/provider/provider-listing-builder.tsx`, `listing-validation.ts`, and `components/i18n/materials-copy.ts`.

## Developer implementation checklist

- [ ] Persist and validate the source enum on create/update; filter and count both groups on the server, including map results and pagination.
- [ ] Store remaining quantity and unit as structured values, separately from minimum order and price unit. Document condition, specification/grade, site area, collection/delivery and pickup timing. The prototype keeps quantities as display strings.
- [ ] Let owners update quantities and pause sold-out lots; prevent stale stock claims across devices. KLIGO does not reserve or sell the lot through a payment checkout.
- [ ] Preserve photos/documents with owner permissions; disclose precise collection addresses only under the agreed privacy rules.
- [ ] Deliver real inquiries to the correct seller. Parties agree the deal and pay each other directly, per `LAUNCH_SCOPE.md`.
- [ ] Keep paid placements within their matching group/category and clearly label sponsorship; payment does not verify a seller or material.
- [ ] Verify new/surplus separation, legacy defaults, edits moving groups, quantity changes, empty results, links, RTL, mobile and real backend permissions.

Independent native-language review and production persistence remain open. Browser-local publication is only a demonstration, visible in that browser tab.
