Components
Backend paths are relative to
backend/horizon-api/ unless they start with
frontend/.
The backend decides the step
The backend decides the stage; the portal only adds local views on top of it (looking back at earlier steps, the welcome and the password). Every read ofGET /api/v3/contract/{id}/state returns a ContractState whose stage
is derived on the server from the contract status and the customer’s
progress; a cancelled, rejected or expired contract answers 400:
stage and flags); rewind and
creating the password return the full state, and starting the Fintoc
enrollment returns the Fintoc URL. Realtime events then bring the rest of the
state, so a tab that reloads always lands on the right step. See
Flows for what each stage does.
Asynchronous workers
Long work never runs inside a portal request. It runs in five workers on the contract queue, delivered through the platform queue transport and tracked in the queue ledger:
The signing pipeline starts when the customer confirms the payment method
(Worker A may prepare the PDFs earlier, when the period is picked). The
enterprise worker starts when operations approve the review (or, for
workflows with
company_phase = first, when the signature group opens).
Realtime
The portal subscribes to the private channelprivate-contract-{id}. The
backend publishes a small patch after most wizard steps and a full state
snapshot after a rewind and after the holder’s password; a patch with the
documents and seats when the signature is requested; and a full snapshot on
status changes, when the contract is signed and on the Fintoc enrollment
events. The channel, the authorizer and the event contract are
documented in Realtime — Channels & Events.
Boundaries
Contracting reaches the signature engine mainly through
internalSignerClient and resolveSignatureWorkflow. Every signature
document references the contract and its annex, so the engine and the
contract domain share their tables.
See MaihueSigner — Consumer integration.