Customers (Persons)
Customers are represented by the Person model (Person) with different types depending on the context.
Person Types
| Type | Description |
|---|---|
organization | Tenant/organization that uses the platform |
customer | Customer of an organization |
contact | Secondary contact |
Customer Fields
| Field | Description |
|---|---|
| Name | Name or legal name |
| Nickname | Trade name |
| Legal name | Full legal name |
| Document type | CPF or CNPJ |
| Document number | Normalized (digits only) |
| Nature | natural (individual) or juridical (legal entity) |
| Date of birth | Optional |
| Addresses | List of addresses (JSON) |
| Phones | List of phone numbers (JSON) |
| Emails | List of emails (JSON) |
| Websites | List of websites (JSON) |
| Tags | List of tags for categorization |
| Notes | Internal observations |
| Custom data | Custom fields (JSON) |
Hierarchy
Customers belong to an organization via the parentId field:
Organization (type=organization, parentId=null)
├── Customer A (type=customer, parentId=org_id)
├── Customer B (type=customer, parentId=org_id)
└── Contact (type=contact, parentId=org_id)
Validations
- Document number unique within the organization
- External code (
externalCode) unique per organization - Document format restrictions: CPF (11 digits) or CNPJ (14 digits)