{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/payroll_run/v2.json",
  "title": "payroll_run contract v2",
  "type": "object",
  "required": [
    "external_id",
    "financial_period",
    "is_finalised",
    "legal_entity",
    "occurred_at",
    "pay_period_start",
    "total_gross",
    "total_net"
  ],
  "properties": {
    "worker": {
      "type": "string",
      "description": "a worker the run paid, if the grain is ever per-worker",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "currency": {
      "type": "currency",
      "description": "denomination of the money measures",
      "x-demiton-requiredness": "optional"
    },
    "notation": {
      "type": "string",
      "description": "the run's free-text label/notation",
      "x-demiton-requiredness": "optional"
    },
    "date_paid": {
      "type": "string",
      "description": "the date the run was paid",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "total_net": {
      "type": "number",
      "description": "whole-run net pay",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "currency (by coordinate)",
      "x-demiton-type": "decimal"
    },
    "external_id": {
      "type": "string",
      "description": "the source system's identifier for the pay run; the producer hinge",
      "x-demiton-requiredness": "required"
    },
    "occurred_at": {
      "type": "string",
      "description": "the pay period end — the payday the run is dated to",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "total_gross": {
      "type": "number",
      "description": "whole-run gross pay",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "currency (by coordinate)",
      "x-demiton-type": "decimal"
    },
    "is_finalised": {
      "type": "boolean",
      "description": "whether the run is finalised (reportable)",
      "x-demiton-requiredness": "required"
    },
    "legal_entity": {
      "type": "string",
      "description": "the employing legal entity (the KeyPay business)",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "date_finalised": {
      "type": "string",
      "description": "when the run reached its finalised state",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "pay_schedule_id": {
      "type": "number",
      "description": "the pay schedule / calendar the run belongs to",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "financial_period": {
      "type": "string",
      "description": "the financial period the run is attributed to",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "pay_period_start": {
      "type": "string",
      "description": "first day of the pay period",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "pay_slips_published": {
      "type": "boolean",
      "description": "whether payslips for the run have been published",
      "x-demiton-requiredness": "optional"
    }
  },
  "x-demiton-register-type": "payroll_run",
  "x-demiton-contract-version": "2.0.2",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [
    {
      "axis": "financial_period",
      "requirement": "required",
      "role": "context"
    },
    {
      "axis": "legal_entity",
      "requirement": "optional",
      "role": "context"
    },
    {
      "axis": "currency",
      "requirement": "optional",
      "role": "context"
    },
    {
      "axis": "worker",
      "requirement": "optional",
      "role": "subject"
    }
  ],
  "x-demiton-measures": [
    {
      "key": "total_gross",
      "accumulation": "additive",
      "dtype": "decimal",
      "unit": "by_coordinate"
    },
    {
      "key": "total_net",
      "accumulation": "additive",
      "dtype": "decimal",
      "unit": "by_coordinate"
    }
  ],
  "x-demiton-provenance": {
    "standards": [
      {
        "code": "Fair Work Act 2009 (Cth)",
        "title": "Fair Work Act 2009 - employee records and National Employment Standards",
        "access": "full_text_verified",
        "clause": "s.535",
        "region": "Australia",
        "edition": "compilation 2026-07-07",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Fair Work Regulations 2009 (Cth)",
        "title": "Fair Work Regulations 2009 - employee record content",
        "access": "full_text_verified",
        "clause": "regs 3.33-3.34 ; regs 3.45-3.46",
        "region": "Australia",
        "edition": "compilation 2026-06-20",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Payday Super (ATO)",
        "title": "Single Touch Payroll reporting under Payday Super",
        "access": "public_summary",
        "region": "Australia",
        "edition": "from 1 Jul 2026",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Single Touch Payroll Phase 2 (ATO)",
        "title": "Single Touch Payroll Phase 2 employer reporting guidelines",
        "access": "public_summary",
        "region": "Australia",
        "edition": "Phase 2 (mandatory from 1 Jan 2022)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Tax Administration Act 1994 (NZ) Schedule 4",
        "title": "Reporting of employment income information (payday filing)",
        "access": "full_text_verified",
        "clause": "Schedule 4 Tables 1-3",
        "region": "New Zealand",
        "edition": "version as at 1 Jul 2026",
        "checked_on": "2026-09-14"
      },
      {
        "code": "HMRC Real Time Information (RTI)",
        "title": "PAYE Real Time Information - Full Payment Submission and Employer Payment Summary",
        "access": "public_summary",
        "region": "United Kingdom",
        "edition": "guidance updated 6 Apr 2026",
        "checked_on": "2026-09-14"
      }
    ]
  },
  "description": "Completed pay runs with gross and net totals.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/payroll_run/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}