> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-8.md).

# Housekeeping tables

{% hint style="info" %}
Generated from the staging database schema, with descriptions drafted by agents ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/db/tables/viewpoint-8.md).
{% endhint %}

## Description

Housekeeping: links from a cleaning task to its inspection, room-status task rules, room assignments and staff working hours.

## Tables

| Name                                                                                                                 | Columns | Comment                                                                                                                                                                                                                                                                                                | Type       |
| -------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| [tPri\_JobLink](https://docs.snapfix.com/engineering-reference/db/tables/tpri_joblink.md)                            | 15      | Links a master task to a tagged task, which may be in another group; housekeeping uses it to pair a cleaning task with its inspection task.                                                                                                                                                            | BASE TABLE |
| [tPri\_RoomStatus\_TaskRules](https://docs.snapfix.com/engineering-reference/db/tables/tpri_roomstatus_taskrules.md) | 23      | One rule for a building's main and secondary room status, which decides whether a housekeeping cleaning or inspection task is created when a room takes the status (optionally only when it is occupied or reserved), which checklist each task uses, and what happens when the tasks start or finish. | BASE TABLE |
| [tPri\_RoomUser](https://docs.snapfix.com/engineering-reference/db/tables/tpri_roomuser.md)                          | 15      | A user linked to a room, with active, archived and visible flags. php-apis's sync reads it and its save action writes it; empty on staging.                                                                                                                                                            | BASE TABLE |
| [tPri\_RoomUserAssigned](https://docs.snapfix.com/engineering-reference/db/tables/tpri_roomuserassigned.md)          | 13      | A user assigned to a room, with an unassigned flag. php-apis's sync reads it and its save action writes it; empty on staging.                                                                                                                                                                          | BASE TABLE |
| [tPri\_User\_WorkingHours](https://docs.snapfix.com/engineering-reference/db/tables/tpri_user_workinghours.md)       | 19      | One working session of a staff member at a site, with its type, day, start and end times and housekeeping role, used by the housekeeping schedule.                                                                                                                                                     | BASE TABLE |

## Relations

```mermaid
erDiagram


"tPri_JobLink" {
}
"tPri_RoomStatus_TaskRules" {
}
"tPri_RoomUser" {
}
"tPri_RoomUserAssigned" {
}
"tPri_User_WorkingHours" {
}
```

***

> Generated by [tbls](https://github.com/k1LoW/tbls)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-8.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
