From eea66de129a6a869cff1f4a1451fe6a56fac4aea Mon Sep 17 00:00:00 2001 From: lorentz Date: Tue, 17 Mar 2026 23:05:57 -0400 Subject: [PATCH] =?UTF-8?q?docs:=20refresh=20database=20skill=20=E2=80=94?= =?UTF-8?q?=20timezone=20(UTC),=20full=20picklist=20tables,=20updated=20ro?= =?UTF-8?q?w=20counts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PULSE_DATABASE_SKILL.md | 183 +++++++++++++++++++++++++++++++--------- 1 file changed, 144 insertions(+), 39 deletions(-) diff --git a/PULSE_DATABASE_SKILL.md b/PULSE_DATABASE_SKILL.md index 5bd9482..dbf516d 100644 --- a/PULSE_DATABASE_SKILL.md +++ b/PULSE_DATABASE_SKILL.md @@ -8,6 +8,7 @@ - **Database:** `pulse_autotask` - **User:** `pulse_user` - **Read-only queries only** — no INSERT/UPDATE/DELETE +- **Timezone:** PostgreSQL server runs in **UTC**. All `timestamp without time zone` columns are UTC. Convert to ET with `AT TIME ZONE 'America/New_York'`. --- @@ -15,15 +16,15 @@ | Domain | Key Tables | Approx Rows | Description | |---|---|---|---| -| **Autotask PSA** | tickets, time_entries, companies, contacts, resources, configuration_items, contracts, projects, tasks, ticket_notes | 152K tickets, 155K time entries, 7K CIs | Service desk, billing, contracts, clients | -| **Datto RMM** | datto_rmm_alerts, datto_rmm_devices, datto_rmm_sites | 20.7K alerts, 3.6K devices | Remote monitoring & management | +| **Autotask PSA** | tickets, time_entries, companies, contacts, resources, configuration_items, contracts, projects, tasks, ticket_notes | 152K tickets, 156K time entries, 7K CIs | Service desk, billing, contracts, clients | +| **Datto RMM** | datto_rmm_alerts, datto_rmm_devices, datto_rmm_sites | 21K alerts, 3.6K devices | Remote monitoring & management | | **SentinelOne** | s1_agents, s1_threats, s1_sites | 2.8K agents, 4.1K threats | Endpoint security | | **Veeam** | veeam_organizations, veeam_backup_jobs, veeam_backup_agents, veeam_alarms, veeam_protected_workloads, veeam_repositories, veeam_backup_servers | ~2.5K total | Backup & disaster recovery | -| **IT Glue** | itg_organizations, itg_configurations, itg_passwords, itg_flexible_assets, itg_contacts, itg_documents, itg_expirations, itg_domains, itg_locations | 14.7K configs, 7.1K contacts | IT documentation | +| **IT Glue** | itg_organizations, itg_configurations, itg_passwords, itg_flexible_assets, itg_contacts, itg_documents, itg_expirations, itg_domains, itg_locations | 14.7K configs | IT documentation | | **Microsoft 365** | graph_users, teams_meetings, teams_meeting_attendees, engagement_snapshots | 14.4K meetings | Teams meetings, activity reports | -| **Zoom** | zoom_users, zoom_meetings, zoom_meeting_participants, zoom_calls | 2.8K calls, meetings | Zoom calls and meetings | +| **Zoom** | zoom_users, zoom_meetings, zoom_meeting_participants, zoom_calls | 2.8K calls | Zoom calls and meetings | | **QuickBooks Online** | qbo_invoices, qbo_payments, qbo_deposits, qbo_transactions, qbo_reports | 6.9K invoices, 12.1K txns | Accounting — invoices, payments, deposits, financial reports | -| **Zabbix NMS** | zabbix_events, zabbix_wan_hosts | 228 events, 75 hosts | Network monitoring — WAN hosts, alert events | +| **Zabbix NMS** | zabbix_events, zabbix_wan_hosts | 231 events, 75 hosts | Network monitoring — WAN hosts, alert events | | **Billing** | billing_items | 96K items | Invoice line items tied to tickets/projects/tasks | | **Authentication** | "user", session, account, verification, two_factor | 3 users | Better Auth — Entra ID SSO, RBAC, sessions | @@ -33,6 +34,8 @@ ### tickets (~152K rows, 68 columns) +> **Timezone note:** `create_date`, `due_date_time`, `completed_date`, `resolved_date_time`, `first_response_date_time`, `last_activity_date` are all `timestamp without time zone` stored in **UTC**. To display in ET: `create_date AT TIME ZONE 'America/New_York'`. + The central table. Each row is a service ticket. **Key columns:** @@ -62,27 +65,27 @@ The central table. Each row is a service ticket. - `is_deleted` (boolean) — soft delete flag **Source codes (tickets.source):** -| Value | Meaning | Count | -|---|---|---| -| 8 | Monitoring Alert (RMM/Datto) | 80,736 | -| 4 | Email | 14,872 | -| 21 | Portal | 2,500 | -| 2 | Phone/Voice | 1,781 | -| -1 | Insourced | 1,092 | -| -2 | Outsourced | 1,088 | -| 35 | Phish Alert | 726 | -| 6 | API | 488 | -| 17 | Internal Alert | 453 | +| Value | Meaning | +|---|---| +| 8 | Monitoring Alert (RMM/Datto) | +| 4 | Email | +| 21 | Portal | +| 2 | Phone/Voice | +| -1 | Insourced | +| -2 | Outsourced | +| 35 | Phish Alert | +| 6 | API | +| 17 | Internal Alert | -**Ticket types:** -| Value | Meaning | Count | -|---|---|---| -| 1 | Incident | 8,409 | -| 2 | Service Request | 3,217 | -| 5 | Alert | 29,885 | -| NULL | Unclassified | 67,737 | +**Ticket types (tickets.ticket_type):** +| Value | Meaning | +|---|---| +| 1 | Incident | +| 2 | Service Request | +| 5 | Alert | +| NULL | Unclassified | -### companies (~241 rows, 41 columns) +### companies (~246 rows, 41 columns) Client/customer organizations. @@ -225,52 +228,154 @@ These map integer codes to human-readable labels. Join on `value`. ### statuses (ticket statuses) +Join: `statuses.value = tickets.status` + | Value | Label | |---|---| | 1 | New | | 5 | Complete | | 7 | Waiting Customer | | 8 | In Progress | +| 9 | Waiting Materials | | 10 | Dispatched | | 11 | Escalate | | 12 | Waiting Vendor | | 13 | Waiting Approval | | 14 | Resource Assigned | +| 15 | Ready to Deploy | | 16 | Reopened | +| 17 | Info Req | | 19 | End User Note Added | +| 20 | Equipment Pulled | +| 21 | Waiting Verification | | 25 | On Hold | +| 27 | Resolution Plan | +| 30 | Service Call Scheduled | +| 37 | Client Non-Responsive | +| 45 | Pending Next Site Visit | +| 46 | Burn-in In Progress | +| 47 | Resource Requested | | 48 | Escalate to MC | +| 51 | Reconcile Billing | | 54 | Resolved \ | +| 55 | Huddle Review | +| 56 | Tracking Shipment | | 57 | Escalate to Wulf | +| 58 | Pre-Pick Order | +| 59 | Need to Order/Fulfill | +| 60 | Loading Customer Config | +| 61 | Escalate to CSM | +| 62 | Escalate to Customer HD | +| 64 | Waiting Trivium Employee | +| 65 | Waiting Procurement | +| 66 | Internal Note Added | +| 67 | Quote Delivered | +| 68 | Ready for Customer Config | +| 69 | Outsourced | +| 70 | Waiting Quote Acceptance | +| 71 | Waiting Project/Ticket | ### priorities +Join: `priorities.value = tickets.priority` + | Value | Label | |---|---| | 1 | Standard | | 2 | Medium | +| 3 | Standard | | 4 | Critical | | 6 | High | | 7 | Security Event | | 8 | Minor Service | | 9 | Major Service | +| 10 | Installation | | 11 | Fast Track | ### queues (46 active) -Major queues include: -- `29682833` Level 1 Support -- `29682969` Level 2 Support -- `29703428` Level 3 Support -- `29749490` Client Success -- `8` Monitoring Alert -- `29832283` Operations Triage -- `5` Client Triage -- `29853700` Deployment -- `29853698` Project Delivery -- `29853701` IT Operations -- `29853699` Mission Control -- Client-specific queues: TTG, LEC, PER, VCF, Premier Automation, TNT Pizza, Trivium Packaging, Glunt +Join: `queues.value = tickets.queue_id` + +| Value | Label | +|---|---| +| 5 | Client Triage | +| 6 | Post Sale | +| 8 | Monitoring Alert | +| 29682833 | Level 1 Support | +| 29682969 | Level 2 Support | +| 29703428 | Level 3 Support | +| 29749490 | Client Success | +| 29793481 | App-Care | +| 29807035 | Alert II | +| 29807036 | Alert I | +| 29832283 | Operations Triage | +| 29853695 | Follow Up | +| 29853697 | Trivium Packaging - Help Desk | +| 29853698 | Project Delivery | +| 29853699 | Mission Control | +| 29853700 | Deployment | +| 29853701 | IT Operations | +| 29853702 | Recurring Tickets | +| 29853706 | Premier Automation Help Desk | +| 29853710 | TTG Help Desk | +| 29853714 | Glunt Help Desk | +| 29853719 | TNT Pizza Help Desk | +| 29853720 | TTG Machines | +| 29853721 | TTG NetOps | +| 29853723 | TTG Finance | +| 29853724 | TTG Safety | +| 29853726 | TTG Remote | +| 29853727 | Purchasing | +| 29853728 | TTG New User Access | +| 29853729 | TTG Term User Access | +| 29853731 | Trivium Packaging - MES | +| 29853738 | TTG Security | +| 29853740 | TTG Change Mgmt | +| 29853741 | Subcontractor | +| 29853750 | PER Service Desk | +| 29853751 | PER Network Operations Center | +| 29853752 | PER Security Operations Center | +| 29853753 | LEC Service Desk | +| 29853754 | LEC Network Operations Center | +| 29853755 | LEC Security Operations Center | +| 29853756 | VCF Service Desk | +| 29853757 | VCF Network Operations | +| 29853758 | VCF Security Operations Center | +| 29853766 | Sales | +| 29780304 | TaskFire | +| 29753333 | Waiting Verification | + +### issue_types + +Join: `issue_types.value = tickets.issue_type` + +| Value | Label | +|---|---| +| 4 | Upgrade | +| 6 | New Install | +| 7 | Monitoring Alert | +| 10 | Break/Fix | +| 11 | Maintenance | +| 12 | Help Desk | +| 13 | Email | +| 14 | Vendor | +| 15 | User Education | +| 16 | Provision | +| 18 | Purchase | +| 19 | Deploy | +| 20 | Reactive | +| 21 | MAC | +| 22 | Centralized Services | +| 23 | NOC Services | +| 25 | Networking | +| 27 | WiFi | +| 28 | Client Success | +| 29 | Automation | +| 30 | Server | +| 31 | Hardware | +| 32 | LOB Software | +| 33 | Workstation | +| 36 | 24-Hour Emergency Support | --- @@ -647,7 +752,7 @@ WHERE ze.value = 1 ORDER BY ze.clock DESC; 3. **Configuration item names are NOT unique globally.** Names like "DT037" are a per-client naming convention. Always pair with `company_id`. -4. **Timestamps:** Most Autotask timestamps are `timestamp without time zone` stored in UTC. Teams/Zoom timestamps are `timestamp with time zone`. +4. **Timestamps — all UTC:** The PostgreSQL server timezone is UTC. All `timestamp without time zone` columns (Autotask) are stored in UTC. `timestamp with time zone` columns (Teams, Zoom, QBO) are also UTC-normalized. To display in Eastern Time: `column AT TIME ZONE 'America/New_York'`. Example: `create_date AT TIME ZONE 'America/New_York'`. 5. **Monitor tickets:** `tickets.source = 8` indicates RMM-generated tickets. `monitor_id` links to the specific Datto RMM monitor. These represent ~74% of all tickets. @@ -658,4 +763,4 @@ WHERE ze.value = 1 ORDER BY ze.clock DESC; - Zoom/Teams → Contacts: `matched_contact_id` / `matched_company_id` columns - Config Items → RMM: `configuration_items.reference_number` sometimes matches RMM device UIDs -7. **Row counts** (as of March 2026): tickets 152K, time_entries 155K, billing_items 96K, ticket_notes 41K, teams_meetings 14.4K, itg_configurations 14.7K, configuration_items 7K, companies 241, contacts 4.2K, datto_rmm_devices 3.6K, datto_rmm_alerts 20.7K, s1_agents 2.8K, s1_threats 4.1K, zoom_calls 2.8K, qbo_invoices 6.9K, qbo_transactions 12.1K, qbo_payments 4.5K, qbo_deposits 1.8K, qbo_reports 36, zabbix_wan_hosts 75, zabbix_events 228. +7. **Row counts** (as of March 17, 2026): tickets 152K, time_entries 156K, billing_items 96K, ticket_notes 42K, teams_meetings 14.4K, itg_configurations 14.7K, configuration_items 7K, companies 246, contacts 4.2K, datto_rmm_devices 3.6K, datto_rmm_alerts 21K, s1_agents 2.8K, s1_threats 4.1K, zoom_calls 2.8K, qbo_invoices 6.9K, qbo_transactions 12.1K, qbo_payments 4.5K, qbo_deposits 1.8K, qbo_reports 36, zabbix_wan_hosts 75, zabbix_events 231.