> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twine.se/llms.txt
> Use this file to discover all available pages before exploring further.

# Time Report

> The data model for absence and attendance records

A time report is an individual record that describes a period of absence or attendance for a specific employee. Unlike entity properties in the [Employee model](/platform/data-model/employee), time reports are not date-tracked - each record is a discrete event with its own date range.

## Fields

| Field                          | Type       | Required | Description                                                                                  |
| ------------------------------ | ---------- | -------- | -------------------------------------------------------------------------------------------- |
| `id`                           | UUID       | Yes      | Twine-internal identifier                                                                    |
| `org_id`                       | UUID       | Yes      | Organisation identifier                                                                      |
| `employee_id`                  | UUID       | Yes      | The employee this record belongs to                                                          |
| `start_date`                   | date       | Yes      | Inclusive start date of the record                                                           |
| `end_date`                     | date       | Yes      | Inclusive end date of the record                                                             |
| `source_external_time_type_id` | string     | Yes      | The time type identifier from the source system                                              |
| `source_system_slug`           | string     | Yes      | Identifies which system the record originated from                                           |
| `request_status`               | enum       | No       | Approval state - see below                                                                   |
| `minutes`                      | integer\[] | No       | Duration in minutes, one entry per workday within the date range                             |
| `extent`                       | number\[]  | No       | Duration as a fraction of the workday, one entry per workday. Not available for all systems. |
| `from_time`                    | string     | No       | Clock start time (`HH:MM`). Not available for all systems.                                   |
| `to_time`                      | string     | No       | Clock end time (`HH:MM`). Not available for all systems.                                     |
| `comment`                      | string     | No       | Free-text comment                                                                            |
| `child_id`                     | string     | No       | Remote identifier of the child for child-related leave types. Not available for all systems. |
| `child_name`                   | string     | No       | Name of the child for child-related leave types. Not available for all systems.              |
| `inserted_at`                  | datetime   | Yes      | Timestamp of when the record was created in Twine                                            |

### Request status

| Value       | Description                                               |
| ----------- | --------------------------------------------------------- |
| `approved`  | The request has been approved                             |
| `requested` | Submitted and awaiting approval                           |
| `pending`   | Pending action                                            |
| `rejected`  | The request was rejected                                  |
| `cancelled` | The request was cancelled                                 |
| `unknown`   | The status could not be determined from the source system |

## Time types

Every time report references a **time type** that describes what kind of absence or attendance is being recorded - vacation, sick leave, parental leave, and so on. Time types can be sourced from the external system or defined locally within Twine.

Each time type has a name, an optional code, and an optional external identifier. Its behaviour is described by a set of traits:

| Trait                   | Type    | Description                                                                                                                |
| ----------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| `unit`                  | enum    | The unit in which this type is reported: `day`, `hour`, or `minute`                                                        |
| `enabled`               | boolean | Whether this time type is currently active. Time types are enabled by default; untick this to exclude a type from syncing. |
| `must_be_full_day`      | boolean | When `unit` is not `day`, whether records must still span full days. Not available for all systems.                        |
| `comment_as_child_name` | boolean | Whether the comment field should be treated as a child's name, used for parental leave reporting in some systems.          |

## Absence and attendance

Both kinds of record are time reports, but they are not synced on the same terms.

**Absence** - vacation, sick leave, parental leave - syncs with no configuration. Time types are enabled by default, so once a system integration is connected, absence records flow in for every enabled type. You do not need to create time type mappings to sync absence into Twine.

**Attendance** - worked time, and in some systems the breaks within it - is off by default and must be switched on. This is deliberate rather than an oversight: attendance is far higher volume than absence. A year of absence for one employee is typically tens of records; a year of attendance is thousands, because every shift, and often every break, is its own record.

To sync attendance, both of the following must hold:

1. The attendance time types are **enabled**, the same requirement absence has. In Personio these are `WORK` and `BREAK`; other systems use their own codes.
2. You have **opted in**, by either:
   * ticking **Sync attendance** in the system integration's settings, or
   * mapping an attendance time type to a target time type, which system-to-system integrations do as part of normal setup.

<Note>
  If you are syncing into Twine and reading through the API rather than replicating onward, you will not have time type mappings, so **Sync attendance** in the settings is the switch you want. Absence will already be arriving without it.
</Note>

Where a system splits a shift around its breaks - Personio does this - each segment arrives as its own time report, with the break excluded from the surrounding work segments rather than needing to be subtracted. Summing the worked segments for a day gives that day's worked time.
