wine.equipment is a catalogue of winery equipment: crushers, presses, tanks, filters, bottling lines. It also has a cost calculator. You pick how many cases a year you make, the wine type and how automated you want to be, and it gives you a budget range per production stage.

The calculator was wrong, and the page itself showed it. Below each stage's estimate it printed what listings on the site actually cost. The two numbers sat a few pixels apart and disagreed.

The rule of thumb

The estimate was a per-case rule. Each stage has a dollar-per-case range, and the result is scaled for wine type and automation:

const STAGES = [ { stage: "grape-processing", rate: [8, 15] }, { stage: "fermentation", rate: [12, 25] }, { stage: "pressing", rate: [6, 18] }, { stage: "wine-transfer", rate: [4, 10] }, { stage: "filtration", rate: [3, 8] }, { stage: "bottling", rate: [5, 15] }, ]; const autoMult = automation === "manual" ? 0.6 : automation === "semi-automatic" ? 1 : 1.8; const typeMult = wineType === "red" ? 1.1 : wineType === "sparkling" ? 1.5 : 1; const m = autoMult * typeMult; // estimate = volume × rate × m 

For a commercial winery that's reasonable. Equipment cost does grow with volume.

For a small one it breaks. At the default setting (500 cases, red, semi-automatic) the rule priced pressing at $3,300 – $9,900. The cheapest semi-automatic press in the catalogue was $24,975. A winery needs at least one press whatever its volume, and a press doesn't come in a size that costs $3,300 just because you make less wine.

The total came out at $20,900 – $50,050. That was roughly a quarter of what the listings said.

The fix: let the catalogue set a floor

The data was already there. The page loaded catalogue prices per stage to show the "Listed here" line. It just wasn't used for the estimate.

Two changes:

  1. Group prices by automation level, not only by stage. Comparing a semi-automatic estimate to the cheapest press of any kind would mix basket presses with full pneumatic lines.
  2. Use them as bounds. A stage's range never starts below the cheapest listing at the chosen level, and never tops out below their median.
export const calculateBudget = ( volume: number, wineType: string, automation: string, catalogue?: StagePrices, // stage -> { lo, hi, median } at this automation level ): BudgetItem[] => STAGES.map(({ stage, rate }) => { const ruleLow = Math.round(volume * rate[0] * m); const ruleHigh = Math.round(volume * rate[1] * m); const listed = catalogue?.[stage]; const low = listed ? Math.max(ruleLow, listed.lo) : ruleLow; const high = listed ? Math.max(ruleHigh, listed.median, low) : ruleHigh; return { stage, low, high, raisedToCatalogue: low > ruleLow }; }); 

Everything is Math.max. The catalogue can only raise a number, never lower it, so large wineries where the rule already beats the listings are untouched. Both bounds come from real listings, so there's no made-up minimum anywhere in the code.

The automation level needed one more step. The automation_level column holds whatever the importers wrote: semi-automatic, semi-auto, automatic, fully-automatic and so on. The site already had a map of spellings for its filters, so the calculator reuses it rather than keeping a second list:

export const automationOption = (value: string | null | undefined): string | null => { if (!value) return null; for (const [option, spellings] of Object.entries(AUTOMATION_VARIANTS)) { if (spellings.includes(value)) return option; } return null; }; 

When the floor kicks in, the stage says so: "Raised to the cheapest semi-automatic machine listed". A visitor can see why the number moved and click through to that machine.

What changed

Setup Before After
500 cases, red, semi-automatic $20,900 – $50,050 $78,940 – $163,410
5,000 cases, red, semi-automatic $209,000 – $500,500 $209,000 – $500,500

The large winery doesn't move, which is the point. The tests pin both cases. One feeds in a catalogue and checks that pressing goes to $24,975 – $44,800. Another checks that 10,000 cases is exactly what the rule says.

The stage where the data said no

Bottling didn't follow. At semi-automatic it stayed at $2,750 – $8,250, while the line under it said listings run $13,440 – $114,750.

The obvious move was to apply the same floor using every bottling listing. Then I looked at what those listings were. Nearly every priced bottling machine is an automatic line: monoblocs, rotary labellers, volumetric fillers. The one exception, the $13,440 labeller at the bottom of the range, has no automation level recorded at all. The kit a 500-case winery would actually buy, a vacuum bottle filler and a bench corker, is in the catalogue too, but without a price.

So raising the estimate would have told a small winery it needs at least $13,440 for bottling, based on machines it would never buy. The rule's $2,750 – $8,250 was the better guess. The problem was the label, which put automatic-line prices next to a semi-automatic estimate as if they were the same thing.

That row now reads:

No semi-automatic machine priced here. Other levels: $13,440 – $114,750

Same numbers, honest framing.

What I'd take from it

  • If your page shows two numbers that disagree, one of them is a bug. Users notice before you do.
  • Check what the data actually holds before you build on it. 53 of 156 listings have no automation level, and nearly every priced bottling machine was automatic. A fix that looked general only held for five stages out of six.
  • Prefer bounds over replacements. Math.max(rule, catalogue) kept everything that already worked and only corrected what was too low.
  • When you have no comparable data, say so. A clear "nothing priced at this level" is more useful than a confident number built from the wrong machines.

Try it at wine.equipment/calculator, or browse the equipment catalogue by production stage. Figures there are budgeting estimates, not quotes. Only a manufacturer can price a real configuration.