> 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-22.md).

# Reference 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-22.md).
{% endhint %}

## Description

Code lists and standard data: the enum tables, countries, currencies, industry codes, defaults the apps download, and the API endpoint lists.

## Tables

| Name                                                                                                                    | Columns | Comment                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Type       |
| ----------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [enum\_BusinessType](https://docs.snapfix.com/engineering-reference/db/tables/enum_businesstype.md)                     | 8       | The two group kinds, task and asset, with the code in uuid. No code reads the table: tPri\_Business.enum\_BusinessType holds the code, and the code compares it with the RegType values \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)].                                                                                                                                                                                                                                               | BASE TABLE |
| [enum\_IntegrationSource](https://docs.snapfix.com/engineering-reference/db/tables/enum_integrationsource.md)           | 10      | Legacy lookup of three PMS sources of room status changes (comtrol-lodginglink, oracle-opera and guestline, code in uuid); nothing reads it. tPri\_Log\_RoomStatusChange.uuid\_enum\_IntegrationSource holds the Pms enum values (comtrol, guestline, opera, hotsoft, cloudbeds and others) instead.                                                                                                                                                                                                                                                                      | BASE TABLE |
| [enum\_JobType](https://docs.snapfix.com/engineering-reference/db/tables/enum_jobtype.md)                               | 10      | Task types: the code in uuid, which tPri\_Job.enum\_JobType holds, with a name and a report name, for example 0 normal (mobile app task) and 1 planned (scheduled task); 27 rows. No code reads the table \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)]. Codes 45 (cleaning task) and 46 (inspection task) of the app's JobType enum have no row \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)]. | BASE TABLE |
| [enum\_Origin](https://docs.snapfix.com/engineering-reference/db/tables/enum_origin.md)                                 | 10      | Where a task was made: the code in uuid, which tPri\_Job.enum\_Origin holds, from 0 to 10 (unknown, android, ios, web, web-admin, email, qr, publicapi, guestline, schedule and auto-hk). No code reads the table \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)]. Code 11 (xvendor) has no row.                                                                                                                                                                                       | BASE TABLE |
| [enum\_ScheduleCategory](https://docs.snapfix.com/engineering-reference/db/tables/enum_schedulecategory.md)             | 8       | The schedule categories schedule and tasknotif, code in uuid. The scheduler also uses duedatenotif, which has no row \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)]. No code reads the table \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)].                                                                                                                                                      | BASE TABLE |
| [enum\_UserType](https://docs.snapfix.com/engineering-reference/db/tables/enum_usertype.md)                             | 9       | The three account kinds that tPri\_User.enum\_UserType holds, code in uuid: 1 normal, 2 snapfix (Snapfix internal user) and 3 snapfix\_test. No code reads the table \[[ASK-246](https://github.com/snapfix/docs/blob/main/ASK.md#ask-246-should-the-enum-lookup-tables-follow-the-code-or-be-retired)].                                                                                                                                                                                                                                                                  | BASE TABLE |
| [std\_continents](https://docs.snapfix.com/engineering-reference/db/tables/std_continents.md)                           | 2       | Reference list of continents, a two-letter code and an English name; only a seeder writes it and no code reads it.                                                                                                                                                                                                                                                                                                                                                                                                                                                        | BASE TABLE |
| [std\_countries](https://docs.snapfix.com/engineering-reference/db/tables/std_countries.md)                             | 9       | Reference list of countries: ISO codes, English names, continent, Stripe tax ID type and a blacklist flag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                | BASE TABLE |
| [std\_currencies](https://docs.snapfix.com/engineering-reference/db/tables/std_currencies.md)                           | 10      | Reference list of ISO currencies; snapfix\_supported marks the ones a package price may use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | BASE TABLE |
| [std\_naics\_codes\_2](https://docs.snapfix.com/engineering-reference/db/tables/std_naics_codes_2.md)                   | 2       | One NAICS industry code at level 2, with its English title; only a seeder writes it and no code reads it (tPri\_Parent has a std\_naics\_codes column).                                                                                                                                                                                                                                                                                                                                                                                                                   | BASE TABLE |
| [std\_naics\_codes\_3](https://docs.snapfix.com/engineering-reference/db/tables/std_naics_codes_3.md)                   | 3       | One NAICS industry code at level 3, with its English title; only a seeder writes it and no code reads it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | BASE TABLE |
| [std\_naics\_codes\_4](https://docs.snapfix.com/engineering-reference/db/tables/std_naics_codes_4.md)                   | 3       | One NAICS industry code at level 4, with its English title; only a seeder writes it and no code reads it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | BASE TABLE |
| [std\_naics\_codes\_5](https://docs.snapfix.com/engineering-reference/db/tables/std_naics_codes_5.md)                   | 3       | One NAICS industry code at level 5, with its English title; only a seeder writes it and no code reads it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | BASE TABLE |
| [std\_naics\_codes\_6](https://docs.snapfix.com/engineering-reference/db/tables/std_naics_codes_6.md)                   | 3       | One NAICS industry code at level 6, with its English title; only a seeder writes it and no code reads it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | BASE TABLE |
| [std\_usecases](https://docs.snapfix.com/engineering-reference/db/tables/std_usecases.md)                               | 2       | Reference list of use cases, a code and a name, two rows; no code reads or writes it (tPri\_Parent has a std\_usecases column of the same name).                                                                                                                                                                                                                                                                                                                                                                                                                          | BASE TABLE |
| [tPub\_ApiEndPoint](https://docs.snapfix.com/engineering-reference/db/tables/tpub_apiendpoint.md)                       | 12      | A reference list of API endpoints with live and test URLs and a description. The apps download it in their sync, php-apis's generic read action returns it (nothing calls it), and no row is newer than 2021-03.                                                                                                                                                                                                                                                                                                                                                          | BASE TABLE |
| [tPub\_ApiEndPoint\_v7](https://docs.snapfix.com/engineering-reference/db/tables/tpub_apiendpoint_v7.md)                | 14      | A second endpoint list for API v7, with live and test URLs, token types and io\_type. Only php-apis's generic read action names it (nothing calls it), and no row is newer than 2024-06.                                                                                                                                                                                                                                                                                                                                                                                  | BASE TABLE |
| [tPub\_ApiEndPoint\_v7\_LEGACY](https://docs.snapfix.com/engineering-reference/db/tables/tpub_apiendpoint_v7_legacy.md) | 14      | An old copy of the v7 endpoint list; only its migration names it, and no row is newer than 2021-03 \[[ASK-242](https://github.com/snapfix/docs/blob/main/ASK.md#ask-242-can-the-unused-copy-and-scratch-tables-be-dropped)].                                                                                                                                                                                                                                                                                                                                              | BASE TABLE |
| [tPub\_ChatItemType](https://docs.snapfix.com/engineering-reference/db/tables/tpub_chatitemtype.md)                     | 6       | A reference list of chat item types, each with a number (message\_id), a name (fName), an example and a comment. Only php-apis's generic table actions name it, and nothing calls them.                                                                                                                                                                                                                                                                                                                                                                                   | BASE TABLE |
| [tPub\_GlobalValues](https://docs.snapfix.com/engineering-reference/db/tables/tpub_globalvalues.md)                     | 3       | App-wide settings by key, read by authpy and php-apis, such as minimum and current app versions for Android and iOS, Android API levels and the web and mobile registration switches. A few keys are test keys.                                                                                                                                                                                                                                                                                                                                                           | BASE TABLE |
| [tPub\_NotifRepeatType](https://docs.snapfix.com/engineering-reference/db/tables/tpub_notifrepeattype.md)               | 3       | Repeat options for a notification. Empty on staging; only php-apis's generic table actions name it, and nothing calls them.                                                                                                                                                                                                                                                                                                                                                                                                                                               | BASE TABLE |
| [tPub\_Status](https://docs.snapfix.com/engineering-reference/db/tables/tpub_status.md)                                 | 4       | Default task statuses, Red, Amber and Green, plus test rows. Only php-apis's uncalled save\_new\_business copies them into a new group; the group creation in use sets Red, Amber and Green itself.                                                                                                                                                                                                                                                                                                                                                                       | BASE TABLE |
| [tPub\_StatusSub](https://docs.snapfix.com/engineering-reference/db/tables/tpub_statussub.md)                           | 4       | Default sub-statuses, New, In Progress and Closed, plus test rows. Only php-apis's uncalled save\_new\_business copies them into a new group.                                                                                                                                                                                                                                                                                                                                                                                                                             | BASE TABLE |
| [tPub\_TagDefault](https://docs.snapfix.com/engineering-reference/db/tables/tpub_tagdefault.md)                         | 4       | Default tags, each under a default tag folder (uuid\_tTagHeaderDefault). php-apis's copy into new groups is commented out \[[ASK-252](https://github.com/snapfix/docs/blob/main/ASK.md#ask-252-should-new-groups-start-with-the-default-tag-folders)].                                                                                                                                                                                                                                                                                                                    | BASE TABLE |
| [tPub\_TagHeaderDefault](https://docs.snapfix.com/engineering-reference/db/tables/tpub_tagheaderdefault.md)             | 4       | Default tag folders, Location, Equipment and Category. php-apis's copy into new groups is commented out \[[ASK-252](https://github.com/snapfix/docs/blob/main/ASK.md#ask-252-should-new-groups-start-with-the-default-tag-folders)].                                                                                                                                                                                                                                                                                                                                      | BASE TABLE |
| [tPub\_UserType](https://docs.snapfix.com/engineering-reference/db/tables/tpub_usertype.md)                             | 3       | The group roles, Admin and User (tPri\_UserBusiness.uuid\_tUserType). php-apis looks the Admin row up by name, and the apps, apipy and the Laravel API read it.                                                                                                                                                                                                                                                                                                                                                                                                           | BASE TABLE |

## Relations

```mermaid
erDiagram

"std_countries" }o--|| "std_continents" : "FOREIGN KEY (continent_code) REFERENCES std_continents (code)"
"std_naics_codes_3" }o--|| "std_naics_codes_2" : "FOREIGN KEY (naics_codes_2_code) REFERENCES std_naics_codes_2 (code)"
"std_naics_codes_4" }o--|| "std_naics_codes_3" : "FOREIGN KEY (naics_codes_3_code) REFERENCES std_naics_codes_3 (code)"
"std_naics_codes_5" }o--|| "std_naics_codes_4" : "FOREIGN KEY (naics_codes_4_code) REFERENCES std_naics_codes_4 (code)"
"std_naics_codes_6" }o--|| "std_naics_codes_5" : "FOREIGN KEY (naics_codes_5_code) REFERENCES std_naics_codes_5 (code)"

"enum_BusinessType" {
}
"enum_IntegrationSource" {
}
"enum_JobType" {
}
"enum_Origin" {
}
"enum_ScheduleCategory" {
}
"enum_UserType" {
}
"std_continents" {
  char_2_ code
}
"std_countries" {
  char_2_ continent_code
}
"std_currencies" {
}
"std_naics_codes_2" {
  char_2_ code
}
"std_naics_codes_3" {
  char_3_ code
  char_2_ naics_codes_2_code
}
"std_naics_codes_4" {
  char_4_ code
  char_3_ naics_codes_3_code
}
"std_naics_codes_5" {
  char_5_ code
  char_4_ naics_codes_4_code
}
"std_naics_codes_6" {
  char_5_ naics_codes_5_code
}
"std_usecases" {
}
"tPub_ApiEndPoint" {
}
"tPub_ApiEndPoint_v7" {
}
"tPub_ApiEndPoint_v7_LEGACY" {
}
"tPub_ChatItemType" {
}
"tPub_GlobalValues" {
}
"tPub_NotifRepeatType" {
}
"tPub_Status" {
}
"tPub_StatusSub" {
}
"tPub_TagDefault" {
}
"tPub_TagHeaderDefault" {
}
"tPub_UserType" {
}
```

***

> 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-22.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.
