- type
- concept
- created
- Tue Apr 07 2026 02:00:00 GMT+0200 (Central European Summer Time)
- updated
- Tue Apr 07 2026 02:00:00 GMT+0200 (Central European Summer Time)
- sources
- raw/articles/PRD
- tags
- visibility geographic distribution pricing mills
Geographic Visibility System
Overview
Surplus visibility is controlled at the geographic level, NOT the individual buyer level. This is a deliberate design decision reflecting how paper mills actually manage distribution. Mills think in terms of markets and regions, not individual companies. A Spanish mill might sell surplus at EUR450/MT in Iberia but EUR420/MT to North Africa. A Swedish mill might not want to sell surplus in their domestic market to avoid undercutting production prices.
From the Madrid meeting: "I'm a miller, so I don't want to sell the same product to everyone because I have a higher price in Mexico, Brazil pays less, Ecuador pays less. So they choose what they want."
Rule Structure
Each VisibilityRule has:
- mill_id -- the owning mill
- surplus_item_id -- NULL for mill-wide defaults, specific UUID for item overrides
- rule_type --
allow(whitelist) ordeny(blacklist) - scope --
region,country, orcity - scope_value -- e.g., "EU", "DE", "Barcelona"
- price_adjustment_mt -- per-MT price modifier for this destination (e.g., +15 for Tunisia)
- is_active -- whether the rule is currently applied
Scope Hierarchy
Rules are evaluated from most specific to least specific:
city > country > region
If a city-level rule matches the buyer's location, it takes precedence over country and region rules. If no city rule matches, the system checks country rules, then region rules.
The full geographic hierarchy:
GLOBAL
+-- EU (European Union)
| +-- DE, ES, PL, CZ, SE, FI, PT, FR, IT, GR, NL, ...
+-- EUROPE_NON_EU
| +-- GB, NO, CH, TR
+-- NORTH_AMERICA
| +-- US, CA, MX
+-- SOUTH_AMERICA
| +-- BR, VE, CO, PE, CL, AR, BO, EC, UY
+-- MIDDLE_EAST
| +-- IL, AE, SA
+-- AFRICA
| +-- MA, DZ, TN, EG, ZA
+-- ASIA
| +-- CN, ID, IN, JP, KR
+-- OCEANIA
+-- AU, NZ
Evaluation Logic
- Collect item-specific rules first, then mill-wide defaults
- For each rule set, check from most specific to least specific scope
- At each scope level: deny overrides allow (if both exist for same scope, deny wins)
- Item-specific rules take full precedence -- if an item-specific rule matches, mill-wide defaults are not consulted
- Secure by default: if no rules match the buyer's location, the surplus is NOT visible
Price Adjustment
Allow rules can carry a price adjustment that modifies the base price per MT for buyers in that geographic scope. Adjustments are additive: adjusted_price = base_price + price_adjustment_mt.
The most specific matching rule's adjustment is used. Example for a Swedish mill:
| rule_type | scope | scope_value | price_adjustment_mt | Effect |
|---|---|---|---|---|
| allow | region | EU | 0 | Base price for EU buyers |
| allow | country | MA | -30 | Morocco buyers see EUR30 less per MT |
| allow | country | DZ | -30 | Algeria buyers see EUR30 less per MT |
| allow | country | TN | -15 | Tunisia buyers see EUR15 less per MT |
| deny | country | BR | -- | Brazil buyers cannot see this surplus at all |
Real example from Mara's surplus list (Holland):
- Casablanca/Algeria: $465/MT (base)
- Tunisia: $480/MT (+$15)
- Cartagena (Colombia): $475/MT (+$10)
- Veracruz (Mexico): $475/MT (+$10)
- Carutla/Porto Quesar (Guatemala): $485/MT (+$20)
Integration Points
Visibility is checked in ALL downstream systems:
- Matching algorithm -- visibility check runs BEFORE scoring to avoid wasted computation (see wiki/concepts/matching-algorithm)
- Newsletter generation -- only visibility-passing matches appear in buyer newsletters (see wiki/concepts/newsletter-generation)
- Container assembly -- only visible surplus can be proposed in containers (see wiki/concepts/container-assembly)
- API endpoints -- buyer-facing surplus list endpoints apply
VisibilityFilteredMixinto QuerySets - Price display -- adjusted prices are shown based on buyer's geographic location
Default Rules and Overrides
- When a new surplus item is created (via ingestion or manually), the mill's default visibility rules apply automatically
- Mills can override defaults for specific surplus items (e.g., a particular lot might be restricted to a narrower geography)
- Admin can view and audit all visibility rules across all mills
- Every surplus item must have at least one applicable visibility rule -- "invisible" surplus with no applicable rules defaults to hidden (secure by default)
Sources
- raw/articles/PRD -- sections 5.5, 6.7, 13.1-13.5
Related
- wiki/concepts/matching-algorithm -- visibility is a pre-filter for matching
- wiki/concepts/newsletter-generation -- visibility filters newsletter content
- wiki/concepts/incoterms-in-paper-trading -- price adjustments interact with incoterm pricing
- wiki/concepts/container-assembly -- only visible surplus appears in proposals