{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/allocation/v1.json",
  "title": "allocation contract v1",
  "type": "object",
  "required": [
    "external_id",
    "financial_period",
    "hours",
    "occurred_at",
    "project"
  ],
  "properties": {
    "asset": {
      "type": "string",
      "description": "the plant/equipment the allocation places",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "hours": {
      "type": "number",
      "description": "hours allocated (the shelf's only measure)",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "hours",
      "x-demiton-type": "decimal"
    },
    "status": {
      "type": "object",
      "description": "the allocation's state",
      "x-demiton-requiredness": "optional"
    },
    "worker": {
      "type": "string",
      "description": "the person the allocation places",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "ends_at": {
      "type": "string",
      "description": "planned end of the assignment",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "instant",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "project": {
      "type": "string",
      "description": "the project/job the worker or asset is allocated to",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "cost_code": {
      "type": "string",
      "description": "cost code / work activity the hours are coded to",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "starts_at": {
      "type": "string",
      "description": "planned start of the assignment",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "instant",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "external_id": {
      "type": "string",
      "description": "the source row's own identifier (`id`)",
      "x-demiton-requiredness": "required"
    },
    "occurred_at": {
      "type": "string",
      "description": "the resource date the allocation is for",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "legal_entity": {
      "type": "string",
      "description": "the employing/owning legal entity",
      "x-demiton-requiredness": "tenant-specific",
      "x-demiton-reference": true
    },
    "checked_in_at": {
      "type": "string",
      "description": "actual check-in on the allocated shift",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "instant",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "checked_out_at": {
      "type": "string",
      "description": "actual check-out from the allocated shift",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "instant",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "financial_period": {
      "type": "string",
      "description": "the period the allocation is attributed to",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    }
  },
  "x-demiton-register-type": "allocation",
  "x-demiton-contract-version": "1.0.3",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [
    {
      "axis": "cost_code",
      "requirement": "optional",
      "role": "context"
    },
    {
      "axis": "worker",
      "requirement": "optional",
      "role": "subject"
    },
    {
      "axis": "project",
      "requirement": "required",
      "role": "subject"
    },
    {
      "axis": "legal_entity",
      "requirement": "optional",
      "role": "context"
    },
    {
      "axis": "financial_period",
      "requirement": "required",
      "role": "context"
    },
    {
      "axis": "asset",
      "requirement": "optional",
      "role": "subject"
    }
  ],
  "x-demiton-measures": [
    {
      "key": "hours",
      "accumulation": "additive",
      "dtype": "decimal",
      "unit": "hours"
    }
  ],
  "x-demiton-provenance": {
    "standards": [
      {
        "code": "AS/NZS ISO 45001:2018",
        "title": "Occupational health and safety management systems - Requirements with guidance for use (AU/NZ adoption)",
        "access": "paywalled_secondary",
        "region": "Australia",
        "edition": "2018 incorporating Amd 1:2024",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Fair Work Act 2009 (Cth)",
        "title": "Fair Work Act 2009 - employee records and National Employment Standards",
        "access": "full_text_verified",
        "clause": "ss.87(1), 96(1), 535 ; s.62",
        "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",
        "region": "Australia",
        "edition": "compilation 2026-06-20",
        "checked_on": "2026-09-14"
      },
      {
        "code": "ISO 30414:2025",
        "title": "Human resource management - Requirements and recommendations for human capital reporting and disclosure",
        "access": "paywalled_secondary",
        "region": "International",
        "edition": "2nd ed. 2025 (supersedes ISO 30414:2018)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Holidays Act 2003 (NZ)",
        "title": "Holidays Act 2003 (2003 No 129) - holiday and leave record",
        "access": "full_text_verified",
        "clause": "s.81(2)",
        "region": "New Zealand",
        "edition": "version as at 20 Dec 2023 (repealed on commencement of Employment Leave Act 2026)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "SI 1998/1833",
        "title": "Working Time Regulations 1998",
        "access": "full_text_verified",
        "clause": "regs 4, 6, 9",
        "region": "United Kingdom",
        "edition": "as amended by SI 2023/1426 from 1 Jan 2024",
        "checked_on": "2026-09-14"
      }
    ]
  },
  "description": "Who and what is rostered on which job, and when.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/allocation/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}