Pricing Platform: Sales Quotes
My role
I built the system end to end, from modeling the pricing rules to the /inbot-orcamento skill.
InBot's sales team used to build quotes in a 2023 spreadsheet. The Pricing Platform turns those rules into a system where prices are calculated on the server, every change is logged and a quote only goes out once the required approvals are in.
Catalog and versioned tables: products with code, category and base price; price tables with effective dates and a draft → active → archived lifecycle.
Server-side pricing rules: partner discount, pricing markup and manual discount, applied on save and frozen on the line item.
Five billing types: setup, monthly fee, usage tiers, bundle with allowance and reference price.
Approval tiers: discounts above the limit or margins below the minimum require approval before sending.
Ready-made proposal: editable sections with template variables, exported to PDF and Word.
Audit trail: every change writes its log entry in the same transaction, with the user who made it.
Agent-operated: the /inbot-orcamento skill interviews salespeople in plain language, maps the request to products in the price table, previews the totals, saves the quote and generates the PDF proposal with InBot branding. People who don't know the system can build a proposal just by talking to Claude Code.
Internal InBot system: the code is proprietary and the screenshots use fictitious data.
Before
Quotes built on a 2023 spreadsheet, with formulas copied from proposal to proposal, no price-table versions and no check on discounts outside the policy.
The problem
Quotes started from a 2023 spreadsheet, with formulas copied from one proposal to the next. Price tables had no versions, a discount outside the policy could slip through unnoticed, and it was hard to tell which price applied to an older quote.
Every price change risked the spreadsheet and the proposals already sent telling different stories.
The solution
I modeled the domain in Convex with versioned price tables and effective dates: active versions never overlap within a segment, and a simulator shows which table applied on any date. Each line item's price is recalculated on the server with the spreadsheet formula and frozen on the item, together with the tier grid in force.
Role-based approval tiers decide who must approve, and a quote can't leave draft while an approval is pending. The rules were built test-first, with Vitest, Convex tests and mutation testing with Stryker.
On top of the system, I built the /inbot-orcamento skill: Claude Code interviews the person about the client, picks products and quantities from the active price table, shows a preview and only saves and publishes the PDF proposal after a "yes".
Decisions and trade-offs
Prices recalculated on the server with the spreadsheet formula and frozen on each item, together with the tier grid in force. Price tables with validity periods that never overlap within a segment. Approval levels by role: a quote cannot leave draft while an approval is pending.
The results
Pricing moved from a spreadsheet to an auditable system, with 308 commits and 224 test files. Every quote keeps the prices and rules that applied when it was built, and the proposal comes out ready in PDF or Word from a library of sections. With the skill, people who don't know the system can build quotes and proposals too.
Results by the numbers
- 5Billing types
- 308Commits
- 224Test files
- /inbot-orcamentoRun by an agent