> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Digital contracting

> How a Maihue lead becomes an active customer in one digital journey: registration, identity, summary, payment method, electronic signature, review and activation.

> [!NOTE]
>
> This section documents **digital contracting**: the end-to-end journey that
> turns a Maihue lead into an active customer inside the customer portal. It
> covers the portal wizard, the contract backend in `horizon-api`, the
> asynchronous workers and how contracting uses the platform signature engine.

## What this is

A commercial channel registers a contract for a customer. The customer
receives a one-time link, opens the customer portal and completes a guided
wizard: proves their identity, accepts the contract summary, enrolls a payment
method and signs every contract document with an email one-time code. Right
after signing, the customer sees the signed documents, creates their portal
password and enters the customer portal already signed in.

From there the contract continues without the customer: Maihue operations
review it, Maihue's representatives countersign it (unattended by default),
and the contract and its subscription become active. The customer receives a
confirmation email.

The journey serves the three Maihue business units (Home, Horeca and Business)
and two kinds of customer:

| Customer | Signers | How they sign |
| - | - | - |
| **Person** | One signer, the account holder | Signs alone |
| **Company** | One or more administrators, in a fixed order | Each administrator signs after the previous one |

> [card] What the journey does
>
> Collects identity, terms acceptance, a payment method and legally
> meaningful signatures in one guided flow, with no paper and no external
> e-signature vendor.

> [card] What it does NOT do
>
> It does not charge the customer. Enrolling a payment method never creates
> a charge; billing happens after activation, outside this journey.

## The journey at a glance

```mermaid theme={null}
flowchart LR
    register["Registration<br/>(contract created)"] --> link["One-time link<br/>by email"]
    link --> identity["Identity<br/>verification"]
    identity --> summary["Contract<br/>summary"]
    summary --> payment["Payment method<br/>(no charge)"]
    payment --> sign["Customer<br/>signature"]
    sign --> password["Portal password<br/>and sign-in"]
    sign -.-> review["Operations<br/>review"]
    subgraph maihue [Without the customer]
        review --> counter["Maihue<br/>countersignature"]
        counter --> active["Contract active<br/>+ confirmation email"]
    end
```

## Who takes part

| Actor | Role |
| - | - |
| Customer signer | Opens the link and completes the wizard in `frontend/portal-customer` |
| Maihue operations | Approves or rejects the contract after the customer signs |
| Maihue representatives | Countersign on behalf of Maihue, unattended by default, through the signature engine |
| `horizon-api` | Owns the contract state, the wizard endpoints and the workers |
| Floid | Verifies the customer identity (RUT and identity card) |
| Fintoc | Enrolls the card or bank-account mandate (PAC) |
| Pusher | Pushes progress to the open portal tab |

## Where to go next

> [card] [Architecture](https://docs.bbrands.io/digital-contracting/architecture.md)
>
> Components, layers and the boundaries with identity and the signature engine.

> [card] [Flows](https://docs.bbrands.io/digital-contracting/flows.md)
>
> The twelve steps of the journey, the contract statuses and the exceptions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.