# Tickets, folders, statuses and tags in Todomator

> The data model of Todomator: what a ticket holds, the six statuses, who can see a ticket, folders for customers and projects, tags, comments, links and attachments.

Framework: todomator
Product: Todomator (todomator@1.7)
Language: en
Content-SHA256: 34671bd5d1988af591d37c044efd7371cc9c6952df0f651981fc840762dd480a
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: 
Review: not-recorded

The center of Todomator is the **ticket** (table `tbl_ticket`, schema `Tickets` in `schemas/tickets.js`). Everything else organizes tickets or hangs from them.

## What a ticket holds

| Field | Meaning |
|---|---|
| `name` | the title (required) |
| `statusid` | the status; a new ticket is `pending` unless you say otherwise |
| `folderid` | the folder (customer or project) it belongs to |
| `ownerid`, `userid`, `watcherid` | the author, the people assigned and the people who only follow it |
| `ispublic` | visible to everybody; a public ticket has no assigned people |
| `ispriority`, `isbillable` | a priority mark and a billable flag |
| `markdown`, `html` | the content (the interface uses Markdown) |
| `tags` | a list of tags |
| `date`, `deadline` | the day of the ticket (today by default) and an optional deadline |
| `estimate`, `worked` | the estimate and the minutes already worked ([time tracking](/en/todomator/time-tracking/)) |
| `reference`, `source` | free text to connect the ticket with something outside |
| `parentid` | the parent ticket, for subtasks |
| `attachments` | the files of the ticket |
| `attrs` | free JSON data |
| `callback` | an address that receives the ticket when it changes ([API](/en/todomator/create-tickets-with-the-api/)) |

## The six statuses

The table `cl_status` is created with: `pending` (Pending), `open` (In progress), `review` (Review), `postponed` (Postponed), `note` (Note) and `closed` (Closed). The names are translated into the language of the user.

## Who can see a ticket

A ticket is visible to its owner, to the people in `userid`, to the people in `watcherid` and to everybody when `ispublic` is set. The list of folders that a user sees is limited the same way: a folder appears only if the user can see a ticket in it (users with `sa` see all). The list of tickets takes `type` (for example `pending`, `postponed`, `review`, `assigned`, `note`, `unread` or `all`), `q` (search), `folderid`, `date`, `skip` and `limit` (10 by default).

## Folders and tags

A **folder** has a name, an icon, a colour, a customer, an email and a phone, and flags: `isbillable` (new tickets inherit it), `isprivate`, `ispinned`, `isarchived` and `isdisabled`. Only people with the `admin` permission (or administrators) manage folders. A **tag** has a name, a colour and an icon, and can belong to a folder.

## Around the ticket

- **Comments** (`Comments|create`, `Comments|update`, `Comments|remove`): Markdown text attached to a ticket.
- **Unread marks and bookmarks**: each user has their own unread state and bookmarks for a ticket.
- **Links** between tickets, and **clone** of a ticket.
- **History and logs** of the changes of a ticket.
- **Attachments**: `POST /upload/` takes up to 5 MB per request. The address of a file is signed (`/download/<id>-<signature>.<ext>`): images, video and PDF open in the browser and the other types are downloaded.
- **Live updates**: the WebSocket sends a `refresh` event only to the people who can see the ticket, and tells the others who is looking at a ticket right now.
