> 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/how-the-apps-work/screens/compliance/system-detail.md).

# System detail

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). Platforms: web. [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/screens/compliance/system-detail.md).
{% endhint %}

One compliance system: its name and status, expiry date, alert window, frequency and note, its documents, its users, its contractor, its assets and its activity.

![System detail](https://3653879137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVVGa79QbcEkJ7n8srxe%2Fuploads%2Fgit-blob-a60372ecd456e4d3426724a5c0d400ce1f799f76%2Fsystem-detail.png?alt=media)

* **Where:** web `/comply/system/:id?type={type name}&id={type ID}`. [Systems](https://docs.snapfix.com/how-the-apps-work/screens/compliance/systems.md), the [Dashboard](https://docs.snapfix.com/how-the-apps-work/screens/compliance/dashboard.md) and the [Timeline](https://docs.snapfix.com/how-the-apps-work/screens/compliance/timeline.md) add the two parameters. Without `id` the page hides the "Attachment" card, and the system object carries no type ID to fill the gap.
* **Who:** site admins (role "Admin"); see [Dashboard](https://docs.snapfix.com/how-the-apps-work/screens/compliance/dashboard.md#getting-here). The API refuses writes from anyone else.
* **Feature:** [Compliance systems](https://docs.snapfix.com/product/features/compliance/compliance-systems.md); the "Attachment" card is part of [Compliance documents](https://docs.snapfix.com/product/features/compliance/compliance-documents.md).

## Layout

1. **Header:** the breadcrumb "Comply" > "Systems".
2. **Title row:** a back button (title "Back"), "Compliance System:" with the name and a pencil, the traffic light, and an "Actions" button ("⋯") whose only item is "Delete System". "Back" goes to the previous page in the app's route history, not to `/comply`.
3. **Traffic light:** three buttons with the tooltips "Expired", "Expiring Soon" and "Active". The lit one follows the expiry date and the alert days. A click does nothing.
4. **Left column:**
   * "Expiry Date" (DD/MM/YYYY, or "DD/MM/YYYY" when unset), "Expiry Alert" ("{n} Days", or "Set" when unset) and "Frequency" (the frequency's name), each a box that opens a dialog;
   * "Notes", the note editor (placeholder "Write a note here...", a counter, "Cancel" and "Save");
   * "Attachment", the documents card, shown only when the address has the type's ID. With no active document it shows only a "+". Otherwise it lists the active documents, earliest expiry first, each with its name (a link that opens the file in a new tab), its expiry date or "No Expiry Date", and a "⋯" menu, then an "Add Document" button. Inactive documents are hidden here; [Folders](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md) lists them.
5. **Right column:** the tabs "Details" and "Activity". The page always opens on "Details".
   * **Details:** "Users" with "Created by" and "Assigned to"; "Contractors", with a "+" when no contractor is linked, or the contractor's chip (name, status icon and "×"), open by default; "Assets".
   * **Activity:** the system's log, grouped by day ("Today" and earlier days), each entry with the actor's name and photo and the time.

## Inputs

| Field        | Type                                                                                                                                            | Required       | Default             | Rules and messages                                                                                                                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name         | Text                                                                                                                                            | Yes            | Current name        | Edited with the pencil. Trimmed. Enter saves. Leaving the box saves too, and an empty box then closes without saving. Enter on an empty box keeps it open                                                  |
| Expiry Date  | Date                                                                                                                                            | No             | None                | Set in [Expiry Date](#expiry-date). A past date makes the system out of compliance                                                                                                                         |
| Expiry Alert | 7, 30, 60, 90 or 180 days, or a custom number                                                                                                   | No             | 30 for a new system | Set in [Expiry Alert](#expiry-alert). A custom number must be a whole number from 1 to 365. The server checks only that it is a whole number                                                               |
| Frequency    | One of "None", "Daily", "Weekly", "Fortnightly", "Monthly", "Quarterly", "Semiannually", "Annually", "2 years", "3 years", "4 years", "5 years" | No             | "None"              | Set in [Frequency](#frequency). Saved as its name; no code acts on it \[[ASK-109](https://github.com/snapfix/docs/blob/main/ASK.md#ask-109-what-should-frequency-do-and-what-should-new-items-start-with)] |
| Note         | Text                                                                                                                                            | No             | Empty               | Up to 2,000 characters in the box; the server keeps 1,000 and cuts the rest without an error. "Save" saves, "Cancel" discards                                                                              |
| Users        | One site user                                                                                                                                   | No             | None                | Set in [Users](#users)                                                                                                                                                                                     |
| Contractor   | One contractor of the site                                                                                                                      | No             | None                | Set in [Contractor](#contractor)                                                                                                                                                                           |
| Assets       | Assets of the site's asset registers                                                                                                            | No             | None                | Set in [Assets](#assets)                                                                                                                                                                                   |
| Document     | Type, expiry date and file                                                                                                                      | Yes, to upload | -                   | Set in [Upload a Compliance Document](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md#upload-a-compliance-document)                                                               |

## Actions

| Action                              | Who         | What happens                                                                                                                                                                                                                                           | API                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open the page                       | Site admins | Loads the system with its assets, assigned users, contractor and documents, then the frequency list, the site's users and the site's contractors                                                                                                       | [`GET /v1/app/comply/system/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplysystemuuid), [frequencies](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appfrequencies), [users](https://docs.snapfix.com/engineering-reference/api/users.md), [`GET /v1/app/comply/contractor`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplycontractor) |
| Edit the name                       | Site admins | Saves the name, then reloads the system                                                                                                                                                                                                                | [`PUT /v1/app/comply/system/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplysystemuuid) with `name`                                                                                                                                                                                                                                                                                                |
| Set the expiry date or the alert    | Site admins | Saves the value. When the system has both a date and an alert, the page also sends a colour it worked out, which the server ignores                                                                                                                    | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplysystemuuid) with `expiryTs` or `expiryAlertDays`                                                                                                                                                                                                                                                                                                    |
| Set the frequency                   | Site admins | Saves the frequency's name                                                                                                                                                                                                                             | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplysystemuuid) with `frequencyDescription`                                                                                                                                                                                                                                                                                                             |
| Save the note                       | Site admins | Saves the note                                                                                                                                                                                                                                         | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplysystemuuid) with `note`                                                                                                                                                                                                                                                                                                                             |
| "Assigned to" pencil                | Site admins | Opens [Users](#users). "Select" assigns the picked user and unassigns every other assigned user \[[ASK-113](https://github.com/snapfix/docs/blob/main/ASK.md#ask-113-should-a-system-or-contractor-have-one-assigned-user-or-several)]                 | [`POST /v1/app/comply/system/assign`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemassign), [`POST /v1/app/comply/system/unassign`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemunassign)                                                                                                                                                              |
| Remove an assigned user             | Site admins | Unassigns that user                                                                                                                                                                                                                                    | [`POST /v1/app/comply/system/unassign`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemunassign)                                                                                                                                                                                                                                                                                                    |
| "+" on Contractors                  | Site admins | Opens [Contractor](#contractor). "Select" links the picked contractor                                                                                                                                                                                  | [`POST /v1/app/comply/system/link-contractor`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemlink-contractor)                                                                                                                                                                                                                                                                                      |
| "×" on the contractor chip          | Site admins | Unlinks the contractor at once, with no confirmation. Only then does the "+" come back to pick another                                                                                                                                                 | [`POST /v1/app/comply/system/unlink-contractor`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemunlink-contractor)                                                                                                                                                                                                                                                                                  |
| Click the contractor chip           | Site admins | Opens [Contractor detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/contractor-detail.md)                                                                                                                                          | -                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| "+" or edit on Assets               | Site admins | Opens [Assets](#assets). "Save" links the added assets and unlinks the removed ones                                                                                                                                                                    | [`POST /v1/app/comply/system/link-asset`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemlink-asset), [`POST /v1/app/comply/system/unlink-asset`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplysystemunlink-asset)                                                                                                                                              |
| "+" or "Add Document" on Attachment | Site admins | Opens [Upload a Compliance Document](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md#upload-a-compliance-document) with this system as the folder; saving reloads the system                                                  | [`POST /v1/app/comply/document`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplydocument)                                                                                                                                                                                                                                                                                                                 |
| Document menu: "Open File"          | Site admins | Opens the file's link in a new tab. The link is a plain bucket address \[[ASK-115](https://github.com/snapfix/docs/blob/main/ASK.md#ask-115-can-compliance-documents-report-files-and-the-comply-report-be-opened-from-their-link-without-signing-in)] | -                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Document menu: "Download"           | Site admins | Downloads the file under its name                                                                                                                                                                                                                      | -                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Document menu: "Edit Info"          | Site admins | Opens the upload dialog in edit mode, to change the type and the expiry date, not the file                                                                                                                                                             | [`PUT /v1/app/comply/document/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplydocumentuuid)                                                                                                                                                                                                                                                                                                        |
| Document menu: "Set As Inactive"    | Site admins | Hides the document here; it stays in [Folders](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md). An info icon on the item says so                                                                                             | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplydocumentuuid) with `inactive` 1                                                                                                                                                                                                                                                                                                                     |
| Document menu: "Delete"             | Site admins | Opens [Delete Document](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md#delete-document); confirming deletes it                                                                                                               | [`DELETE /v1/app/comply/document/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#delete-v1appcomplydocumentuuid)                                                                                                                                                                                                                                                                                                  |
| "Activity" tab                      | Site admins | Loads the log. Any signed-in user with the system's ID can read it from the API                                                                                                                                                                        | [`GET /v1/app/comply/system/{uuid}/activities`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplysystemuuidactivities)                                                                                                                                                                                                                                                                                       |
| "Delete System"                     | Site admins | Opens [Delete System](#delete-system). Confirming deletes the system and goes to `/comply`                                                                                                                                                             | [`DELETE /v1/app/comply/system/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#delete-v1appcomplysystemuuid)                                                                                                                                                                                                                                                                                                      |

The server accepts users and assets of other sites in the assign and link calls and returns their details, though the page offers only the site's own.

Activity entries read, for example, `Compliance item "Room 101 fire doors" created`. The update entry ends with a stray quotation mark after "updated". The page writes the server's text into the page as HTML, without escaping the system, contractor or user names in it.

## States

* **Loading:** a spinner in place of the page until the system arrives. If it never arrives, the spinner stays.
* **Empty:** the "Attachment" card shows only its "+"; "Assigned to", "Contractors" and "Assets" offer their add control; the Activity tab can be empty.
* **Error:** a failed save shows the API's message in the shared alert. A system whose type was deleted answers `404`, and the page shows only its breadcrumb.
* **No permission:** a non-admin never reaches the page. The API answers "Access denied" to a write from a non-admin.
* **Offline (mobile):** not applicable (web only).

## Dialogs and sheets

### Expiry Date

Opened from the "Expiry Date" box. The title, "Expiry Date", is written in the code. Two options:

* **"Set Date Manually"** (selected at first): a pencil opens a date picker with "Cancel" and "Set"; the chosen date shows as DD/MM/YYYY.
* **"Set The Expiry Date Same As A Document":** lists the system's active documents with their expiry dates. It is disabled when the system has no documents; the dialog then says "No Documents Available. To Upload A Document, Tap The" with an "Add Document" button, which closes this dialog and opens the upload dialog.

Buttons "Cancel" and "Select". "Select" turns on once a date is picked, and saves it. A document's date picked first stays selected after switching to "Set Date Manually", and "Select" saves it.

### Expiry Alert

Title "Expiry Alert", with the text "Set How Many Days Before The Expiry Date The Status Should Automatically Change To Yellow." The choices are "7 days", "30 days", "60 days", "90 days", "180 days" and "Custom +". "Custom +" opens a "Days" number box with "Ok"; until the number is a whole number from 1 to 365, "Ok" stays off and "Please enter a number between 1 and 365" shows. After "Ok" the choice reads "{n} Days". Buttons "Cancel" and "Select"; "Select" stays off until a choice is made. Pressing "Select" after typing a number but before "Ok" saves 0 days, which the page then shows as "Set".

### Frequency

Title "Frequency". The twelve frequencies, "None" first, with "Cancel" and "Select". "Select" saves the chosen name.

### Users

Title "Users". The site's users, with a "Find users" box and one radio button per row, so one user can be picked; the first assigned user starts selected. Buttons "Cancel" and "Select" \[[ASK-113](https://github.com/snapfix/docs/blob/main/ASK.md#ask-113-should-a-system-or-contractor-have-one-assigned-user-or-several)].

### Contractor

Opened by the "+" on "Contractors". The title shows the raw word "contractors" and the search box "Search Contractors", both written in the code. The site's contractors, each with a status icon and a radio button. Buttons "Cancel" and "Select".

### Assets

The shared assets dialog of [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#assets), titled "Assets", with the site's asset registers ([`GET /v1/app/asset-regs`](https://docs.snapfix.com/engineering-reference/api/assets.md#get-v1appasset-regs)) and the buttons "Cancel" and "Save".

### Delete System

Title "Delete System". The message reads "Deleting this System will permanently remove it, and all related data from associated tasks and contractors. Do you want to continue?". Buttons "Cancel" and "DELETE". The API deletes only the system row: its task, contractor and document links stay.

### Upload a Compliance Document

The shared upload dialog, described in [Folders](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md#upload-a-compliance-document). Here the folder is the system's name.

## Platform differences

Web only. The apps show a compliance system only as a choice on a task ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#compliance-system)) and on a planned task ([Planned task](https://docs.snapfix.com/how-the-apps-work/screens/planner/planned-task.md)); they cannot open, edit or delete one.


---

# 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/how-the-apps-work/screens/compliance/system-detail.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.
