T1 Electrical SolutionsT1 Platform Docs
Platform

Data Model

Core entity relationships and database concepts.

Data Model

This page documents the high-value entity relationships needed to understand the platform.

Client configuration cluster

Client is the owner of most reusable configuration:

  • Project records through Client.projects
  • ClientMembership rows for client-scoped access
  • ClientRate rows for base/classification rates
  • ClientAllowance rows for allowance matrix rules
  • ClientMaterial rows for materials
  • ClientCostCode rows for cost codes
  • ClientWorkCondition rows for work condition flags
  • ClientExpenseCategory rows for expense category setup
  • Admin and assigned user many-to-many relationships

This is why most setup pages live under /admin/clients/{id} or client-scoped portal routes.

Project operational cluster

Project belongs to a Client and anchors operational submissions:

  • Project.timesheets
  • Project.expenses
  • Project.clientSupervisors
  • Project assigned electricians/users
  • Project.attachments
  • ProjectExpenseCategory links
  • JSON configuration such as allowances_data, locations, materials, and cost-code exposure

Project allowance settings are not the same as client allowance rules. Client allowances define the rule, amount, trigger, and mode. Project allowances decide project-level eligibility, project-specific rate/type overrides, and apply toggles.

Timesheet cluster

Timesheet is the main workflow record:

  • Timesheet.user is the electrician or owner.
  • Timesheet.project points to the project and client context.
  • Timesheet.entries stores date/start/end rows and per-entry selections.
  • Timesheet.attachments stores uploaded evidence.
  • Timesheet.changeLogs stores edit audit rows.
  • Timesheet.approvalSheetItems links a timesheet into supervisor approval sheet workflows.
  • Timesheet.allowanceLines stores calculated allowance results.
  • Timesheet.calculations stores award snapshots.
  • Timesheet.riskAssessment stores risk scoring output.

Timesheet statuses are draft, submitted, accepted, approved, and rejected.

Time entry cluster

TimeEntry belongs to a timesheet and can optionally link to an expense. It carries the detailed submitted work data:

  • date, start time, end time
  • job code and cost code
  • vehicle type
  • shift work flag and description
  • allowances_data for selected/manual allowances
  • materials_data for materials used
  • work_conditions_data for flags such as breaks, callouts, night shift, or dirty work
  • attachments through Attachment

Calculation records

TimesheetAllowanceLine is generated by the allowance matrix. It stores:

  • timesheet and optional time entry
  • optional source ClientAllowance
  • name and code
  • amount unit
  • quantity, unit rate, amount
  • trigger reason
  • taxable and billable flags
  • sourceSnapshot containing trigger type, mode, config, EAB state, and matched metadata

TimesheetCalculation is generated by the award calculator. It stores snapshot totals and owns TimesheetCalculationLine rows with types such as ordinary, minimum shift, break, overtime, Saturday, Sunday, shift loading, public holiday, allowance, travel, callout, expense, and billing.

On this page