Reports Domain
Technical deep dive into shift and manager report data models
Overview
The reports domain handles the collection and storage of end-of-shift data from staff and daily operational summaries from managers. It includes automated Slack notifications, audit logging, and compliance tracking.
Database Schema
Reports are stored in two primary tables, separated by audience and purpose.
Server Reports (server_reports)
Captured at the end of each staff member's shift.
| Column | Type | Description |
|---|---|---|
userId | text | References users.clerkId |
locationId | text | References locations.id |
date | text | ISO date string (YYYY-MM-DD) |
shift | text | morning, afternoon, evening |
actualSales | numeric | Actual sales for the shift |
goalSales | numeric | Target sales for the shift |
fohRating | integer | 0-5 rating |
bohRating | integer | 0-5 rating |
incidentNotes | text | Qualitative notes on incidents |
hero | text | Free-text mention of a colleague |
Manager Reports (manager_reports)
Captured daily by shift supervisors or general managers.
| Column | Type | Description |
|---|---|---|
totalSales | numeric | Combined sales for the location/day |
employeeReviews |