QuotePilot

Documentation

How QuotePilot is put together

This documentation explains the parts that affect commercial trust: how a quote is calculated, who can change what, and what happens to client content.

Quote lifecycle

A quote moves through draft, analysing, in review, approved, locked, sent and then accepted or declined. Locked, sent and accepted quotes are treated as historical records. They cannot be edited in place, and their line items cannot be changed.

Versions and locking

Locking a quote writes an immutable version containing a snapshot of the quote and its line items, plus the calculated totals at that moment. The version number increments each time. A proposal references one exact version, so a client always receives the numbers that were approved.

To change a locked quote, an owner or admin revises it back into review, makes the change, and locks again. That creates the next version. The earlier version remains readable.

Line item sources

Line items record whether they came from a person, from analysis or from an import. They also carry a match status. Matched means the item was tied to a catalogue entry. Unmatched means a person still has to decide how to price it, and unmatched items are excluded from the mandatory total.

Totals and rounding

Money is stored and calculated as fixed precision numbers. Each line is rounded to the nearest cent once, then summed. Discounts are applied as a percentage of the subtotal, and the taxable base is reduced by the same percentage before tax is calculated. Gross profit is net revenue minus cost. Margin is gross profit divided by net revenue.

Totals are computed by database logic, not by the browser. A client request cannot overwrite the totals on a quote.

Discounts and authority

Only owners and admins can change the discount or the tax and margin rules on a quote. Discounts above fifteen percent raise a warning that names the authority requirement. The change is written to the audit log with the actor and the before and after values.

Margin warnings

Each company sets a minimum margin. When a quote falls below it, a warning appears on the quote and in the totals. Below zero margin the warning is critical. Warnings do not block a quote, they make the decision visible.

Role matrix

  • Owner: billing, company settings, team roles, ownership transfer, everything an admin can do.
  • Admin: quotes, catalogue, clients, venues, discounts, locking, sending proposals. Cannot change an owner's role or remove an owner.
  • Estimator: builds and prices quotes, accepts recommendations, manages clients and venues. Cannot apply discounts, lock a quote or send a proposal.
  • Viewer: reads quotes without cost, margin or discount detail. Cannot edit.

Ownership safeguards

A company must always keep at least one owner. Ownership is transferred explicitly by an existing owner to an existing team member, in one atomic step. Admins cannot assign or remove owners, and the owner role cannot be set through an ordinary role change or an invitation.

Extraction contract

Analysis returns a structured object that separates stated facts, reasonable requirements, open questions, technical risks, commercial warnings and suggested catalogue matches. The schema contains no price, rate, tax, discount or total fields. The model describes scope. It cannot describe money.

Untrusted content handling

Client briefs and uploaded documents are treated as untrusted data. They are wrapped in explicit delimiters, and the model is instructed that instructions inside them cannot change its rules, reach tools, reveal prompts or alter commercial authority. Recognised injection patterns are recorded against the brief so a reviewer can see that they were present.

Model routing and cost

Short and simple briefs are routed to a faster, cheaper model. Long or structurally complex briefs use the stronger configured model. Every run records provider, model, latency, token counts, estimated cost, retry count and outcome, without storing unnecessary content. Retries are bounded and never create a duplicate quote.

Operational endpoints

A health endpoint reports application status without exposing configuration. Stripe webhooks are verified by signature and de-duplicated by event id before any subscription state is written.