Skip to main content

KPI Performance System Implementation

Overview

The KPI system is a coaching-oriented staff performance framework built on a core philosophy: KPIs belong to the person, not the contract. Contracts trigger KPI attachment, but performance history persists across the entire employment lifecycle — from first hire to final exit. The system is designed around growth language ("exceeding", "meeting", "growing") rather than deficit language ("below", "failing"), and recognises that effort counts alongside measurable outcomes.


Design Principles

PrincipleImplementation
Person-centricKPIs attach to staff_id, not contract_id. Contract triggers assignment but history is never deleted.
Effort mattersEach KPI carries an effort_weight (15–30%) that factors into final scoring.
Growth languageStatus labels use "exceeding / meeting / growing" — never "below" or "failing".
Living JournalEvery score change is recorded with context. Append-only kpi_journal_entries table.
Transparency of processStaff see the evaluation process and their journal entries (where is_visible_to_staff = true), but raw scoring mechanics remain manager-facing.

Database Schema

All KPI tables reside in the hr schema.

hr.kpi_modules

The KPI template library — the master catalogue of all measurable performance indicators.

ColumnTypeDescription
iduuidPrimary key
nametextDisplay name
slugtextURL-safe identifier
categorykpi_categoryOne of 9 categories (see enums)
role_groupkpi_role_groupTarget role group (see enums)
objectivetextWhat this KPI measures
measurement_methodtextHow performance is assessed
data_sourcestext[]Array of data source references
automation_statustextLevel of automated scoring support
score_typetextScoring methodology
target_scorenumericExpected performance level
minimum_scorenumericThreshold for "growing" status
effort_weightnumericWeight given to effort (0.15–0.30)
evaluation_frequencykpi_frequencyHow often this KPI is evaluated
coaching_tipstext[]Array of coaching suggestions for managers
is_default_for_rolebooleanAuto-attach when role group matches
is_seedbooleanSystem-provided seed data
display_orderintegerSort position in UI

hr.template_kpis

Links KPI modules to contract templates so KPIs are automatically assigned when a contract is generated.

ColumnTypeDescription
iduuidPrimary key
template_iduuidFK → contract template
kpi_module_iduuidFK → hr.kpi_modules
weightnumericRelative weight within this template
is_requiredbooleanCannot be removed by managers
custom_targetnumericOverride target for this template context

hr.staff_kpis

Individual KPI assignments — the live, per-person performance records.

ColumnTypeDescription
iduuidPrimary key
staff_iduuidFK → staff member
contract_iduuidFK → triggering contract
kpi_module_iduuidFK → hr.kpi_modules
statustextActive status of this assignment
sourcetext'template' or 'manual'
current_scorenumericLatest evaluated score
current_effort_scorenumericLatest effort component
previous_scorenumericScore from prior evaluation
score_trendtextDirection of movement
trend_percentagenumericMagnitude of change
last_evaluated_attimestamptzWhen last scored
next_evaluation_duetimestamptzWhen next evaluation is due

hr.kpi_journal_entries

The Living Journal — an append-only audit trail of every score change, observation, and coaching note.

ColumnTypeDescription
iduuidPrimary key
staff_kpi_iduuidFK → hr.staff_kpis
entry_typejournal_entry_typeOne of 16 entry types (see enums)
titletextEntry heading
contenttextFull narrative content
score_impactnumericNumerical effect on score
score_beforenumericScore prior to this entry
score_afternumericScore after this entry
effort_recognizedbooleanWhether effort was acknowledged
effort_notestextNarrative on effort observed
is_visible_to_staffbooleanControls staff visibility
is_pending_approvalbooleanRequires manager sign-off
linked_catchup_iduuidFK → catch-up session (optional)
linked_incident_iduuidFK → incident record (optional)
created_byuuidFK → user who created the entry

Enums

kpi_category (9 values)

culture, productivity, communication, safety,
care_quality, financial, leadership, compliance, operational

kpi_role_group (15 values)

There are 15 distinct role groups, each with approximately 5 default KPIs. Examples include support workers, team leaders, registered nurses, administration, management, and allied health professionals.

journal_entry_type (16 values)

Covers the full range of journal interactions including observations, coaching sessions, incident links, catch-up notes, score adjustments, effort recognitions, and approval workflows.

kpi_frequency

weekly, fortnightly, monthly, quarterly, annually

Universal KPIs

Five KPIs apply to all staff regardless of role group:

KPICategoryApplies To
Code of Conduct & CulturecultureAll staff
Attendance & ReliabilityoperationalAll staff
WHS & Safety CompliancesafetyAll staff
Communication ResponsivenesscommunicationAll staff
Documentation QualitycomplianceAll staff

These are seeded with is_default_for_role = true across all 15 role groups.


API Endpoints

All endpoints are mounted at /api/v1/.

KPI Module Library

MethodPathDescription
GET/hr/kpi-modulesList all KPI modules. Optional ?role_group= filter.
GET/hr/kpi-modules/:idGet a single KPI module by ID.

Template KPIs

MethodPathDescription
GET/hr/templates/:templateId/kpisList KPIs attached to a contract template.
PUT/hr/templates/:templateId/kpisUpdate the full set of KPIs for a template.

Staff KPIs

MethodPathDescription
GET/hr/staff/:staffId/kpisList KPIs for a staff member. Optional ?status=all to include inactive.
POST/hr/staff/:staffId/kpisManually assign a new KPI to a staff member.
PATCH/hr/staff/:staffId/kpis/:kpiId/statusUpdate the status of a staff KPI assignment.
POST/hr/staff/:staffId/deactivate-kpisDeactivate all active KPIs for a staff member.

Frontend Integration

Pages

PageFilePurpose
KPI Gallerypage_hr_kpis.html / page_hr_kpis.jsBrowse and manage the KPI module library
Contracting Wizardpage_hr_contracting.html / page_hr_contracting.jsKPI step in the contract creation wizard
Staff Detailpage_staff_detail.html / page_staff_detail.jsIndividual staff KPI tab with journal view

Contract Integration Flow

When a contract is created from a template:

  1. Template KPIs (hr.template_kpis) are read for the selected template.
  2. Each template KPI is copied to hr.staff_kpis with source = 'template'.
  3. Managers can add additional KPIs manually (source = 'manual').
  4. The KPI step in the contracting wizard displays both required and optional KPIs.

Employment Lifecycle

KPIs follow the staff member through the full employment lifecycle:

Setup → Hiring → Working → Review → Renewal → Role Change → Exit
Lifecycle EventKPI Behaviour
Contract createdTemplate KPIs auto-assigned to staff_kpis
Working phaseKPIs are actively evaluated per their frequency
Review cycleJournal entries capture coaching and score updates
Contract renewalExisting KPIs persist; new template KPIs may be added
Role changeNew role-group KPIs assigned; old ones deactivated (not deleted)
Contract end / ExitAll active KPIs deactivated; journal history preserved permanently

KPIs are never deleted — only deactivated. This ensures a complete, auditable performance history for every staff member.


SQL Migrations

Migration FilePurpose
20260113_kpi_comprehensive_system.sqlCore schema: all tables, enums, indexes, and seed data
20260113_kpi_seed_update.sqlUpdated seed KPI modules for all 15 role groups
20260114_kpi_active_status.sqlAdded active/inactive status management

Summary

The KPI system transforms performance management from a punitive checkbox exercise into a coaching-oriented, journal-driven growth framework. By anchoring KPIs to people rather than contracts, recognising effort alongside outcomes, and maintaining a permanent living journal, the system supports transparent and compassionate staff development across every phase of employment.