# plugin-forms

`@fayz-ai/plugin-forms` · beta · Capability parcial

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.

## Ficha técnica

- **Pacote:** `@fayz-ai/plugin-forms`
- **Versão:** 0.2.0
- **Status:** beta
- **Capability:** Capability parcial
- **Tipo de produto:** Gestão (Admin/SaaS)
- **Canal stable:** `^0.2.0`
- **Migrations:** 3 migration(s)
- **Factory:** `createCustomFormsPlugin()`

## Modelo de dados

Tabelas instaladas (convenção `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

## Tools de IA

| id | modo | descrição |
| --- | --- | --- |
| `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. |

## Integrações

Sem conector hospedado — provedores externos via spine de conectores (`@fayz-ai/core`).

## Integrar

Adicione o plugin em `surfaces.admin.plugins` do `app.manifest.json` e rode o doctor:

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

```bash
npx fayz doctor
```
