> 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/staff/support-logs.md).

# Support logs

{% 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/staff/support-logs.md).
{% endhint %}

Staff record the support minutes a site has bought, used or been given, see the site's balance, and approve or delete entries.

* **Where:** admin app `/support-logs`; menu "Support Logs".
* **Who:** any signed-in staff user. The route checks only that a session exists, and the support-hours routes check no staff flag.
* **Feature:** [Support tools](https://docs.snapfix.com/product/features/staff/support-tools.md)

## Layout

1. The title "Support Logs", then a round "+" button with the text "Create a new Support Log".
2. The site picker ("Type to search account"). The first site in the list is chosen when the page opens.
3. Once the site's log has loaded, four tags: "Total Remaining Minute(s) :", "Total Credit Minute(s) :", "Total Deposit Minute(s) :" and "Total Withdraw Minute(s) :", each with its value. Remaining is deposits plus the credit minus withdrawals, counting entries that are not approved yet \[[ASK-203](https://github.com/snapfix/docs/blob/main/ASK.md#ask-203-what-should-approving-support-minutes-mean-and-who-may-approve-or-delete-entries)]; "Delete" entries do not count ([support hours object](https://docs.snapfix.com/engineering-reference/api/staff.md#support-hours-object)).
4. The site's entries, most recently changed first, 10 per page by default (10, 20, 50 or 100) with a page jump. Columns: "Type", "Minutes", "Description", "Created Date", "Approved Date", "Created By", "Approved By" and "Actions", fixed at the right.

* "Type" shows the label of the entry's type (see [New Support Log](#new-support-log)).
* "Created Date" and "Approved Date" are shown as "MM/dd/YYYY".
* "Created By" is the creator's name. "Approved By" shows the creator's name too, not the approver's.
* "Actions" has two round buttons: approve (a check icon, tooltip "Approve", or "Approved" once approved) and delete (a bin icon, tooltip "Delete").

## Inputs

| Field | Type          | Required         | Default                    | Rules and messages                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----- | ------------- | ---------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site  | Search select | Yes, in practice | The first site in the list | Searches site names on the server 1 second after typing; 50 sites at a time, more on scrolling down. Deleted sites show in red and can be chosen \[[ASK-223](https://github.com/snapfix/docs/blob/main/ASK.md#ask-223-should-deleted-accounts-be-selectable-for-card-payments-and-support-logs)]. Choosing a site loads its log. Clearing the picker keeps the previous site's log, and new entries still go to that site. |

## Actions

| Action                           | Who   | What happens                                                                                                                                                                                                                                                                                                                                                                                                                                                               | API                                                                                                                                                                                                                            |
| -------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Open the page                    | Staff | Lists sites and chooses the first, then loads its log.                                                                                                                                                                                                                                                                                                                                                                                                                     | [`GET /v4/parents`](https://docs.snapfix.com/engineering-reference/api/staff.md#get-v4parents), [`GET /support-hours/{parent_uuid}`](https://docs.snapfix.com/engineering-reference/api/staff.md#get-support-hoursparent_uuid) |
| Choose a site                    | Staff | Loads the site's totals and entries.                                                                                                                                                                                                                                                                                                                                                                                                                                       | [`GET /support-hours/{parent_uuid}`](https://docs.snapfix.com/engineering-reference/api/staff.md#get-support-hoursparent_uuid)                                                                                                 |
| "+" ("Create a new Support Log") | Staff | Opens [New Support Log](#new-support-log) for the chosen site. The button is never disabled, so before a site is chosen the save fails with "invalid parent".                                                                                                                                                                                                                                                                                                              | See the dialog                                                                                                                                                                                                                 |
| Approve                          | Staff | Disabled for an approved entry. Asks "Are you sure you want to Approve?" with "Approve". On confirm the entry is approved, by the signed-in user, and the list and totals come back from the server with "Approved Date" and "Approved By" filled in. Every entry can be approved by anyone, its creator included \[[ASK-203](https://github.com/snapfix/docs/blob/main/ASK.md#ask-203-what-should-approving-support-minutes-mean-and-who-may-approve-or-delete-entries)]. | [`PUT /support-hours/{parent_uuid}`](https://docs.snapfix.com/engineering-reference/api/staff.md#put-support-hoursparent_uuid)                                                                                                 |
| Delete                           | Staff | Asks "Are you sure you want to Delete?" with a danger "Delete". On confirm the entry is deleted and the list and totals come back from the server. Approved entries can be deleted too, with no other warning \[[ASK-203](https://github.com/snapfix/docs/blob/main/ASK.md#ask-203-what-should-approving-support-minutes-mean-and-who-may-approve-or-delete-entries)].                                                                                                     | [`DELETE /support-hours/{parent_uuid}/{log_uuid}`](https://docs.snapfix.com/engineering-reference/api/staff.md#delete-support-hoursparent_uuidlog_uuid)                                                                        |

Approve, delete and save show "Success" when they succeed and the server's message when they are refused. Both row buttons are disabled while an approve or delete runs.

## States

* **Loading:** the table shows its loading state while a log loads.
* **Empty:** a site with no live entry shows an empty table and no totals: the server answers "no support account logs found!", and the page shows no message.
* **Error:** the log load shows no error message. An answer that is not a success clears the totals and the table. A failed request keeps the previous site's totals and entries on screen under the newly chosen site, and new entries, approvals and deletes then go to the new site.
* **No permission:** none in the app.

## Dialogs and sheets

### New Support Log

"New Support Log", 600 px wide, with "Cancel" and "Save".

| Field            | Type                                                    | Required | Default | Rules and messages                                                                                                                                                                                                                                                                               |
| ---------------- | ------------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Action Type      | Select, searchable and clearable ("Select Action Type") | Yes      | Empty   | "Please Select Action Type". The four types: "Delete (remove hours added by accident)", "Deposit (add in hours that a customer has just purchased from us)", "Withdraw (log the time you have spent working on customer tasks)" and "Credit (add free credit into an account - needs approval)". |
| Description      | Text                                                    | Yes      | Empty   | "Please input Description".                                                                                                                                                                                                                                                                      |
| Worked Minute(s) | Number                                                  | Yes      | Empty   | "Please input correct Worked Minute(s)". The form sets no minimum, so 0 and negative numbers pass it. The server refuses 0 for a deposit, withdrawal or credit with "invalid params", accepts 0 for "Delete", and accepts negative numbers.                                                      |

* The "Delete" type deletes nothing: the server stores it as a note whose minutes do not count in the totals.
* A new credit replaces the site's earlier credit entries, which the server marks deleted.

| Action   | Who   | What happens                                                                                                                                                                                                                                                                                                                      | API                                                                                                                              |
| -------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| "Save"   | Staff | Disabled until the form is valid. Sends the type, the description and the minutes for the chosen site. On success the dialog closes and the page shows the server's new totals and entries; a refusal shows the server's message and the dialog stays open. While saving, "Save" shows a spinner and the dialog cannot be closed. | [`POST /support-hours/{parent_uuid}`](https://docs.snapfix.com/engineering-reference/api/staff.md#post-support-hoursparent_uuid) |
| "Cancel" | Staff | Closes. Disabled while saving.                                                                                                                                                                                                                                                                                                    | None                                                                                                                             |


---

# 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/staff/support-logs.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.
