Quote and acceptance.
Calculate a quote, inspect its typed result, and accept only the terms that are still current.
Inspect a path through the work.
Change the scenario to see the inputs, operations, and outcome. These are guided browser illustrations of repository reference products.
Define the terms.
20% sample tax. Amounts are calculated in integer cents; discount and tax round to the nearest cent.
Calculated total, including tax.
- Subtotal
- $2,500.00
- Discount
- −$250.00
- Tax
- $450.00
- Result type
- total_minor: integer
What happens,
and why.
- 01
Load the current request and its pricing inputs.
- 02
Calculate local feedback as the operator changes the terms.
- 03
Run the authoritative Function to verify the current quote.
- 04
Plan acceptance against the selected request and inspect its effects.
- 05
Execute the current plan and record the accepted outcome.
When the conditions are no longer met.
Editing terms invalidates the previous verification in the reference application. A delayed response must not replace newer inputs, and acceptance still crosses the server’s Action checks.
Inspect the implementation.
async function acceptCurrentQuote() { if (local === null || isAcceptanceInFlight.current) return; isAcceptanceInFlight.current = true; setIsAccepting(true); const revision = inputRevision.current; const input = { request_id: requestId, unit_price_minor: BigInt(unitPrice), units: BigInt(units), discount_bps: BigInt(discount), tax_bps: BigInt(tax), }; try { setOperationError(null); const plan = await acceptBookingQuote.plan(client, input, { targetKey: requestId }); if (inputRevision.current !== revision) return; await acceptBookingQuote.execute(client, plan, { planHash: plan.hash }); if (inputRevision.current !== revision) return; setAccepted(true); } catch (cause) { if (inputRevision.current !== revision) return;The capabilities behind this example.
Bring us a process.
We'll build it with you.
A business process, the systems it touches, and the rules it needs to follow.