# plugin-forms

`@fayz-ai/plugin-forms` · beta · Partial capability

Every real business runs on forms it never wanted to build: anamnesis sheets, evolution notes, consent contracts, intake docs. plugin-forms kills that busywork. Define a template once, attach a filled document to a person, and the data lives in your tenant — not in a PDF nobody can query.

## Specs

- **Package:** `@fayz-ai/plugin-forms`
- **Version:** 0.2.0
- **Status:** beta
- **Capability:** Partial capability
- **Product type:** Management (Admin/SaaS)
- **Stable channel:** `^0.2.0`
- **Migrations:** 3 migration(s)
- **Factory:** `createCustomFormsPlugin()`

## Data model

Convention: plg_ + tenant_id + RLS.

- `plg_forms_templates` — name, description, category, version, is_current, parent_id
- `plg_forms_documents` — template_id, person_id, title, data, status, signed_at
- `plg_forms_document_files` — document_id, field_key, file_url, file_name, file_size, mime_type
- `documents` — kind, person_id, title, description, status, file_url

## AI tools

| id | mode | description |
| --- | --- | --- |
| `custom_forms.list-templates` | read | Lists available form templates for the current tenant. |
| `custom_forms.list-documents` | read | Lists filled documents, optionally filtered by person or status. |

## Integrations

No hosted connector — external providers come in via the connector spine (`@fayz-ai/core`).

## Integrate

Add the plugin to surfaces.admin.plugins in your app's app.manifest.json and run the doctor to validate:

```json
{ "surfaces": { "admin": { "plugins": [ { "id": "forms", "enabled": true } ] } } }
```

```bash
npx fayz doctor
```
