# The person

An entity that represents a person says `person: true`. The law calls this
person the *data subject*: the one the data is about. Most apps have one
such entity, `User`. You can have several, so a clinic might also have
`Patient`, and a shop a guest `Customer`.

```jadpo
entity User {
    ...
    person: true
}
```

You don't list which records belong to the person. A record **belongs
to** a person when it refers to them directly: a todo through its
`owner_id`. The compiler reads every reference to find them, and the
[report](/docs/the-personal-data-report.md) shows them for you to review.

A record that refers to two people, such as a message from one user to
another, belongs to both. A record that refers only to another record
belongs to no one: a reply someone writes on another user's todo refers
to its author and to the todo, not to the todo's owner, so it belongs to
its author alone.

Erasure still reaches further than a person's own records, through what
it deletes ([Erasure](/docs/erasure.md)). Here a user is a person, a todo belongs
to its owner, and an attachment goes with its todo. The attachment's
caption is personal data, and erasing the user deletes it:

```jadpo
type Caption = Text {
    max_length: 200
}

entity User {
    id: Uuid
    email: Email {
        unique: true
        personal: PersonalData.contact
    }

    person: true
}

entity Todo {
    id: Uuid
    owner_id: User.id {
        on_delete: OnDelete.restricted
        erase: Erasure.deleted
    }
    title: Caption
}

entity Attachment {
    id: Uuid
    todo_id: Todo.id {
        on_delete: OnDelete.cascade
    }
    caption: Caption {
        personal: PersonalData.identifying
    }
}
```

`person:` takes only `true`; an entity that isn't a person leaves the
line out. A field may still be called `person`.
