# Coffee trading - samples and quality Mirror page: [coffee.md](coffee.md) ## BR-PT-COF-001 - Coffee sample phase 1 Status: active Source: project decision on 2026-06-29 ### Business rule Coffee trading must track samples linked to purchase and sale lines. Each sample stores: Coffee compatibility is disabled by default and must be enabled on `purchase_trade.configuration` with the `Active coffee compatibility` field. While the option is disabled, coffee menus and coffee quality pages on lines must not be visible. Cupping results are entered through sessions: `purchase.line` and `sale.line` store the target coffee quality specifications: origin, process, variety, crop year, screen size, maximum moisture, maximum defect count and minimum cup score. ### Developer notes ## BR-PT-COF-002 - Phase 2 lab delegation Status: active Source: project decision on 2026-06-29 ### Business rule A coffee sample can be delegated to a laboratory. The delegation creates and tracks lab analyses linked to the sample: The sample `Send to lab` button creates an active lab request when a lab is set and no open analysis already exists. ## BR-PT-COF-003 - Phase 3 consolidated quality decision Status: active Source: project decision on 2026-06-29 ### Business rule The quality decision of a sample is consolidated from: The sample exposes a quality status (`pending`, `pass`, `warning`, `fail`) and a recommended decision (`approve`, `re-cup`, `reject`). The `Evaluate quality` button applies the recommendation: approval, rejection or review when the sample must be cupped again. These features remain under `Active coffee compatibility` and do not add a cross-flow blocking rule for non-coffee flows.