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

# Generating Documents

> OREA/TRREB form packs, uploadable fillable templates, the draft-to-generate workflow, and form versioning.

Document generation in Winnerr produces a filled, print-ready PDF from either a registered OREA/TRREB form pack or a fillable PDF template you upload. The two paths share a common wizard and the same draft → review → generate lifecycle.

## OREA/TRREB form packs

Seven Ontario form packs are registered and available to all organization users with no verification gate required:

| Form key                | Form                                            | Notes                                                                         |
| ----------------------- | ----------------------------------------------- | ----------------------------------------------------------------------------- |
| `on/freehold-purchase`  | OREA 100 Agreement of Purchase and Sale         | Closing date must be a business day (blocking error if not)                   |
| `on/condo-purchase`     | OREA 101 Agreement of Purchase and Sale (Condo) | Same business-day rule; includes condo legal block                            |
| `on/condo-lease`        | OREA 400 + RTA Standard Lease (Form 2229E)      | Deposit is flexible per OREA 400; RTA rent deposit capped at one month's rent |
| `on/freehold-lease`     | OREA 400 (no condo block)                       | Closing allowed any day                                                       |
| `on/listing-sale`       | OREA 271 + PropTx MLS                           | \~717 mapped fields; multi-select checkboxes                                  |
| `on/listing-lease`      | TRREB condo-lease listing                       | Shares listing shared block                                                   |
| `on/rental-application` | OREA 410 Rental Application                     | Tenant-facing share-link fill flow built in                                   |

<Note>
  The OREA/TRREB blank PDF templates must be loaded into your Winnerr instance by your administrator. They are not bundled in the source repository due to licensing. Reach out to support if the OREA templates are missing from the form picker.
</Note>

### Business-day rule for purchases

Purchase agreements (`on/freehold-purchase`, `on/condo-purchase`) enforce an Ontario business-day closing rule: a completion date that falls on a Saturday, Sunday, statutory holiday, or bank holiday is a **blocking error**, not a warning. The picker shows the day of week on hover and will not let you save an invalid closing date. Lease and listing forms may close or go live on any day and are not subject to this rule.

### Deposit semantics

* **OREA Agreement-to-Lease deposit:** flexible (first and last month, or another arrangement agreed by the parties).
* **RTA Standard Lease rent deposit:** capped at one month's rent by law. The form fills exactly one month—never more.

## Generic (uploadable) templates

If you have a fillable PDF that is not an OREA pack—a custom schedule, a brokerage addendum, or any other contract—you can upload it and tag the fields. The field tagger overlays signature, initials, text, date, and checkbox fields at coordinates on the rendered PDF. Tagged templates are saved as `DocumentTemplate` rows and are available in the form picker alongside the OREA packs.

<Warning>
  Generic templates have no legal field map. Winnerr does not validate the content of fields in uploaded templates—field correctness is the user's responsibility. Use the typed OREA packs for legally mapped Ontario forms.
</Warning>

## The draft-to-generate workflow

Every document starts as a `DRAFT`. The wizard walks through the data fields for the selected form, pre-filling where possible from the linked deal or a prior AI proposal.

### AI draft-in-chat

From the AI assistant, describe a document in plain language—"draft a condo lease for 88 Harbour St unit 2502, \$3,200/month, one year from August 1"—and the assistant returns a validated draft with only the fields the request clearly implies. AI-filled fields are marked with a provenance badge in the wizard so you know which values to confirm. The AI proposes; you review and decide.

**The AI never auto-generates.** Clicking "Generate" in the wizard is always a deliberate human action. The draft is validated with the same Zod schema used at generation time—if required fields are missing or a value is out of range, the wizard surfaces the gaps before you proceed.

### Generating the document

When you click Generate on the wizard's review step:

1. The wizard calls the generate endpoint.
2. The form pack's canonical is validated and rendered to PDF (fonts embedded, AcroForm filled).
3. The document status moves to `GENERATED`.
4. Obligations (closing date, condition waiver deadlines, deposit due date) are written to the Locker feed automatically for typed OREA packs.
5. A semantic embedding is generated if the AI gateway is configured, making the document findable via natural-language search.

The hub shows a document-usage meter (for example, "12 / 15 this month"). Generating over the plan allotment charges overage—it does not block the render.

## Form versioning

OREA and TRREB update their forms on a schedule. Winnerr versions each pack with an official revision label (for example, "OREA 400 · Revised 2026") visible on the document detail and hub.

* **Drafts auto-upgrade:** when you re-open an older draft and a newer revision is effective, the document upgrades to the current version and re-validates. Required-field gaps introduced by the new revision are surfaced as alerts—no data is silently dropped.
* **Generated and signed documents pin their version forever.** A completed APS with a `formVersion` stamp renders at exactly that revision regardless of later updates. This is a legal requirement: the parties signed the version they saw.

## Related

* [Sign](/documents/sign) — sending a generated document for signature.
* [Documents API — draft endpoint](/api-reference/documents#ai-draft) — POST a prompt to get a validated canonical draft.
* [Documents API — generate endpoint](/api-reference/documents#generate) — POST to render a draft to PDF.
