glossary
title: TankSafe Glossary slug: glossary sidebar_position: 2 tags: [overview, glossary]
Key terms referenced throughout the verified TankSafe documentation. Every definition comes directly from behaviour in the tank-wise-portal codebase.
Inspection data
| Term | Definition (code reference) |
|---|---|
| Job | A row in inspections representing a scheduled tanker inspection. Jobs include identifiers, status, inspector assignment, and scheduling metadata. Surfaced in AdminJobs.tsx, InspectorJobs.tsx, and SearchInspections.tsx. |
| Inspection | The record that the wizard reads/writes. In the UI we treat "job" and "inspection" interchangeably because each job maps 1:1 to an inspection record. |
| Wizard step | One of the 10 entries in WIZARD_STEPS inside InspectionWizard.tsx. Each step stores form data under a specific template ID. |
| Form response | JSON payload stored in the form_responses table. Helper functions getOrCreateInspection and upsertHeader in src/lib/api.ts manage these records. |
| Grid table | Tabular data sets (e.g., compartment readings) backed by Supabase tables such as risk_assessment_compartments or continuity_test_readings, rendered via GridTable and ContinuityMatrix. |
| Charge sheet | Combined labour/parts/work item summary assembled in AdminJobDetail.tsx by joining charge_sheet_* tables. |
| Completeness | Percentage calculated client-side by comparing completed form responses against the total wizard step count. Implemented in SearchInspections.tsx, AdminJobs.tsx, and InspectorJobs.tsx. |
| Status | Inspection status stored on the inspections table (draft, in_progress, completed, failed, passed, void). The UI maps void to "Cancelled" for filters. |
Roles & permissions
| Role | What the code allows |
|---|---|
| Administrator | Full access to every protected route. Can invite/update/delete users through edge functions, assign inspectors, edit jobs, manage the schedule, and configure MFA. |
| Inspector | Can access dashboard, job search, inspector job list, and run the inspection wizard. Inspectors cannot reach /admin/* routes. |
No additional personas (e.g., supervisors, engineers) have dedicated UI or policy logic in the repository today.
Components & utilities
| Component | Purpose |
|---|---|
ProtectedRoute | Wraps route elements and redirects unauthenticated users to /auth. Accepts an adminOnly flag. |
AppLayout | Shared navigation shell for authenticated areas. |
JsonForm | Renders form schemas defined in src/lib/formSchemas.ts and writes answers back to Supabase. |
ContinuityMatrix | Specialised grid for continuity readings with compartment rows and pass/fail flags. |
ThicknessTestCanvas | Fabric-based drawing surface used in the final wizard step for annotating tank diagrams. |
SecuritySettingsDialog | MFA setup modal shown in Admin Settings for administrators who still need to enrol. |
Supporting terminology
- Edge function — Supabase serverless function used for privileged user-management operations. Located in
supabase/functions/admin-*. - Availability slot — A record in
inspector_availabilitythat the schedule page uses to suggest assignments. - Reminder — A
schedule_remindersentry used byAdminSchedule.tsxto track follow-up notifications. (UI currently surfaces existing reminders but does not send emails.)
Documentation conventions
- All doc references map to actual files, components, or tables in the repository.
- Dates in the UI rely on
en-GBformatting (DD/MM/YYYY). Mention the locale explicitly when writing procedural steps. - When describing Supabase tables, use the snake_case table name found in migrations. | Incident Report | Structured record triggered when an inspection fails a safety threshold. |