Enquiry and quote acceptance
A customer request becomes accepted commercial work when the customer agrees to an identified offered quote version and Toolora records its acceptance evidence. An opportunity, an editable quote, an invitation and an individual approver’s response are separate records. Only a final acceptance authorizes the quote-backed project and its accepted billing basis.
Commercial authority defines those evidence relationships. This article follows their transitions through the office and public quote pages. Publication separately explains project presentations and audience visibility after handoff.
Stages and ownership
Section titled “Stages and ownership”| Stage | Actor and owning record | Persistence boundary |
|---|---|---|
| Record the need | Staff maintain an opportunity, customer/contact, work site, follow-up and interactions | Ordinary company-scoped browser writes use row-level security (RLS). Creating a private customer and opportunity together uses a guarded API and one RPC transaction. |
| Prepare an offer | Staff create a quote/thread or review a saved AI preparation | Quote creation uses create_quote_with_thread. Confirming an AI preparation creates a draft; it does not send or accept it. |
| Save the draft | Staff edit quote fields, stable line identities and recipient allocation | The API checks quotes:write; the draft RPC locks the quote and compares its revision before saving the group. |
| Invite approvers | Staff select named recipients and send the reviewed version | The API checks quotes:send and company/resource scope. Token updates, approval-round creation, provider calls and sent-state promotion are separate operations. |
| Record responses | Named people answer through their invitation; staff can separately record original proof | The response RPC locks the quote and round, saves an immutable response and evaluates the approval rule. A partial response leaves the offer pending. |
| Establish accepted work | The last required acceptance finalizes the version | Acceptance, evidence, normal project/basis handoff and durable customer-notification enqueue participate in the database transaction. Delivery happens afterwards. |
The capability and resource checks apply to each privileged operation. A hidden button or an AI client’s confirmation is not a substitute for those checks.
Record the request and create one offer
Section titled “Record the request and create one offer”The opportunity workspace retains the need, its source, follow-up, responsible person and links to subsequent records. Staff can open an existing quote/project or create a quote from the opportunity. The creation caller passes the linked customer, contact and responsible person; the database also carries the selected opportunity work site when applicable.
The current creation RPC locks the opportunity and refuses a second initial quote or creation after a linked project exists. Reopen the existing record after that refusal. This rule concerns initial creation; the version and duplicate actions have separate paths. An offer can also start without an opportunity. Customers and contacts explains why customer, contact, communication recipient and deduction recipient remain separate choices.
A saved AI proposal remains preparation until staff confirm the reviewed version. The contextual workspace checks its source revision, current mail/source access, customer confirmation and saved draft revision. Its transaction creates the native thread/quote and lines together and stores the resulting quote ID. A matching finalized retry returns that ID. An ordinary agent quote-draft proposal has its own guarded confirmation path and atomic creation RPC.
Unanswered contextual questions follow the quote into the editor. Staff must confirm that answers have been incorporated before the first send or manual acceptance. Creating the quote does not silently resolve those questions.
Edit and review the offered version
Section titled “Edit and review the offered version”A thread identifies the offer family; each quote row identifies a concrete version.
The editor saves an incomplete working draft with its expected_updated_at value.
The RPC locks that row, rejects a stale revision and preserves existing line IDs
while applying fields, rows, totals and the supplied deduction-recipient allocation.
The current API wrapper rounds VAT by line and returns a non-retryable business
conflict as HTTP 409. It does not overwrite another tab’s save.
A successful first send locks the commercial draft. The editor flushes pending work before leaving or sending. Review the customer preview, scope, exclusions, prices, optional rows, validity, contact and work site. An optional row becomes accepted scope only when selected through acceptance. A communication recipient is not automatically a ROT/RUT recipient; the separate deduction workflow owns that allocation.
New offers default to 90 days of validity. A dated public link expires at the UTC
start of the day after valid_until; an undated link uses 90 days from issue.
The contextual first-send gate additionally checks today’s validity in Swedish
time. These are explicit implementation rules, not a guarantee that every path
uses one clock or deadline.
The work site is an explicit job location. On the first native send, a missing site can be captured from the customer’s postal address as an initial job site. Later address edits do not reconstruct the old job location. See projects and work orders for the retained relationship.
Send, resend and replace
Section titled “Send, resend and replace”A first send requires an active, unsent working draft. The server resolves the chosen people from stored company profiles, requires usable names and distinct email addresses, and checks customer-contact relationships, send readiness, outbound policy and the company’s sender. Request fields cannot redirect an invitation to an arbitrary email address.
The server issues the shared quote token, then creates the named approval round under a quote lock. The round retains the approval rule, signers, offered contract and terms content/version/hash. Its snapshot computes the final display number before delivery without publishing the draft. Each personal token is stored as a digest and identifies an invited person; possession of that token and a typed name are not independent proof of a government-verified identity.
The API sends each eligible invitation. Only after all provider calls succeed does
the first-send update set sent_at, the sent status and the frozen version label.
Provider acceptance is not evidence that a recipient has read the email. An earlier
recipient can already have received an invitation when a later send fails. The
public accept and named-decline routes refuse responses until the quote has reached
sent state; replay of an already-final acceptance remains delegated to the RPC.
This check preserves the separate staff path for documented manual acceptance.
A resend requires an existing pending recipient round and a sent/viewed quote. It retains the version and an active shared link, creates additional personal tokens for eligible unanswered signers and leaves previous delivered personal tokens usable. A changed rule or signer set requires the separate correction/version rules; resending does not edit the commercial content. A closed round cannot be reopened by another delivery attempt.
Creating a new version archives the source version and copies a fresh working version in the same offer family. The handler reuses an existing live child draft when found. Archiving, creating and copying lines/recipients are separate requests: a failure can leave an archived source or incomplete child. The precheck does not establish a transactional guarantee for simultaneous requests. A duplicate creates a new independent thread and likewise copies through several requests.
Share-link rotation replaces the shared bearer token. Revocation closes future use of that token; neither action reverses recorded acceptance or recalls a delivered email. The current editor has no dedicated commercial withdrawal action. Treat archiving a version, revoking a link and declining an offer as different states.
sequenceDiagram participant O as Office participant A as API participant D as Database participant M as Mail provider participant C as Customer O->>A: Save draft with expected revision A->>D: Atomic fields, lines and allocation save O->>A: Send reviewed quote A->>D: Issue link and save approval round loop Eligible named recipients A->>M: Submit personal invitation end A->>D: Promote first successful send C->>A: Personal response and idempotency key A->>D: Lock quote/round and record response alt More approvals required D-->>A: Pending with counts and locked options else Final required acceptance D->>D: Accept, retain evidence, create project/basis, enqueue notice D-->>A: Accepted with evidence ID end A-->>C: Recorded result
Responses and final acceptance
Section titled “Responses and final acceptance”For one_of, any one named signer can finalize acceptance. One decline closes that
person’s invitation; the round remains pending while another signer can respond.
For all_of, every required signer must accept, and any decline closes the round.
The round records its outcome separately from the quote’s ordinary status. Do not
infer every person’s response from the quote status alone.
The first accepting signer locks the selected optional line IDs for the round. Subsequent signers must accept the same selection. The RPC compares the current contract against the retained snapshot and digest, checks link/token and round expiry, and saves each person’s response with the invitation identity, terms, selection, request fingerprint and request ID. Final acceptance calculates and retains the accepted totals and immutable evidence. Superseded versions cannot receive a new native acceptance or named response.
A matching response replay returns the stored response and the round’s current outcome; a changed key or payload cannot replace an existing signer’s decision. Replay still requires the applicable token to be valid. The older generic acceptance path requires a signer email and explicit terms acceptance and is refused when named approvers are required. Missing email returns HTTP 422 before any acceptance RPC. The accepted receipt can be retrieved after ordinary quote-link expiry; revocation still applies, and the receipt omits email, signature and personal ID.
A change request records a quote interaction and an office notification; it does not accept, decline, edit the offer or automatically make a new version. Its idempotency key prevents a duplicate interaction, but reusing the key with changed text returns the first interaction rather than comparing content. Named response and acceptance checks reject superseded versions. The older generic view, decline and change-request gates check sent state without the same active-version check; do not assume all response endpoints implement identical restrictions.
Staff can correct sent recipients without rewriting accepted commercial content. The correction compares the quote revision, retains the signature count/rule and existing response identities, and restricts replacement contacts. A new personal invitation uses the corrected recipient; an old delivered link retains its original invited identity. Correction itself sends no notification: staff resend afterwards.
Original proof and accepted-project handoff
Section titled “Original proof and accepted-project handoff”Manual acceptance records a staff actor, represented customer person, reviewed terms and private original evidence. It can finalize an eligible unaccepted draft without an email send, or supply one named response while other signers remain required. File validation/upload and the database operation are separate steps; failed database writes have compensating upload cleanup. This is staff-recorded evidence, not a customer signature captured by the public page.
Historical import records a source-system acceptance and its provenance. Source
offer links, reconciliation labels and invoices do not manufacture native signing
evidence. The historical skip_project_creation path can deliberately retain
acceptance without creating new Toolora billing basis for previously invoiced work.
The commercial evidence concept
owns these channel distinctions.
For an ordinary final acceptance, the trigger creates an unplanned project and accepted billing rows in the same transaction. A handoff/configuration failure rolls back that final acceptance and its triggering response. Previously committed partial responses remain. The explicit staff create project from quote API also uses the atomic handoff: it locks the accepted quote, reuses its existing live project and checks complete, unchanged basis. A replay does not apply new project overrides or create a second basis. Change-order threads follow their parent-project path; the separate contract/change-order lifecycle remains outside this article.
A first send normally moves the opportunity to quoted; acceptance moves it to won and records the close date. Source-owned stage/value fields then become Toolora-owned. Historical imports and change-order threads are excluded; a first send does not reopen an already won/lost opportunity. The website status outbox records applicable transitions, but its receiving delivery contract remains unimplemented in this source revision.
Customer confirmation email uses a durable outbox with its own retry state and provider idempotency key. Office in-app notification is a separate best-effort step. A failed notification does not undo an acceptance already committed. Retry delivery through its existing retry operation; repeating the acceptance is not a mail repair. A portal link still requires customer portal admission. Planning, execution and review starts from the operational handoff. Accepted scope is not published instructions, approved delivery or consumed invoice basis.
The transaction reference compares draft revisions, acceptance/handoff, replay and recovery outside the transaction.
Example and recovery
Section titled “Example and recovery”A synthetic opportunity describes painting two rooms. Staff create version 1 with
10,000 SEK of mandatory work and a 2,000 SEK optional task, before VAT, and invite
Alex and Sam under all_of. Alex accepts with the optional task selected: one
response is saved, the selection is locked and no final project basis exists yet.
Sam accepts the same selection: Toolora commits final evidence and the accepted
12,000 SEK net basis. Replaying Sam’s identical request returns the existing result.
The project remains unplanned until staff arrange its delivery.
| Failure or intermediate result | What remains recorded | Next action |
|---|---|---|
| Stale draft revision | The other save remains authoritative; this grouped save changes nothing | Reload/reconcile the draft before retrying with its current revision. |
| Failed first send | Draft remains unsent; shared token, round and earlier provider deliveries may exist | Retry the unchanged round. If its contract became stale, use a reviewed new version. |
| Response before first-send promotion | Public API refuses it; no response RPC runs | Wait for the office to complete or repair the send. |
| Partial approval | Immutable response and optional selection remain; no final acceptance/basis | Collect the remaining required responses. |
| Superseded or changed signing snapshot | New acceptance/response transaction is refused | Open the current invitation; do not reprice the old version. |
| Final handoff fails | That final response, acceptance and handoff roll back together; earlier responses remain | Repair the named configuration/state issue, then retry the original request. |
| Response succeeds but client loses the result | Committed evidence and project remain | Replay the same key/payload while the token is valid, or reload the receipt. |
| Confirmation email fails | Acceptance and project remain; outbox retains delivery state | Use notification retry and inspect its outcome. |
| New-version copy fails | Archive or child/line requests may already have committed | Inspect the existing source/child before retrying; automatic rollback is not provided. |
The delivery PR records executed checks, substituted services, observed component versions and the narrowly tested shared scenarios. Local SQL tests establish their named scenarios against repository migrations; neither those checks nor handbook browser checks establish independent customer business acceptance or delivery to every recipient. No Fortnox operation belongs to this workflow verification.